#include <decomposable_matrix.h>
Public Types | |
enum | DecompositionType { none, LU, QU } |
typedef Vector< C >::size_type | size_type |
Public Member Functions | |
DecomposableMatrix (const size_type n=0) | |
DecomposableMatrix (const DecomposableMatrix< C > &M) | |
DecomposableMatrix (const Matrix< C > &M) | |
DecomposableMatrix< C > & | operator= (const DecomposableMatrix< C > &M) |
const size_type | row_dimension () const |
const size_type | column_dimension () const |
const size_type | size () const |
void | decompose (DecompositionType d=LU) |
void | solve (const Vector< C > &b, Vector< C > &x, DecompositionType d=LU) |
void | print (std::ostream &os, const unsigned int tabwidth=10, const unsigned int precision=3) const |
Protected Member Functions | |
void | LU_decomposition () |
void | QU_decomposition () |
void | revert_decomposition () |
Protected Attributes | |
DecompositionType | decomposition |
Vector< double > | D |
Array1D< size_type > | P |
This class models finite, densely populated matrices M = (m_{i,j})_{0<=i<m, 0<=j<n} with entries from an arbitrary (scalar) class C, designed for the solution of linear systems A*x=b or least squares problems min \|A*x-b\|_2 by the application of LU or QU factorization (m >= n). The factorizations is stored in place.
typedef Vector<C>::size_type MathTL::DecomposableMatrix< C >::size_type |
type of indices and size type (cf. STL containers)
Reimplemented from MathTL::Matrix< C >.
enum MathTL::DecomposableMatrix::DecompositionType |
type of factorizations
MathTL::DecomposableMatrix< C >::DecomposableMatrix | ( | const size_type | n = 0 | ) | [inline, explicit] |
default constructor, yields zero square matrix which is empty per default
MathTL::DecomposableMatrix< C >::DecomposableMatrix | ( | const DecomposableMatrix< C > & | M | ) | [inline] |
copy constructor
MathTL::DecomposableMatrix< C >::DecomposableMatrix | ( | const Matrix< C > & | M | ) | [inline] |
copy constructor from a Matrix
const DecomposableMatrix< C >::size_type MathTL::DecomposableMatrix< C >::column_dimension | ( | ) | const [inline, virtual] |
column dimension
Reimplemented from MathTL::Matrix< C >.
void MathTL::DecomposableMatrix< C >::decompose | ( | DecompositionType | d = LU | ) |
perform (or revert) decomposition
DecomposableMatrix< C > & MathTL::DecomposableMatrix< C >::operator= | ( | const DecomposableMatrix< C > & | M | ) |
assignment from another matrix
void MathTL::DecomposableMatrix< C >::print | ( | std::ostream & | os, |
const unsigned int | tabwidth = 10 , |
||
const unsigned int | precision = 3 |
||
) | const [inline, virtual] |
stream output with user-defined tabwidth and precision (cf. deal.II)
Reimplemented from MathTL::Matrix< C >.
const DecomposableMatrix< C >::size_type MathTL::DecomposableMatrix< C >::row_dimension | ( | ) | const [inline, virtual] |
row dimension
Reimplemented from MathTL::Matrix< C >.
const DecomposableMatrix< C >::size_type MathTL::DecomposableMatrix< C >::size | ( | ) | const [inline] |
size as an STL-compatible container for matrix entries
Reimplemented from MathTL::Matrix< C >.
void MathTL::DecomposableMatrix< C >::solve | ( | const Vector< C > & | b, |
Vector< C > & | x, | ||
DecompositionType | d = LU |
||
) |
solve the linear system A*x=b via a given decomposition (x will be scaled appropriately)