3#include <boost/numeric/mtl/vector/dense_vector.hpp>
5#include <dune/common/ftraits.hh>
7#include <amdis/Output.hpp>
8#include <amdis/common/FakeContainer.hpp>
9#include <amdis/linearalgebra/VectorBase.hpp>
10#include <amdis/typetree/MultiIndex.hpp>
14 class DefaultIndexDistribution;
38 using field_type =
typename Dune::FieldTraits<value_type>::field_type;
59 return mtl::vec::size(vector_);
64 template <
class Basis>
65 void init(Basis
const& basis,
bool clear)
67 vector_.change_dim(basis.dimension());
73 template <
class MultiIndex>
77 test_exit_dbg(i <
size(),
"Index {} out of range [0,{})", i,
size());
82 template <
class MultiIndex>
86 test_exit_dbg(i <
size(),
"Index {} out of range [0,{})", i,
size());
96 vector_ += alpha * x.vector_;
103 vector_ = alpha * vector_ + x.vector_;
130 struct ForEach<MTLVector<T>> : ForEach<VectorBase<MTLVector<T>>> {};
133 struct Transform<MTLVector<T>> : Transform<VectorBase<MTLVector<T>>> {};
136 struct InnerProduct<MTLVector<T>> : InnerProduct<VectorBase<MTLVector<T>>> {};
Dummy implementation for sequential index "distribution".
Definition IndexDistribution.hpp:7
The basic container that stores a base vector data.
Definition VectorBackend.hpp:20
value_type & at(MultiIndex const &idx)
Access the entry i of the vector with read-access.
Definition VectorBackend.hpp:74
value_type const & at(MultiIndex const &idx) const
Access the entry i of the vector with read-access.
Definition VectorBackend.hpp:83
typename BaseVector::value_type value_type
The type of the elements of the DOFVector.
Definition VectorBackend.hpp:28
Self & axpy(const value_type &alpha, const Self &x)
Implements *this = *this + alpha * x.
Definition VectorBackend.hpp:94
void scale(const value_type &alpha)
scale all entries by the factor alpha
Definition VectorBackend.hpp:114
typename BaseVector::size_type size_type
The index/size - type.
Definition VectorBackend.hpp:31
Self & aypx(const value_type &alpha, const Self &x)
Implements *this = alpha * (*this) + x.
Definition VectorBackend.hpp:101
void init(Basis const &basis, bool clear)
Resize the vector_ to the size s.
Definition VectorBackend.hpp:65
BaseVector & vector()
Return the data-vector vector_.
Definition VectorBackend.hpp:51
MTLVector(DefaultIndexDistribution const &)
Constructor. Constructs new BaseVector.
Definition VectorBackend.hpp:42
BaseVector const & vector() const
Return the data-vector vector_.
Definition VectorBackend.hpp:45
void set(const value_type &alpha)
Set all entries to alpha.
Definition VectorBackend.hpp:108
std::size_t size() const
Return the current size of the vector_.
Definition VectorBackend.hpp:57
mtl::dense_vector< T > BaseVector
The type of the base vector.
Definition VectorBackend.hpp:25
CRTP base class for flat vector backends.
Definition VectorBase.hpp:19