5#include <dune/common/ftraits.hh>
7#include <amdis/Output.hpp>
8#include <amdis/algorithm/ForEach.hpp>
9#include <amdis/algorithm/Transform.hpp>
10#include <amdis/common/FakeContainer.hpp>
11#include <amdis/linearalgebra/VectorBase.hpp>
12#include <amdis/typetree/MultiIndex.hpp>
16 class DefaultIndexDistribution;
40 using field_type =
typename Dune::FieldTraits<value_type>::field_type;
61 return vector_.size();
66 template <
class Basis>
67 void init(Basis
const& basis,
bool clear)
69 vector_.resize(basis.dimension());
76 template <
class MultiIndex>
80 test_exit_dbg(i <
size(),
"Index {} out of range [0,{})", i,
size());
81 return vector_.coeffRef(i);
85 template <
class MultiIndex>
89 test_exit_dbg(i <
size(),
"Index {} out of range [0,{})", i,
size());
90 return vector_.coeff(i);
100 vector_ += alpha * x.vector_;
107 vector_ = alpha * vector_ + x.vector_;
114 vector_.setConstant(alpha);
134 struct ForEach<EigenVector<T>> : ForEach<VectorBase<EigenVector<T>>> {};
137 struct Transform<EigenVector<T>> : Transform<VectorBase<EigenVector<T>>> {};
140 struct InnerProduct<EigenVector<T>> : InnerProduct<VectorBase<EigenVector<T>>> {};
Dummy implementation for sequential index "distribution".
Definition IndexDistribution.hpp:7
The basic container that stores a base vector and a corresponding basis.
Definition VectorBackend.hpp:22
value_type & at(MultiIndex const &idx)
Access the entry i of the vector with write-access.
Definition VectorBackend.hpp:77
value_type const & at(MultiIndex const &idx) const
Access the entry i of the vector with read-access.
Definition VectorBackend.hpp:86
typename BaseVector::Index size_type
The index/size - type.
Definition VectorBackend.hpp:33
typename BaseVector::Scalar value_type
The type of the elements of the DOFVector.
Definition VectorBackend.hpp:30
Self & axpy(const value_type &alpha, const Self &x)
Implements *this = *this + alpha * x.
Definition VectorBackend.hpp:98
void scale(const value_type &alpha)
scale all entries by the factor alpha
Definition VectorBackend.hpp:118
size_type size() const
Return the current size of the vector_.
Definition VectorBackend.hpp:59
EigenVector(DefaultIndexDistribution const &)
Constructor. Constructs new BaseVector.
Definition VectorBackend.hpp:44
Self & aypx(const value_type &alpha, const Self &x)
Implements *this = alpha * (*this) + x.
Definition VectorBackend.hpp:105
void init(Basis const &basis, bool clear)
Resize the vector_ to the size s.
Definition VectorBackend.hpp:67
Eigen::Matrix< T, Eigen::Dynamic, 1 > BaseVector
The type of the base vector.
Definition VectorBackend.hpp:27
BaseVector & vector()
Return the data-vector vector_.
Definition VectorBackend.hpp:53
BaseVector const & vector() const
Return the data-vector vector_.
Definition VectorBackend.hpp:47
void set(const value_type &alpha)
Set all entries to alpha.
Definition VectorBackend.hpp:112
CRTP base class for flat vector backends.
Definition VectorBase.hpp:19