KASKADE 7 development version
Loading...
Searching...
No Matches
Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt > Class Template Reference

More...

#include <triplet.hh>

Public Types

typedef Scalar value_type
 STL-compliant typedefs.
typedef std::vector< Scalar >::iterator iterator
typedef std::vector< Scalar >::const_iterator const_iterator
typedef std::vector< SparseIndexInt >::iterator index_iterator
typedef std::vector< SparseIndexInt >::const_iterator const_index_iterator

Public Member Functions

 MatrixAsTriplet ()
 Constructor.
 MatrixAsTriplet (size_t s)
 Constructor that allocates memory directly.
template<int n, int m, class Allocator>
 MatrixAsTriplet (Dune::BCRSMatrix< Dune::FieldMatrix< Scalar, n, m >, Allocator > const &other)
 Constructor from a Dune::BCRSMatrix.
template<int n, int m, class Index>
 MatrixAsTriplet (NumaBCRSMatrix< Dune::FieldMatrix< Scalar, n, m >, Index > const &other)
 Constructor from a NumaBCRSMatrix.
 MatrixAsTriplet (std::vector< SparseIndexInt > &&row, std::vector< SparseIndexInt > &&col, std::vector< Scalar > &&value)
 Move constructor taking raw data.
 MatrixAsTriplet (SparseIndexInt nrows, SparseIndexInt ncols, Scalar const &value)
 Constructs a matrix of size (nrows,ncols), filled with value. If value==0.0, then it is an empty matrix.
 MatrixAsTriplet (SparseIndexInt nrows, SparseIndexInt ncols, SparseIndexInt shift, Scalar const &value)
 Constructs a diagonal matrix of size (nrows,ncols). The diagonal is shifted down shift rows (if shift is negative, it is shifted up)
 MatrixAsTriplet (SparseIndexInt nrows, SparseIndexInt ncols, SparseIndexInt shift, std::vector< Scalar > const &value)
 Constructs a diagonal matrix of size (nrows,ncols). The diagonal is shifted down shift rows (if shift is negative, it is shifted up)
 MatrixAsTriplet (MatrixAsTriplet const &other)=default
 Copy constructor.
 MatrixAsTriplet (MatrixAsTriplet &&other)=default
 Move constructor.
template<class OtherScalar, class OtherIndex>
 MatrixAsTriplet (MatrixAsTriplet< OtherScalar, OtherIndex > const &A)
 Copy constructor from a triplet matrix with different entry and/or index types.
void clear ()
 Deletes the data, leaving an empty matrix of size 0 x 0.
void setStartToZero ()
 Shift the row and column indices such that \( A_{00} \) is (structurally) nonzero.
SparseIndexInt nrows () const
 Returns number of rows (computes them, if not known)
SparseIndexInt N () const
 Returns number of rows (computes them, if not known) This is a Dune ISTL compatibility method.
SparseIndexInt ncols () const
 Returns number of cols (computes them, if not known)
SparseIndexInt M () const
 Returns number of columns (computes them, if not known) This is a Dune ISTL compatibility method.
void resize (size_t s)
 Resizes the memory.
void reserve (size_t s)
 Reserve memory.
size_t nnz () const
template<class X, class Y>
void axpy (Y &out, X const &in, Scalar alpha=1.0, int nvectors=1) const
 Matrix-vector multiplication: out += alpha * (*this) * in.
template<class X, class Y>
void atxpy (Y &y, X const &x, Scalar alpha=1.0) const
 Matrix-vector multiplication.
template<class X, class Y>
void usmtv (Scalar const alpha, X const &x, Y &y) const
 Matrix-vector multiplication.
template<class X, class Y>
void usmv (Scalar const alpha, X const &x, Y &y) const
 scaled matrix-vector multiplication
template<class X, class Y>
void ax (Y &out, X const &in) const
 Matrix-vector multiplication: out = (*this) * in.
template<class X, class Y>
void mv (X const &x, Y &y) const
 matrix-vector multiplication
void shiftIndices (SparseIndexInt row, SparseIndexInt col)
 Shifts matrix indices. Can be used together with += to concatenate sparese matrices.
void addEntry (SparseIndexInt row, SparseIndexInt col, Scalar const &value)
 Adds the given value to the specified matrix entry. The entry is created in case it has been structurally zero before.
MatrixAsTriplet & operator+= (MatrixAsTriplet const &m)
 Matrix addition: (*this) += m (works also for matrices with non-matching sparsity pattern)
MatrixAsTriplet & operator-= (MatrixAsTriplet const &m)
MatrixAsTriplet & operator*= (Scalar const &scalar)
 Scaling.
MatrixAsTriplet & operator/= (Scalar const &scalar)
 Scaling.
MatrixAsTriplet & operator= (MatrixAsTriplet const &m)=default
 Assignment.
MatrixAsTriplet & operator= (MatrixAsTriplet &&other)=default
 Move assignment.
void scaleRows (std::vector< Scalar >const &scaling)
MatrixAsTriplet & transpose ()
 Transposition.
void deleteLowerTriangle ()
 Deletes all sub-diagonal entries.
std::ostream & print (std::ostream &out=std::cout, double threshold=0.0) const
 Output as Matlab source code.
void toColumns (std::vector< std::vector< Scalar > > &colsvector) const
 transform into a set of column vectors
void toRows (std::vector< std::vector< Scalar > > &rows) const
void toVector (std::vector< Scalar > &colsvector)
void addColumn (std::vector< Scalar > &colsvector, size_t position)
 add a column
template<class Mat>
void addToMatrix (Mat &mat)
 add to a dense matrix
void erase (SparseIndexInt i)
MatrixAsTriplet lumped ()
iterator begin ()
 get iterator on data field
const_iterator begin () const
 get const iterator on data field
iterator end ()
 get iterator on end of data field
const_iterator end () const
 get const iterator on end of data field
size_t size () const
 get number of entries in sparse matrix
void toFile (const char *filename, unsigned int precision=10) const
 write to text file
template<int bcrsN = 1>
std::unique_ptr< Dune::BCRSMatrix< Dune::FieldMatrix< Scalar, bcrsN, bcrsN > > > toBCRS () const
 copy to Dune::BCRSMatrix
bool isSymmetric () const
std::pair< size_t, bool > findEntry (SparseIndexInt row, SparseIndexInt col) const

Public Attributes

std::vector< SparseIndexInt > ridx
 row indices
std::vector< SparseIndexInt > cidx
 column indices
std::vector< Scalar > data
 data

Detailed Description

template<class Scalar, class SparseIndexInt = int>
class Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >

Sparse Matrix in triplet format.

A simple sparse matrix format consisting of scalar-valued (row,col,value) entries. Use this as the least common denominator of sparse linear algebra interfaces.

Multiple entries with same row and col are semantically summed up.

Template Parameters
Scalar(double or float, field_type)
SparseIndexInt(int,long)

long has to be used as SparseIndexInt if the number of nonzeros of the sparse matrix exceeds INT_MAX 2,147,483,647 or if the umfpack direct solver is used and the internal workspace exceeds this number, what will happen much earlier.

Definition at line 56 of file triplet.hh.

Member Typedef Documentation

◆ const_index_iterator

template<class Scalar, class SparseIndexInt = int>
typedef std::vector<SparseIndexInt>::const_iterator Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::const_index_iterator

Definition at line 64 of file triplet.hh.

◆ const_iterator

template<class Scalar, class SparseIndexInt = int>
typedef std::vector<Scalar>::const_iterator Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::const_iterator

Definition at line 62 of file triplet.hh.

◆ index_iterator

template<class Scalar, class SparseIndexInt = int>
typedef std::vector<SparseIndexInt>::iterator Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::index_iterator

Definition at line 63 of file triplet.hh.

◆ iterator

template<class Scalar, class SparseIndexInt = int>
typedef std::vector<Scalar>::iterator Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::iterator

Definition at line 61 of file triplet.hh.

◆ value_type

template<class Scalar, class SparseIndexInt = int>
typedef Scalar Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::value_type

STL-compliant typedefs.

Definition at line 60 of file triplet.hh.

Constructor & Destructor Documentation

◆ MatrixAsTriplet() [1/11]

template<class Scalar, class SparseIndexInt = int>
Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::MatrixAsTriplet ( )
inline

Constructor.

Definition at line 67 of file triplet.hh.

◆ MatrixAsTriplet() [2/11]

template<class Scalar, class SparseIndexInt = int>
Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::MatrixAsTriplet ( size_t s)
inlineexplicit

Constructor that allocates memory directly.

Definition at line 70 of file triplet.hh.

◆ MatrixAsTriplet() [3/11]

template<class Scalar, class SparseIndexInt = int>
template<int n, int m, class Allocator>
Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::MatrixAsTriplet ( Dune::BCRSMatrix< Dune::FieldMatrix< Scalar, n, m >, Allocator > const & other)
inlineexplicit

Constructor from a Dune::BCRSMatrix.

Definition at line 74 of file triplet.hh.

◆ MatrixAsTriplet() [4/11]

template<class Scalar, class SparseIndexInt = int>
template<int n, int m, class Index>
Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::MatrixAsTriplet ( NumaBCRSMatrix< Dune::FieldMatrix< Scalar, n, m >, Index > const & other)
inlineexplicit

Constructor from a NumaBCRSMatrix.

Definition at line 81 of file triplet.hh.

◆ MatrixAsTriplet() [5/11]

template<class Scalar, class SparseIndexInt = int>
Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::MatrixAsTriplet ( std::vector< SparseIndexInt > && row,
std::vector< SparseIndexInt > && col,
std::vector< Scalar > && value )
inline

Move constructor taking raw data.

The size of row, col, and value has to be identical. All entries in row and col need to be nonnegative. The supplied containers are empty after construction.

Definition at line 94 of file triplet.hh.

◆ MatrixAsTriplet() [6/11]

template<class Scalar, class SparseIndexInt = int>
Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::MatrixAsTriplet ( SparseIndexInt nrows,
SparseIndexInt ncols,
Scalar const & value )
inline

Constructs a matrix of size (nrows,ncols), filled with value. If value==0.0, then it is an empty matrix.

Definition at line 107 of file triplet.hh.

◆ MatrixAsTriplet() [7/11]

template<class Scalar, class SparseIndexInt = int>
Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::MatrixAsTriplet ( SparseIndexInt nrows,
SparseIndexInt ncols,
SparseIndexInt shift,
Scalar const & value )
inline

Constructs a diagonal matrix of size (nrows,ncols). The diagonal is shifted down shift rows (if shift is negative, it is shifted up)

Definition at line 124 of file triplet.hh.

◆ MatrixAsTriplet() [8/11]

template<class Scalar, class SparseIndexInt = int>
Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::MatrixAsTriplet ( SparseIndexInt nrows,
SparseIndexInt ncols,
SparseIndexInt shift,
std::vector< Scalar > const & value )
inline

Constructs a diagonal matrix of size (nrows,ncols). The diagonal is shifted down shift rows (if shift is negative, it is shifted up)

Definition at line 143 of file triplet.hh.

◆ MatrixAsTriplet() [9/11]

template<class Scalar, class SparseIndexInt = int>
Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::MatrixAsTriplet ( MatrixAsTriplet< Scalar, SparseIndexInt > const & other)
default

Copy constructor.

◆ MatrixAsTriplet() [10/11]

template<class Scalar, class SparseIndexInt = int>
Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::MatrixAsTriplet ( MatrixAsTriplet< Scalar, SparseIndexInt > && other)
default

Move constructor.

◆ MatrixAsTriplet() [11/11]

template<class Scalar, class SparseIndexInt = int>
template<class OtherScalar, class OtherIndex>
Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::MatrixAsTriplet ( MatrixAsTriplet< OtherScalar, OtherIndex > const & A)
inline

Copy constructor from a triplet matrix with different entry and/or index types.

Definition at line 168 of file triplet.hh.

Member Function Documentation

◆ addColumn()

template<class Scalar, class SparseIndexInt = int>
void Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::addColumn ( std::vector< Scalar > & colsvector,
size_t position )
inline

add a column

Definition at line 536 of file triplet.hh.

◆ addEntry()

template<class Scalar, class SparseIndexInt = int>
void Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::addEntry ( SparseIndexInt row,
SparseIndexInt col,
Scalar const & value )
inline

Adds the given value to the specified matrix entry. The entry is created in case it has been structurally zero before.

Definition at line 349 of file triplet.hh.

Referenced by lumped().

◆ addToMatrix()

template<class Scalar, class SparseIndexInt = int>
template<class Mat>
void Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::addToMatrix ( Mat & mat)
inline

add to a dense matrix

Definition at line 549 of file triplet.hh.

◆ atxpy()

template<class Scalar, class SparseIndexInt = int>
template<class X, class Y>
void Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::atxpy ( Y & y,
X const & x,
Scalar alpha = 1.0 ) const
inline

Matrix-vector multiplication.

\( x = x + \alpha A^{T}y \)

Definition at line 283 of file triplet.hh.

Referenced by usmtv().

◆ ax()

template<class Scalar, class SparseIndexInt = int>
template<class X, class Y>
void Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::ax ( Y & out,
X const & in ) const
inline

Matrix-vector multiplication: out = (*this) * in.

Definition at line 312 of file triplet.hh.

◆ axpy()

template<class Scalar, class SparseIndexInt = int>
template<class X, class Y>
void Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::axpy ( Y & out,
X const & in,
Scalar alpha = 1.0,
int nvectors = 1 ) const
inline

Matrix-vector multiplication: out += alpha * (*this) * in.

?????: Was ist denn nr? number of blocks/rows?? Damit kann man mehrere Vektoren gleichzeitig axpy'en

Definition at line 262 of file triplet.hh.

Referenced by mv(), and usmv().

◆ begin() [1/2]

template<class Scalar, class SparseIndexInt = int>
iterator Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::begin ( )
inline

get iterator on data field

Definition at line 586 of file triplet.hh.

◆ begin() [2/2]

template<class Scalar, class SparseIndexInt = int>
const_iterator Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::begin ( ) const
inline

get const iterator on data field

Definition at line 589 of file triplet.hh.

◆ clear()

template<class Scalar, class SparseIndexInt = int>
void Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::clear ( )
inline

Deletes the data, leaving an empty matrix of size 0 x 0.

Definition at line 182 of file triplet.hh.

◆ deleteLowerTriangle()

template<class Scalar, class SparseIndexInt = int>
void Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::deleteLowerTriangle ( )
inline

Deletes all sub-diagonal entries.

Definition at line 461 of file triplet.hh.

Referenced by Kaskade::HigherOrderRecovery< Grid, Space >::getErrorFunction().

◆ end() [1/2]

template<class Scalar, class SparseIndexInt = int>
iterator Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::end ( )
inline

get iterator on end of data field

Definition at line 592 of file triplet.hh.

◆ end() [2/2]

template<class Scalar, class SparseIndexInt = int>
const_iterator Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::end ( ) const
inline

get const iterator on end of data field

Definition at line 595 of file triplet.hh.

◆ erase()

template<class Scalar, class SparseIndexInt = int>
void Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::erase ( SparseIndexInt i)
inline

Definition at line 555 of file triplet.hh.

◆ findEntry()

template<class Scalar, class SparseIndexInt = int>
std::pair< size_t, bool > Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::findEntry ( SparseIndexInt row,
SparseIndexInt col ) const
inline
Returns
std::pair<size_t,bool> retVal. retVal.first: index. retVal.second: true, if entry was found

Definition at line 658 of file triplet.hh.

Referenced by isSymmetric().

◆ isSymmetric()

template<class Scalar, class SparseIndexInt = int>
bool Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::isSymmetric ( ) const
inline

Definition at line 642 of file triplet.hh.

◆ lumped()

template<class Scalar, class SparseIndexInt = int>
MatrixAsTriplet Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::lumped ( )
inline

Definition at line 562 of file triplet.hh.

◆ M()

template<class Scalar, class SparseIndexInt = int>
SparseIndexInt Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::M ( ) const
inline

Returns number of columns (computes them, if not known) This is a Dune ISTL compatibility method.

Definition at line 225 of file triplet.hh.

◆ mv()

template<class Scalar, class SparseIndexInt = int>
template<class X, class Y>
void Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::mv ( X const & x,
Y & y ) const
inline

matrix-vector multiplication

Definition at line 328 of file triplet.hh.

◆ N()

template<class Scalar, class SparseIndexInt = int>
SparseIndexInt Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::N ( ) const
inline

Returns number of rows (computes them, if not known) This is a Dune ISTL compatibility method.

Definition at line 212 of file triplet.hh.

◆ ncols()

template<class Scalar, class SparseIndexInt = int>
SparseIndexInt Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::ncols ( ) const
inline

Returns number of cols (computes them, if not known)

Definition at line 215 of file triplet.hh.

Referenced by axpy(), Kaskade::getFactorization(), lumped(), M(), operator+=(), operator-=(), toBCRS(), toColumns(), toRows(), and toVector().

◆ nnz()

◆ nrows()

◆ operator*=()

template<class Scalar, class SparseIndexInt = int>
MatrixAsTriplet & Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::operator*= ( Scalar const & scalar)
inline

Scaling.

Definition at line 426 of file triplet.hh.

◆ operator+=()

template<class Scalar, class SparseIndexInt = int>
MatrixAsTriplet & Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::operator+= ( MatrixAsTriplet< Scalar, SparseIndexInt > const & m)
inline

Matrix addition: (*this) += m (works also for matrices with non-matching sparsity pattern)

Definition at line 357 of file triplet.hh.

◆ operator-=()

template<class Scalar, class SparseIndexInt = int>
MatrixAsTriplet & Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::operator-= ( MatrixAsTriplet< Scalar, SparseIndexInt > const & m)
inline

Definition at line 389 of file triplet.hh.

◆ operator/=()

template<class Scalar, class SparseIndexInt = int>
MatrixAsTriplet & Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::operator/= ( Scalar const & scalar)
inline

Scaling.

Definition at line 435 of file triplet.hh.

◆ operator=() [1/2]

template<class Scalar, class SparseIndexInt = int>
MatrixAsTriplet & Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::operator= ( MatrixAsTriplet< Scalar, SparseIndexInt > && other)
default

Move assignment.

◆ operator=() [2/2]

template<class Scalar, class SparseIndexInt = int>
MatrixAsTriplet & Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::operator= ( MatrixAsTriplet< Scalar, SparseIndexInt > const & m)
default

Assignment.

◆ print()

template<class Scalar, class SparseIndexInt = int>
std::ostream & Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::print ( std::ostream & out = std::cout,
double threshold = 0.0 ) const
inline

Output as Matlab source code.

Definition at line 490 of file triplet.hh.

Referenced by Kaskade::operator<<().

◆ reserve()

template<class Scalar, class SparseIndexInt = int>
void Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::reserve ( size_t s)
inline

Reserve memory.

Definition at line 242 of file triplet.hh.

Referenced by MatrixAsTriplet().

◆ resize()

template<class Scalar, class SparseIndexInt = int>
void Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::resize ( size_t s)
inline

Resizes the memory.

Existing values are preserved if s >= nnz(), and the new entries are undefined. For s<nnz(), all the values are undefined.

Definition at line 234 of file triplet.hh.

Referenced by MatrixAsTriplet(), MatrixAsTriplet(), and MatrixAsTriplet().

◆ scaleRows()

template<class Scalar, class SparseIndexInt = int>
void Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::scaleRows ( std::vector< Scalar >const & scaling)
inline

Definition at line 446 of file triplet.hh.

◆ setStartToZero()

template<class Scalar, class SparseIndexInt = int>
void Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::setStartToZero ( )
inline

Shift the row and column indices such that \( A_{00} \) is (structurally) nonzero.

Definition at line 193 of file triplet.hh.

◆ shiftIndices()

template<class Scalar, class SparseIndexInt = int>
void Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::shiftIndices ( SparseIndexInt row,
SparseIndexInt col )
inline

Shifts matrix indices. Can be used together with += to concatenate sparese matrices.

Definition at line 334 of file triplet.hh.

Referenced by Kaskade::LagrangeOperator< NormalStepAssembler, TangentialStepAssembler, stateId, controlId, adjointId >::getTriplet(), and setStartToZero().

◆ size()

template<class Scalar, class SparseIndexInt = int>
size_t Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::size ( ) const
inline

get number of entries in sparse matrix

Definition at line 598 of file triplet.hh.

Referenced by toBCRS().

◆ toBCRS()

template<class Scalar, class SparseIndexInt = int>
template<int bcrsN = 1>
std::unique_ptr< Dune::BCRSMatrix< Dune::FieldMatrix< Scalar, bcrsN, bcrsN > > > Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::toBCRS ( ) const
inline

copy to Dune::BCRSMatrix

Definition at line 613 of file triplet.hh.

◆ toColumns()

template<class Scalar, class SparseIndexInt = int>
void Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::toColumns ( std::vector< std::vector< Scalar > > & colsvector) const
inline

transform into a set of column vectors

Definition at line 500 of file triplet.hh.

◆ toFile()

template<class Scalar, class SparseIndexInt = int>
void Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::toFile ( const char * filename,
unsigned int precision = 10 ) const
inline

write to text file

Definition at line 601 of file triplet.hh.

◆ toRows()

template<class Scalar, class SparseIndexInt = int>
void Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::toRows ( std::vector< std::vector< Scalar > > & rows) const
inline

Definition at line 513 of file triplet.hh.

◆ toVector()

template<class Scalar, class SparseIndexInt = int>
void Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::toVector ( std::vector< Scalar > & colsvector)
inline

Definition at line 526 of file triplet.hh.

◆ transpose()

template<class Scalar, class SparseIndexInt = int>
MatrixAsTriplet & Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::transpose ( )
inline

Transposition.

Definition at line 453 of file triplet.hh.

◆ usmtv()

template<class Scalar, class SparseIndexInt = int>
template<class X, class Y>
void Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::usmtv ( Scalar const alpha,
X const & x,
Y & y ) const
inline

Matrix-vector multiplication.

\( x = x + \alpha A^{T}y \)

Definition at line 296 of file triplet.hh.

◆ usmv()

template<class Scalar, class SparseIndexInt = int>
template<class X, class Y>
void Kaskade::MatrixAsTriplet< Scalar, SparseIndexInt >::usmv ( Scalar const alpha,
X const & x,
Y & y ) const
inline

scaled matrix-vector multiplication

Definition at line 304 of file triplet.hh.

Member Data Documentation

◆ cidx

◆ data

◆ ridx


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