Alien  1.3.0
User documentation
Loading...
Searching...
No Matches
Alien::IInternalLinearAlgebra< M, V > Class Template Referenceabstract

Internal linear algebra interface. More...

#include <core/alien/core/backend/IInternalLinearAlgebraT.h>

Public Types

typedef M Matrix
 Type of the matrix used.
typedef V Vector
 Type of the vector used.
typedef IInternalLinearAlgebra< Matrix, Vector > *(* Factory) ()
 Type of the the linear algebra.
using MatrixType = Matrix
using VectorType = Vector
using ValueType = Real

Public Member Functions

virtual ~IInternalLinearAlgebra ()
 Free resources.
virtual Real norm0 (const Vector &x) const =0
 Compute L0 norm of a vector.
virtual Real norm1 (const Vector &x) const =0
 Compute L1 norm of a vector.
virtual Real norm2 (const Vector &x) const =0
 Compute L2 norm of a vector.
virtual Real normInf (const Vector &x) const =0
 Compute LInf norm of a vector.
virtual void mult (const Matrix &a, const Vector &x, Vector &r) const =0
 Compute a matrix vector product.
virtual void axpy (Real alpha, const Vector &x, Vector &y) const =0
 Scale a vector by a factor and adds the result to another vector.
virtual void aypx (Real alpha, Vector &y, const Vector &x) const =0
 Scale a vector by a factor and adds the result to another vector.
virtual void copy (const Vector &x, Vector &r) const =0
 Copy a vector in another one.
virtual Real dot (const Vector &x, const Vector &y) const =0
 Compute the dot product of two vectors.
virtual void scal (Real alpha, Vector &x) const =0
 Scale a vector by a factor.
virtual void diagonal (const Matrix &a, Vector &x) const =0
 Extract the diagonal of a matrix in a vector.
virtual void reciprocal (Vector &x) const =0
 Compute the reciprocal of a vector.
virtual void pointwiseMult (const Vector &x, const Vector &y, Vector &w) const =0
 Compute the point wise multiplication of two vectors and store the result in another one.
virtual void dump (Matrix const &a, std::string const &filename) const
 Dumps a matrix to a file.
virtual void dump (Vector const &x, std::string const &filename) const
 Dumps a vector to a file.

Detailed Description

template<class M, class V>
class Alien::IInternalLinearAlgebra< M, V >

Internal linear algebra interface.

Internal interface for all linear algebra package

Template Parameters
MThe type of matrix used
VThe type of vector used

Definition at line 33 of file IInternalLinearAlgebraT.h.

Member Typedef Documentation

◆ Factory

template<class M, class V>
typedef IInternalLinearAlgebra< Matrix, Vector > *(* Alien::IInternalLinearAlgebra< M, V >::Factory) ()

Type of the the linear algebra.

Definition at line 41 of file IInternalLinearAlgebraT.h.

◆ Matrix

template<class M, class V>
typedef M Alien::IInternalLinearAlgebra< M, V >::Matrix

Type of the matrix used.

Definition at line 37 of file IInternalLinearAlgebraT.h.

◆ MatrixType

template<class M, class V>
using Alien::IInternalLinearAlgebra< M, V >::MatrixType = Matrix

Definition at line 43 of file IInternalLinearAlgebraT.h.

◆ ValueType

template<class M, class V>
using Alien::IInternalLinearAlgebra< M, V >::ValueType = Real

Definition at line 45 of file IInternalLinearAlgebraT.h.

◆ Vector

template<class M, class V>
typedef V Alien::IInternalLinearAlgebra< M, V >::Vector

Type of the vector used.

Definition at line 39 of file IInternalLinearAlgebraT.h.

◆ VectorType

template<class M, class V>
using Alien::IInternalLinearAlgebra< M, V >::VectorType = Vector

Definition at line 44 of file IInternalLinearAlgebraT.h.

Constructor & Destructor Documentation

◆ ~IInternalLinearAlgebra()

template<class M, class V>
virtual Alien::IInternalLinearAlgebra< M, V >::~IInternalLinearAlgebra ( )
inlinevirtual

Free resources.

Definition at line 49 of file IInternalLinearAlgebraT.h.

Member Function Documentation

◆ axpy()

template<class M, class V>
virtual void Alien::IInternalLinearAlgebra< M, V >::axpy ( Real alpha,
const Vector & x,
Vector & y ) const
pure virtual

Scale a vector by a factor and adds the result to another vector.

Scale the vector x by the real value alpha and add the result to the vector y : y += alpha * x

Parameters
[in]alphaThe real value to scale with
[in]xThe vector to be scaled
[in,out]yThe resulting vector

◆ aypx()

template<class M, class V>
virtual void Alien::IInternalLinearAlgebra< M, V >::aypx ( Real alpha,
Vector & y,
const Vector & x ) const
pure virtual

Scale a vector by a factor and adds the result to another vector.

Scale the vector y by the real value alpha and add the values of x : alpha * y += x

Parameters
[in]alphaThe real value to scale with
[in,out]yThe vector to be scaled
[in]xThe vector to add

◆ copy()

template<class M, class V>
virtual void Alien::IInternalLinearAlgebra< M, V >::copy ( const Vector & x,
Vector & r ) const
pure virtual

Copy a vector in another one.

Parameters
[in]xThe vector to copy
[in,out]rThe copied vector

◆ diagonal()

template<class M, class V>
virtual void Alien::IInternalLinearAlgebra< M, V >::diagonal ( const Matrix & a,
Vector & x ) const
pure virtual

Extract the diagonal of a matrix in a vector.

Parameters
[in]aThe matrix to extract the diagonal
[in,out]xThe diagonal elements of the matrix stored in a vector

◆ dot()

template<class M, class V>
virtual Real Alien::IInternalLinearAlgebra< M, V >::dot ( const Vector & x,
const Vector & y ) const
pure virtual

Compute the dot product of two vectors.

Parameters
[in]xThe first vector
[in]yThe second vector
Returns
The dot product of x * y

◆ dump() [1/2]

template<class M, class V>
virtual void Alien::IInternalLinearAlgebra< M, V >::dump ( Matrix const & a,
std::string const & filename ) const
inlinevirtual

Dumps a matrix to a file.

Parameters
[in]aThe matrix to dump
[in]filenameThe name of the file

Definition at line 166 of file IInternalLinearAlgebraT.h.

◆ dump() [2/2]

template<class M, class V>
virtual void Alien::IInternalLinearAlgebra< M, V >::dump ( Vector const & x,
std::string const & filename ) const
inlinevirtual

Dumps a vector to a file.

Parameters
[in]xThe vector to dump
[in]filenameThe name of the file

Definition at line 178 of file IInternalLinearAlgebraT.h.

◆ mult()

template<class M, class V>
virtual void Alien::IInternalLinearAlgebra< M, V >::mult ( const Matrix & a,
const Vector & x,
Vector & r ) const
pure virtual

Compute a matrix vector product.

Compute the matrix-vector product a by x and store it in r : r = a * x

Parameters
[in]aThe matrix to be multiplied
[in]xThe vector to be multipled
[in,out]rThe resulting vector

◆ norm0()

template<class M, class V>
virtual Real Alien::IInternalLinearAlgebra< M, V >::norm0 ( const Vector & x) const
pure virtual

Compute L0 norm of a vector.

Parameters
[in]xThe vector on which norm0 is computed
Returns
The norm0 of the vector

◆ norm1()

template<class M, class V>
virtual Real Alien::IInternalLinearAlgebra< M, V >::norm1 ( const Vector & x) const
pure virtual

Compute L1 norm of a vector.

Parameters
[in]xThe vector on which norm0 is computed
Returns
The norm1 of the vector

◆ norm2()

template<class M, class V>
virtual Real Alien::IInternalLinearAlgebra< M, V >::norm2 ( const Vector & x) const
pure virtual

Compute L2 norm of a vector.

Parameters
[in]xThe vector on which norm2 is computed
Returns
The norm2 of the vector

◆ normInf()

template<class M, class V>
virtual Real Alien::IInternalLinearAlgebra< M, V >::normInf ( const Vector & x) const
pure virtual

Compute LInf norm of a vector.

Parameters
[in]xThe vector on which normInf is computed
Returns
The normInf of the vector

◆ pointwiseMult()

template<class M, class V>
virtual void Alien::IInternalLinearAlgebra< M, V >::pointwiseMult ( const Vector & x,
const Vector & y,
Vector & w ) const
pure virtual

Compute the point wise multiplication of two vectors and store the result in another one.

Parameters
[in]xThe first vector
[in]yThe second vector
[in,out]wThe resulting vector

◆ reciprocal()

template<class M, class V>
virtual void Alien::IInternalLinearAlgebra< M, V >::reciprocal ( Vector & x) const
pure virtual

Compute the reciprocal of a vector.

Parameters
[in,out]xThe vector to be processed

◆ scal()

template<class M, class V>
virtual void Alien::IInternalLinearAlgebra< M, V >::scal ( Real alpha,
Vector & x ) const
pure virtual

Scale a vector by a factor.

Parameters
[in]alphaThe real value to scale with
[in,out]xThe vector to be scaled

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