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

Internal linear algebra interface. More...

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

Collaboration diagram for Alien::IInternalLinearAlgebraExpr< M, V >:

Public Types

typedef M Matrix
 Type of the matrix used.
typedef V Vector
 Type of the vector used.
typedef IInternalLinearAlgebraExpr< Matrix, Vector > *(* Factory) ()
 Type of the the linear algebra.

Public Member Functions

virtual ~IInternalLinearAlgebraExpr ()
 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 Real norm2 (const Matrix &x) const =0
 Compute L2 (Frobenous) norm of a matrix.
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 void copy (const Matrix &a, Matrix &r) const =0
 Copy a matrix in another one.
virtual void add (const Matrix &a, Matrix &r) const =0
 Add a matrix to 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 scal (Real alpha, Matrix &a) const =0
 Scale a matrix 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.
virtual void mult (const Matrix &a, const UniqueArray< Real > &x, UniqueArray< Real > &r) const =0
 Compute a matrix vector product.
virtual void axpy (Real alpha, const UniqueArray< Real > &x, UniqueArray< Real > &y) const =0
 Scale a vector by a factor and adds the result to another vector.
virtual void aypx (Real alpha, UniqueArray< Real > &y, const UniqueArray< Real > &x) const =0
 Scale a vector by a factor and adds the result to another vector.
virtual void copy (const UniqueArray< Real > &x, UniqueArray< Real > &r) const =0
 Copy a vector in another one.
virtual Real dot (Integer local_size, const UniqueArray< Real > &x, const UniqueArray< Real > &y) const =0
 Compute the dot product of two vectors.
virtual void scal (Real alpha, UniqueArray< Real > &x) const =0
 Scale a vector by a factor.

Detailed Description

template<class M, class V>
class Alien::IInternalLinearAlgebraExpr< 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 38 of file IInternalLinearAlgebraExprT.h.

Member Typedef Documentation

◆ Factory

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

Type of the the linear algebra.

Definition at line 46 of file IInternalLinearAlgebraExprT.h.

◆ Matrix

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

Type of the matrix used.

Definition at line 42 of file IInternalLinearAlgebraExprT.h.

◆ Vector

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

Type of the vector used.

Definition at line 44 of file IInternalLinearAlgebraExprT.h.

Constructor & Destructor Documentation

◆ ~IInternalLinearAlgebraExpr()

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

Free resources.

Definition at line 50 of file IInternalLinearAlgebraExprT.h.

Member Function Documentation

◆ add()

template<class M, class V>
virtual void Alien::IInternalLinearAlgebraExpr< M, V >::add ( const Matrix & a,
Matrix & r ) const
pure virtual

Add a matrix to another one.

Parameters
[in]aThe matrix to copy
[in,out]rThe copied vector

◆ axpy() [1/2]

template<class M, class V>
virtual void Alien::IInternalLinearAlgebraExpr< M, V >::axpy ( Real alpha,
const UniqueArray< Real > & x,
UniqueArray< Real > & 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

◆ axpy() [2/2]

template<class M, class V>
virtual void Alien::IInternalLinearAlgebraExpr< 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() [1/2]

template<class M, class V>
virtual void Alien::IInternalLinearAlgebraExpr< M, V >::aypx ( Real alpha,
UniqueArray< Real > & y,
const UniqueArray< Real > & 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

◆ aypx() [2/2]

template<class M, class V>
virtual void Alien::IInternalLinearAlgebraExpr< 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() [1/3]

template<class M, class V>
virtual void Alien::IInternalLinearAlgebraExpr< M, V >::copy ( const Matrix & a,
Matrix & r ) const
pure virtual

Copy a matrix in another one.

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

◆ copy() [2/3]

template<class M, class V>
virtual void Alien::IInternalLinearAlgebraExpr< M, V >::copy ( const UniqueArray< Real > & x,
UniqueArray< Real > & r ) const
pure virtual

Copy a vector in another one.

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

◆ copy() [3/3]

template<class M, class V>
virtual void Alien::IInternalLinearAlgebraExpr< 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::IInternalLinearAlgebraExpr< 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() [1/2]

template<class M, class V>
virtual Real Alien::IInternalLinearAlgebraExpr< 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

◆ dot() [2/2]

template<class M, class V>
virtual Real Alien::IInternalLinearAlgebraExpr< M, V >::dot ( Integer local_size,
const UniqueArray< Real > & x,
const UniqueArray< Real > & y ) const
pure virtual

Compute the dot product of two vectors.

Parameters
[in]local_sizeThe size of the vectors
[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::IInternalLinearAlgebraExpr< 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
Todo
Implement this method

Definition at line 197 of file IInternalLinearAlgebraExprT.h.

◆ dump() [2/2]

template<class M, class V>
virtual void Alien::IInternalLinearAlgebraExpr< 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
Todo
Implement this method

Definition at line 209 of file IInternalLinearAlgebraExprT.h.

◆ mult() [1/2]

template<class M, class V>
virtual void Alien::IInternalLinearAlgebraExpr< M, V >::mult ( const Matrix & a,
const UniqueArray< Real > & x,
UniqueArray< Real > & 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

◆ mult() [2/2]

template<class M, class V>
virtual void Alien::IInternalLinearAlgebraExpr< 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::IInternalLinearAlgebraExpr< 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::IInternalLinearAlgebraExpr< 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() [1/2]

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

Compute L2 (Frobenous) norm of a matrix.

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

◆ norm2() [2/2]

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

Compute L2 norm of a vector.

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

◆ normInf()

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

Compute LInf norm of a vector.

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

◆ pointwiseMult()

template<class M, class V>
virtual void Alien::IInternalLinearAlgebraExpr< 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::IInternalLinearAlgebraExpr< M, V >::reciprocal ( Vector & x) const
pure virtual

Compute the reciprocal of a vector.

Parameters
[in,out]xThe vector to be processed

◆ scal() [1/3]

template<class M, class V>
virtual void Alien::IInternalLinearAlgebraExpr< M, V >::scal ( Real alpha,
Matrix & a ) const
pure virtual

Scale a matrix by a factor.

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

◆ scal() [2/3]

template<class M, class V>
virtual void Alien::IInternalLinearAlgebraExpr< M, V >::scal ( Real alpha,
UniqueArray< Real > & 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

◆ scal() [3/3]

template<class M, class V>
virtual void Alien::IInternalLinearAlgebraExpr< 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: