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

Inherits from Dune::XT::LA::ContainerInterface.

Friends Dune::XT::LA::VectorInterface::const_iterator, Dune::XT::LA::VectorInterface::iterator, operator<<(std::ostream &, const VectorInterface<T, S> &).

template<class Traits, class ScalarImp = typename Traits::ScalarType>
class Dune::XT::LA::VectorInterface<Traits, ScalarImp> : public ContainerInterface<Traits, ScalarImp>

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

Struct Dune::XT::LA::VectorInterface::complex_switch

template<class Traits, class ScalarImp = typename Traits::ScalarType>
struct Dune::XT::LA::VectorInterface<Traits, ScalarImp>::complex_switch

No documentation provided.

Method Dune::XT::LA::VectorInterface::complex_switch::min

template<class Traits, class ScalarImp = typename Traits::ScalarType>
static ScalarType Dune::XT::LA::VectorInterface<Traits, ScalarImp>::complex_switch::min(const derived_type &self)

No documentation provided.

Method Dune::XT::LA::VectorInterface::complex_switch::max

template<class Traits, class ScalarImp = typename Traits::ScalarType>
static ScalarType Dune::XT::LA::VectorInterface<Traits, ScalarImp>::complex_switch::max(const derived_type &self)

No documentation provided.

Function template Dune::XT::LA::VectorInterface::complex_switch::dot

template<class Traits, class ScalarImp = typename Traits::ScalarType>
template<class T>
static ScalarType Dune::XT::LA::VectorInterface<Traits, ScalarImp>::complex_switch::dot(const derived_type &self, const VectorInterface<T, ScalarType> &other)

No documentation provided.

Method Dune::XT::LA::VectorInterface::size

template<class Traits, class ScalarImp = typename Traits::ScalarType>
inline size_t Dune::XT::LA::VectorInterface<Traits, ScalarImp>::size() const

The size of the vector.

:returns: The size of the vector.

Method Dune::XT::LA::VectorInterface::resize

template<class Traits, class ScalarImp = typename Traits::ScalarType>
inline void Dune::XT::LA::VectorInterface<Traits, ScalarImp>::resize(const size_t new_size)

Note

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

Method Dune::XT::LA::VectorInterface::add_to_entry

template<class Traits, class ScalarImp = typename Traits::ScalarType>
inline void Dune::XT::LA::VectorInterface<Traits, ScalarImp>::add_to_entry(const size_t ii, const ScalarType &value)

Add a scalar to the iith entry.

Method Dune::XT::LA::VectorInterface::set_entry

template<class Traits, class ScalarImp = typename Traits::ScalarType>
inline void Dune::XT::LA::VectorInterface<Traits, ScalarImp>::set_entry(const size_t ii, const ScalarType &value)

Set the iith entry to given scalar.

Method Dune::XT::LA::VectorInterface::get_entry

template<class Traits, class ScalarImp = typename Traits::ScalarType>
inline ScalarType Dune::XT::LA::VectorInterface<Traits, ScalarImp>::get_entry(const size_t ii) const

Get the iith entry.

Method Dune::XT::LA::VectorInterface::get_unchecked_ref

template<class Traits, class ScalarImp = typename Traits::ScalarType>
inline ScalarType &Dune::XT::LA::VectorInterface<Traits, ScalarImp>::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.

Method Dune::XT::LA::VectorInterface::get_unchecked_ref

template<class Traits, class ScalarImp = typename Traits::ScalarType>
inline const ScalarType &Dune::XT::LA::VectorInterface<Traits, ScalarImp>::get_unchecked_ref(const size_t ii) const

No documentation provided.

Method Dune::XT::LA::VectorInterface::set_all

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual void Dune::XT::LA::VectorInterface<Traits, ScalarImp>::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! \ {

Method Dune::XT::LA::VectorInterface::valid

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual bool Dune::XT::LA::VectorInterface<Traits, ScalarImp>::valid() const

No documentation provided.

Method Dune::XT::LA::VectorInterface::operator[]

template<class Traits, class ScalarImp = typename Traits::ScalarType>
inline ScalarType &Dune::XT::LA::VectorInterface<Traits, ScalarImp>::operator[](const size_t ii)

Get writable reference to the iith entry.

Method Dune::XT::LA::VectorInterface::operator[]

template<class Traits, class ScalarImp = typename Traits::ScalarType>
inline const ScalarType &Dune::XT::LA::VectorInterface<Traits, ScalarImp>::operator[](const size_t ii) const

Get read-only reference to the iith entry.

Method Dune::XT::LA::VectorInterface::min

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual ScalarType Dune::XT::LA::VectorInterface<Traits, ScalarImp>::min() const

No documentation provided.

Method Dune::XT::LA::VectorInterface::max

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual ScalarType Dune::XT::LA::VectorInterface<Traits, ScalarImp>::max() const

No documentation provided.

Method Dune::XT::LA::VectorInterface::mean

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual ScalarType Dune::XT::LA::VectorInterface<Traits, ScalarImp>::mean() const

No documentation provided.

Method Dune::XT::LA::VectorInterface::amax

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual std::pair<size_t, RealType> Dune::XT::LA::VectorInterface<Traits, ScalarImp>::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.

Method Dune::XT::LA::VectorInterface::almost_equal

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual bool Dune::XT::LA::VectorInterface<Traits, ScalarImp>::almost_equal(const derived_type &other, const ScalarType epsilon = Common::FloatCmp::DefaultEpsilon<ScalarType>::value()) 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.

Method Dune::XT::LA::VectorInterface::dot

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual ScalarType Dune::XT::LA::VectorInterface<Traits, ScalarImp>::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.

Method Dune::XT::LA::VectorInterface::l1_norm

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual RealType Dune::XT::LA::VectorInterface<Traits, ScalarImp>::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.

Method Dune::XT::LA::VectorInterface::one_norm

template<class Traits, class ScalarImp = typename Traits::ScalarType>
RealType Dune::XT::LA::VectorInterface<Traits, ScalarImp>::one_norm() const

No documentation provided.

Method Dune::XT::LA::VectorInterface::l2_norm

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual RealType Dune::XT::LA::VectorInterface<Traits, ScalarImp>::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.

Method Dune::XT::LA::VectorInterface::two_norm

template<class Traits, class ScalarImp = typename Traits::ScalarType>
RealType Dune::XT::LA::VectorInterface<Traits, ScalarImp>::two_norm() const

No documentation provided.

Method Dune::XT::LA::VectorInterface::sup_norm

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual RealType Dune::XT::LA::VectorInterface<Traits, ScalarImp>::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.

Method Dune::XT::LA::VectorInterface::inf_norm

template<class Traits, class ScalarImp = typename Traits::ScalarType>
RealType Dune::XT::LA::VectorInterface<Traits, ScalarImp>::inf_norm() const

No documentation provided.

Method Dune::XT::LA::VectorInterface::standard_deviation

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual ScalarType Dune::XT::LA::VectorInterface<Traits, ScalarImp>::standard_deviation() const

No documentation provided.

Method Dune::XT::LA::VectorInterface::add

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual void Dune::XT::LA::VectorInterface<Traits, ScalarImp>::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

Method Dune::XT::LA::VectorInterface::add

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual derived_type Dune::XT::LA::VectorInterface<Traits, ScalarImp>::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.

Method Dune::XT::LA::VectorInterface::iadd

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual void Dune::XT::LA::VectorInterface<Traits, ScalarImp>::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.

Method Dune::XT::LA::VectorInterface::sub

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual void Dune::XT::LA::VectorInterface<Traits, ScalarImp>::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.

Method Dune::XT::LA::VectorInterface::sub

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual derived_type Dune::XT::LA::VectorInterface<Traits, ScalarImp>::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.

Method Dune::XT::LA::VectorInterface::isub

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual void Dune::XT::LA::VectorInterface<Traits, ScalarImp>::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.

Method Dune::XT::LA::VectorInterface::operator*

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual ScalarType Dune::XT::LA::VectorInterface<Traits, ScalarImp>::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.

Method Dune::XT::LA::VectorInterface::operator+=

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual derived_type &Dune::XT::LA::VectorInterface<Traits, ScalarImp>::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.

Method Dune::XT::LA::VectorInterface::operator-=

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual derived_type &Dune::XT::LA::VectorInterface<Traits, ScalarImp>::operator-=(const derived_type &other)

Subtracts another vector from this, in-place variant.

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

Method Dune::XT::LA::VectorInterface::operator+

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual derived_type Dune::XT::LA::VectorInterface<Traits, ScalarImp>::operator+(const derived_type &other) const

Adds two vectors.

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

Method Dune::XT::LA::VectorInterface::operator-

template<class Traits, class ScalarImp = typename Traits::ScalarType>
virtual derived_type Dune::XT::LA::VectorInterface<Traits, ScalarImp>::operator-(const derived_type &other) const

Substracts two vectors.

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

Method Dune::XT::LA::VectorInterface::operator/=

template<class Traits, class ScalarImp = typename Traits::ScalarType>
derived_type &Dune::XT::LA::VectorInterface<Traits, ScalarImp>::operator/=(const ScalarType &scalar) override

No documentation provided.

Method Dune::XT::LA::VectorInterface::operator==

template<class Traits, class ScalarImp = typename Traits::ScalarType>
bool Dune::XT::LA::VectorInterface<Traits, ScalarImp>::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.

Method Dune::XT::LA::VectorInterface::operator!=

template<class Traits, class ScalarImp = typename Traits::ScalarType>
bool Dune::XT::LA::VectorInterface<Traits, ScalarImp>::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.

Method Dune::XT::LA::VectorInterface::begin

template<class Traits, class ScalarImp = typename Traits::ScalarType>
iterator Dune::XT::LA::VectorInterface<Traits, ScalarImp>::begin()

No documentation provided.

Method Dune::XT::LA::VectorInterface::begin

template<class Traits, class ScalarImp = typename Traits::ScalarType>
const_iterator Dune::XT::LA::VectorInterface<Traits, ScalarImp>::begin() const

No documentation provided.

Method Dune::XT::LA::VectorInterface::end

template<class Traits, class ScalarImp = typename Traits::ScalarType>
iterator Dune::XT::LA::VectorInterface<Traits, ScalarImp>::end()

No documentation provided.

Method Dune::XT::LA::VectorInterface::end

template<class Traits, class ScalarImp = typename Traits::ScalarType>
const_iterator Dune::XT::LA::VectorInterface<Traits, ScalarImp>::end() const

No documentation provided.

Method Dune::XT::LA::VectorInterface::operator std::vector<Dune::XT::LA::VectorInterface::ScalarType, std::allocator<Dune::XT::LA::VectorInterface::ScalarType>>

operator vector<ScalarType>() const

No documentation provided.

Destructor Dune::XT::LA::VectorInterface::~VectorInterface

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

No documentation provided.

Variable Dune::XT::LA::VectorInterface::dense_matrix_type

template<class Traits, class ScalarImp = typename Traits::ScalarType>
const Backends Dune::XT::LA::VectorInterface<Traits, ScalarImp>::dense_matrix_type

No documentation provided.

Variable Dune::XT::LA::VectorInterface::sparse_matrix_type

template<class Traits, class ScalarImp = typename Traits::ScalarType>
const Backends Dune::XT::LA::VectorInterface<Traits, ScalarImp>::sparse_matrix_type

No documentation provided.

Type alias Dune::XT::LA::VectorInterface::BaseType

template<class Traits, class ScalarImp = typename Traits::ScalarType>
using Dune::XT::LA::VectorInterface<Traits, ScalarImp>::BaseType = ContainerInterface<Traits, ScalarImp>

No documentation provided.

Type alias Dune::XT::LA::VectorInterface::const_iterator

template<class Traits, class ScalarImp = typename Traits::ScalarType>
using Dune::XT::LA::VectorInterface<Traits, ScalarImp>::const_iterator = internal::VectorInputIterator<Traits, ScalarType>

No documentation provided.

Type alias Dune::XT::LA::VectorInterface::iterator

template<class Traits, class ScalarImp = typename Traits::ScalarType>
using Dune::XT::LA::VectorInterface<Traits, ScalarImp>::iterator = internal::VectorOutputIterator<Traits, ScalarType>

No documentation provided.

Function template Dune::XT::LA::VectorInterface::assign_from

template<class Traits, class ScalarImp = typename Traits::ScalarType>
template<class Vector>
std::enable_if_t<Common::is_vector<Vector>::value, derived_type&> Dune::XT::LA::VectorInterface<Traits, ScalarImp>::assign_from(const Vector &other)

No documentation provided.

Function template Dune::XT::LA::VectorInterface::operator=

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

No documentation provided.

Function template Dune::XT::LA::VectorInterface::almost_equal

template<class Traits, class ScalarImp = typename Traits::ScalarType>
template<class T>
bool Dune::XT::LA::VectorInterface<Traits, ScalarImp>::almost_equal(const VectorInterface<T> &other, const ScalarType epsilon = Common::FloatCmp::DefaultEpsilon<ScalarType>::value()) 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.

Function template Dune::XT::LA::VectorInterface::operator+=

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

No documentation provided.

Function template Dune::XT::LA::VectorInterface::operator-=

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

No documentation provided.

Function template Dune::XT::LA::VectorInterface::operator+

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

No documentation provided.

Function template Dune::XT::LA::VectorInterface::operator-

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

No documentation provided.

Function template Dune::XT::LA::VectorInterface::as_derived

template<class Traits, class ScalarImp = typename Traits::ScalarType>
template<class T, class S>
derived_type Dune::XT::LA::VectorInterface<Traits, ScalarImp>::as_derived(const VectorInterface<T, S> &other) const

No documentation provided.