Matrix

Functions

template<class T>
Matrix<T> operator+(const Matrix<T> &A, const Matrix<T> &B)
template<class T>
Matrix<T> operator*(const Matrix<T> &A, const Matrix<T> &B)
template<class T, class U>
Matrix<T> operator*(const U lambda, const Matrix<T> &M)
template<class T>
bool operator==(const Matrix<T> &A, const Matrix<T> &B)
template<class T>
inline std::ostream &operator<<(std::ostream &os, const Matrix<T> &M)
template<class T>
class Matrix

Public Functions

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

Creates a matrix filled with the given coefficients.

inline Matrix(const int lines_count, const int columns_count)

Creates a matrix filled with 0s.

inline Matrix()

Creates an empty matrix.

inline Matrix(const int n)

Creates a square matrix of size n filled with 0s.

inline int lines_count() const

Returns the number of lines of the matrix.

inline int columns_count() const

Returns the number of colmuns of the matrix.

inline T operator()(const int i, const int j) const

Returns the coefficient (i, j) of the matrix.

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

Updates the coefficient (i, j) of the matrix.

Public Static Functions

static Matrix<T> identity(const int n)

Returns the identity matrix of size n.

Private Members

std::vector<std::vector<T>> m_coefs