Reference documentation for deal.II version 8.5.1
Public Types | Public Member Functions | Private Attributes | List of all members
ProductSparseMatrix< number, vector_number > Class Template Reference

#include <deal.II/lac/matrix_lib.h>

Inheritance diagram for ProductSparseMatrix< number, vector_number >:
[legend]

Public Types

typedef SparseMatrix< number > MatrixType
 
typedef Vector< vector_number > VectorType
 
- Public Types inherited from PointerMatrixBase< Vector< vector_number > >
typedef Vector< vector_number > ::value_type value_type
 

Public Member Functions

 ProductSparseMatrix (const MatrixType &m1, const MatrixType &m2, VectorMemory< VectorType > &mem)
 
 ProductSparseMatrix ()
 
void clear ()
 
virtual void vmult (VectorType &w, const VectorType &v) const
 
virtual void Tvmult (VectorType &w, const VectorType &v) const
 
virtual void vmult_add (VectorType &w, const VectorType &v) const
 
virtual void Tvmult_add (VectorType &w, const VectorType &v) const
 
- Public Member Functions inherited from PointerMatrixBase< Vector< vector_number > >
virtual ~PointerMatrixBase ()
 
- Public Member Functions inherited from Subscriptor
 Subscriptor ()
 
 Subscriptor (const Subscriptor &)
 
 Subscriptor (Subscriptor &&)
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
Subscriptoroperator= (Subscriptor &&)
 
void subscribe (const char *identifier=0) const
 
void unsubscribe (const char *identifier=0) const
 
unsigned int n_subscriptions () const
 
void list_subscribers () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

SmartPointer< const MatrixType, ProductSparseMatrix< number, vector_number > > m1
 
SmartPointer< const MatrixType, ProductSparseMatrix< number, vector_number > > m2
 
SmartPointer< VectorMemory< VectorType >, ProductSparseMatrix< number, vector_number > > mem
 

Additional Inherited Members

- Static Public Member Functions inherited from Subscriptor
static ::ExceptionBaseExcInUse (int arg1, char *arg2, std::string &arg3)
 
static ::ExceptionBaseExcNoSubscriber (char *arg1, char *arg2)
 

Detailed Description

template<typename number, typename vector_number>
class ProductSparseMatrix< number, vector_number >

Poor man's matrix product of two sparse matrices. Stores two matrices m1 and m2 of arbitrary type SparseMatrix and implements matrix-vector multiplications for the product M1M2 by performing multiplication with both factors consecutively.

The documentation of ProductMatrix applies with exception that these matrices here may be rectangular.

Deprecated:
If deal.II was configured with C++11 support, use the LinearOperator class instead, see the module on linear operators for further details.
Author
Guido Kanschat, 2000, 2001, 2002, 2005

Definition at line 233 of file matrix_lib.h.

Member Typedef Documentation

◆ MatrixType

template<typename number , typename vector_number >
typedef SparseMatrix<number> ProductSparseMatrix< number, vector_number >::MatrixType

Define the type of matrices used.

Definition at line 239 of file matrix_lib.h.

◆ VectorType

template<typename number , typename vector_number >
typedef Vector<vector_number> ProductSparseMatrix< number, vector_number >::VectorType

Define the type of vectors we plly this matrix to.

Definition at line 244 of file matrix_lib.h.

Constructor & Destructor Documentation

◆ ProductSparseMatrix() [1/2]

template<typename number , typename vnumber >
ProductSparseMatrix< number, vnumber >::ProductSparseMatrix ( const MatrixType m1,
const MatrixType m2,
VectorMemory< VectorType > &  mem 
)

Constructor. Additionally to the two constituting matrices, a memory pool for the auxiliary vector must be provided.

Definition at line 28 of file matrix_lib.cc.

◆ ProductSparseMatrix() [2/2]

template<typename number , typename vnumber >
ProductSparseMatrix< number, vnumber >::ProductSparseMatrix ( )

Constructor leaving an uninitialized matrix. initialize() must be called, before the matrix can be used.

Definition at line 42 of file matrix_lib.cc.

Member Function Documentation

◆ clear()

template<typename number , typename vnumber >
void ProductSparseMatrix< number, vnumber >::clear ( )
virtual

Reset the object to its original state.

Implements PointerMatrixBase< Vector< vector_number > >.

Definition at line 66 of file matrix_lib.cc.

◆ vmult()

template<typename number , typename vnumber >
void ProductSparseMatrix< number, vnumber >::vmult ( VectorType w,
const VectorType v 
) const
virtual

Matrix-vector product w = m1 * m2 * v.

Implements PointerMatrixBase< Vector< vector_number > >.

Definition at line 75 of file matrix_lib.cc.

◆ Tvmult()

template<typename number , typename vnumber >
void ProductSparseMatrix< number, vnumber >::Tvmult ( VectorType w,
const VectorType v 
) const
virtual

Transposed matrix-vector product w = m2T * m1T * v.

Implements PointerMatrixBase< Vector< vector_number > >.

Definition at line 107 of file matrix_lib.cc.

◆ vmult_add()

template<typename number , typename vnumber >
void ProductSparseMatrix< number, vnumber >::vmult_add ( VectorType w,
const VectorType v 
) const
virtual

Adding matrix-vector product w += m1 * m2 * v

Implements PointerMatrixBase< Vector< vector_number > >.

Definition at line 91 of file matrix_lib.cc.

◆ Tvmult_add()

template<typename number , typename vnumber >
void ProductSparseMatrix< number, vnumber >::Tvmult_add ( VectorType w,
const VectorType v 
) const
virtual

Adding, transposed matrix-vector product w += m2T * m1T * v.

Implements PointerMatrixBase< Vector< vector_number > >.

Definition at line 123 of file matrix_lib.cc.

Member Data Documentation

◆ m1

template<typename number , typename vector_number >
SmartPointer<const MatrixType,ProductSparseMatrix<number,vector_number> > ProductSparseMatrix< number, vector_number >::m1
private

The left matrix of the product.

Definition at line 297 of file matrix_lib.h.

◆ m2

template<typename number , typename vector_number >
SmartPointer<const MatrixType,ProductSparseMatrix<number,vector_number> > ProductSparseMatrix< number, vector_number >::m2
private

The right matrix of the product.

Definition at line 302 of file matrix_lib.h.

◆ mem

template<typename number , typename vector_number >
SmartPointer<VectorMemory<VectorType>,ProductSparseMatrix<number,vector_number> > ProductSparseMatrix< number, vector_number >::mem
private

Memory for auxiliary vector.

Definition at line 307 of file matrix_lib.h.


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