Public Member Functions | Private Attributes | List of all members
oomph::DiagonalComplexMatrix Class Reference

#include <complex_matrices.h>

+ Inheritance diagram for oomph::DiagonalComplexMatrix:

Public Member Functions

 DiagonalComplexMatrix (const unsigned long n)
 
 DiagonalComplexMatrix (const unsigned long n, std::complex< double > &z)
 
virtual std::complex< double > operator() (const unsigned long &i, const unsigned long &j) const
 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 std::complex< double > & operator() (const unsigned long &i, const unsigned long &j)
 
void multiply (const Vector< std::complex< double > > &x, Vector< std::complex< double > > &result)
 Multiply the matrix by the vector x: soln=Ax. More...
 
void multiply_transpose (const Vector< std::complex< double > > &x, Vector< std::complex< double > > &result)
 Multiply the transposed matrix by the vector x: soln=A^T x. More...
 
virtual void residual (const Vector< std::complex< double > > &x, const Vector< std::complex< double > > &b, Vector< std::complex< double > > &residual)
 Find the residual, i.e. r=b-Ax the residual. More...
 
void resize (const unsigned &N, const unsigned &M)
 
void resize (const unsigned &N, const unsigned &M, std::complex< double > z)
 
unsigned long nrow () const
 Return the number of rows of the matrix. More...
 
unsigned long ncol () const
 Return the number of columns of the matrix. More...
 
- Public Member Functions inherited from oomph::ComplexMatrixBase
 ComplexMatrixBase ()
 (Empty) constructor. More...
 
 ComplexMatrixBase (const ComplexMatrixBase &matrix)
 Broken copy constructor. More...
 
void operator= (const ComplexMatrixBase &)
 Broken assignment operator. More...
 
virtual ~ComplexMatrixBase ()
 virtual (empty) destructor 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 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...
 

Private Attributes

Vector< std::complex< double > > Matrixdata
 

Detailed Description

Definition at line 161 of file complex_matrices.h.

Constructor & Destructor Documentation

◆ DiagonalComplexMatrix() [1/2]

oomph::DiagonalComplexMatrix::DiagonalComplexMatrix ( const unsigned long  n)
inline

Definition at line 165 of file complex_matrices.h.

◆ DiagonalComplexMatrix() [2/2]

oomph::DiagonalComplexMatrix::DiagonalComplexMatrix ( const unsigned long  n,
std::complex< double > &  z 
)
inline

Member Function Documentation

◆ multiply()

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

Multiply the matrix by the vector x: soln=Ax.

Implements oomph::ComplexMatrixBase.

Definition at line 144 of file complex_matrices.cc.

References i, oomph::QuadTreeNames::N, and oomph::ComplexMatrixBase::ncol().

◆ multiply_transpose()

void oomph::DiagonalComplexMatrix::multiply_transpose ( const Vector< std::complex< double > > &  x,
Vector< std::complex< double > > &  soln 
)
inlinevirtual

Multiply the transposed matrix by the vector x: soln=A^T x.

Implements oomph::ComplexMatrixBase.

Definition at line 182 of file complex_matrices.h.

References oomph::ComplexMatrixBase::multiply().

◆ ncol()

unsigned long oomph::DiagonalComplexMatrix::ncol ( ) const
inlinevirtual

Return the number of columns of the matrix.

Implements oomph::ComplexMatrixBase.

Definition at line 200 of file complex_matrices.h.

◆ nrow()

unsigned long oomph::DiagonalComplexMatrix::nrow ( ) const
inlinevirtual

Return the number of rows of the matrix.

Implements oomph::ComplexMatrixBase.

Definition at line 198 of file complex_matrices.h.

Referenced by oomph::DenseComplexMatrix::DenseComplexMatrix().

◆ operator()() [1/2]

std::complex< double > oomph::DiagonalComplexMatrix::operator() ( const unsigned long &  i,
const unsigned long &  j 
) const
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!)

Implements oomph::ComplexMatrixBase.

Definition at line 87 of file complex_matrices.cc.

References i.

◆ operator()() [2/2]

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

Definition at line 100 of file complex_matrices.cc.

References i.

◆ residual()

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

Find the residual, i.e. r=b-Ax the residual.

Implements oomph::ComplexMatrixBase.

Definition at line 189 of file complex_matrices.h.

References oomph::QuadTreeNames::N.

◆ resize() [1/2]

void oomph::DiagonalComplexMatrix::resize ( const unsigned &  N,
const unsigned &  M 
)

◆ resize() [2/2]

void oomph::DiagonalComplexMatrix::resize ( const unsigned &  N,
const unsigned &  M,
std::complex< double >  z 
)

Definition at line 129 of file complex_matrices.cc.

Member Data Documentation

◆ Matrixdata

Vector<std::complex<double> > oomph::DiagonalComplexMatrix::Matrixdata
private

Definition at line 204 of file complex_matrices.h.


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