#include <triangular_matrix.h>
Public Types | |
typedef LowerTriangularMatrix < C >::size_type | size_type |
Public Member Functions | |
UpperTriangularMatrix (const size_type n=0) | |
UpperTriangularMatrix (const UpperTriangularMatrix< C > &M) | |
UpperTriangularMatrix (const size_type rows, const size_type columns) | |
UpperTriangularMatrix (const size_type rows, const size_type columns, const char *str, const bool byrow=true) | |
const size_type | row_dimension () const |
const size_type | column_dimension () const |
void | resize (const size_type rows, const size_type columns) |
const C | operator() (const size_type row, const size_type column) const |
const C | get_entry (const size_type row, const size_type column) const |
C & | operator() (const size_type row, const size_type column) |
void | set_entry (const size_type row, const size_type column, const C value) |
template<class C2 > | |
bool | operator== (const UpperTriangularMatrix< C2 > &M) const |
template<class C2 > | |
bool | operator!= (const UpperTriangularMatrix< C2 > &M) const |
UpperTriangularMatrix< C > & | operator= (const UpperTriangularMatrix< C > &M) |
void | inverse (UpperTriangularMatrix< C > &MInv) const |
template<class VECTOR > | |
void | apply (const VECTOR &x, VECTOR &Mx) const |
template<class VECTOR > | |
void | apply_transposed (const VECTOR &x, VECTOR &Mtx) const |
void | print (std::ostream &os, const unsigned int tabwidth=10, const unsigned int precision=3) const |
This class models finite, densely populated, upper triangular matrices M = (m_{i,j})_{0<=i<m, 0<=j<n} with entries from an arbitrary (scalar) class C, designed for numerical computations. The class also works for nonquadratic matrices, where the triangular shape is appropriately clipped or filled up with zeros.
typedef LowerTriangularMatrix<C>::size_type MathTL::UpperTriangularMatrix< C >::size_type |
type of indexes and size type (cf. STL containers)
Reimplemented from MathTL::LowerTriangularMatrix< C >.
MathTL::UpperTriangularMatrix< C >::UpperTriangularMatrix | ( | const size_type | n = 0 | ) | [inline, explicit] |
default constructor, yields zero square matrix which is empty per default
MathTL::UpperTriangularMatrix< C >::UpperTriangularMatrix | ( | const UpperTriangularMatrix< C > & | M | ) | [inline] |
copy constructor
MathTL::UpperTriangularMatrix< C >::UpperTriangularMatrix | ( | const size_type | rows, |
const size_type | columns | ||
) |
construct m*n rectangular matrix
MathTL::UpperTriangularMatrix< C >::UpperTriangularMatrix | ( | const size_type | rows, |
const size_type | columns, | ||
const char * | str, | ||
const bool | byrow = true |
||
) |
Construct matrix from a string holding its entries, separated by a blank.
row_dimension | row dimension |
column_dimension | column dimension |
str | input string |
byrow | indicates whether coefficients are stored row by row in the stream |
void MathTL::UpperTriangularMatrix< C >::apply | ( | const VECTOR & | x, |
VECTOR & | Mx | ||
) | const |
matrix-vector multiplication Mx = (*this) * x; we assume that the vector Mx has the correct size and is not identical to x
Reimplemented from MathTL::LowerTriangularMatrix< C >.
void MathTL::UpperTriangularMatrix< C >::apply_transposed | ( | const VECTOR & | x, |
VECTOR & | Mtx | ||
) | const |
transposed matrix-vector multiplication Mtx = (*this)^T * x; we assume that the vector Mtx has the correct size and is not identical to x
Reimplemented from MathTL::LowerTriangularMatrix< C >.
const UpperTriangularMatrix< C >::size_type MathTL::UpperTriangularMatrix< C >::column_dimension | ( | ) | const [inline] |
column dimension
Reimplemented from MathTL::LowerTriangularMatrix< C >.
const C MathTL::UpperTriangularMatrix< C >::get_entry | ( | const size_type | row, |
const size_type | column | ||
) | const [inline] |
read-only access to a matrix entry
Reimplemented from MathTL::LowerTriangularMatrix< C >.
void MathTL::UpperTriangularMatrix< C >::inverse | ( | UpperTriangularMatrix< C > & | MInv | ) | const |
compute the inverse of *this (if possible), M will be properly scaled
bool MathTL::UpperTriangularMatrix< C >::operator!= | ( | const UpperTriangularMatrix< C2 > & | M | ) | const [inline] |
non-equality test
const C MathTL::UpperTriangularMatrix< C >::operator() | ( | const size_type | row, |
const size_type | column | ||
) | const [inline] |
read-only access to a matrix entry
Reimplemented from MathTL::LowerTriangularMatrix< C >.
C & MathTL::UpperTriangularMatrix< C >::operator() | ( | const size_type | row, |
const size_type | column | ||
) | [inline] |
read-write access to a matrix entry
Reimplemented from MathTL::LowerTriangularMatrix< C >.
UpperTriangularMatrix< C > & MathTL::UpperTriangularMatrix< C >::operator= | ( | const UpperTriangularMatrix< C > & | M | ) |
assignment from another upper triangular matrix
bool MathTL::UpperTriangularMatrix< C >::operator== | ( | const UpperTriangularMatrix< C2 > & | M | ) | const [inline] |
equality test with another matrix
void MathTL::UpperTriangularMatrix< C >::print | ( | std::ostream & | os, |
const unsigned int | tabwidth = 10 , |
||
const unsigned int | precision = 3 |
||
) | const |
stream output with user-defined tabwidth and precision (cf. deal.II)
Reimplemented from MathTL::LowerTriangularMatrix< C >.
void MathTL::UpperTriangularMatrix< C >::resize | ( | const size_type | rows, |
const size_type | columns | ||
) | [inline] |
resize matrix and initialize with zero
Reimplemented from MathTL::LowerTriangularMatrix< C >.
const UpperTriangularMatrix< C >::size_type MathTL::UpperTriangularMatrix< C >::row_dimension | ( | ) | const [inline] |
row dimension
Reimplemented from MathTL::LowerTriangularMatrix< C >.
void MathTL::UpperTriangularMatrix< C >::set_entry | ( | const size_type | row, |
const size_type | column, | ||
const C | value | ||
) | [inline] |
write access to a matrix entry
Reimplemented from MathTL::LowerTriangularMatrix< C >.