#include <matrix.h>


Public Types | |
| typedef T | value_type |
| typedef T | element_type |
| typedef T | aligned_value_type |
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) | |
| 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 |
| ro element access | |
| T & | operator() (const unsigned int, const unsigned int) |
| 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) |
| Fill matrix. | |
| Matrix< T > & | fill (const Vector< T > &v) |
| Fill complete matrix by vector elements (m00, m01, ... m0C, m10, ...). | |
| Matrix< T > & | setunit (const T &f=(T) 1) |
| Set to unit matrix (optionally scaled). | |
| Matrix< T > & | clear () |
| Clear matrix (fill with 0). | |
| Matrix< T > & | operator+= (const Matrix< T > &a) |
| Matrix< T > & | operator-= (const Matrix< T > &a) |
| Matrix< T > & | operator+= (TMatrix< T > a) |
| arithmetics ... | |
| 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 |
| TVector< T > | operator* (TVector< T >) const |
| Now for the Matrix-Vector multiplications. | |
| TVector< T > | operator* (const TSVector< T > &tsv) const |
| TVector< T > | transMult (const Vector< T > &) const |
| 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 |
| Sum over all squared elements. | |
| double | fabs () const |
Static Public Member Functions | |
| static const char * | mat_info () |
Friends | |
| class | TSMatrix< T > |
| BVector< T > & | bvfillm (BVector< T > &, const Matrix< T > &m) |
| std::ostream & | operator (std::ostream &, const Matrix< T > &) |
| std::istream & | operator>> (std::istream &, Matrix< T > &) |
| char | gaussj (Matrix< T > &, Matrix< T > &) |
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.
Definition at line 1561 of file matrix.h.
| typedef T TBCI::Matrix< T >::value_type |
| typedef T TBCI::Matrix< T >::element_type |
| typedef T TBCI::Matrix< T >::aligned_value_type |
| TBCI::Matrix< T >::Matrix | ( | const unsigned | d = 0 |
) | [inline, explicit] |
| TBCI::Matrix< T >::Matrix | ( | const unsigned | r, | |
| const unsigned | c | |||
| ) | [inline] |
| TBCI::Matrix< T >::Matrix | ( | const T & | v, | |
| const unsigned | r, | |||
| const unsigned | c | |||
| ) | [inline] |
| TBCI::Matrix< T >::Matrix | ( | const Vector< T > & | v, | |
| const enum rowcolvec | r = colvec | |||
| ) | [inline] |
| TBCI::Matrix< T >::Matrix | ( | const Matrix< T > & | m | ) | [inline] |
| TBCI::Matrix< T >::Matrix | ( | const TMatrix< T > & | tm | ) | [inline] |
| TBCI::Matrix< T >::Matrix | ( | const TSMatrix< T > & | ts | ) | [inline] |
| TBCI::Matrix< T >::~Matrix | ( | ) | [inline] |
| TBCI::Matrix< T >::Matrix | ( | const Matrix< U > & | m | ) | [inline, explicit] |
| TBCI::Matrix< T >::Matrix | ( | const TMatrix< U > & | tm | ) | [inline, explicit] |
| static const char* TBCI::Matrix< T >::mat_info | ( | ) | [inline, static] |
| tbci_traits< T >::const_refval_type TBCI::Matrix< T >::operator() | ( | const unsigned int | i, | |
| const unsigned int | j | |||
| ) | const [inline] |
ro element access
Reimplemented from TBCI::TMatrix< T >.
Definition at line 1762 of file matrix.h.
References BCHK, TBCI::TMatrix< T >::col, TBCI::TMatrix< T >::mat, and TBCI::TMatrix< T >::row.
| T & TBCI::Matrix< T >::operator() | ( | const unsigned int | i, | |
| const unsigned int | j | |||
| ) | [inline] |
rw element access
Definition at line 1770 of file matrix.h.
References BCHK, TBCI::TMatrix< T >::col, TBCI::TMatrix< T >::mat, and TBCI::TMatrix< T >::row.
| TVector< T > TBCI::Matrix< T >::operator() | ( | const unsigned int | i | ) | const [inline] |
get row
Reimplemented from TBCI::TMatrix< T >.
Definition at line 1778 of file matrix.h.
References BCHK, TBCI::TMatrix< T >::col, TBCI::TMatrix< T >::row, T, TBCICOPY, and TBCI::BVector< T >::vec.
| Matrix<T>& TBCI::Matrix< T >::operator= | ( | const Matrix< T > & | m | ) | [inline] |
| Matrix<T>& TBCI::Matrix< T >::operator= | ( | const TMatrix< T > & | tm | ) | [inline] |
| Matrix<T>& TBCI::Matrix< T >::operator= | ( | TSMatrix< T > | ts | ) | [inline] |
| Matrix<T>& TBCI::Matrix< T >::operator= | ( | const T & | v | ) | [inline] |
| Matrix<T>& TBCI::Matrix< T >::resize | ( | const unsigned | r, | |
| const unsigned | c | |||
| ) | [inline] |
| Matrix<T>& TBCI::Matrix< T >::resize | ( | const unsigned | d | ) | [inline] |
| Matrix<T>& TBCI::Matrix< T >::resize | ( | const T & | v, | |
| const unsigned | r, | |||
| const unsigned | c | |||
| ) | [inline] |
| Matrix<T>& TBCI::Matrix< T >::resize | ( | const Matrix< T > & | m | ) | [inline] |
| Matrix<T>& TBCI::Matrix< T >::fill | ( | const T & | val = (T) 0 |
) | [inline] |
| Matrix<T>& TBCI::Matrix< T >::fill | ( | const Vector< T > & | v | ) | [inline] |
Fill complete matrix by vector elements (m00, m01, ... m0C, m10, ...).
Reimplemented from TBCI::TMatrix< T >.
| Matrix<T>& TBCI::Matrix< T >::setunit | ( | const T & | fac = (T) 1 |
) | [inline] |
| Matrix<T>& TBCI::Matrix< T >::clear | ( | ) | [inline] |
| Matrix<T>& TBCI::Matrix< T >::operator+= | ( | const Matrix< T > & | a | ) | [inline] |
| Matrix<T>& TBCI::Matrix< T >::operator-= | ( | const Matrix< T > & | a | ) | [inline] |
| Matrix<T>& TBCI::Matrix< T >::operator+= | ( | TMatrix< T > | a | ) | [inline] |
| Matrix<T>& TBCI::Matrix< T >::operator-= | ( | TMatrix< T > | a | ) | [inline] |
| Matrix<T>& TBCI::Matrix< T >::operator+= | ( | TSMatrix< T > | a | ) | [inline] |
| Matrix<T>& TBCI::Matrix< T >::operator-= | ( | TSMatrix< T > | a | ) | [inline] |
| Matrix<T>& TBCI::Matrix< T >::operator+= | ( | const T & | a | ) | [inline] |
| Matrix<T>& TBCI::Matrix< T >::operator-= | ( | const T & | a | ) | [inline] |
| Matrix< T > & TBCI::Matrix< T >::operator*= | ( | const T & | a | ) | [inline] |
Reimplemented from TBCI::TMatrix< T >.
Definition at line 1837 of file matrix.h.
References TBCI::TMatrix< T >::dim, STD_SMP_TEMPLATE2C, and TBCI::TMatrix< T >::vec.
| Matrix< T > & TBCI::Matrix< T >::operator/= | ( | const T & | a | ) | [inline] |
Reimplemented from TBCI::TMatrix< T >.
Definition at line 1843 of file matrix.h.
References TBCI::TMatrix< T >::dim, STD_SMP_TEMPLATE2C, and TBCI::TMatrix< T >::vec.
| TMatrix<T> TBCI::Matrix< T >::operator- | ( | ) | const [inline] |
| TMatrix< T > TBCI::Matrix< T >::operator+ | ( | const Matrix< T > & | a | ) | const [inline] |
Definition at line 1878 of file matrix.h.
References BCHK, TBCI::TMatrix< T >::col, TBCI::TMatrix< T >::dim, TBCI::TMatrix< T >::row, TBCI::TMatrix< T >::size(), STD_SMP_TEMPLATE3VV, and TBCI::TMatrix< T >::vec.
| TMatrix< T > TBCI::Matrix< T >::operator- | ( | const Matrix< T > & | a | ) | const [inline] |
Definition at line 1886 of file matrix.h.
References BCHK, TBCI::TMatrix< T >::col, TBCI::TMatrix< T >::dim, TBCI::TMatrix< T >::row, TBCI::TMatrix< T >::size(), STD_SMP_TEMPLATE3VV, and TBCI::TMatrix< T >::vec.
| TMatrix< T > TBCI::Matrix< T >::operator* | ( | const Matrix< T > & | b | ) | const [inline] |
Definition at line 1953 of file matrix.h.
References BCHK, TBCI::TMatrix< T >::clear(), TBCI::TMatrix< T >::col, LIKELY, PREFETCH_W, TBCI::TMatrix< T >::row, TBCI::slice_offset(), SMP_MATSLICE, TBCI::thread_start_off(), TBCI::thread_wait(), and TBCI::threads_avail().
| TMatrix< T > & TBCI::Matrix< T >::operator+ | ( | TMatrix< T > & | a | ) | const [inline] |
Definition at line 1895 of file matrix.h.
References BCHK, TBCI::TMatrix< T >::dim, TBCI::TMatrix< T >::size(), STD_SMP_TEMPLATE2V, and TBCI::TMatrix< T >::vec.
| TMatrix< T > & TBCI::Matrix< T >::operator- | ( | TMatrix< T > & | a | ) | const [inline] |
Definition at line 1902 of file matrix.h.
References BCHK, TBCI::TMatrix< T >::dim, TBCI::TMatrix< T >::size(), STD_SMP_TEMPLATE2V, and TBCI::TMatrix< T >::vec.
| TMatrix< T > TBCI::Matrix< T >::operator* | ( | TMatrix< T > & | a | ) | const [inline] |
| TMatrix< T > TBCI::Matrix< T >::operator+ | ( | TSMatrix< T > & | ts | ) | const [inline] |
Definition at line 1910 of file matrix.h.
References BCHK, TBCI::TSMatrix< T >::detach(), TBCI::TSMatrix< T >::dim, TBCI::TMatrix< T >::dim, TBCI::TSMatrix< T >::real_destroy(), TBCI::TMatrix< T >::size(), STD_SMP_TEMPLATE4V, T, and TBCI::TSMatrix< T >::vec.
| TMatrix< T > TBCI::Matrix< T >::operator- | ( | TSMatrix< T > & | ts | ) | const [inline] |
Definition at line 1918 of file matrix.h.
References BCHK, TBCI::TSMatrix< T >::detach(), TBCI::TSMatrix< T >::dim, TBCI::TMatrix< T >::dim, TBCI::TSMatrix< T >::real_destroy(), TBCI::TMatrix< T >::size(), STD_SMP_TEMPLATE4V, T, and TBCI::TSMatrix< T >::vec.
| TMatrix< T > TBCI::Matrix< T >::operator* | ( | TSMatrix< T > & | a | ) | const [inline] |
Definition at line 1999 of file matrix.h.
References ALIGN, BCHK, TBCI::TMatrix< T >::col, TBCI::TSMatrix< T >::col, TBCI::TSMatrix< T >::mat, TBCI::TMatrix< T >::mat, MIN_ALIGN2, TBCI::TSMatrix< T >::real_destroy(), TBCI::TSMatrix< T >::row, TBCI::TMatrix< T >::row, and T.
| TMatrix< T > TBCI::Matrix< T >::operator+ | ( | const T & | a | ) | const [inline] |
Definition at line 1852 of file matrix.h.
References TBCI::TMatrix< T >::col, TBCI::TMatrix< T >::dim, TBCI::TMatrix< T >::row, STD_SMP_TEMPLATE3VC, and TBCI::TMatrix< T >::vec.
| TMatrix< T > TBCI::Matrix< T >::operator- | ( | const T & | a | ) | const [inline] |
Definition at line 1859 of file matrix.h.
References TBCI::TMatrix< T >::col, TBCI::TMatrix< T >::dim, TBCI::TMatrix< T >::row, STD_SMP_TEMPLATE3VC, and TBCI::TMatrix< T >::vec.
| TSMatrix< T > TBCI::Matrix< T >::operator* | ( | const T & | a | ) | const [inline] |
| TSMatrix< T > TBCI::Matrix< T >::operator/ | ( | const T & | a | ) | const [inline] |
| TVector< T > TBCI::Matrix< T >::operator* | ( | const Vector< T > & | v | ) | const [inline] |
Definition at line 2131 of file matrix.h.
References BCHK, TBCI::TMatrix< T >::col, LIKELY, PREFETCH_W, TBCI::TMatrix< T >::row, TBCI::TVector< T >::size(), TBCI::slice_offset(), SMP_MATSLICE, TBCI::thread_start_off(), TBCI::thread_wait(), TBCI::threads_avail(), and TBCI::BVector< T >::vec.
| TVector< T > TBCI::Matrix< T >::operator* | ( | TVector< T > | c | ) | const [inline] |
| TVector< T > TBCI::Matrix< T >::operator* | ( | const TSVector< T > & | tsv | ) | const [inline] |
Definition at line 2211 of file matrix.h.
References BCHK, TBCI::TMatrix< T >::col, TBCI::TMatrix< T >::do_mat_tsv_mult, TBCI::TMatrix< T >::row, and TBCI::TSVector< T >::size().
| TVector< T > TBCI::Matrix< T >::transMult | ( | const Vector< T > & | v | ) | const [inline] |
Definition at line 2161 of file matrix.h.
References BCHK, TBCI::TMatrix< T >::col, LIKELY, TBCI::TMatrix< T >::row, TBCI::TVector< T >::size(), SMP_MATSLICE, TBCI::thread_start_off(), TBCI::thread_wait(), and TBCI::threads_avail().
| bool TBCI::Matrix< T >::operator== | ( | const Matrix< T > & | m | ) | const [inline] |
Definition at line 2047 of file matrix.h.
References TBCI::TMatrix< T >::col, LIKELY, TBCI::TMatrix< T >::row, T, TBCICOMP, and TBCI::TMatrix< T >::vec.
| bool TBCI::Matrix< T >::operator!= | ( | const Matrix< T > & | m | ) | const [inline] |
| bool TBCI::Matrix< T >::operator== | ( | TMatrix< T > | tm | ) | const [inline] |
| bool TBCI::Matrix< T >::operator!= | ( | TMatrix< T > | tm | ) | const [inline] |
| bool TBCI::Matrix< T >::operator== | ( | TSMatrix< T > | ts | ) | const [inline] |
Definition at line 2060 of file matrix.h.
References TBCI::TSMatrix< T >::col, TBCI::TMatrix< T >::dim, TBCI::TMatrix< T >::endvec, LIKELY, TBCI::TSMatrix< T >::real_destroy(), TBCI::TSMatrix< T >::row, TBCI::TMatrix< T >::row, T, TBCICOMP, UNLIKELY, TBCI::TSMatrix< T >::vec, and TBCI::TMatrix< T >::vec.
| bool TBCI::Matrix< T >::operator!= | ( | TSMatrix< T > | ts | ) | const [inline] |
| Matrix< T > & TBCI::Matrix< T >::mult_rows | ( | const Vector< T > & | v | ) | [inline] |
Elementwise ops.
Definition at line 2234 of file matrix.h.
References BCHK, TBCI::TMatrix< T >::col, fac(), TBCI::TMatrix< T >::row, TBCI::TMatrix< T >::rows(), TBCI::TVector< T >::size(), and T.
| Matrix< T > & TBCI::Matrix< T >::div_rows | ( | const Vector< T > & | v | ) | [inline] |
Definition at line 2247 of file matrix.h.
References BCHK, TBCI::TMatrix< T >::col, fac(), TBCI::TMatrix< T >::row, TBCI::TMatrix< T >::rows(), TBCI::TVector< T >::size(), and T.
| Matrix< T > & TBCI::Matrix< T >::mult_row | ( | const T & | f, | |
| const unsigned | r | |||
| ) | [inline] |
Definition at line 2260 of file matrix.h.
References BCHK, TBCI::TMatrix< T >::col, and TBCI::TMatrix< T >::row.
Referenced by TBCI::Matrix< T >::div_row().
| Matrix< T > & TBCI::Matrix< T >::div_row | ( | const T & | d, | |
| const unsigned | r | |||
| ) | [inline] |
Definition at line 2269 of file matrix.h.
References BCHK, TBCI::TMatrix< T >::col, TBCI::Matrix< T >::mult_row(), TBCI::TMatrix< T >::row, and T.
| double TBCI::Matrix< T >::fabssqr | ( | ) | const [inline] |
Sum over all squared elements.
Reimplemented from TBCI::TMatrix< T >.
Definition at line 2085 of file matrix.h.
References TBCI::TMatrix< T >::dim, TBCI::do_vec_fabssqr(), LONG_DOUBLE, and TBCI::TMatrix< T >::vec.
Referenced by TBCI::fabssqr(), and TBCI::TMatrix< T >::fabssqr().
| double TBCI::Matrix< T >::fabs | ( | ) | const [inline] |
Reimplemented from TBCI::TMatrix< T >.
Definition at line 1739 of file matrix.h.
References TBCI::TSMatrix< T >::fabssqr(), GLBL__, MATH__, and sqrt().
Referenced by TBCI::GMRES().
friend class TSMatrix< T > [friend] |
| std:: ostream& operator | ( | std::ostream & | , | |
| const Matrix< T > & | ||||
| ) | [friend] |
| std:: istream& operator>> | ( | std::istream & | in, | |
| Matrix< T > & | m | |||
| ) | [friend] |
gauss-jordan linear algebraic equation solver with pivoting; Num.Rec. p.39
Definition at line 46 of file gauss_jordan.h.
1.5.6