Class template Dune::XT::LA::VectorInterface

template<class Traits, class ScalarImp>
class Dune::XT::LA::VectorInterface

CRTP base interface for vector containers, providing access, arithmetic, norms and dot products.

inline size_t Dune::XT::LA::VectorInterface::size() const

The size of the vector.

:returns: The size of the vector.

inline void Dune::XT::LA::VectorInterface::resize(const size_t new_size)

Note

This is supposed to do nothing if new_size == size()

inline void Dune::XT::LA::VectorInterface::add_to_entry(const size_t ii, const ScalarType &value)

Add a scalar to the iith entry.

inline void Dune::XT::LA::VectorInterface::set_entry(const size_t ii, const ScalarType &value)

Set the iith entry to given scalar.

inline ScalarType Dune::XT::LA::VectorInterface::get_entry(const size_t ii) const

Get the iith entry.

inline ScalarType &Dune::XT::LA::VectorInterface::get_unchecked_ref(const size_t ii)

The purpose of get_unchecked_ref is to allow direct access to the underlying data without any checks (regarding cow or thread safety). This allows default implementations in the interface with locking prior to for-loops.

inline const ScalarType &Dune::XT::LA::VectorInterface::get_unchecked_ref(const size_t ii) const

No documentation provided.

virtual void Dune::XT::LA::VectorInterface::set_all(const ScalarType &val)

\ }

Provided by the interface for convenience!

Note

Those marked as virtual may be implemented more efficiently in a derived class! \ {

virtual bool Dune::XT::LA::VectorInterface::valid() const

No documentation provided.

inline ScalarType &Dune::XT::LA::VectorInterface::operator[](const size_t ii)

Get writable reference to the iith entry.

inline const ScalarType &Dune::XT::LA::VectorInterface::operator[](const size_t ii) const

Get read-only reference to the iith entry.

virtual ScalarType Dune::XT::LA::VectorInterface::min() const

No documentation provided.

virtual ScalarType Dune::XT::LA::VectorInterface::max() const

No documentation provided.

virtual ScalarType Dune::XT::LA::VectorInterface::mean() const

No documentation provided.

virtual std::pair<size_t, RealType> Dune::XT::LA::VectorInterface::amax() const

The maximum absolute value of the vector.

Note

If you override this method please use exceptions instead of assertions (for the python bindings).

:returns: A pair of the highest index at which the maximum is attained and the absolute maximum value.

virtual bool Dune::XT::LA::VectorInterface::almost_equal(const derived_type &other, const ScalarType epsilon = <recovery-expr>()) const

Check vectors for equality. Equality of two vectors is defined as in Dune::FloatCmp componentwise.

Note

If you override this method please use exceptions instead of assertions (for the python bindings).

See also: Dune::Common::FloatCmp

:param other: A vector of same size to compare with. :param epsilon: See Dune::FloatCmp. :returns: Truth value of the comparison.

virtual ScalarType Dune::XT::LA::VectorInterface::dot(const derived_type &other) const

Computes the scalar products between two vectors.

Note

If you override this method please use exceptions instead of assertions (for the python bindings).

:param other: The second factor. :returns: The scalar product.

virtual RealType Dune::XT::LA::VectorInterface::l1_norm() const

The l1-norm of the vector.

Note

If you override this method please use exceptions instead of assertions (for the python bindings).

:returns: The l1-norm of the vector.

RealType Dune::XT::LA::VectorInterface::one_norm() const

No documentation provided.

virtual RealType Dune::XT::LA::VectorInterface::l2_norm() const

The l2-norm of the vector.

Note

If you override this method please use exceptions instead of assertions (for the python bindings).

:returns: The l2-norm of the vector.

RealType Dune::XT::LA::VectorInterface::two_norm() const

No documentation provided.

virtual RealType Dune::XT::LA::VectorInterface::sup_norm() const

The l-infintiy-norm of the vector.

Note

If you override this method please use exceptions instead of assertions (for the python bindings).

:returns: The l-infintiy-norm of the vector.

RealType Dune::XT::LA::VectorInterface::inf_norm() const

No documentation provided.

virtual ScalarType Dune::XT::LA::VectorInterface::standard_deviation() const

No documentation provided.

virtual void Dune::XT::LA::VectorInterface::add(const derived_type &other, derived_type &result) const

Adds two vectors.

Note

If you override this method please use exceptions instead of assertions (for the python bindings).

Note

If you are looking for the old (now deprecated) add() method,

See also: add_to_entry

:param other: The right summand. :param result: Vector to write the result of this + other to

virtual derived_type Dune::XT::LA::VectorInterface::add(const derived_type &other) const

Adds two vectors.

Note

If you override this method please use exceptions instead of assertions (for the python bindings).

Note

If you are looking for the old (now deprecated) add() method,

See also: add_to_entry

:param other: The right summand. :returns: The sum of this and other.

virtual void Dune::XT::LA::VectorInterface::iadd(const derived_type &other)

Inplace variant of add().

Note

If you override this method please use exceptions instead of assertions (for the python bindings).

:param other: The right summand.

virtual void Dune::XT::LA::VectorInterface::sub(const derived_type &other, derived_type &result) const

Subtracts two vectors.

Note

If you override this method please use exceptions instead of assertions (for the python bindings).

:param other: The subtrahend. :param result: The vectror to write the difference between this and other to.

virtual derived_type Dune::XT::LA::VectorInterface::sub(const derived_type &other) const

Subtracts two vectors.

Note

If you override this method please use exceptions instead of assertions (for the python bindings).

:param other: The subtrahend. :returns: The difference between this and other.

virtual void Dune::XT::LA::VectorInterface::isub(const derived_type &other)

Inplace variant of sub().

Note

If you override this method please use exceptions instead of assertions (for the python bindings).

:param other: The subtrahend.

virtual ScalarType Dune::XT::LA::VectorInterface::operator*(const derived_type &other) const

Computes the scalar products between this and another vector.

See also: dot

:param other: The second factor. :returns: The scalar product.

virtual derived_type &Dune::XT::LA::VectorInterface::operator+=(const derived_type &other)

Adds another vector to this, in-place variant.

:param other: The second summand. :returns: The sum of this and other.

virtual derived_type &Dune::XT::LA::VectorInterface::operator-=(const derived_type &other)

Subtracts another vector from this, in-place variant.

:param other: The subtrahend. :returns: The difference between this and other.

virtual derived_type Dune::XT::LA::VectorInterface::operator+(const derived_type &other) const

Adds two vectors.

:param other: The second summand. :returns: The sum of the two vectors.

virtual derived_type Dune::XT::LA::VectorInterface::operator-(const derived_type &other) const

Substracts two vectors.

:param other: The subtrahend :returns: The difference.

derived_type &Dune::XT::LA::VectorInterface::operator/=(const ScalarType &scalar) override

No documentation provided.

bool Dune::XT::LA::VectorInterface::operator==(const derived_type &other) const

Check vectors for equality (componentwise) using almost_equal()

See also: almost_equal

:param other: A vector of same size to compare with. :returns: Truth value of the comparison.

bool Dune::XT::LA::VectorInterface::operator!=(const derived_type &other) const

Check vectors for inequality using !almost_equal()

:param other: A vector of same size to compare with. :returns: Truth value of the comparison.

iterator Dune::XT::LA::VectorInterface::begin()

No documentation provided.

const_iterator Dune::XT::LA::VectorInterface::begin() const

No documentation provided.

iterator Dune::XT::LA::VectorInterface::end()

No documentation provided.

const_iterator Dune::XT::LA::VectorInterface::end() const

No documentation provided.

template<>
Dune::XT::LA::VectorInterface::~VectorInterface<Traits, ScalarImp>() override = default

No documentation provided.

const Backends Dune::XT::LA::VectorInterface::dense_matrix_type

No documentation provided.

const Backends Dune::XT::LA::VectorInterface::sparse_matrix_type

No documentation provided.

type Dune::XT::LA::VectorInterface::BaseType

No documentation provided.

type Dune::XT::LA::VectorInterface::const_iterator

No documentation provided.

type Dune::XT::LA::VectorInterface::iterator

No documentation provided.

template<class Vector>
int Dune::XT::LA::VectorInterface::assign_from(const Vector &other)

No documentation provided.

template<class T, class S>
derived_type &Dune::XT::LA::VectorInterface::operator=(const VectorInterface<T, S> &other)

No documentation provided.

template<class T>
bool Dune::XT::LA::VectorInterface::almost_equal(const int &other, const ScalarType epsilon = <recovery-expr>()) const

Check vectors for equality (variant for arbitrary derived combinations). Equality of two vectors is defined as in Dune::FloatCmp componentwise.

See also: Dune::Common::FloatCmp

:param other: A vector of same size to compare with. :param epsilon: See Dune::FloatCmp. :returns: Truth value of the comparison.

template<class T, class S>
derived_type &Dune::XT::LA::VectorInterface::operator+=(const VectorInterface<T, S> &other)

No documentation provided.

template<class T, class S>
derived_type &Dune::XT::LA::VectorInterface::operator-=(const VectorInterface<T, S> &other)

No documentation provided.

template<class T, class S>
derived_type Dune::XT::LA::VectorInterface::operator+(const VectorInterface<T, S> &other) const

No documentation provided.

template<class T, class S>
derived_type Dune::XT::LA::VectorInterface::operator-(const VectorInterface<T, S> &other) const

No documentation provided.