13#include <alien/utils/Precomp.h>
18#include <alien/core/backend/BackEnd.h>
19#include <alien/core/backend/IInternalLinearAlgebraT.h>
48template <
class Tag,
class TagV = Tag>
60 template <
typename... T>
184 void mult(
const IMatrix& a,
const UniqueArray<Real>& x, UniqueArray<Real>& r)
const;
196 void axpy(
const Real& alpha,
const UniqueArray<Real>& x, UniqueArray<Real>& r)
const;
207 void aypx(Real alpha, UniqueArray<Real>& y,
const UniqueArray<Real>& x)
const;
215 void copy(
const UniqueArray<Real>& x, UniqueArray<Real>& r)
const;
225 Integer local_size,
const UniqueArray<Real>& x,
const UniqueArray<Real>& y)
const;
232 void scal(Real alpha, UniqueArray<Real>& x)
const;
Interface for linear algebra.
Interface for all matrices.
Interface for all vectors.
void mult(const IMatrix &a, const UniqueArray< Real > &x, UniqueArray< Real > &r) const
Compute a matrix vector product.
virtual ~LinearAlgebra()
Free resources.
void copy(const UniqueArray< Real > &x, UniqueArray< Real > &r) const
Copy a vector in another one.
void dump(IVector const &x, std::string const &filename) const
Dumps a vector to a file.
Real normInf(const IVector &x) const
Compute LInf norm of a vector.
LinearAlgebra(T... args)
Creates a linear algebra.
void reciprocal(IVector &x) const
Compute the reciprocal of a vector.
Real norm2(const IVector &x) const
Compute L2 norm of a vector.
void scal(Real alpha, IVector &x) const
Scale a vector by a factor.
void axpy(const Real &alpha, const UniqueArray< Real > &x, UniqueArray< Real > &r) const
Scale a vector by a factor and adds the result to another vector.
void aypx(Real alpha, UniqueArray< Real > &y, const UniqueArray< Real > &x) const
Scale a vector by a factor and adds the result to another vector.
void diagonal(const IMatrix &a, IVector &x) const
Extract the diagonal of a matrix in a vector.
AlgebraTraits< Tag >::algebra_type KernelAlgebra
The type of the linear algebra.
Real dot(const IVector &x, const IVector &y) const
Compute the dot product of two vectors.
void axpy(Real alpha, const IVector &x, IVector &y) const
Scale a vector by a factor and adds the result to another vector.
void scal(Real alpha, UniqueArray< Real > &x) const
Scale a vector by a factor.
void copy(const IVector &x, IVector &r) const
Copy a vector in another one.
Real norm1(const IVector &x) const
Compute L1 norm of a vector.
std::unique_ptr< KernelAlgebra > m_algebra
Real dot(Integer local_size, const UniqueArray< Real > &x, const UniqueArray< Real > &y) const
Compute the dot product of two vectors.
void dump(IMatrix const &a, std::string const &filename) const
Dumps a matrix to a file.
Real norm0(const IVector &x) const
Compute L0 norm of a vector.
void mult(const IMatrix &a, const IVector &x, IVector &r) const
Compute a matrix vector product.
void pointwiseMult(const IVector &x, const IVector &y, IVector &w) const
Compute the point wise multiplication of two vectors and store the result in another one.
void aypx(Real alpha, IVector &y, const IVector &x) const
Scale a vector by a factor and adds the result to another vector.
Implementation of an algebraic space.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --