Matrix representation and operations, allows operation in selected subspace. More...
#include <indexed_matrix.hpp>
Public Types | |
typedef boost::shared_ptr< SUBSET > | PSubset |
Public Member Functions | |
Indexed_Matrix (const DIMTYPE n, bool LUstorage=false) | |
Indexed_Matrix (const Indexed_Matrix &im) | |
Indexed_Matrix & | operator= (Indexed_Matrix const &im) |
void | reset (const DIMTYPE n_max, bool LUstorage=false) |
reallocates | |
void | redim (const DIMTYPE n=0) |
keeps main allocations, just resets index arrays and adjusts _n; n==0 here equals _n_max | |
DATATYPE & | at_raw (const DIMTYPE row, const DIMTYPE col) |
DATATYPE & | at (const DIMTYPE row, const DIMTYPE col) |
DATATYPE * | get_row_raw (const DIMTYPE row) |
DATATYPE * | get_row (const DIMTYPE row) |
void | narrow_to (const PSubset sub) |
fill _index[] -> access to data is then mapped to sub-matrix | |
void | denarrow () |
reset _index[] -> access is reset to the full matrix | |
DIMTYPE | get_n_max () const |
DIMTYPE | get_n () const |
DIMTYPE | get_d () const |
void | set_all_raw_to (const DATATYPE val) |
void | add_raw (const Indexed_Matrix &mr) |
void | add_constmul_raw (const Indexed_Matrix &mr, const DATATYPE mul) |
void | copy_constmul_raw (const Indexed_Matrix &mr, const DATATYPE mul) |
void | copy_raw (const Indexed_Matrix &mr) |
void | LUdecompose (Indexed_Matrix &result) |
returns matrix+vector+sign | |
void | solve_equations (Indexed_Vector< DATATYPE, DIMTYPE, SUBSET > &result_vec, const Indexed_Matrix &LU_matrix, Indexed_Vector< DATATYPE, DIMTYPE, SUBSET > &coef_vec) |
returns vector | |
void | invert (Indexed_Matrix &result, const Indexed_Matrix &LU_matrix) |
returns matrix | |
DATATYPE | determinant (const Indexed_Matrix &LU_matrix) |
returns scalar | |
Protected Attributes | |
DIMTYPE | _n_max |
allocated space can hold _n_max*_n_max matrix | |
DIMTYPE | _n |
full feature set dimensionality | |
boost::scoped_array< DATATYPE > | _data |
raw matrix data | |
boost::scoped_array< DIMTYPE > | _permut |
LU permutation index. | |
int | _sign |
permutation sign (renamed obsolete d) | |
DIMTYPE | _d |
virtual sub-matrix (as represented by _index) dimensionality | |
boost::scoped_array< DIMTYPE > | _index |
maps virtual sub-matrix _d dimensions to original _n dimensions | |
boost::scoped_array< DATATYPE > | _tmp_rowscale |
(lazy allocation) | |
boost::scoped_array< DIMTYPE > | _tmp_whereis |
(lazy allocation) | |
boost::scoped_ptr < Indexed_Vector< DATATYPE, DIMTYPE, SUBSET > > | _tmp_eq_coefs |
invert coefs (lazy allocation) | |
boost::scoped_ptr < Indexed_Vector< DATATYPE, DIMTYPE, SUBSET > > | _tmp_eq_roots |
to store/pass intermediate results in invert() etc. (lazy allocation) | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Indexed_Matrix &mr) |
Matrix representation and operations, allows operation in selected subspace.