Vector

Functions

template<class T>
Vect<T> operator+(const Vect<T> &u, const Vect<T> &v)
template<class T>
Vect<T> operator-(const Vect<T> &u, const Vect<T> &v)
template<class T, class U>
Vect<T> operator*(const U lambda, const Vect<T> &u)
template<class T>
bool operator==(const Vect<T> &u, const Vect<T> &v)
template<class T>
inline std::ostream &operator<<(std::ostream &os, const Vect<T> &u)
template<class T>
class Vect

Public Functions

inline Vect(std::vector<T> coefs)

Creates a vector filled with the given coefficients.

inline Vect(const int size)

Creates a vector filled with 0s.

inline Vect()

Creates an empty vector.

inline int size() const

Returns the size of the vector.

inline T operator()(const int i) const

Returns the i-th coefficient of the vector.

inline void set(const int i, const T v)

Updates the i-th coefficient of the vector.

inline T squared_norm() const

Returns the norm of the vector, squared.

inline T norm() const

Returns the norm of the vector.

void operator+=(const Vect &other)
void operator-=(const Vect &other)

Private Members

std::vector<T> m_coefs