Public Member Functions | List of all members
oomph::ComplexMatrixBase Class Referenceabstract

Abstract base class for matrices of complex doubles – adds abstract interfaces for solving, LU decomposition and multiplication by vectors. More...

#include <complex_matrices.h>

+ Inheritance diagram for oomph::ComplexMatrixBase:

Public Member Functions

 ComplexMatrixBase ()
 (Empty) constructor. More...
 
 ComplexMatrixBase (const ComplexMatrixBase &matrix)
 Broken copy constructor. More...
 
void operator= (const ComplexMatrixBase &)
 Broken assignment operator. More...
 
virtual unsigned long nrow () const =0
 Return the number of rows of the matrix. More...
 
virtual unsigned long ncol () const =0
 Return the number of columns of the matrix. More...
 
virtual ~ComplexMatrixBase ()
 virtual (empty) destructor More...
 
virtual std::complex< double > operator() (const unsigned long &i, const unsigned long &j) const =0
 Round brackets to give access as a(i,j) for read only (we're not providing a general interface for component-wise write access since not all matrix formats allow efficient direct access!) More...
 
virtual int ludecompose ()
 LU decomposition of the matrix using the appropriate linear solver. Return the sign of the determinant. More...
 
virtual void lubksub (Vector< std::complex< double > > &rhs)
 LU backsubstitue a previously LU-decomposed matrix; The passed rhs will be over-written with the solution vector. More...
 
virtual void solve (Vector< std::complex< double > > &rhs)
 Complete LU solve (replaces matrix by its LU decomposition and overwrites RHS with solution). The default should not need to be over-written. More...
 
virtual void solve (const Vector< std::complex< double > > &rhs, Vector< std::complex< double > > &soln)
 Complete LU solve (Nothing gets overwritten!). The default should not need to be overwritten. More...
 
virtual void residual (const Vector< std::complex< double > > &x, const Vector< std::complex< double > > &b, Vector< std::complex< double > > &residual)=0
 Find the residual, i.e. r=b-Ax the residual. More...
 
virtual double max_residual (const Vector< std::complex< double > > &x, const Vector< std::complex< double > > &rhs)
 Find the maximum residual r=b-Ax – generic version, can be overloaded for specific derived classes where the max. can be determined "on the fly". More...
 
virtual void multiply (const Vector< std::complex< double > > &x, Vector< std::complex< double > > &soln)=0
 Multiply the matrix by the vector x: soln=Ax. More...
 
virtual void multiply_transpose (const Vector< std::complex< double > > &x, Vector< std::complex< double > > &soln)=0
 Multiply the transposed matrix by the vector x: soln=A^T x. More...
 

Detailed Description

Abstract base class for matrices of complex doubles – adds abstract interfaces for solving, LU decomposition and multiplication by vectors.

Definition at line 60 of file complex_matrices.h.

Constructor & Destructor Documentation

◆ ComplexMatrixBase() [1/2]

oomph::ComplexMatrixBase::ComplexMatrixBase ( )
inline

(Empty) constructor.

Definition at line 65 of file complex_matrices.h.

◆ ComplexMatrixBase() [2/2]

oomph::ComplexMatrixBase::ComplexMatrixBase ( const ComplexMatrixBase matrix)
inline

Broken copy constructor.

Definition at line 68 of file complex_matrices.h.

References oomph::BrokenCopy::broken_copy().

◆ ~ComplexMatrixBase()

virtual oomph::ComplexMatrixBase::~ComplexMatrixBase ( )
inlinevirtual

virtual (empty) destructor

Definition at line 86 of file complex_matrices.h.

References i, and operator()().

Member Function Documentation

◆ lubksub()

virtual void oomph::ComplexMatrixBase::lubksub ( Vector< std::complex< double > > &  rhs)
inlinevirtual

LU backsubstitue a previously LU-decomposed matrix; The passed rhs will be over-written with the solution vector.

Reimplemented in oomph::CCComplexMatrix, oomph::CRComplexMatrix, and oomph::DenseComplexMatrix.

Definition at line 110 of file complex_matrices.h.

References residual(), and solve().

Referenced by oomph::DenseComplexMatrix::operator()(), oomph::CRComplexMatrix::operator()(), oomph::CCComplexMatrix::operator()(), and solve().

◆ ludecompose()

virtual int oomph::ComplexMatrixBase::ludecompose ( )
inlinevirtual

LU decomposition of the matrix using the appropriate linear solver. Return the sign of the determinant.

Dummy return

Reimplemented in oomph::CCComplexMatrix, oomph::CRComplexMatrix, and oomph::DenseComplexMatrix.

Definition at line 97 of file complex_matrices.h.

Referenced by oomph::DenseComplexMatrix::operator()(), oomph::CRComplexMatrix::operator()(), oomph::CCComplexMatrix::operator()(), and solve().

◆ max_residual()

virtual double oomph::ComplexMatrixBase::max_residual ( const Vector< std::complex< double > > &  x,
const Vector< std::complex< double > > &  rhs 
)
inlinevirtual

Find the maximum residual r=b-Ax – generic version, can be overloaded for specific derived classes where the max. can be determined "on the fly".

Definition at line 137 of file complex_matrices.h.

References multiply(), multiply_transpose(), and residual().

◆ multiply()

virtual void oomph::ComplexMatrixBase::multiply ( const Vector< std::complex< double > > &  x,
Vector< std::complex< double > > &  soln 
)
pure virtual

◆ multiply_transpose()

virtual void oomph::ComplexMatrixBase::multiply_transpose ( const Vector< std::complex< double > > &  x,
Vector< std::complex< double > > &  soln 
)
pure virtual

◆ ncol()

virtual unsigned long oomph::ComplexMatrixBase::ncol ( ) const
pure virtual

◆ nrow()

virtual unsigned long oomph::ComplexMatrixBase::nrow ( ) const
pure virtual

◆ operator()()

virtual std::complex<double> oomph::ComplexMatrixBase::operator() ( const unsigned long &  i,
const unsigned long &  j 
) const
pure virtual

Round brackets to give access as a(i,j) for read only (we're not providing a general interface for component-wise write access since not all matrix formats allow efficient direct access!)

Implemented in oomph::CCComplexMatrix, oomph::CRComplexMatrix, oomph::DenseComplexMatrix, and oomph::DiagonalComplexMatrix.

Referenced by oomph::DiagonalComplexMatrix::DiagonalComplexMatrix(), and ~ComplexMatrixBase().

◆ operator=()

void oomph::ComplexMatrixBase::operator= ( const ComplexMatrixBase )
inline

Broken assignment operator.

Definition at line 74 of file complex_matrices.h.

References oomph::BrokenCopy::broken_assign(), ncol(), and nrow().

◆ residual()

virtual void oomph::ComplexMatrixBase::residual ( const Vector< std::complex< double > > &  x,
const Vector< std::complex< double > > &  b,
Vector< std::complex< double > > &  residual 
)
pure virtual

◆ solve() [1/2]

void oomph::ComplexMatrixBase::solve ( Vector< std::complex< double > > &  rhs)
virtual

Complete LU solve (replaces matrix by its LU decomposition and overwrites RHS with solution). The default should not need to be over-written.

Complete LU solve (overwrites RHS with solution). This is the generic version which should not need to be over-written.

Definition at line 40 of file complex_matrices.cc.

References lubksub(), ludecompose(), ncol(), and nrow().

Referenced by lubksub(), and solve().

◆ solve() [2/2]

void oomph::ComplexMatrixBase::solve ( const Vector< std::complex< double > > &  rhs,
Vector< std::complex< double > > &  soln 
)
virtual

Complete LU solve (Nothing gets overwritten!). The default should not need to be overwritten.

Complete LU solve (Nothing gets overwritten!). This generic version should never need to be overwritten

Definition at line 76 of file complex_matrices.cc.

References solve().


The documentation for this class was generated from the following files: