|
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 | |
| 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 | |
| unsigned int | rows () const |
| query matrix dimensions | |
| 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 | |
| CSCMatrix< T > & | clear () |
| set all elements defined to zero | |
| CSCMatrix< T > & | fill (const T &) |
| set all defined element to a val | |
| CSCMatrix< T > & | setunit (const T &=(T) 1) |
| set CSCMatrix to val times the unit matrix | |
| tbci_traits< T >::const_refval_type | operator() (unsigned int row, unsigned int column) const HOT |
| element access (read) | |
| tbci_traits< T >::const_refval_type | get (unsigned int row, unsigned int column) const HOT |
| element access (read) | |
| CSCMatrix< T > & | setval (const T &z, unsigned int row, unsigned int column) |
| element access (write) | |
| T & | setval (unsigned int row, unsigned int column) |
| element access (write) | |
| 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 | |
| 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. | |
| template<typename MatType> | |
| void | do_export (MatType &M) |
| Export operation. | |
| CSCMatrix< T > | operator- () const |
| matrix negation | |
| CSCMatrix< T > | operator+ (const CSCMatrix< T > &) const |
| Addition. | |
| CSCMatrix< T > | operator- (const CSCMatrix< T > &) const |
| F_TMatrix< T > | operator* (const CSCMatrix< T > &) const |
| CSCMatrix * CSCMatrix. | |
| F_TMatrix< T > | multf (const F_Matrix< T > &) const |
| matrix-matrix multiplication | |
| F_TMatrix< T > | mult (const F_Matrix< T > &) const |
| Calculate *this * m1 (dumb version). | |
| F_TMatrix< T > | mult1 (const F_Matrix< T > &) const |
| Calculate *this * m1 (smart version). | |
| TVector< T > | operator* (const Vector< T > &v) const HOT |
| matrix - vector multiplication | |
| 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); | |
| void | MatVecMult (T *v, T *res) HOT |
| TVector< T > | transMult (const Vector< T > &v) const HOT |
| transpose-vector multiplication | |
| 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); | |
| 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. | |
| 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 | |
| T & | operator() (const unsigned, const unsigned) |
| rw access | |
| 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) | |
| 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. | |
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]. | |
| 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. | |
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 65 of file cscmatrix.h.
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.
Definition at line 70 of file cscmatrix.h.
constructors
Definition at line 75 of file cscmatrix.h.
References allocate().
Referenced by clear(), copy(), CSCMatrix(), do_import(), fill(), mult(), operator F_TMatrix< T >(), operator!=(), operator()(), operator*(), operator*(), operator*=(), operator+(), operator-(), operator-(), operator/(), operator/=(), operator<<FGDT, operator=(), operator==(), resize(), setunit(), setval(), swap(), transpose(), and transposed_copy().
|
inline |
Definition at line 76 of file cscmatrix.h.
References allocate(), columns(), fill(), rows(), and T.
|
inline |
Definition at line 80 of file cscmatrix.h.
References allocate(), columns(), and rows().
Definition at line 83 of file cscmatrix.h.
References copy(), and CSCMatrix().
|
inline |
Definition at line 85 of file cscmatrix.h.
References allocate(), F_Matrix< T >::columns(), fill(), and F_Matrix< T >::rows().
|
inline |
Definition at line 87 of file cscmatrix.h.
References allocate(), BdMatrix< T >::columns(), fill(), and BdMatrix< T >::rows().
|
inline |
Definition at line 89 of file cscmatrix.h.
References allocate(), TMatrix< T >::columns(), fill(), and TMatrix< T >::rows().
Definition at line 91 of file cscmatrix.h.
References destroy().
|
protected |
Definition at line 929 of file cscmatrix.h.
References BCHKNR, columns(), comp, i, irow, n_cols, n_max_size, n_rows, n_size, NULL, pcol, rows(), and T.
Referenced by CSCMatrix(), CSCMatrix(), CSCMatrix(), CSCMatrix(), CSCMatrix(), CSCMatrix(), do_import(), and resize().
set all elements defined to zero
Definition at line 1012 of file cscmatrix.h.
References comp, CSCMatrix(), CSTD__, n_size, and T.
Definition at line 102 of file cscmatrix.h.
References n_cols.
Referenced by allocate(), CSCMatrix(), CSCMatrix(), F_Matrix< T >::F_Matrix(), lu_solve(), mult(), mult1(), multf(), operator*(), F_TSMatrix< T >::operator*(), operator+(), operator-(), and operator<<().
Definition at line 973 of file cscmatrix.h.
References BCHKNR, comp, CSCMatrix(), i, irow, n_cols, n_max_size, n_rows, n_size, NULL, pcol, and T.
Referenced by CSCMatrix(), and operator=().
Definition at line 733 of file cscmatrix.h.
References BCHK, comp, i, irow, n_cols, n_rows, pcol, REGISTER, res, F_TSMatrix< T >::row, TVector< T >::setval(), TVector< T >::size(), T, and y.
Referenced by operator*().
Definition at line 956 of file cscmatrix.h.
References comp, irow, n_max_size, n_size, NULL, and pcol.
Referenced by do_import(), and ~CSCMatrix().
|
inline |
Export operation.
Definition at line 152 of file cscmatrix.h.
References comp, do_export(), i, irow, n_cols, and pcol.
Referenced by do_export().
|
inline |
Import operation, automatic conversion to sparse matrix.
Definition at line 142 of file cscmatrix.h.
References allocate(), CSCMatrix(), destroy(), do_import(), and fill().
Referenced by do_import().
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(), CSCMatrix(), Matrix_Sig< T >::rows(), and T.
Referenced by CSCMatrix(), CSCMatrix(), CSCMatrix(), CSCMatrix(), do_import(), and fill().
|
inline |
element access (read)
Definition at line 455 of file cscmatrix.h.
References F_TSMatrix< T >::col, comp, dummy, irow, pcol, REGISTER, F_TSMatrix< T >::row, 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, comp, i, irow, n_cols, pcol, res, TVector< T >::size(), and T.
Referenced by MatVecMult().
Calculate *this * m1 (dumb version).
Definition at line 301 of file cscmatrix.h.
References BCHK, columns(), F_Matrix< T >::columns(), Matrix_Sig< T >::columns(), do_exactsum2(), i, mult(), REGISTER, res, F_Matrix< T >::rows(), Matrix_Sig< T >::rows(), T, x, and y.
Referenced by mult(), mult1(), operator*(), and operator*().
for friend CSCMatrix<T> operator* FGD (const T& z, const CSCMatrix<T>& m);
Definition at line 882 of file cscmatrix.h.
Calculate *this * m1 (smart version).
Definition at line 332 of file cscmatrix.h.
References BCHK, c, columns(), F_Matrix< T >::columns(), Matrix_Sig< T >::columns(), comp, irow, mult(), pcol, res, F_Matrix< T >::rows(), Matrix_Sig< T >::rows(), and T.
Referenced by operator*().
matrix-matrix multiplication
Calculate m1 * *this.
Definition at line 265 of file cscmatrix.h.
References BCHK, columns(), F_Matrix< T >::columns(), Matrix_Sig< T >::columns(), comp, do_exactsum2(), i, irow, multf(), pcol, REGISTER, res, F_Matrix< T >::rows(), Matrix_Sig< T >::rows(), T, x, and y.
Referenced by multf(), and operator*().
conversion to F_Matrix
Definition at line 549 of file cscmatrix.h.
References c, Matrix_Sig< T >::columns(), comp, CSCMatrix(), irow, pcol, res, Matrix_Sig< T >::rows(), and T.
Definition at line 135 of file cscmatrix.h.
References CSCMatrix(), and operator==().
|
inline |
Definition at line 127 of file cscmatrix.h.
| tbci_traits< T >::const_refval_type CSCMatrix< T >::operator() | ( | unsigned int | row, |
| unsigned int | column ) const |
element access (read)
References CSCMatrix(), HOT, and T.
Mat-Mat mult.
Definition at line 354 of file cscmatrix.h.
References BCHK, columns(), Matrix_Sig< T >::columns(), comp, CSCMatrix(), do_exactsum2(), irow, mult(), pcol, REGISTER, res, rows(), Matrix_Sig< T >::rows(), T, and y.
Definition at line 871 of file cscmatrix.h.
Definition at line 767 of file cscmatrix.h.
matrix - vector multiplication
Definition at line 752 of file cscmatrix.h.
References BCHK, comp, cscm_vec_mul_exact(), do_exactsum2(), i, irow, n_cols, n_rows, pcol, res, and TVector< T >::size().
Definition at line 775 of file cscmatrix.h.
References BCHK, comp, TSVector< T >::destroy(), TSVector< T >::get(), i, irow, n_cols, n_rows, pcol, res, and TSVector< T >::size().
Definition at line 898 of file cscmatrix.h.
References comp, CSCMatrix(), i, n_size, and T.
Addition.
Definition at line 385 of file cscmatrix.h.
References BCHK, c, columns(), Matrix_Sig< T >::columns(), comp, CSCMatrix(), irow, pcol, res, rows(), Matrix_Sig< T >::rows(), and size().
matrix negation
Definition at line 699 of file cscmatrix.h.
References comp, CSCMatrix(), i, n_cols, n_rows, n_size, and res.
Definition at line 418 of file cscmatrix.h.
References BCHK, c, columns(), Matrix_Sig< T >::columns(), comp, CSCMatrix(), irow, pcol, res, rows(), Matrix_Sig< T >::rows(), and size().
Definition at line 907 of file cscmatrix.h.
Definition at line 918 of file cscmatrix.h.
References comp, CSCMatrix(), i, n_size, and T.
Definition at line 672 of file cscmatrix.h.
References copy(), CSCMatrix(), and F_TSMatrix< T >::destroy().
matrix-matrix assignment and comparison
Definition at line 683 of file cscmatrix.h.
References CSCMatrix(), i, n_cols, and n_rows.
Referenced by 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 allocate(), comp, CSCMatrix(), F_TSMatrix< T >::destroy(), i, irow, MIN, n_cols, n_max_size, n_rows, T, and UNLIKELY.
Referenced by fill().
query matrix dimensions
Definition at line 101 of file cscmatrix.h.
References n_rows.
Referenced by allocate(), CSCMatrix(), CSCMatrix(), F_Matrix< T >::F_Matrix(), lu_solve(), operator*(), operator+(), operator-(), and operator<<().
set CSCMatrix to val times the unit matrix
Definition at line 1016 of file cscmatrix.h.
References BCHK, Matrix_Sig< T >::clear(), CSCMatrix(), i, n_cols, n_rows, setunit(), setval(), and T.
Referenced by 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 CSCMatrix(), F_TSMatrix< T >::row, setval(), and T.
Referenced by fill(), operator()(), setunit(), and setval().
element access (write)
Definition at line 648 of file cscmatrix.h.
References F_TSMatrix< T >::col, comp, EXPCHKNR, index, insert(), irow, n_cols, n_rows, pcol, F_TSMatrix< T >::row, and T.
Definition at line 103 of file cscmatrix.h.
References n_size.
Referenced by lu_solve(), operator+(), and operator-().
Definition at line 1027 of file cscmatrix.h.
References comp, CSCMatrix(), irow, n_cols, n_max_size, n_rows, n_size, and pcol.
Referenced by transpose().
Definition at line 862 of file cscmatrix.h.
References Matrix_Sig< T >::transMult().
Definition at line 854 of file cscmatrix.h.
References Matrix_Sig< T >::transMult().
transpose-vector multiplication
Definition at line 826 of file cscmatrix.h.
References BCHK, comp, do_exactsum2(), i, irow, n_cols, n_rows, pcol, REGISTER, res, TVector< T >::size(), T, and y.
Definition at line 1047 of file cscmatrix.h.
References CSCMatrix(), swap(), and transposed_copy().
Inefficient! Use transMult if possible.
Definition at line 1037 of file cscmatrix.h.
References c, Matrix_Sig< T >::columns(), CSCMatrix(), and Matrix_Sig< T >::rows().
Referenced by transpose(), and transpose().
|
friend |
Definition at line 41 of file cscmatrix.h.
|
friend |
Output operations.
References CSCMatrix(), and STD__.
Definition at line 218 of file cscmatrix.h.
Referenced by allocate(), clear(), copy(), cscm_vec_mul_exact(), dataPointer(), destroy(), do_export(), get(), insert(), MatVecMult(), MatVecMult(), mult(), mult1(), multf(), operator F_TMatrix< T >(), operator*(), operator*(), operator*(), operator*(), F_TSMatrix< T >::operator*(), operator*=(), operator+(), operator-(), operator-(), operator/(), operator/=(), resize(), setval(), swap(), and transMult().
Definition at line 219 of file cscmatrix.h.
Referenced by get().
Definition at line 217 of file cscmatrix.h.
Referenced by allocate(), copy(), cscm_vec_mul_exact(), destroy(), do_export(), get(), insert(), MatVecMult(), MatVecMult(), mult1(), multf(), operator F_TMatrix< T >(), operator*(), operator*(), operator*(), F_TSMatrix< T >::operator*(), operator+(), operator-(), resize(), rowIndexPointer(), setval(), swap(), and transMult().
Definition at line 215 of file cscmatrix.h.
Referenced by allocate(), columns(), copy(), cscm_vec_mul_exact(), do_export(), fill(), insert(), MatVecMult(), MatVecMult(), operator*(), operator*(), operator-(), operator==(), resize(), setunit(), setval(), swap(), and transMult().
Definition at line 215 of file cscmatrix.h.
Referenced by allocate(), copy(), destroy(), insert(), resize(), and 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 allocate(), copy(), cscm_vec_mul_exact(), fill(), operator*(), operator*(), operator-(), operator==(), resize(), rows(), setunit(), setval(), swap(), and transMult().
Definition at line 215 of file cscmatrix.h.
Referenced by allocate(), clear(), copy(), destroy(), insert(), mult(), operator*(), operator*=(), operator-(), operator/(), operator/=(), size(), and swap().
Definition at line 216 of file cscmatrix.h.
Referenced by allocate(), columnPointer(), copy(), cscm_vec_mul_exact(), destroy(), do_export(), get(), insert(), MatVecMult(), MatVecMult(), mult1(), multf(), operator F_TMatrix< T >(), operator*(), operator*(), operator*(), F_TSMatrix< T >::operator*(), operator+(), operator-(), setval(), swap(), and transMult().