vector.h
Go to the documentation of this file.
#ifndef FASTTEXT_VECTOR_H
#define FASTTEXT_VECTOR_H
#include <cstdint>
#include <ostream>
#include "real.h"
namespace fasttext {
class Matrix;
class QMatrix;
class Vector {
public:
int64_t m_;
real* data_;
explicit Vector(int64_t);
~Vector();
real& operator[](int64_t);
const real& operator[](int64_t) const;
int64_t size() const;
void zero();
void mul(real);
real norm() const;
void addVector(const Vector& source);
void addVector(const Vector&, real);
void addRow(const Matrix&, int64_t);
void addRow(const QMatrix&, int64_t);
void addRow(const Matrix&, int64_t, real);
void mul(const QMatrix&, const Vector&);
void mul(const Matrix&, const Vector&);
int64_t argmax();
};
std::ostream& operator<<(std::ostream&, const Vector&);
}
#endif
fasttext::Vector::zero
void zero()
Definition: vector.cc:35
fasttext::Vector::size
int64_t size() const
Definition: vector.cc:31
fasttext::Vector::operator[]
real & operator[](int64_t)
Definition: vector.cc:120
fasttext
Definition: args.cc:17
fasttext::Vector
Definition: vector.h:23
fasttext::Vector::data_
real * data_
Definition: vector.h:27
fasttext::Vector::argmax
int64_t argmax()
Definition: vector.cc:108
real.h
fasttext::Vector::addRow
void addRow(const Matrix &, int64_t)
Definition: vector.cc:69
fasttext::Vector::Vector
Vector(int64_t)
Definition: vector.cc:22
fasttext::Vector::mul
void mul(real)
Definition: vector.cc:49
fasttext::real
float real
Definition: real.h:15
fasttext::Matrix
Definition: matrix.h:23
fasttext::Vector::m_
int64_t m_
Definition: vector.h:26
fasttext::operator<<
std::ostream & operator<<(std::ostream &os, const Vector &v)
Definition: vector.cc:128
fasttext::Vector::~Vector
~Vector()
Definition: vector.cc:27
fasttext::QMatrix
Definition: qmatrix.h:29
fasttext::Vector::norm
real norm() const
Definition: vector.cc:41
fasttext::Vector::addVector
void addVector(const Vector &source)
Definition: vector.cc:55