Matrix

Matrix operator= row col resize_rows resize get rotate clear_zero print row_op col_op row_sum col_sum row_prod col_prod operator*= operator+= operator-= pow operator==

toggle TOC (ctrl + ⇔)

sal/data/matrix.h

Matrix
operator=
row
col
resize_rows
resize
get
rotate
clear_zero
print
row_op
col_op
row_sum
col_sum
row_prod
col_prod
operator*=
operator+=
operator-=
pow
operator==

Matrix

Declaration

Matrix();

Matrix(size_t r, size_t c, T d = 0);

Matrix(size_t r, size_t c, vector<T>&& e);

Matrix(const Matrix& a);

Matrix(Matrix&& a);

Parameters

r
c
d
e
a

Return value

Example

Discussion

operator= | Matrix::operator=

Declaration

Matrix<T>& operator=(const Matrix& a);

Matrix<T>& operator=(Matrix&& a);

Parameters

a

Return value

Example

Discussion

row | Matrix::row

Declaration

size_t row() const;

Return value

Example

Discussion

col | Matrix::col

Declaration

size_t col() const;

Return value

Example

Discussion

resize_rows | Matrix::resize_rows

Declaration

void resize_rows(size_t new_rows, T def = 0);

Parameters

new_rows
def

Return value

Example

Discussion

resize | Matrix::resize

Declaration

void resize(size_t new_rows, size_t new_cols, T def = 0);

Parameters

new_rows
new_cols
def

Return value

Example

Discussion

get | Matrix::get

Declaration

T& get(size_t row, size_t col);

const T& get (size_t row, size_t col);

Parameters

row
col

Return value

Example

Discussion

rotate | Matrix::rotate

Declaration

void rotate();

Return value

Example

Discussion

clear_zero | Matrix::clear_zero

Declaration

void clear_zero();

Return value

Example

Discussion

print | Matrix::print

Declaration

void print() const;

Return value

Example

Discussion

row_op | Matrix::row_op

Declaration

template <typename Op>
T row_op(size_t row, Op&& op, T res = 0);

Parameters

row
op
res

Return value

Example

Discussion

col_op | Matrix::col_op

Declaration

template <typename Op>
T col_op(size_t col, Op&& op, T res = 0);

Parameters

col
op
res

Return value

Example

Discussion

row_sum | Matrix::row_sum

Declaration

T row_sum(size_t row);

Parameters

row

Return value

Example

Discussion

col_sum | Matrix::col_sum

Declaration

T col_sum(size_t col);

Parameters

col

Return value

Example

Discussion

row_prod | Matrix::row_prod

Declaration

T row_prod(size_t row);

Parameters

row

Return value

Example

Discussion

col_prod | Matrix::col_prod

Declaration

T col_prod(size_t col);

Parameters

col

Return value

Example

Discussion

operator*= | Matrix::operator*=

Declaration

Matrix<T>& operator*=(T);

Matrix<T>& operator*=(const Matrix&);

Parameters

T
Matrix&

Return value

Example

Discussion

operator+= | Matrix::operator+=

Declaration

Matrix<T>& operator+=(const Matrix&);

Parameters

Matrix&

Return value

Example

Discussion

operator-= | Matrix::operator-=

Declaration

Matrix<T>& operator-=(const Matrix&);

Parameters

Matrix&

Return value

Example

Discussion

pow | Matrix::pow

Declaration

Matrix<T>& pow(size_t exponent);

Parameters

exponent

Return value

Example

Discussion

operator== | Matrix::operator==

Declaration

bool operator==(const Matrix&);

Parameters

Matrix&

Return value

Example

Discussion