Sparse matrix. More...

#include <compositions.hh>

Public Types

typedef Cmplxtype< F >::type c_type
 Complex type of data type. More...
 
typedef _HashedSMatrix_iterator< F, const F &, const F * > const_iterator
 
typedef std::conditional< std::is_same< typename Realtype< F >::type, F >::value, typename Realtype< F >::type, typename Cmplxtype< F >::type >::type d_type
 Data type, depending if F is real or complex. More...
 
typedef _HashedSMatrix_iterator< F, F &, F * > iterator
 
typedef Realtype< F >::type r_type
 Real type of data type. More...
 

Public Member Functions

template<class H , class I >
void add (const Vector< H > &v, const I fact, const uint rowoffset=0, const uint coloffset=0)
 Copies the vector v multiplied by fact on position (rowoffset, coloffset) More...
 
template<class H , class I >
void addInto (Matrix< H > &dest, const I fact, const uint rowoffset=0, const uint coloffset=0) const
 This matrix is added as block to the given matrix dest. More...
 
template<class H , class I >
void addIntoT (Matrix< H > &dest, const I fact, const uint rowoffset=0, const uint coloffset=0) const
 The transposed of this matrix is added as block to the given matrix. More...
 
template<class H , class I >
void addT (const Vector< H > &v, const I fact, const uint rowoffset=0, const uint coloffset=0)
 Copies the transpose of the vector v multiplied by fact on position (rowoffset, coloffset) More...
 
iterator begin (uint row=0)
 Iterator over the elements, standing at position (row,c), where row is the given row number and c the first non-zero entry. More...
 
const_iterator begin (uint row=0) const
 Constant iterator over the elements, standing at position (row,c), where row is the given row number and c the first non-zero entry. More...
 
void compress (Real threshold=EPS)
 Compresses the matrix by dropping small entries. More...
 
virtual void convertCCS (F *a, int *asub, int *xa) const
 
virtual void convertCRS (F *a, int *asub, int *xa) const
 
virtual void convertIJK (F *, int *, int *) const
 
void copy (const SparseMatrix< F > &n)
 Copies n to this matrix. More...
 
const_iterator end () const
 Last entrance of the particular order. More...
 
void histogram (std::map< int, uint > &hist) const
 Creates a histogram of the matrix entries. More...
 
const HashedSparseMatrix< F > * m () const
 Returns the sparse matrix itself. More...
 
float memory () const
 Memory usage in byte. More...
 
template<class H >
void multiply (const H &fact, Matrix< F > &dest) const
 Multiplies this matrix with fact and adds the result to dest. More...
 
void multiply (const SparseMatrix< F > &fact, Matrix< F > &dest) const
 Multiplies this matrix with fact and adds the result to dest. More...
 
virtual void operator() (const Function< c_type > &fncY, Function< c_type > &fncX)
 
virtual void operator() (const Function< r_type > &fncY, Function< F > &fncX)
 
virtual F & operator() (const uint i, const uint j)
 
virtual F operator() (const uint i, const uint j) const
 
template<class H , class I >
void operator() (const Vector< H > &fncY, Vector< I > &fncX)
 Multiplies the matrix with fncY. The result is fncX. More...
 
SparseMatrix< F > & operator*= (const F factor)
 
void operator= (const SparseMatrix< F > &)
 
virtual void resize (uint m, uint n)
 Sets a new size, previous data might be lost
More...
 
template<class G >
 SparseMatrix (const Space< G > &spc, const BilinearForm< F, G > &bf, const Real eps=0.0)
 Constructor. More...
 
template<class G >
 SparseMatrix (const Space< G > &spc, const BilinearForm< F, G > &bf, const Sequence< ElementWithCell< G > * > &seq, const Real eps=0.0)
 Constructor. More...
 
template<class G >
 SparseMatrix (const Space< G > &spc, const F *const v, const int i=-1)
 Constructor of partial rank 1 matrix. More...
 
template<class G >
 SparseMatrix (const Space< G > &spc, const Sequence< bool > &seq, const BilinearForm< F, G > &bf, const Real eps=0.0)
 Constructor. More...
 
template<class G >
 SparseMatrix (const Space< G > &spc, const Vector< F > &x, const Vector< F > &y)
 Constructor of rank 1 matrix. More...
 
template<class G >
 SparseMatrix (const Space< G > &spcX, const Space< G > &spcY)
 Constructor. More...
 
template<class G >
 SparseMatrix (const Space< G > &spcX, const Space< G > &spcY, const BilinearForm< F, G > &bf, const Real eps=0.0, const bool single=false)
 Constructor. More...
 
template<class G >
 SparseMatrix (const Space< G > &spcX, const Space< G > &spcY, const BilinearForm< F, G > &bf, const Sequence< ElementWithCell< G > * > &seq, const Real eps=0.0)
 Constructor. More...
 
template<class G >
 SparseMatrix (const Space< G > &spcX, const Space< G > &spcY, const Sequence< bool > &seq, const BilinearForm< F, G > &bf, const Real eps=0.0, const bool single=false)
 Constructor. More...
 
 SparseMatrix (const Space< typename Realtype< F >::type > &spc, const BilinearFormContainer< F > bf, const Real eps=0.0)
 Constructor. More...
 
 SparseMatrix (const SparseMatrix< F > &m, bool t=false)
 Copy constructor. More...
 
template<class H >
 SparseMatrix (const SparseMatrix< H > &fncX)
 Constructor. More...
 
template<class H >
 SparseMatrix (const SparseMatrix< H > &fncX, const F &fnc(const H &))
 
template<class H >
 SparseMatrix (const SparseMatrix< H > &fncX, F fnc(const H &))
 Constructor. More...
 
template<class H >
 SparseMatrix (Operator< H > &A, bool slow=false)
 Constructor. More...
 
 SparseMatrix (uint dim=0)
 
 SparseMatrix (uint nofrows, uint nofcols)
 Constructor. More...
 
bool storeMatlab (const std::string filename, const std::string name="", bool append=false) const
 Stores the matrix in a Matlab sparse matrix. More...
 
void symmetrize ()
 Makes sure a theoretically symmetric matrix is symmetric in memory too. More...
 
virtual void transpMult (const Vector< c_type > &fncY, Vector< c_type > &fncX)
 
virtual void transpMult (const Vector< r_type > &fncY, Vector< F > &fncX)
 Multiplies the transpose of the matrix with fncY and adds the results to fncX. More...
 
virtual uint used () const
 Returns the number of used entries in the matrix. More...
 
void write (char *fname) const
 Writes the matrix to a file. More...
 
virtual ~SparseMatrix ()
 

Protected Member Functions

virtual std::ostream & info (std::ostream &os) const
 

Private Member Functions

virtual void apply_ (const Vector< F > &fncY, Vector< F > &fncX)
 
void copyConstructor_ (const SparseMatrix< F > &m, bool t)
 

Private Attributes

std::unique_ptr< HashedSparseMatrix< F > > m_
 The matrix. More...
 
uint nX_
 Dimension of image space (spcX_) More...
 
uint nY_
 Dimension of source space (spcY_) More...
 

Static Private Attributes

static uint storeMatlabCounter_
 Counts number of Matlab outputs (used to uniquely name the matrices) More...
 

Detailed Description

template<class F>
class concepts::SparseMatrix< F >

Sparse matrix.

The matrix has the size m x n where m is the dimension of the image space (spaceX) and n is the dimension of the source space (spaceY).

The matrix is setup and assembled in the constructor. It calls the bilinear form on every element of the space and uses the T matrices of the elements to assemble the element matrices into the global matrix.

There are quite a few solver which can be used to solve the system.

See also
TMatrixBase
CG
GMRes
Test:

test::CompositionsTest

test::MoreCompositionsTest

test::DriverTest

test::SparseMatrixTest

Examples
arpackppTutorial.cc, BGT_0.cc, elasticity2D_tutorial.cc, and exactDtN.cc.

Definition at line 25 of file compositions.hh.

Member Typedef Documentation

◆ c_type

template<class F >
typedef Cmplxtype<F>::type concepts::SparseMatrix< F >::c_type

Complex type of data type.

Definition at line 70 of file sparseMatrix.hh.

◆ const_iterator

template<class F >
typedef _HashedSMatrix_iterator<F, const F&, const F*> concepts::SparseMatrix< F >::const_iterator

Definition at line 76 of file sparseMatrix.hh.

◆ d_type

template<class F >
typedef std::conditional<std::is_same<typename Realtype<F>::type, F>::value , typename Realtype<F>::type, typename Cmplxtype<F>::type >::type concepts::SparseMatrix< F >::d_type

Data type, depending if F is real or complex.

Definition at line 73 of file sparseMatrix.hh.

◆ iterator

template<class F >
typedef _HashedSMatrix_iterator<F, F&, F*> concepts::SparseMatrix< F >::iterator

Definition at line 75 of file sparseMatrix.hh.

◆ r_type

template<class F >
typedef Realtype<F>::type concepts::SparseMatrix< F >::r_type

Real type of data type.

Definition at line 68 of file sparseMatrix.hh.

Constructor & Destructor Documentation

◆ SparseMatrix() [1/17]

template<class F >
template<class G >
concepts::SparseMatrix< F >::SparseMatrix ( const Space< G > &  spcX,
const Space< G > &  spcY 
)
inline

Constructor.

Creates an empty matrix.

Definition at line 81 of file sparseMatrix.hh.

◆ SparseMatrix() [2/17]

template<class F >
concepts::SparseMatrix< F >::SparseMatrix ( uint  nofrows,
uint  nofcols 
)
inline

Constructor.

Creates an empty matrix.

Definition at line 90 of file sparseMatrix.hh.

◆ SparseMatrix() [3/17]

template<class F >
concepts::SparseMatrix< F >::SparseMatrix ( uint  dim = 0)
inline

Definition at line 96 of file sparseMatrix.hh.

◆ SparseMatrix() [4/17]

template<class F >
template<class G >
concepts::SparseMatrix< F >::SparseMatrix ( const Space< G > &  spcX,
const Space< G > &  spcY,
const BilinearForm< F, G > &  bf,
const Real  eps = 0.0,
const bool  single = false 
)

Constructor.

Computes the global matrix by assembling the element matrices.

This constructor features a double loop over the elements of the image and the source space. On each combination, the bilinear form is called. You can force this constructor to execute the double loop in such a way that only for diagonal combinations of the elements in both space the integration and assembling is executed. Use single and set it to true.

Use this constructor, if spcX != spcY or if you have local matrices which express the interaction of the two elements., const Real eps = 0.0, const Real eps = 0.0

In non-symmetric FEM (eg. DGFEM), one has to solve AT u = f. This constructor computes A and not AT.

Parameters
spcXImage space
spcYSource space
bfBilinear form
epsentries, which absolute value is smaller then eps times the maximal absolute value of the element matrix are set to zero.

◆ SparseMatrix() [5/17]

template<class F >
template<class G >
concepts::SparseMatrix< F >::SparseMatrix ( const Space< G > &  spcX,
const Space< G > &  spcY,
const Sequence< bool > &  seq,
const BilinearForm< F, G > &  bf,
const Real  eps = 0.0,
const bool  single = false 
)

Constructor.

Computes the global matrix by assembling the element matrices.

This constructor features a double loop over the elements of the image and the source space. On each combination, the bilinear form is called. You can force this constructor to execute the double loop in such a way that only for diagonal combinations of the elements in both space the integration and assembling is executed. Use single and set it to true.

Use this constructor, if spcX != spcY or if you have local matrices which express the interaction of the two elements., const Real eps = 0.0, const Real eps = 0.0

In non-symmetric FEM (eg. DGFEM), one has to solve AT u = f. This constructor computes A and not AT.

Parameters
spcXImage space
spcYSource space
seqFlag on where the elements have to be built
bfBilinear form
epsentries, which absolute value is smaller then eps times the maximal absolute value of the element matrix are set to zero.
singleDiagonal parameter flag

◆ SparseMatrix() [6/17]

template<class F >
template<class G >
concepts::SparseMatrix< F >::SparseMatrix ( const Space< G > &  spcX,
const Space< G > &  spcY,
const BilinearForm< F, G > &  bf,
const Sequence< ElementWithCell< G > * > &  seq,
const Real  eps = 0.0 
)

Constructor.

Computes the global matrix by assembling the element matrices.

This constructor features a double loop over the elements of the image and the source space. On each combination, the bilinear form is called. You can force this constructor to execute the double loop in such a way that only for diagonal combinations of the elements in both space the integration and assembling is executed. Use single and set it to true.

Use this constructor, if spcX != spcY or if you have local matrices which express the interaction of the two elements., const Real eps = 0.0, const Real eps = 0.0

In non-symmetric FEM (eg. DGFEM), one has to solve AT u = f. This constructor computes A and not AT.

Parameters
spcXImage space
spcYSource space
bfBilinear form
seqSequence of elements to take into account for the Image space
epsentries, which absolute value is smaller then eps times the maximal absolute value of the element matrix are set to zero.

◆ SparseMatrix() [7/17]

template<class F >
template<class G >
concepts::SparseMatrix< F >::SparseMatrix ( const Space< G > &  spc,
const BilinearForm< F, G > &  bf,
const Real  eps = 0.0 
)

Constructor.

Computes the global matrix by assembling the element matrices.

Parameters
spcImage and source space
bfBilinear form
epsentries, which absolute value is smaller then eps times the maximal absolute value of the element matrix are set to zero.

◆ SparseMatrix() [8/17]

template<class F >
concepts::SparseMatrix< F >::SparseMatrix ( const Space< typename Realtype< F >::type > &  spc,
const BilinearFormContainer< F >  bf,
const Real  eps = 0.0 
)

Constructor.

Computes the global matrix by assembling the element matrices.

Parameters
spcImage and source space
bfbilinearform Container
epsentries, which absolute value is smaller then eps times the maximal absolute value of the element matrix are set to zero.

◆ SparseMatrix() [9/17]

template<class F >
template<class G >
concepts::SparseMatrix< F >::SparseMatrix ( const Space< G > &  spc,
const Sequence< bool > &  seq,
const BilinearForm< F, G > &  bf,
const Real  eps = 0.0 
)

Constructor.

Computes the global matrix by assembling the element matrices.

Parameters
spcImage and source space
seqFlag on where the elements have to be built
bfBilinear form
epsentries, which absolute value is smaller then eps times the maximal absolute value of the element matrix are set to zero.

◆ SparseMatrix() [10/17]

template<class F >
template<class G >
concepts::SparseMatrix< F >::SparseMatrix ( const Space< G > &  spc,
const BilinearForm< F, G > &  bf,
const Sequence< ElementWithCell< G > * > &  seq,
const Real  eps = 0.0 
)

Constructor.

Computes the partial matrix by assembling the element matrices on a given subdomain

Parameters
spcImage and source space
bfBilinear form
seqSequence of elements to take into account
epsentries, which absolute value is smaller then eps times the maximal absolute value of the element matrix are set to zero.

◆ SparseMatrix() [11/17]

template<class F >
concepts::SparseMatrix< F >::SparseMatrix ( const SparseMatrix< F > &  m,
bool  t = false 
)

Copy constructor.

If t is set to true, the matrix is transposed during the copy process

◆ SparseMatrix() [12/17]

template<class F >
template<class G >
concepts::SparseMatrix< F >::SparseMatrix ( const Space< G > &  spc,
const F *const  v,
const int  i = -1 
)

Constructor of partial rank 1 matrix.

The matrix is set to $ \vec x \cdot \vec x^\top $ where the bottom entries of x are given by v and, if i >= 0, x(i) = 1 and x(0:i) = 0.

Parameters
spcImage and source space
vPartial vector for rank 1 product
iShift index, i==-1 means that v has the full size of x

◆ SparseMatrix() [13/17]

template<class F >
template<class G >
concepts::SparseMatrix< F >::SparseMatrix ( const Space< G > &  spc,
const Vector< F > &  x,
const Vector< F > &  y 
)

Constructor of rank 1 matrix.

The matrix is set to $ \vec x \cdot \vec y^\top $.

Parameters
spcImage and source space
xFirst vector
ySecond vector

◆ SparseMatrix() [14/17]

template<class F >
template<class H >
concepts::SparseMatrix< F >::SparseMatrix ( Operator< H > &  A,
bool  slow = false 
)

Constructor.

Converts A to a sparse matrix.

In case, the slow mode is allowed, the matrix is computed by multiplying A with the standard basis vectors and entering the results into the matrix. This is a O(n^2) operation.

Parameters
AOperator to store as sparse matrix
slowAlso do slow O(n^2) conversion if nothing else is left.

◆ SparseMatrix() [15/17]

template<class F >
template<class H >
concepts::SparseMatrix< F >::SparseMatrix ( const SparseMatrix< H > &  fncX,
F   fncconst H & 
)

Constructor.

Use this constructor to create a matrix of type F out of a matrix with entries of type H. The F type vector consists of elementwise evaluations of the function fnc.

Definition at line 482 of file sparseMatrix.hh.

◆ SparseMatrix() [16/17]

template<class F >
template<class H >
concepts::SparseMatrix< F >::SparseMatrix ( const SparseMatrix< H > &  fncX,
const F &  fncconst H & 
)

Definition at line 518 of file sparseMatrix.hh.

◆ SparseMatrix() [17/17]

template<class F >
template<class H >
concepts::SparseMatrix< F >::SparseMatrix ( const SparseMatrix< H > &  fncX)

Constructor.

Use this constructor to create a matrix of type F out of a matrix with entries of type H. The F type vector consists of elementwise conversions.

Definition at line 500 of file sparseMatrix.hh.

◆ ~SparseMatrix()

template<class F >
virtual concepts::SparseMatrix< F >::~SparseMatrix ( )
inlinevirtual

Definition at line 313 of file sparseMatrix.hh.

Member Function Documentation

◆ add()

template<class F >
template<class H , class I >
void concepts::SparseMatrix< F >::add ( const Vector< H > &  v,
const I  fact,
const uint  rowoffset = 0,
const uint  coloffset = 0 
)

Copies the vector v multiplied by fact on position (rowoffset, coloffset)

Definition at line 597 of file sparseMatrix.hh.

◆ addInto()

template<class F >
template<class H , class I >
void concepts::SparseMatrix< F >::addInto ( Matrix< H > &  dest,
const I  fact,
const uint  rowoffset = 0,
const uint  coloffset = 0 
) const

This matrix is added as block to the given matrix dest.

Parameters
destMatrix into which this matrix should be added.
factFactor by which this matrix should be multiplied.
rowoffsetRow in dest, where block begins.
coloffsetColumn in dest, where block begins.

For example: Given a real matrix R. Then one construct a complex one by

SparseMatrix<Cmplx> C(spc,spc);
R.addInto(C, 1.0);

Definition at line 538 of file sparseMatrix.hh.

◆ addIntoT()

template<class F >
template<class H , class I >
void concepts::SparseMatrix< F >::addIntoT ( Matrix< H > &  dest,
const I  fact,
const uint  rowoffset = 0,
const uint  coloffset = 0 
) const

The transposed of this matrix is added as block to the given matrix.

Parameters
destMatrix into which this matrix should be added.
factFactor by which this matrix should be multiplied.
rowoffsetRow in dest, where block begins.
coloffsetColumn in dest, where block begins.

Definition at line 567 of file sparseMatrix.hh.

◆ addT()

template<class F >
template<class H , class I >
void concepts::SparseMatrix< F >::addT ( const Vector< H > &  v,
const I  fact,
const uint  rowoffset = 0,
const uint  coloffset = 0 
)

Copies the transpose of the vector v multiplied by fact on position (rowoffset, coloffset)

Definition at line 613 of file sparseMatrix.hh.

◆ apply_()

template<class F >
virtual void concepts::SparseMatrix< F >::apply_ ( const Vector< F > &  fncY,
Vector< F > &  fncX 
)
inlineprivatevirtual

Definition at line 474 of file sparseMatrix.hh.

◆ begin() [1/2]

template<class F >
iterator concepts::SparseMatrix< F >::begin ( uint  row = 0)

Iterator over the elements, standing at position (row,c), where row is the given row number and c the first non-zero entry.

If there is not entry in this line, the iterators stand at the next non-zero entry or it is end(), if the matrix is empty.

◆ begin() [2/2]

template<class F >
const_iterator concepts::SparseMatrix< F >::begin ( uint  row = 0) const

Constant iterator over the elements, standing at position (row,c), where row is the given row number and c the first non-zero entry.

If there is not entry in this line, the iterators stand at the next non-zero entry or it is end(), if the matrix is empty.

◆ compress()

template<class F >
void concepts::SparseMatrix< F >::compress ( Real  threshold = EPS)
inline

Compresses the matrix by dropping small entries.

All matrix entries which are smaller than a certain threshold times the largest entry of the matrix are deleted from the matrix.

Definition at line 444 of file sparseMatrix.hh.

◆ convertCCS()

template<class F >
virtual void concepts::SparseMatrix< F >::convertCCS ( F *  a,
int *  asub,
int *  xa 
) const
virtual

◆ convertCRS()

template<class F >
virtual void concepts::SparseMatrix< F >::convertCRS ( F *  a,
int *  asub,
int *  xa 
) const
virtual

◆ convertIJK()

template<class F >
virtual void concepts::SparseMatrix< F >::convertIJK ( F *  ,
int *  ,
int *   
) const
virtual

◆ copy()

template<class F >
void concepts::SparseMatrix< F >::copy ( const SparseMatrix< F > &  n)

Copies n to this matrix.

◆ copyConstructor_()

template<class F >
void concepts::SparseMatrix< F >::copyConstructor_ ( const SparseMatrix< F > &  m,
bool  t 
)
private

◆ end()

template<class F >
const_iterator concepts::SparseMatrix< F >::end ( ) const

Last entrance of the particular order.

◆ histogram()

template<class F >
void concepts::SparseMatrix< F >::histogram ( std::map< int, uint > &  hist) const

Creates a histogram of the matrix entries.

◆ info()

template<class F >
virtual std::ostream& concepts::SparseMatrix< F >::info ( std::ostream &  os) const
protectedvirtual

◆ m()

template<class F >
const HashedSparseMatrix<F>* concepts::SparseMatrix< F >::m ( ) const
inline

Returns the sparse matrix itself.

Definition at line 378 of file sparseMatrix.hh.

◆ memory()

template<class F >
float concepts::SparseMatrix< F >::memory ( ) const
inline

Memory usage in byte.

Definition at line 435 of file sparseMatrix.hh.

◆ multiply() [1/2]

template<class F >
template<class H >
void concepts::SparseMatrix< F >::multiply ( const H &  fact,
Matrix< F > &  dest 
) const
inline

Multiplies this matrix with fact and adds the result to dest.

Definition at line 429 of file sparseMatrix.hh.

◆ multiply() [2/2]

template<class F >
void concepts::SparseMatrix< F >::multiply ( const SparseMatrix< F > &  fact,
Matrix< F > &  dest 
) const
inline

Multiplies this matrix with fact and adds the result to dest.

Definition at line 424 of file sparseMatrix.hh.

◆ operator()() [1/5]

template<class F >
virtual void concepts::SparseMatrix< F >::operator() ( const Function< c_type > &  fncY,
Function< c_type > &  fncX 
)
virtual

◆ operator()() [2/5]

template<class F >
virtual void concepts::SparseMatrix< F >::operator() ( const Function< r_type > &  fncY,
Function< F > &  fncX 
)
virtual

◆ operator()() [3/5]

template<class F >
virtual F& concepts::SparseMatrix< F >::operator() ( const uint  i,
const uint  j 
)
inlinevirtual

Definition at line 353 of file sparseMatrix.hh.

◆ operator()() [4/5]

template<class F >
virtual F concepts::SparseMatrix< F >::operator() ( const uint  i,
const uint  j 
) const
inlinevirtual

Definition at line 351 of file sparseMatrix.hh.

◆ operator()() [5/5]

template<class F >
template<class H , class I >
void concepts::SparseMatrix< F >::operator() ( const Vector< H > &  fncY,
Vector< I > &  fncX 
)
inline

Multiplies the matrix with fncY. The result is fncX.

Definition at line 322 of file sparseMatrix.hh.

◆ operator*=()

template<class F >
SparseMatrix<F>& concepts::SparseMatrix< F >::operator*= ( const F  factor)
inline

Definition at line 355 of file sparseMatrix.hh.

◆ operator=()

template<class F >
void concepts::SparseMatrix< F >::operator= ( const SparseMatrix< F > &  )

◆ resize()

template<class F >
virtual void concepts::SparseMatrix< F >::resize ( uint  m,
uint  n 
)
inlinevirtual

Sets a new size, previous data might be lost

Definition at line 361 of file sparseMatrix.hh.

◆ storeMatlab()

template<class F >
bool concepts::SparseMatrix< F >::storeMatlab ( const std::string  filename,
const std::string  name = "",
bool  append = false 
) const

Stores the matrix in a Matlab sparse matrix.

Returns
true if the writes was successfull

◆ symmetrize()

template<class F >
void concepts::SparseMatrix< F >::symmetrize ( )

Makes sure a theoretically symmetric matrix is symmetric in memory too.

◆ transpMult() [1/2]

template<class F >
virtual void concepts::SparseMatrix< F >::transpMult ( const Vector< c_type > &  fncY,
Vector< c_type > &  fncX 
)
virtual

◆ transpMult() [2/2]

template<class F >
virtual void concepts::SparseMatrix< F >::transpMult ( const Vector< r_type > &  fncY,
Vector< F > &  fncX 
)
virtual

Multiplies the transpose of the matrix with fncY and adds the results to fncX.

◆ used()

template<class F >
virtual uint concepts::SparseMatrix< F >::used ( ) const
inlinevirtual

Returns the number of used entries in the matrix.

Definition at line 433 of file sparseMatrix.hh.

◆ write()

template<class F >
void concepts::SparseMatrix< F >::write ( char *  fname) const

Writes the matrix to a file.

Parameters
fnameFilename

Member Data Documentation

◆ m_

template<class F >
std::unique_ptr<HashedSparseMatrix<F> > concepts::SparseMatrix< F >::m_
private

The matrix.

Definition at line 467 of file sparseMatrix.hh.

◆ nX_

template<class F >
uint concepts::SparseMatrix< F >::nX_
private

Dimension of image space (spcX_)

Definition at line 461 of file sparseMatrix.hh.

◆ nY_

template<class F >
uint concepts::SparseMatrix< F >::nY_
private

Dimension of source space (spcY_)

Definition at line 464 of file sparseMatrix.hh.

◆ storeMatlabCounter_

template<class F >
uint concepts::SparseMatrix< F >::storeMatlabCounter_
staticprivate

Counts number of Matlab outputs (used to uniquely name the matrices)

Definition at line 470 of file sparseMatrix.hh.


The documentation for this class was generated from the following files:
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich