|
| | MatrixD () |
| | Default constructor. More...
|
| |
| | MatrixD (const size_t _rowsNumber, const size_t _columnsNumber, double first_value,...) |
| | Creates a matrix with specific dimensions and fills it with given values separated by comma. More...
|
| |
| | MatrixD (const size_t _rowsNumber, const size_t _columnsNumber) |
| | Creates matrix with specific dimensions and fills it with 0. More...
|
| |
| | MatrixD (const MatrixD &rhs) |
| | Copy constructor. More...
|
| |
| | MatrixD (const VectorD &rhs) |
| | VectorD constructor (creates a one-column matrix). More...
|
| |
| virtual | ~MatrixD () |
| | Default destructor. More...
|
| |
| void | assign (const size_t _rowsNumber, const size_t _columnsNumber, double value=0.) |
| | Assigns a new matrix with all coefficients set to value. More...
|
| |
| void | setLine (size_t i, const NumA::VectorD &line) |
| | Sets an existing line of the matrix to new values given by a vector. More...
|
| |
| void | addLine (size_t i, const NumA::VectorD &line) |
| | Adds a new line in the matrix (its dimension is therefore incremented) with the values given by a vector. More...
|
| |
| void | appendLine (const NumA::VectorD &line) |
| | Adds a new line at the end of the matrix (its dimension is therefore incremented) with the values given by a vector. More...
|
| |
| NumA::VectorD | getLine (const size_t lineIndex) const |
| | Extracts a single line from the matrix. More...
|
| |
| NumA::VectorD | operator* (const NumA::VectorD &rhs) const |
| | Matrix vector multiplication. More...
|
| |
| NumA::MatrixD | operator* (const NumA::MatrixD &rhs) const |
| | Matrix-matrix multiplication. More...
|
| |
| NumA::MatrixD | operator+ (const NumA::MatrixD &rhs) const |
| | Matrix addition. More...
|
| |
| NumA::MatrixD | operator- (const NumA::MatrixD &rhs) const |
| | Matrix subtraction. More...
|
| |
| NumA::MatrixD | operator* (double rhs) const |
| | Multiplication of all the coefficients by a scalar. More...
|
| |
| NumA::MatrixD | operator+ (double rhs) const |
| | Addition coefficient by coefficient with a scalar. More...
|
| |
| NumA::MatrixD | operator- (double rhs) const |
| | Subtraction coefficient by coefficient with a scalar. More...
|
| |
| NumA::MatrixD | operator/ (double rhs) const |
| | Division of all the coefficients by a scalar. More...
|
| |
| NumA::MatrixD | transpose () const |
| | Matrix transpose. More...
|
| |
| void | update (const size_t i, const size_t j, const double value) |
| | Update the value at the given indices. More...
|
| |
| double & | at (const size_t i, const size_t j) |
| | Element access. More...
|
| |
| const double & | at (const size_t i, const size_t j) const |
| | Element access. More...
|
| |
| std::string | toString () const |
| | Return a formatted characters string to display matrix's values. More...
|
| |
| size_t | cols () const |
| |
| size_t | rows () const |
| |
Represents a two-dimensional array of double.
The indices start at 0 up to size-1.
Examples:
A.at(1,3) = 10.;
C = A*B + B/2.;
Represents a two-dimensional array of double.
Definition: MatrixD.h:49
static NumA::MatrixD Id(unsigned int n)
Matrix identity.
Definition: MatrixD.cpp:207
std::string toString() const
Return a formatted characters string to display matrix's values.
Definition: MatrixD.cpp:226
double & at(const size_t i, const size_t j)
Element access.
Definition: MatrixD.cpp:316
This returns:
0.5 0 0 0 0
0 0.5 0 10 0
0 0 0.5 0 0
0 0 0 0.5 0
0 0 0 0 2.5
| NumA::MatrixD::MatrixD |
( |
const size_t |
_rowsNumber, |
|
|
const size_t |
_columnsNumber, |
|
|
double |
first_value, |
|
|
|
... |
|
) |
| |
Creates a matrix with specific dimensions and fills it with given values separated by comma.
TODO: Write something better?
If the number and type of arguments are not right, UNDEFINED BEHAVIOUR !!! This constructor is very DANGEROUS!!! USE IT RIGHT, OR SCRAP IT ALL AND REWRITE SOMETHING BETTER!
- Parameters
-
| _rowsNumber | : number of rows |
| _columnsNumber | : number of columns |
| first_value | : first value of the matrix |