31template <
class Tag,
class TagV>
36template <
class Tag,
class TagV>
40 const auto& vx = x.
impl()->
get<TagV>();
46template <
class Tag,
class TagV>
50 const auto& vx = x.
impl()->
get<TagV>();
57template <
class Tag,
class TagV>
61 const auto& vx = x.
impl()->
get<TagV>();
68template <
class Tag,
class TagV>
72 const auto& vx = x.
impl()->
get<Tag>();
79template <
class Tag,
class TagV>
83 const auto& mx = x.
impl()->
get<Tag>();
89template <
class Tag,
class TagV>
92 const auto& ma = a.
impl()->
get<Tag>();
93 const auto& vx = x.
impl()->
get<TagV>();
94 auto& vr = r.
impl()->
get<TagV>(
true);
95 ALIEN_ASSERT((ma.colSpace() == vx.space() && ma.rowSpace() == vr.space()),
96 (
"Incompatible spaces"));
103template <
class Tag,
class TagV>
106 const auto& vx = x.
impl()->
get<TagV>();
107 auto& vr = r.
impl()->
get<TagV>(
true);
108 ALIEN_ASSERT((vx.space() == vr.space()), (
"Incompatible spaces"));
115template <
class Tag,
class TagV>
118 const auto& vx = x.
impl()->
get<TagV>();
119 auto& vy = y.
impl()->
get<TagV>(
true);
120 ALIEN_ASSERT((vx.space() == vy.space()), (
"Incompatible spaces"));
126template <
class Tag,
class TagV>
129 const auto& vx = x.
impl()->
get<TagV>();
130 auto& vr = r.
impl()->
get<TagV>(
true);
131 ALIEN_ASSERT((vx.space() == vr.space()), (
"Incompatible spaces"));
135template <
class Tag,
class TagV>
138 const auto& mx = x.
impl()->
get<TagV>();
139 auto& mr = r.
impl()->
get<TagV>(
true);
140 ALIEN_ASSERT((mx.rowSpace() == mr.rowSpace()), (
"Incompatible spaces"));
144template <
class Tag,
class TagV>
147 const auto& ma = a.
impl()->
get<Tag>();
148 auto& mb = b.
impl()->
get<Tag>(
true);
149 ALIEN_ASSERT((ma.rowSpace() == mb.rowSpace()), (
"Incompatible spaces"));
155template <
class Tag,
class TagV>
158 const auto& vx = x.
impl()->
get<TagV>();
159 const auto& vy = y.
impl()->
get<TagV>();
160 ALIEN_ASSERT((vx.space() == vy.space()), (
"Incompatible space"));
166template <
class Tag,
class TagV>
169 auto& vx = x.
impl()->
get<TagV>(
true);
170 const auto& ma = a.
impl()->
get<Tag>();
171 ALIEN_ASSERT((ma.rowSpace() == ma.colSpace()), (
"Matrix not square"));
172 ALIEN_ASSERT((ma.rowSpace() == vx.space()), (
"Incompatible space"));
179template <
class Tag,
class TagV>
182 auto& vx = x.
impl()->
get<TagV>(
true);
189template <
class Tag,
class TagV>
192 auto& vx = x.
impl()->
get<TagV>(
true);
196template <
class Tag,
class TagV>
199 auto& ma = A.
impl()->
get<Tag>(
true);
206template <
class Tag,
class TagV>
210 auto& vw = w.
impl()->
get<TagV>(
true);
211 const auto& vx = x.
impl()->
get<TagV>();
212 const auto& vy = y.
impl()->
get<TagV>();
213 ALIEN_ASSERT((vy.space() == vx.space()), (
"Incompatible space"));
214 ALIEN_ASSERT((vw.space() == vx.space()), (
"Incompatible space"));
221template <
class Tag,
class TagV>
223const IMatrix& a,
const UniqueArray<Real>& x, UniqueArray<Real>& r)
const
225 auto const& ma = a.
impl()->
get<Tag>();
232template <
class Tag,
class TagV>
241template <
class Tag,
class TagV>
250template <
class Tag,
class TagV>
252const Alien::UniqueArray<Real>& x, Alien::UniqueArray<Real>& r)
const
254 m_algebra->copy(x, r);
260template <
class Tag,
class TagV>
262Integer local_size,
const UniqueArray<Real>& x,
const UniqueArray<Real>& y)
const
270template <
class Tag,
class TagV>
273 m_algebra->scal(alpha, x);
279template <
class Tag,
class TagV>
282 auto const& ma = a.
impl()->
get<Tag>();
289template <
class Tag,
class TagV>
292 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.
Real norm0(const IVector &x) const
Compute L0 norm of a vector.
void aypx(Real alpha, IVector &y, const IVector &x) const
Scale a vector by a factor and adds the result to another vector.
void mult(const IMatrix &a, const IVector &x, IVector &r) const
Compute a matrix vector product.
std::unique_ptr< KernelAlgebraExpr > m_algebra
The linear algebra kernel.
Real normInf(const IVector &x) const
Compute LInf norm of a vector.
Real norm1(const IVector &x) const
Compute L1 norm of a vector.
void add(const IMatrix &a, IMatrix &b) const
Add two matrices A and B.
void copy(const IVector &x, IVector &r) const
Copy a vector in another one.
Real norm2(const IVector &x) const
Compute L2 norm of a vector.
void axpy(Real alpha, const IVector &x, IVector &y) const
Scale a vector by a factor and adds the result to another vector.
void dump(IMatrix const &a, std::string const &filename) const
Dumps a matrix to a file.
virtual ~LinearAlgebraExpr()
Free resources.
void reciprocal(IVector &x) const
Compute the reciprocal of a vector.
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 diagonal(const IMatrix &a, IVector &x) const
Extract the diagonal of a matrix in a vector.
void scal(Real alpha, IVector &x) const
Scale a vector by a factor.
Real dot(const IVector &x, const IVector &y) const
Compute the dot product of two vectors.
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 --