|
TBCI Numerical high perf. C++ Library 2.8.0
|
#include <matrix.h>


Public Types | |
| typedef T | value_type |
| typedef T | element_type |
| typedef T aligned_value_type | TALIGN(MIN_ALIGN2) |
| Public Types inherited from TMatrix< T > | |
| typedef T | value_type |
| typedef T | element_type |
| typedef T aligned_value_type | TALIGN(MIN_ALIGN2) |
Public Member Functions | |
| Matrix (const unsigned d=0) | |
| Matrix (const unsigned r, const unsigned c) | |
| Matrix (const T &v, const unsigned r, const unsigned c) | |
| Matrix (const Vector< T > &v, const enum rowcolvec r=colvec) | |
| Matrix (const Matrix< T > &m) | |
| copy, does a real copy, as TM(M) is invoked (not TM(TM)) | |
| Matrix (const TMatrix< T > &tm) HOT | |
| alias | |
| Matrix (const TSMatrix< T > &ts) | |
| ~Matrix () | |
| template<typename U> | |
| Matrix (const Matrix< U > &m) | |
| template<typename U> | |
| Matrix (const TMatrix< U > &tm) | |
| tbci_traits< T >::const_refval_type | operator() (const unsigned int, const unsigned int) const HOT |
| ro element access | |
| T & | operator() (const unsigned int, const unsigned int) HOT |
| rw element access | |
| TVector< T > | operator() (const unsigned int) const |
| get row | |
| Matrix< T > & | operator= (const Matrix< T > &m) |
| Assignment, non-resizing. | |
| Matrix< T > & | operator= (const TMatrix< T > &tm) |
| Matrix< T > & | operator= (TSMatrix< T > ts) |
| Matrix< T > & | operator= (const T &v) |
| Matrix< T > & | resize (const unsigned r, const unsigned c) |
| Matrix< T > & | resize (const unsigned d) |
| Matrix< T > & | resize (const T &v, const unsigned r, const unsigned c) |
| Matrix< T > & | resize (const Matrix< T > &m) |
| Matrix< T > & | fill (const T &v=(T) 0) |
| Matrix< T > & | fill (const Vector< T > &v) |
| Matrix< T > & | setunit (const T &f=(T) 1) |
| Matrix< T > & | clear () |
| Matrix< T > & | operator+= (const Matrix< T > &a) |
| Matrix< T > & | operator-= (const Matrix< T > &a) |
| Matrix< T > & | operator+= (TMatrix< T > a) |
| Matrix< T > & | operator-= (TMatrix< T > a) |
| Matrix< T > & | operator+= (TSMatrix< T > a) |
| Matrix< T > & | operator-= (TSMatrix< T > a) |
| Matrix< T > & | operator+= (const T &a) |
| Matrix< T > & | operator-= (const T &a) |
| Matrix< T > & | operator*= (const T &a) |
| Matrix< T > & | operator/= (const T &a) |
| TMatrix< T > | operator- () const |
| TMatrix< T > | operator+ (const Matrix< T > &) const |
| TMatrix< T > | operator- (const Matrix< T > &) const |
| TMatrix< T > | operator* (const Matrix< T > &) const |
| TMatrix< T > & | operator+ (TMatrix< T > &) const |
| TMatrix< T > & | operator- (TMatrix< T > &) const |
| TMatrix< T > | operator* (TMatrix< T > &) const |
| TMatrix< T > | operator+ (TSMatrix< T > &) const |
| TMatrix< T > | operator- (TSMatrix< T > &) const |
| TMatrix< T > | operator* (TSMatrix< T > &) const |
| TMatrix< T > | operator+ (const T &) const |
| TMatrix< T > | operator- (const T &) const |
| TSMatrix< T > | operator* (const T &) const |
| TSMatrix< T > | operator/ (const T &) const |
| TVector< T > | operator* (const Vector< T > &) const HOT |
| TVector< T > | operator* (TVector< T >) const HOT |
| Now for the Matrix-Vector multiplications. | |
| TVector< T > | operator* (const TSVector< T > &tsv) const HOT |
| TVector< T > | transMult (const Vector< T > &) const HOT |
| bool | operator== (const Matrix< T > &m) const |
| bool | operator!= (const Matrix< T > &m) const |
| bool | operator== (TMatrix< T > tm) const |
| bool | operator!= (TMatrix< T > tm) const |
| bool | operator== (TSMatrix< T >) const |
| bool | operator!= (TSMatrix< T > ts) const |
| Matrix< T > & | mult_rows (const Vector< T > &) |
| Elementwise ops. | |
| Matrix< T > & | div_rows (const Vector< T > &) |
| Matrix< T > & | mult_row (const T &, const unsigned) |
| Matrix< T > & | div_row (const T &, const unsigned) |
| double | fabssqr () const |
| double | fabs () const |
| Public Member Functions inherited from TMatrix< T > | |
| T * | getvec () const |
| T * | getendvec () const |
| TMatrix (const unsigned=0) | |
| c'tor for square Matrix | |
| TMatrix (const unsigned, const unsigned) | |
| c'tor for Matrix, specifying rows and columns | |
| TMatrix (const T &, const unsigned, const unsigned) | |
| c'tor for Matrix, specifying and initialization value and rows and columns | |
| TMatrix (const Vector< T > &, const enum rowcolvec=colvec) | |
| c'tor to construct 1-column (or 1-row) Matrix from Vector | |
| TMatrix (const TMatrix< T > &) HOT | |
| aliasing copies (TBCI) | |
| TMatrix (TSMatrix< T >) | |
| TMatrix (const Matrix< T > &) HOT | |
| full copying | |
| void | real_destroy () |
| real destructor | |
| void | mark_destroy () const |
| mark destructible | |
| ~TMatrix () | |
| template<typename U> | |
| TMatrix (const Matrix< U > &m) | |
| template<typename U> | |
| TMatrix (const TMatrix< U > &tm) | |
| TMatrix< T > & | operator= (const Matrix< T > &) HOT |
| assignment, non-resizing | |
| TMatrix< T > & | operator= (const TMatrix< T > &) HOT |
| TMatrix< T > & | operator= (TSMatrix< T >) |
| TMatrix< T > & | operator= (const T &) |
| TMatrix< T > & | alias (const TMatrix< T > &m) |
| TMatrix< T > & | operator+= (TMatrix< T >) |
| arithmetics ... | |
| TMatrix< T > & | operator+= (const Matrix< T > &) |
| TMatrix< T > & | operator+= (const T &) |
| TMatrix< T > & | operator+= (TSMatrix< T >) |
| TMatrix< T > & | operator-= (TMatrix< T >) |
| TMatrix< T > & | operator-= (const Matrix< T > &) |
| TMatrix< T > & | operator-= (const T &) |
| TMatrix< T > & | operator-= (TSMatrix< T >) |
| TSMatrix< T > | operator*= (const T &) |
| TSMatrix< T > | operator/= (const T &) |
| TMatrix< T > & | operator- () |
| TMatrix< T > & | operator+ (TMatrix< T >) |
| TMatrix< T > & | operator+ (TSMatrix< T >) |
| TMatrix< T > & | operator+ (const Matrix< T > &) |
| TMatrix< T > & | operator+ (const T &) |
| TMatrix< T > & | operator- (TMatrix< T >) |
| TMatrix< T > & | operator- (TSMatrix< T >) |
| TMatrix< T > & | operator- (const Matrix< T > &) |
| TMatrix< T > & | operator- (const T &) |
| TSMatrix< T > | operator* (const T &) |
| TSMatrix< T > | operator/ (const T &) |
| TMatrix< T > | operator* (const Matrix< T > &) |
| TMatrix< T > | operator* (TMatrix< T >) |
| TMatrix< T > | operator* (TSMatrix< T >) |
| TVector< T > | operator* (const Vector< T > &v) |
| TVector< T > | operator* (TVector< T > &tv) |
| TVector< T > | operator* (const TSVector< T > &tsv) |
| TMatrix< T > & | swap (TMatrix< T > &) |
| TMatrix< T > | transposed_copy () const |
| Inefficient! Use transMult if possible. | |
| TMatrix< T > & | transpose () |
| T | operator() (const unsigned int, const unsigned int) const HOT |
| Element access (desctructive for TMatrix!). | |
| Mat_Brack< T > | operator[] (const unsigned int i) const |
| T & | setval (const T &val, const unsigned int r, const unsigned int c) |
| T & | setval (const unsigned r, const unsigned c) |
| tbci_traits< T >::const_refval_type | get (const unsigned r, const unsigned c) const |
| get, set and getcref are used internally and not for public consumption | |
| T & | set (const T &val, const unsigned r, const unsigned c) |
| const T & | getcref (const unsigned r, const unsigned c) const |
| const T * | getrowptr (const unsigned r) const |
| Helpers for matvecmul. | |
| T * | getrowptr (const unsigned r) |
| bool | operator== (const Matrix< T > &m) |
| Comparison. | |
| bool | operator!= (const Matrix< T > &m) |
| bool | operator== (TMatrix< T > tm) |
| bool | operator!= (TMatrix< T > tm) |
| bool | operator== (TSMatrix< T >) |
| bool | operator!= (TSMatrix< T > ts) |
| unsigned int | columns () const |
| number of columns | |
| unsigned int | rows () const |
| number of rows | |
| unsigned long | size () const |
| number of elements | |
| TVector< T > | operator() (const unsigned int) const |
| Row vector. | |
| TVector< T > | get_row (const unsigned int) const |
| Row vector. | |
| TVector< T > | get_col (const unsigned int) const |
| Column vector. | |
| void | set_row (const Vector< T > &, const unsigned int) |
| Fill complete row. | |
| void | set_col (const Vector< T > &, const unsigned int) |
| Fill complete column. | |
| void | set_row_partial (const Vector< T > &, const unsigned int, const unsigned int) |
| Fill partial row. | |
| void | set_col_partial (const Vector< T > &, const unsigned int, const unsigned int) |
| Fill partial column. | |
| TMatrix< T > & | resize (const unsigned int, const unsigned int) |
| Resize Matrix, specifying rows and columns. | |
| TMatrix< T > & | resize (const unsigned int d) |
| Resize Matrix to square shape. | |
| TMatrix< T > & | resize (const T &, const unsigned int, const unsigned int) |
| Resize Matrix and fill with value. | |
| TMatrix< T > & | resize (const TMatrix< T > &) |
| Resizing assignment. | |
| TMatrix< T > & | cheapdownsizerow (const unsigned) |
| Resize number of rows without actually freeing memory (efficiency). | |
| TMatrix< T > & | fill (const T &=(T) 0) |
| Fill matrix. | |
| TMatrix< T > & | clear () |
| Clear matrix (fill with 0). | |
| TMatrix< T > & | fill (const Vector< T > &) |
| Fill complete matrix by vector elements (m00, m01, ... m0C, m10, ...). | |
| TMatrix< T > & | setunit (const T &=(T) 1) |
| Set to unit matrix (optionally scaled). | |
| TMatrix< T > & | row_expand (const unsigned int r) |
| Set new numbers of rows to matrix (expansion only). | |
| TMatrix< T > & | row_expand (const TMatrix< T > &m) |
| Append matrix below existing one. | |
| T | trace () const |
| Trace. | |
| double | fabssqr () const |
| Sum over all squared elements. | |
| double | fabs () const |
| 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 () |
| Static Public Member Functions inherited from TMatrix< T > | |
| static const char * | mat_info () |
| Static Public Member Functions inherited from Matrix_Sig< T > | |
| static const char * | mat_info () |
Friends | |
| class | TSMatrix< T > |
| BVector< T > &FRIEND_TBCI2__ bvfillm | FGD (BVector< T > &, const Matrix< T > &m) |
| STD__ ostream & | operator<<FGDT (STD__ ostream &, const Matrix< T > &) |
| STD__ istream & | operator>>FGDT (STD__ istream &, Matrix< T > &) |
| NOINST char FRIEND_TBCI2__ gaussj | FGD (Matrix< T > &, Matrix< T > &) |
Additional Inherited Members | |
| Protected Types inherited from TMatrix< T > | |
| typedef T | mat_t |
| typedef T * | Tptr |
| Protected Member Functions inherited from TMatrix< T > | |
| int | set_ptrs () |
| Protected Attributes inherited from TMatrix< T > | |
| unsigned long | dim |
| unsigned int | row |
| unsigned int | col:31 |
| unsigned int | freeable:1 |
| T ** | mat |
| C storage layout: mat[row][col]. | |
| T * | vec |
| T * | endvec |
Real, user referable, Matrix Does implement high performance arithmetics, together with TMatrix and TSMatrix. All objects that the user creates should be of class Matrix; the temporary objects are emitted by the compiler as suitable.
The implementation is NOT optimized for sparse matrices; please have a look at BdMatrix and CSCMatrix if you want to do computations with sparse matrices.
| typedef T aligned_value_type Matrix< T >::TALIGN(MIN_ALIGN2) |
Definition at line 1587 of file matrix.h.
References T, and TMatrix< T >::TMatrix.
Referenced by clear(), div_row(), div_rows(), FGD, FGD, fill(), fill(), Matrix(), Matrix(), mult_row(), mult_rows(), operator!=(), operator*(), operator*(), operator*(), operator*(), operator*=(), operator+(), operator+=(), operator+=(), operator+=(), operator+=(), operator-(), operator-=(), operator-=(), operator-=(), operator-=(), operator/=(), operator<<FGDT, operator=(), operator=(), operator=(), operator=(), operator==(), operator==(), operator>>FGDT, resize(), resize(), resize(), resize(), setunit(), and transMult().
Definition at line 1590 of file matrix.h.
References c, T, and TMatrix< T >::TMatrix.
Definition at line 1593 of file matrix.h.
References c, T, and TMatrix< T >::TMatrix.
|
inline |
Definition at line 1596 of file matrix.h.
References colvec, T, and TMatrix< T >::TMatrix.
copy, does a real copy, as TM(M) is invoked (not TM(TM))
Definition at line 1601 of file matrix.h.
References Matrix(), T, and TMatrix< T >::TMatrix.
Definition at line 1608 of file matrix.h.
References T, TMatrix< T >::TMatrix, and ts.
Definition at line 1612 of file matrix.h.
References TMatrix< T >::freeable.
|
inlineexplicit |
Definition at line 1619 of file matrix.h.
References Matrix(), T, and TMatrix< T >::TMatrix.
|
inlineexplicit |
Definition at line 1623 of file matrix.h.
References T, and TMatrix< T >::TMatrix.
Definition at line 1661 of file matrix.h.
References TMatrix< T >::clear(), and Matrix().
Definition at line 2274 of file matrix.h.
References BCHK, c, fac, Matrix(), TMatrix< T >::rows(), TVector< T >::size(), and T.
Definition at line 2102 of file matrix.h.
References do_exactsum(), and res.
Referenced by fabs(), fabssqr(), and TMatrix< T >::fabssqr().
Definition at line 1655 of file matrix.h.
References TMatrix< T >::fill(), Matrix(), and T.
Definition at line 1657 of file matrix.h.
References TMatrix< T >::fill(), and Matrix().
Definition at line 2287 of file matrix.h.
References BCHK, c, index, Matrix(), mult_row(), and T.
Referenced by div_row(), and mult_row().
Elementwise ops.
Definition at line 2261 of file matrix.h.
References BCHK, c, fac, Matrix(), TMatrix< T >::rows(), TVector< T >::size(), and T.
Definition at line 1727 of file matrix.h.
References TMatrix< T >::TMatrix.
get row
Definition at line 1791 of file matrix.h.
References BCHK, i, index, TMatrix< T >::row, T, TBCICOPY, and BVector< T >::vec.
|
inline |
ro element access
Definition at line 1775 of file matrix.h.
References TMatrix< T >::col, EXPCHK, i, index, and TMatrix< T >::row.
|
inline |
rw element access
Definition at line 1783 of file matrix.h.
References TMatrix< T >::col, EXPCHK, i, index, TMatrix< T >::row, and T.
Definition at line 1966 of file matrix.h.
References b, BCHK, c, LIKELY, Matrix(), PREFETCH_R, PREFETCH_W, SMP_MATSLICE2, T, thread_start_off(), thread_wait(), threads_avail, and TMatrix< T >::TMatrix.
Definition at line 2238 of file matrix.h.
References BCHK, do_mat_tsv_mult(), Matrix(), and TSVector< T >::size().
Definition at line 2151 of file matrix.h.
References BCHK, do_mat_vec_mult(), job_mat_vec_mult(), LIKELY, Matrix(), PREFETCH_R, PREFETCH_W, TVector< T >::size(), SMP_MATSLICE2, T, thread_start_off(), thread_wait(), threads_avail, and BVector< T >::vec.
Definition at line 2034 of file matrix.h.
References a, c, and TMatrix< T >::TMatrix.
Definition at line 1890 of file matrix.h.
References a, BCHK, Matrix(), TMatrix< T >::size(), STD_SMP_TEMPLATE3VV, TMatrix< T >::TMatrix, and TMatrix< T >::vec.
Definition at line 1864 of file matrix.h.
References a, STD_SMP_TEMPLATE3VC, T, TMatrix< T >::TMatrix, and TMatrix< T >::vec.
Definition at line 1907 of file matrix.h.
References a, BCHK, TMatrix< T >::size(), STD_SMP_TEMPLATE2V, and TMatrix< T >::TMatrix.
Definition at line 1922 of file matrix.h.
References BCHK, TSMatrix< T >::detach(), TMatrix< T >::size(), STD_SMP_TEMPLATE4V, T, TMatrix< T >::TMatrix, TSMatrix< T >::TMatrix< T >, ts, and TSMatrix< T >::vec.
Definition at line 1671 of file matrix.h.
References a, Matrix(), and TMatrix< T >::operator+=().
Definition at line 1675 of file matrix.h.
References a, Matrix(), TMatrix< T >::operator+=(), and TMatrix< T >::TMatrix.
Definition at line 1679 of file matrix.h.
References a, Matrix(), and TMatrix< T >::operator+=().
Definition at line 1694 of file matrix.h.
References TMatrix< T >::TMatrix.
Definition at line 1898 of file matrix.h.
References a, BCHK, Matrix(), TMatrix< T >::size(), STD_SMP_TEMPLATE3VV, TMatrix< T >::TMatrix, and TMatrix< T >::vec.
Definition at line 1871 of file matrix.h.
References a, STD_SMP_TEMPLATE3VC, T, TMatrix< T >::TMatrix, and TMatrix< T >::vec.
Definition at line 1914 of file matrix.h.
References a, BCHK, TMatrix< T >::size(), STD_SMP_TEMPLATE2V, and TMatrix< T >::TMatrix.
Definition at line 1930 of file matrix.h.
References BCHK, TSMatrix< T >::detach(), TMatrix< T >::size(), STD_SMP_TEMPLATE4V, T, TMatrix< T >::TMatrix, TSMatrix< T >::TMatrix< T >, ts, and TSMatrix< T >::vec.
Definition at line 1673 of file matrix.h.
References a, Matrix(), and TMatrix< T >::operator-=().
Definition at line 1677 of file matrix.h.
References a, Matrix(), TMatrix< T >::operator-=(), and TMatrix< T >::TMatrix.
Definition at line 1681 of file matrix.h.
References a, Matrix(), and TMatrix< T >::operator-=().
Assignment, non-resizing.
Definition at line 1638 of file matrix.h.
References Matrix(), and TMatrix< T >::operator=().
Definition at line 1644 of file matrix.h.
References Matrix(), TMatrix< T >::operator=(), and T.
Definition at line 1640 of file matrix.h.
References Matrix(), TMatrix< T >::operator=(), and TMatrix< T >::TMatrix.
Definition at line 1642 of file matrix.h.
References Matrix(), TMatrix< T >::TMatrix, and ts.
Definition at line 2064 of file matrix.h.
References TMatrix< T >::col, LIKELY, Matrix(), TMatrix< T >::row, T, TBCICOMP, and TMatrix< T >::vec.
Definition at line 1725 of file matrix.h.
References Matrix(), and TMatrix< T >::TMatrix.
Definition at line 1653 of file matrix.h.
References Matrix(), and TMatrix< T >::resize().
Definition at line 1659 of file matrix.h.
References Matrix(), TMatrix< T >::setunit(), and T.
Definition at line 2184 of file matrix.h.
References BCHK, do_mat_vec_transmult(), job_mat_vec_transmult(), LIKELY, Matrix(), TVector< T >::size(), SMP_MATSLICE2, T, thread_start_off(), thread_wait(), threads_avail, and transMult().
Referenced by transMult().
|
friend |
References bvfillm(), FRIEND_TBCI2__, and Matrix().
References FRIEND_TBCI2__, gaussj(), Matrix(), and NOINST.