32template <
class Tag,
class TagV>
37template <
class Tag,
class TagV>
41 const auto& vx = x.
impl()->
get<TagV>();
47template <
class Tag,
class TagV>
51 const auto& vx = x.
impl()->
get<TagV>();
58template <
class Tag,
class TagV>
62 const auto& vx = x.
impl()->
get<TagV>();
69template <
class Tag,
class TagV>
73 const auto& vx = x.
impl()->
get<TagV>();
79template <
class Tag,
class TagV>
82 const auto& ma = a.
impl()->
get<Tag>();
83 const auto& vx = x.
impl()->
get<TagV>();
84 auto& vr = r.
impl()->
get<TagV>(
true);
85 ALIEN_ASSERT((ma.colSpace() == vx.space() && ma.rowSpace() == vr.space()),
86 (
"Incompatible spaces"));
93template <
class Tag,
class TagV>
96 const auto& vx = x.
impl()->
get<TagV>();
97 auto& vr = r.
impl()->
get<TagV>(
true);
98 ALIEN_ASSERT((vx.space() == vr.space()), (
"Incompatible spaces"));
105template <
class Tag,
class TagV>
108 const auto& vx = x.
impl()->
get<TagV>();
109 auto& vy = y.
impl()->
get<TagV>(
true);
110 ALIEN_ASSERT((vx.space() == vy.space()), (
"Incompatible spaces"));
116template <
class Tag,
class TagV>
119 const auto& vx = x.
impl()->
get<TagV>();
120 auto& vr = r.
impl()->
get<TagV>(
true);
121 ALIEN_ASSERT((vx.space() == vr.space()), (
"Incompatible spaces"));
127template <
class Tag,
class TagV>
130 const auto& vx = x.
impl()->
get<TagV>();
131 const auto& vy = y.
impl()->
get<TagV>();
132 ALIEN_ASSERT((vx.space() == vy.space()), (
"Incompatible space"));
138template <
class Tag,
class TagV>
141 auto& vx = x.
impl()->
get<TagV>(
true);
142 const auto& ma = a.
impl()->
get<Tag>();
143 ALIEN_ASSERT((ma.rowSpace() == ma.colSpace()), (
"Matrix not square"));
144 ALIEN_ASSERT((ma.rowSpace() == vx.space()), (
"Incompatible space"));
151template <
class Tag,
class TagV>
154 auto& vx = x.
impl()->
get<TagV>(
true);
161template <
class Tag,
class TagV>
164 auto& vx = x.
impl()->
get<TagV>(
true);
171template <
class Tag,
class TagV>
175 auto& vw = w.
impl()->
get<TagV>(
true);
176 const auto& vx = x.
impl()->
get<TagV>();
177 const auto& vy = y.
impl()->
get<TagV>();
178 ALIEN_ASSERT((vy.space() == vx.space()), (
"Incompatible space"));
179 ALIEN_ASSERT((vw.space() == vx.space()), (
"Incompatible space"));
188template <
class Tag,
class TagV>
191 auto const& ma = a.
impl()->
get<Tag>();
198template <
class Tag,
class TagV>
201 auto const& vx = x.
impl()->
get<TagV>();
Interface for all matrices.
virtual MultiMatrixImpl * impl()=0
Get the multimatrix implementation.
Interface for all vectors.
virtual MultiVectorImpl * impl()=0
Get the multivector implementation.
virtual ~LinearAlgebra()
Free resources.
Real normInf(const IVector &x) const
Compute LInf norm of a vector.
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 diagonal(const IMatrix &a, IVector &x) const
Extract the diagonal of a matrix in a vector.
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 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
The linear algebra kernel.
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.
const AlgebraTraits< tag >::matrix_type & get() const
Get a specific matrix implementation.
const AlgebraTraits< tag >::vector_type & get() const
Get a specific vector implementation.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --