Public Member Functions | Protected Attributes | List of all members
oomph::DoubleMatrixBase Class Referenceabstract

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

#include <matrices.h>

+ Inheritance diagram for oomph::DoubleMatrixBase:

Public Member Functions

 DoubleMatrixBase ()
 (Empty) constructor. More...
 
 DoubleMatrixBase (const DoubleMatrixBase &matrix)
 Broken copy constructor. More...
 
void operator= (const DoubleMatrixBase &)
 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 ~DoubleMatrixBase ()
 virtual (empty) destructor More...
 
virtual 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...
 
LinearSolver *& linear_solver_pt ()
 Return a pointer to the linear solver object. More...
 
LinearSolver *const & linear_solver_pt () const
 Return a pointer to the linear solver object (const version) More...
 
void solve (DoubleVector &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...
 
void solve (const DoubleVector &rhs, DoubleVector &soln)
 Complete LU solve (Nothing gets overwritten!). The default should not need to be overwritten. More...
 
void solve (Vector< 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...
 
void solve (const Vector< double > &rhs, Vector< double > &soln)
 Complete LU solve (Nothing gets overwritten!). The default should not need to be overwritten. More...
 
virtual void residual (const DoubleVector &x, const DoubleVector &b, DoubleVector &residual_)
 Find the residual, i.e. r=b-Ax the residual. More...
 
virtual double max_residual (const DoubleVector &x, const DoubleVector &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 DoubleVector &x, DoubleVector &soln) const =0
 Multiply the matrix by the vector x: soln=Ax. More...
 
virtual void multiply_transpose (const DoubleVector &x, DoubleVector &soln) const =0
 Multiply the transposed matrix by the vector x: soln=A^T x. More...
 

Protected Attributes

LinearSolverLinear_solver_pt
 
LinearSolverDefault_linear_solver_pt
 

Detailed Description

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

Definition at line 275 of file matrices.h.

Constructor & Destructor Documentation

oomph::DoubleMatrixBase::DoubleMatrixBase ( )
inline

(Empty) constructor.

Definition at line 288 of file matrices.h.

oomph::DoubleMatrixBase::DoubleMatrixBase ( const DoubleMatrixBase matrix)
inline

Broken copy constructor.

Definition at line 291 of file matrices.h.

References oomph::BrokenCopy::broken_copy().

virtual oomph::DoubleMatrixBase::~DoubleMatrixBase ( )
inlinevirtual

virtual (empty) destructor

Definition at line 309 of file matrices.h.

Member Function Documentation

LinearSolver* & oomph::DoubleMatrixBase::linear_solver_pt ( )
inline

Return a pointer to the linear solver object.

Definition at line 319 of file matrices.h.

References Linear_solver_pt.

Referenced by oomph::HelmholtzMGPreconditioner< DIM >::disable_smoother_and_superlu_doc_time().

LinearSolver* const& oomph::DoubleMatrixBase::linear_solver_pt ( ) const
inline

Return a pointer to the linear solver object (const version)

Definition at line 322 of file matrices.h.

References Linear_solver_pt.

virtual double oomph::DoubleMatrixBase::max_residual ( const DoubleVector x,
const DoubleVector 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 364 of file matrices.h.

References oomph::DoubleVector::max(), and residual().

virtual void oomph::DoubleMatrixBase::multiply ( const DoubleVector x,
DoubleVector soln 
) const
pure virtual
virtual void oomph::DoubleMatrixBase::multiply_transpose ( const DoubleVector x,
DoubleVector soln 
) const
pure virtual

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

Implemented in oomph::CCDoubleMatrix, oomph::DenseDoubleMatrix, oomph::CRDoubleMatrix, and oomph::SumOfMatrices.

virtual unsigned long oomph::DoubleMatrixBase::ncol ( ) const
pure virtual
virtual unsigned long oomph::DoubleMatrixBase::nrow ( ) const
pure virtual
virtual double oomph::DoubleMatrixBase::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::CCDoubleMatrix, oomph::DenseDoubleMatrix, oomph::CRDoubleMatrix, and oomph::SumOfMatrices.

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

Broken assignment operator.

Definition at line 297 of file matrices.h.

References oomph::BrokenCopy::broken_assign().

virtual void oomph::DoubleMatrixBase::residual ( const DoubleVector x,
const DoubleVector b,
DoubleVector residual_ 
)
inlinevirtual
void oomph::DoubleMatrixBase::solve ( DoubleVector rhs)

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 55 of file matrices.cc.

References Linear_solver_pt, and oomph::LinearSolver::solve().

Referenced by oomph::Newmark< NSTEPS >::assign_initial_data_values(), oomph::Newmark< NSTEPS >::assign_initial_data_values_stage2(), oomph::BlackBoxFDNewtonSolver::black_box_fd_newton_solve(), oomph::HelmholtzMGPreconditioner< DIM >::direct_solve(), oomph::BrethertonSpineMesh< ELEMENT, INTERFACE_ELEMENT >::find_distance_to_free_surface(), oomph::PVDEquationsBase< DIM >::get_principal_stress(), and oomph::FiniteElement::locate_zeta().

void oomph::DoubleMatrixBase::solve ( const DoubleVector rhs,
DoubleVector soln 
)

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 79 of file matrices.cc.

References Linear_solver_pt, and oomph::LinearSolver::solve().

void oomph::DoubleMatrixBase::solve ( Vector< 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.

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

Definition at line 98 of file matrices.cc.

References Linear_solver_pt, and oomph::LinearSolver::solve().

void oomph::DoubleMatrixBase::solve ( const Vector< double > &  rhs,
Vector< double > &  soln 
)

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 122 of file matrices.cc.

References Linear_solver_pt, and oomph::LinearSolver::solve().

Member Data Documentation

LinearSolver* oomph::DoubleMatrixBase::Default_linear_solver_pt
protected
LinearSolver* oomph::DoubleMatrixBase::Linear_solver_pt
protected

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