16namespace matrix_science
39 typedef std::vector<double> column_vector_t;
40 typedef std::vector<column_vector_t> matrix_t;
43 static ms_matrix diagonalMatrix(
size_t s,
double v);
46 static ms_matrix identityMatrix(
size_t s);
49 static ms_matrix rowMatrix(
const std::vector<double> & v);
52 static ms_matrix columnMatrix(
const std::vector<double> & v);
61 ms_matrix(
size_t si,
size_t sj,
double v = 0.0);
71 column_vector_t & operator[](
size_t i);
74 const column_vector_t & operator[](
size_t i)
const;
77 double getCR(
size_t i,
size_t j)
const;
79 void setCR(
size_t i,
size_t j,
double value);
82 double getRC(
size_t i,
size_t j)
const {
return getCR(j, i); }
84 void setRC(
size_t i,
size_t j,
double value) { setCR(j, i, value); }
87 const matrix_t & data()
const;
90 bool operator==(
const ms_matrix & m)
const;
93 bool operator!=(
const ms_matrix & m)
const;
102 void resize(
size_t si,
size_t sj,
double v = 0.0);
105 double multiplyByRow(
const std::vector<double> & column,
size_t row)
const;
108 void setColumnDown(
size_t row,
size_t col,
const std::vector<double> & vec);
111 void setColumnUp(
size_t row,
size_t col,
const std::vector<double> & vec);
117 void logContents(
ms_errs & errs,
const char * description)
const;
All errors are collected in an instance of this class.
Definition: ms_errors.hpp:37
A two-dimensional matrix of numbers.
Definition: ms_matrix.hpp:36
double getRC(size_t i, size_t j) const
Get the value for the specified row and column.
Definition: ms_matrix.hpp:82
void setRC(size_t i, size_t j, double value)
Set the value for the specified row and column.
Definition: ms_matrix.hpp:84