#include <mmatrix.h>
Inheritance diagram for Matrix:
Public Methods | |
void | make (int rs, int cs) |
void | load (const String &filename) |
void | load (FILE *in) |
const Matrix & | multiplyToSum (double s) |
double | det () const |
void | splitVertical (Matrix &a, Matrix &b, int column) const |
void | splitHorizontal (Matrix &a, Matrix &b, int column) const |
Matrix | sub (int row0, int row1, int col0, int col1) const |
void | mulRowByScalar (int row, double scalar) |
void | addRowByScalar (int srcrow, int dstrow, double scalar) |
void | swaprows (int row1, int row2) |
Matrix | complement (int row, int col) const |
void | joinVertical (const Matrix &a, const Vector &b) |
void | joinVertical (const Matrix &a, const Matrix &b) |
void | joinHorizontal (const Matrix &a, const Matrix &b) |
const Matrix & | operator= (double x) |
const Matrix & | operator+= (const Matrix &other) |
const Matrix & | operator+= (double k) |
const Matrix & | operator *= (const Matrix &other) |
const Matrix & | operator *= (double k) |
const Matrix & | operator= (const Matrix &other) |
Definition at line 40 of file mmatrix.h.
|
Multiplies a row by a scalar and adds it to another row. Rounds values to zero if they are below threshold ROUND_TO_ZERO_THRESHOLD. Definition at line 226 of file mmatrix.cc. References PackTable< double >::cols, and PackTable< double >::get(). Referenced by det(), and solveLinear(). |
|
Forms the complement of the matrix by the given element.
Definition at line 197 of file mmatrix.cc. References PackTable< double >::cols, PackTable< double >::get(), and PackTable< double >::rows. Referenced by det(). |
|
Computes the determinant of the matrix.
Definition at line 160 of file mmatrix.cc. References addRowByScalar(), PackTable< double >::cols, complement(), PackTable< double >::get(), and PackTable< double >::rows. |
|
Appends two matrices horizontally. The number of columns in both matrices must be equal. Definition at line 392 of file mmatrix.cc. References PackTable< double >::cols, PackTable< double >::get(), make(), and PackTable< double >::rows. |
|
Appends two matrices vertically. The number of rows in both matrices must be equal. Definition at line 377 of file mmatrix.cc. References PackTable< double >::cols, PackTable< double >::get(), make(), and PackTable< double >::rows. |
|
Appends a vertical vector to matrix. The vector must have length equal to number of rows in the matrix. Definition at line 356 of file mmatrix.cc. References PackTable< double >::cols, make(), PackTable< double >::mData, PackTable< double >::rows, and PackArray::size(). Referenced by solveLinear(). |
|
Load matrix from stream. Columns have to be whitespace-separated, rows newline-separated. Definition at line 78 of file mmatrix.cc. References List::add(), String::chop(), PackTable< double >::cols, PackTable< double >::get(), String::length(), make(), String::reserve(), PackTable< double >::rows, and String::toDouble(). |
|
Load matrix from file. Columns have to be whitespace-separated, rows newline-separated. Definition at line 65 of file mmatrix.cc. |
|
Creates or recreates the Table with the given dimensions. If the Table has any old contents, they are destroyed.
Reimplemented from PackTable< double >. Definition at line 55 of file mmatrix.cc. References PackTable::make(), and operator=(). Referenced by joinHorizontal(), joinVertical(), load(), operator=(), splitHorizontal(), splitVertical(), and sub(). |
|
Multiplies a row by a scalar.
Definition at line 216 of file mmatrix.cc. References PackTable< double >::cols, and PackTable< double >::get(). Referenced by solveLinear(). |
|
Makes the sum of the matrix a given value.
Definition at line 138 of file mmatrix.cc. References operator *=(), and sum(). |
|
Scales the elements in the matrix with the given value.
Definition at line 296 of file mmatrix.cc. References PackTable< double >::cols, and PackTable< double >::rows. |
|
Element-by-element multiplication by another matrix.
Definition at line 287 of file mmatrix.cc. References PackTable< double >::cols, PackTable< double >::mData, and PackTable< double >::rows. Referenced by multiplyToSum(). |
|
Adds a value to all the elements in the matrix.
Definition at line 278 of file mmatrix.cc. References PackTable< double >::cols, and PackTable< double >::rows. |
|
Adds the other matrix to the matrix.
Definition at line 269 of file mmatrix.cc. References PackTable< double >::cols, PackTable< double >::mData, and PackTable< double >::rows. |
|
Matrix copy operation.
Definition at line 259 of file mmatrix.cc. References PackTable< double >::cols, make(), PackTable< double >::mData, and PackTable< double >::rows. |
|
Sets the entire matrix to the given value.
Definition at line 250 of file mmatrix.cc. References PackTable< double >::cols, and PackTable< double >::rows. Referenced by make(). |
|
Splits the matrix row-wise to the given two matrices.
Definition at line 341 of file mmatrix.cc. References PackTable< double >::cols, PackTable< double >::get(), make(), and PackTable< double >::rows. |
|
Splits the matrix column-wise to the given two matrices.
Definition at line 328 of file mmatrix.cc. References PackTable< double >::cols, PackTable< double >::get(), make(), and PackTable< double >::rows. |
|
Returns submatrix.
Definition at line 405 of file mmatrix.cc. References PackTable< double >::cols, PackTable< double >::get(), make(), and PackTable< double >::rows. |
|
Exchanges the values in two rows.
Definition at line 239 of file mmatrix.cc. References PackTable< double >::cols. Referenced by solveLinear(). |