|
TBCI Numerical high perf. C++ Library
2.8.0
|
exception class: Use MatErr from matrix.h More...
#include <cscmatrix.h>


Public Types | |
| typedef T | value_type |
| typedef T | element_type |
| typedef T aligned_value_type | TALIGN (MIN_ALIGN2) |
Public Member Functions | |
| CSCMatrix () | |
| constructors More... | |
| CSCMatrix (const T &val, const unsigned int rows, const unsigned int columns, const unsigned int nnzeros=1) | |
| CSCMatrix (const unsigned int rows, const unsigned int columns, const unsigned int nnzeros=1) | |
| CSCMatrix (const CSCMatrix< T > &m) | |
| CSCMatrix (const F_Matrix< T > &m, const double tol=0) | |
| CSCMatrix (const BdMatrix< T > &m, const double tol=0) | |
| CSCMatrix (const Matrix< T > &m, const double tol=0) | |
| ~CSCMatrix () | |
| operator F_TMatrix< T > () const | |
| conversion to F_Matrix More... | |
| unsigned int | rows () const |
| query matrix dimensions More... | |
| unsigned int | columns () const |
| unsigned int | size () const |
| CSCMatrix< T > & | resize (const unsigned int newRows, const unsigned int newColumns, const unsigned int nnzeros=1) |
| change matrix dimensions More... | |
| CSCMatrix< T > & | clear () |
| set all elements defined to zero More... | |
| CSCMatrix< T > & | fill (const T &) |
| set all defined element to a val More... | |
| CSCMatrix< T > & | setunit (const T &=(T) 1) |
| set CSCMatrix to val times the unit matrix More... | |
| tbci_traits< T >::const_refval_type | operator() (unsigned int row, unsigned int column) const HOT |
| element access (read) More... | |
| tbci_traits< T >::const_refval_type | get (unsigned int row, unsigned int column) const HOT |
| element access (read) More... | |
| CSCMatrix< T > & | setval (const T &z, unsigned int row, unsigned int column) |
| element access (write) More... | |
| T & | setval (unsigned int row, unsigned int column) |
| element access (write) More... | |
| T & | operator() (unsigned int row, unsigned int column) |
| T * | dataPointer () |
| unsigned int * | columnPointer () |
| unsigned int * | rowIndexPointer () |
| bool | operator== (const CSCMatrix< T > &m) const |
| matrix-matrix assignment and comparison More... | |
| bool | operator!= (const CSCMatrix< T > &m) const |
| CSCMatrix< T > & | operator= (const CSCMatrix< T > &m) |
| template<typename MatType > | |
| CSCMatrix< T > & | do_import (const MatType &M) |
| Import operation, automatic conversion to sparse matrix. More... | |
| template<typename MatType > | |
| void | do_export (MatType &M) |
| Export operation. More... | |
| CSCMatrix< T > | operator- () const |
| matrix negation More... | |
| CSCMatrix< T > | operator+ (const CSCMatrix< T > &) const |
| Addition. More... | |
| CSCMatrix< T > | operator- (const CSCMatrix< T > &) const |
| F_TMatrix< T > | operator* (const CSCMatrix< T > &) const |
| CSCMatrix * CSCMatrix. More... | |
| F_TMatrix< T > | multf (const F_Matrix< T > &) const |
| matrix-matrix multiplication More... | |
| F_TMatrix< T > | mult (const F_Matrix< T > &) const |
| Calculate *this * m1 (dumb version) More... | |
| F_TMatrix< T > | mult1 (const F_Matrix< T > &) const |
| Calculate *this * m1 (smart version) More... | |
| TVector< T > | operator* (const Vector< T > &v) const HOT |
| matrix - vector multiplication More... | |
| TVector< T > | operator* (const TVector< T > &tv) const HOT |
| TVector< T > | operator* (TSVector< T > &tsv) const HOT |
| TVector< T > | cscm_vec_mul_exact (const Vector< T > &V) const |
| void | MatVecMult (Vector< T > &res, const Vector< T > &v) const HOT |
| for friend void MatVecMult FGD (Vector<T>& res, const CSCMatrix<T>& m, const Vector<T>& v); More... | |
| void | MatVecMult (T *v, T *res) HOT |
| TVector< T > | transMult (const Vector< T > &v) const HOT |
| transpose-vector multiplication More... | |
| TVector< T > | transMult (const TVector< T > &tv) const HOT |
| TVector< T > | transMult (const TSVector< T > &tsv) const HOT |
| CSCMatrix< T > | operator* (const T &z) const |
| CSCMatrix< T > | mult (const T &) const |
| for friend CSCMatrix<T> operator* FGD (const T& z, const CSCMatrix<T>& m); More... | |
| CSCMatrix< T > & | operator*= (const T &z) |
| CSCMatrix< T > | operator/ (const T &z) const |
| CSCMatrix< T > & | operator/= (const T &z) |
| CSCMatrix< T > & | swap (CSCMatrix< T > &) |
| CSCMatrix< T > | transposed_copy () const |
| Inefficient! Use transMult if possible. More... | |
| CSCMatrix< T > & | transpose () |
Public Member Functions inherited from Matrix_Sig< T > | |
| Matrix_Sig () | |
| ~Matrix_Sig () | |
| tbci_traits< T >::const_refval_type | operator() (const unsigned, const unsigned) const |
| ro access More... | |
| T & | operator() (const unsigned, const unsigned) |
| rw access More... | |
| Matrix_Sig< T > & | fill (const T &) |
| Matrix_Sig< T > & | setunit (const T &=(T) 1) |
| Matrix_Sig< T > & | clear () |
| TVector< T > | operator* (const Vector_Sig< T > &) const |
| TVector< T > | transMult (const Vector_Sig< T > &) const |
| unsigned int | rows () const |
| unsigned int | columns () const |
Static Public Member Functions | |
| static const char * | mat_info () |
| allow instantiation (Matrix_Sig) More... | |
Static Public Member Functions inherited from Matrix_Sig< T > | |
| static const char * | mat_info () |
Protected Member Functions | |
| void | allocate (unsigned int rows, unsigned int columns, unsigned int nnzeros=1) |
| void | destroy () |
| void | copy (const CSCMatrix< T > &m) |
| void | insert (const unsigned int column, const unsigned int pos) |
| template<typename MatType > | |
| void | fill (const MatType &M, const double tol=0.0) |
| Import operation, automatic conversion to sparse matrix. More... | |
Protected Attributes | |
| unsigned int | n_rows |
| Storage format: pcol holds the offsets of each column; the length of the column c is pcol[c+1]-pcol[c]. More... | |
| unsigned int | n_cols |
| unsigned int | n_size |
| unsigned int | n_max_size |
| unsigned int * | pcol |
| unsigned int * | irow |
| T * | comp |
| T | dummy |
Friends | |
| class | F_TSMatrix< T > |
| STD__ ostream & | operator<< FGDT (STD__ ostream &stream, const CSCMatrix< T > &m) |
| Output operations. More... | |
exception class: Use MatErr from matrix.h
C++ class for sparse matrices; using compressed column storage, SuperLU compatible (NO FORTRAN NEEDED!!) Performs very well.
Alternative: BdMatrix.
Definition at line 49 of file cscmatrix.h.
| typedef T CSCMatrix< T >::element_type |
Definition at line 71 of file cscmatrix.h.
| typedef T aligned_value_type CSCMatrix< T >::TALIGN(MIN_ALIGN2) |
Definition at line 72 of file cscmatrix.h.
| typedef T CSCMatrix< T >::value_type |
Definition at line 70 of file cscmatrix.h.
|
inline |
Definition at line 76 of file cscmatrix.h.
References CSCMatrix< T >::allocate(), CSCMatrix< T >::fill(), and T.
|
inline |
Definition at line 80 of file cscmatrix.h.
References CSCMatrix< T >::allocate().
Definition at line 83 of file cscmatrix.h.
References CSCMatrix< T >::copy().
|
inline |
Definition at line 85 of file cscmatrix.h.
References CSCMatrix< T >::allocate(), F_Matrix< T >::columns(), CSCMatrix< T >::fill(), and F_Matrix< T >::rows().
|
inline |
Definition at line 87 of file cscmatrix.h.
References CSCMatrix< T >::allocate(), BdMatrix< T >::columns(), CSCMatrix< T >::fill(), and BdMatrix< T >::rows().
|
inline |
Definition at line 89 of file cscmatrix.h.
References CSCMatrix< T >::allocate(), TMatrix< T >::columns(), CSCMatrix< T >::fill(), and TMatrix< T >::rows().
Definition at line 91 of file cscmatrix.h.
References CSCMatrix< T >::destroy().
|
protected |
Definition at line 929 of file cscmatrix.h.
References BCHKNR, Matrix_Sig< T >::columns(), i, NULL, Matrix_Sig< T >::rows(), and T.
Referenced by CSCMatrix< T >::CSCMatrix(), and CSCMatrix< T >::do_import().
set all elements defined to zero
Definition at line 1012 of file cscmatrix.h.
Definition at line 130 of file cscmatrix.h.
References CSCMatrix< T >::pcol.
Referenced by lu_solve().
Definition at line 102 of file cscmatrix.h.
References CSCMatrix< T >::n_cols.
Referenced by F_Matrix< T >::F_Matrix(), lu_solve(), CSCMatrix< T >::operator*(), F_TSMatrix< T >::operator*(), CSCMatrix< T >::operator+(), and CSCMatrix< T >::operator-().
Definition at line 973 of file cscmatrix.h.
References BCHKNR, CSCMatrix< T >::comp, for(), i, CSCMatrix< T >::irow, CSCMatrix< T >::n_cols, CSCMatrix< T >::n_rows, CSCMatrix< T >::n_size, NULL, CSCMatrix< T >::pcol, and T.
Referenced by CSCMatrix< T >::CSCMatrix().
| TVector< T > CSCMatrix< T >::cscm_vec_mul_exact | ( | const Vector< T > & | V | ) | const |
Definition at line 733 of file cscmatrix.h.
References BCHK, i, REGISTER, res, F_TSMatrix< T >::row, TVector< T >::setval(), TVector< T >::size(), T, v, and y.
Definition at line 129 of file cscmatrix.h.
References CSCMatrix< T >::comp.
Referenced by lu_solve().
Definition at line 956 of file cscmatrix.h.
References NULL.
Referenced by CSCMatrix< T >::do_import(), and CSCMatrix< T >::~CSCMatrix().
|
inline |
Export operation.
Definition at line 152 of file cscmatrix.h.
References CSCMatrix< T >::comp, i, CSCMatrix< T >::irow, CSCMatrix< T >::n_cols, and CSCMatrix< T >::pcol.
|
inline |
Import operation, automatic conversion to sparse matrix.
Definition at line 142 of file cscmatrix.h.
References CSCMatrix< T >::allocate(), CSCMatrix< T >::destroy(), and CSCMatrix< T >::fill().
set all defined element to a val
Definition at line 998 of file cscmatrix.h.
References c, Matrix_Sig< T >::clear(), Matrix_Sig< T >::columns(), Matrix_Sig< T >::rows(), and T.
Referenced by CSCMatrix< T >::CSCMatrix(), and CSCMatrix< T >::do_import().
|
inlineprotected |
Import operation, automatic conversion to sparse matrix.
Definition at line 229 of file cscmatrix.h.
References std::fabs(), i, MATH__, CSCMatrix< T >::n_cols, CSCMatrix< T >::n_rows, CSCMatrix< T >::resize(), CSCMatrix< T >::setval(), and STD__.
|
inline |
element access (read)
Definition at line 455 of file cscmatrix.h.
References TBCI::_bin_search(), F_TSMatrix< T >::col, REGISTER, and T.
allow instantiation (Matrix_Sig)
Definition at line 97 of file cscmatrix.h.
| void CSCMatrix< T >::MatVecMult | ( | Vector< T > & | res, |
| const Vector< T > & | v | ||
| ) | const |
for friend void MatVecMult FGD (Vector<T>& res, const CSCMatrix<T>& m, const Vector<T>& v);
Definition at line 791 of file cscmatrix.h.
References BCHKNR, i, TVector< T >::size(), T, and v.
Referenced by MatVecMult().
Definition at line 809 of file cscmatrix.h.
Calculate *this * m1 (dumb version)
Definition at line 301 of file cscmatrix.h.
References BCHK, Matrix_Sig< T >::columns(), F_Matrix< T >::columns(), do_exactsum2(), i, REGISTER, res, Matrix_Sig< T >::rows(), F_Matrix< T >::rows(), T, x, and y.
Referenced by operator*().
for friend CSCMatrix<T> operator* FGD (const T& z, const CSCMatrix<T>& m);
Definition at line 882 of file cscmatrix.h.
References CSCMatrix< T >::comp, i, and res.
Calculate *this * m1 (smart version)
Definition at line 332 of file cscmatrix.h.
References BCHK, c, Matrix_Sig< T >::columns(), F_Matrix< T >::columns(), res, Matrix_Sig< T >::rows(), F_Matrix< T >::rows(), and T.
Referenced by operator*().
matrix-matrix multiplication
Calculate m1 * *this.
Definition at line 265 of file cscmatrix.h.
References BCHK, Matrix_Sig< T >::columns(), F_Matrix< T >::columns(), do_exactsum2(), i, REGISTER, res, Matrix_Sig< T >::rows(), F_Matrix< T >::rows(), T, x, and y.
Referenced by operator*().
conversion to F_Matrix
Definition at line 549 of file cscmatrix.h.
References c, Matrix_Sig< T >::columns(), res, Matrix_Sig< T >::rows(), F_TMatrix< T >::setval(), and T.
Definition at line 135 of file cscmatrix.h.
References CSCMatrix< T >::operator==().
| tbci_traits<T>::const_refval_type CSCMatrix< T >::operator() | ( | unsigned int | row, |
| unsigned int | column | ||
| ) | const |
element access (read)
Definition at line 127 of file cscmatrix.h.
References CSCMatrix< T >::setval().
Mat-Mat mult.
Definition at line 354 of file cscmatrix.h.
References BCHK, Matrix_Sig< T >::columns(), CSCMatrix< T >::columns(), CSCMatrix< T >::comp, do_exactsum2(), CSCMatrix< T >::irow, CSCMatrix< T >::pcol, REGISTER, res, Matrix_Sig< T >::rows(), CSCMatrix< T >::rows(), T, and y.
matrix - vector multiplication
Definition at line 752 of file cscmatrix.h.
References BCHK, do_exactsum2(), i, res, TVector< T >::setval(), TVector< T >::size(), and v.
|
inline |
Definition at line 767 of file cscmatrix.h.
References v.
Definition at line 775 of file cscmatrix.h.
References BCHK, TSVector< T >::destroy(), TSVector< T >::get(), i, res, TVector< T >::setval(), and TSVector< T >::size().
Definition at line 871 of file cscmatrix.h.
References CSCMatrix< T >::comp, i, and res.
Definition at line 898 of file cscmatrix.h.
References i.
Addition.
Definition at line 385 of file cscmatrix.h.
References BCHK, c, Matrix_Sig< T >::columns(), CSCMatrix< T >::columns(), CSCMatrix< T >::comp, CSCMatrix< T >::irow, CSCMatrix< T >::pcol, res, Matrix_Sig< T >::rows(), and CSCMatrix< T >::rows().
matrix negation
Definition at line 699 of file cscmatrix.h.
References CSCMatrix< T >::comp, i, and res.
Definition at line 418 of file cscmatrix.h.
References BCHK, c, Matrix_Sig< T >::columns(), CSCMatrix< T >::columns(), CSCMatrix< T >::comp, CSCMatrix< T >::irow, CSCMatrix< T >::pcol, res, Matrix_Sig< T >::rows(), and CSCMatrix< T >::rows().
Definition at line 907 of file cscmatrix.h.
References CSCMatrix< T >::comp, i, and res.
Definition at line 918 of file cscmatrix.h.
References i.
Definition at line 672 of file cscmatrix.h.
References F_TSMatrix< T >::destroy().
matrix-matrix assignment and comparison
Definition at line 683 of file cscmatrix.h.
References i, CSCMatrix< T >::n_cols, and CSCMatrix< T >::n_rows.
Referenced by CSCMatrix< T >::operator!=().
| CSCMatrix< T > & CSCMatrix< T >::resize | ( | const unsigned int | newRows, |
| const unsigned int | newColumns, | ||
| const unsigned int | nnzeros = 1 |
||
| ) |
change matrix dimensions
Definition at line 561 of file cscmatrix.h.
References F_TSMatrix< T >::destroy(), i, MIN, T, and UNLIKELY.
Referenced by CSCMatrix< T >::fill().
Definition at line 131 of file cscmatrix.h.
References CSCMatrix< T >::irow.
Referenced by lu_solve().
query matrix dimensions
Definition at line 101 of file cscmatrix.h.
References CSCMatrix< T >::n_rows.
Referenced by F_Matrix< T >::F_Matrix(), lu_solve(), CSCMatrix< T >::operator*(), CSCMatrix< T >::operator+(), and CSCMatrix< T >::operator-().
set CSCMatrix to val times the unit matrix
Definition at line 1016 of file cscmatrix.h.
References BCHK, Matrix_Sig< T >::clear(), i, and Matrix_Sig< T >::setunit().
| CSCMatrix< T > & CSCMatrix< T >::setval | ( | const T & | z, |
| unsigned int | row, | ||
| unsigned int | column | ||
| ) |
element access (write)
Definition at line 640 of file cscmatrix.h.
References z.
Referenced by CSCMatrix< T >::fill(), and CSCMatrix< T >::operator()().
element access (write)
Definition at line 648 of file cscmatrix.h.
References F_TSMatrix< T >::col, EXPCHKNR, index, F_TSMatrix< T >::row, and T.
Definition at line 103 of file cscmatrix.h.
References CSCMatrix< T >::n_size.
Referenced by lu_solve().
Definition at line 1027 of file cscmatrix.h.
References CSCMatrix< T >::comp, CSCMatrix< T >::irow, CSCMatrix< T >::n_cols, CSCMatrix< T >::n_max_size, CSCMatrix< T >::n_rows, CSCMatrix< T >::n_size, CSCMatrix< T >::pcol, and TBCI::SWAP().
transpose-vector multiplication
Definition at line 826 of file cscmatrix.h.
References BCHK, do_exactsum2(), i, REGISTER, res, TVector< T >::set(), TVector< T >::size(), T, v, and y.
Definition at line 854 of file cscmatrix.h.
References Matrix_Sig< T >::transMult(), and v.
Definition at line 862 of file cscmatrix.h.
References Matrix_Sig< T >::transMult(), and v.
Definition at line 1047 of file cscmatrix.h.
Inefficient! Use transMult if possible.
Definition at line 1037 of file cscmatrix.h.
References c, Matrix_Sig< T >::columns(), and Matrix_Sig< T >::rows().
Referenced by transpose().
|
friend |
Definition at line 67 of file cscmatrix.h.
|
friend |
Output operations.
Definition at line 218 of file cscmatrix.h.
Referenced by CSCMatrix< T >::copy(), CSCMatrix< T >::dataPointer(), CSCMatrix< T >::do_export(), CSCMatrix< T >::mult(), CSCMatrix< T >::operator*(), F_TSMatrix< T >::operator*(), CSCMatrix< T >::operator+(), CSCMatrix< T >::operator-(), CSCMatrix< T >::operator/(), and CSCMatrix< T >::swap().
Definition at line 219 of file cscmatrix.h.
Definition at line 217 of file cscmatrix.h.
Referenced by CSCMatrix< T >::copy(), CSCMatrix< T >::do_export(), CSCMatrix< T >::operator*(), F_TSMatrix< T >::operator*(), CSCMatrix< T >::operator+(), CSCMatrix< T >::operator-(), CSCMatrix< T >::rowIndexPointer(), and CSCMatrix< T >::swap().
Definition at line 215 of file cscmatrix.h.
Referenced by CSCMatrix< T >::columns(), CSCMatrix< T >::copy(), CSCMatrix< T >::do_export(), CSCMatrix< T >::fill(), CSCMatrix< T >::operator==(), and CSCMatrix< T >::swap().
Definition at line 215 of file cscmatrix.h.
Referenced by CSCMatrix< T >::swap().
Storage format: pcol holds the offsets of each column; the length of the column c is pcol[c+1]-pcol[c].
The elements located at comp[i] with pos[c] <= i < pos[c+1] are representing the matrix elements m(irow[i], c)
Definition at line 215 of file cscmatrix.h.
Referenced by CSCMatrix< T >::copy(), CSCMatrix< T >::fill(), CSCMatrix< T >::operator==(), CSCMatrix< T >::rows(), and CSCMatrix< T >::swap().
Definition at line 215 of file cscmatrix.h.
Referenced by CSCMatrix< T >::copy(), CSCMatrix< T >::size(), and CSCMatrix< T >::swap().
Definition at line 216 of file cscmatrix.h.
Referenced by CSCMatrix< T >::columnPointer(), CSCMatrix< T >::copy(), CSCMatrix< T >::do_export(), CSCMatrix< T >::operator*(), F_TSMatrix< T >::operator*(), CSCMatrix< T >::operator+(), CSCMatrix< T >::operator-(), and CSCMatrix< T >::swap().
1.8.5