Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
Public Member Functions | List of all members
LinearAlgebra::VectorSpaceVector< Number > Class Template Referenceabstract

#include <deal.II/lac/vector_space_vector.h>

Inheritance diagram for LinearAlgebra::VectorSpaceVector< Number >:
[legend]

Public Member Functions

virtual void reinit (const VectorSpaceVector< Number > &V, const bool omit_zeroing_entries=false)=0
 
virtual VectorSpaceVector< Number > & operator= (const Number s)=0
 
virtual VectorSpaceVector< Number > & operator*= (const Number factor)=0
 
virtual VectorSpaceVector< Number > & operator/= (const Number factor)=0
 
virtual VectorSpaceVector< Number > & operator+= (const VectorSpaceVector< Number > &V)=0
 
virtual VectorSpaceVector< Number > & operator-= (const VectorSpaceVector< Number > &V)=0
 
virtual void import (const ReadWriteVector< Number > &V, VectorOperation::values operation, std::shared_ptr< const CommunicationPatternBase > communication_pattern=std::shared_ptr< const CommunicationPatternBase >())=0
 
virtual Number operator* (const VectorSpaceVector< Number > &V) const =0
 
virtual void add (const Number a)=0
 
virtual void add (const Number a, const VectorSpaceVector< Number > &V)=0
 
virtual void add (const Number a, const VectorSpaceVector< Number > &V, const Number b, const VectorSpaceVector< Number > &W)=0
 
virtual void sadd (const Number s, const Number a, const VectorSpaceVector< Number > &V)=0
 
virtual void scale (const VectorSpaceVector< Number > &scaling_factors)=0
 
virtual void equ (const Number a, const VectorSpaceVector< Number > &V)=0
 
virtual bool all_zero () const =0
 
virtual value_type mean_value () const =0
 
virtual real_type l1_norm () const =0
 
virtual real_type l2_norm () const =0
 
virtual real_type linfty_norm () const =0
 
virtual Number add_and_dot (const Number a, const VectorSpaceVector< Number > &V, const VectorSpaceVector< Number > &W)=0
 
virtual void compress (VectorOperation::values)
 
virtual size_type size () const =0
 
virtual ::IndexSet locally_owned_elements () const =0
 
virtual void print (std::ostream &out, const unsigned int precision=3, const bool scientific=true, const bool across=true) const =0
 
virtual std::size_t memory_consumption () const =0
 
virtual ~VectorSpaceVector ()=default
 

Detailed Description

template<typename Number>
class LinearAlgebra::VectorSpaceVector< Number >

VectorSpaceVector is an abstract class that is used to define the interface that vector classes need to implement when they want to implement global operations. This class is complementary of ReadWriteVector which allows the access of individual elements but does not allow global operations.

Author
Bruno Turcksin, 2015.

Definition at line 54 of file vector_space_vector.h.

Constructor & Destructor Documentation

◆ ~VectorSpaceVector()

template<typename Number>
virtual LinearAlgebra::VectorSpaceVector< Number >::~VectorSpaceVector ( )
virtualdefault

Destructor. Declared as virtual so that inheriting classes (which may manage their own memory) are destroyed correctly.

Member Function Documentation

◆ reinit()

template<typename Number>
virtual void LinearAlgebra::VectorSpaceVector< Number >::reinit ( const VectorSpaceVector< Number > &  V,
const bool  omit_zeroing_entries = false 
)
pure virtual

◆ operator=()

template<typename Number>
virtual VectorSpaceVector<Number>& LinearAlgebra::VectorSpaceVector< Number >::operator= ( const Number  s)
pure virtual

◆ operator*=()

template<typename Number>
virtual VectorSpaceVector<Number>& LinearAlgebra::VectorSpaceVector< Number >::operator*= ( const Number  factor)
pure virtual

◆ operator/=()

template<typename Number>
virtual VectorSpaceVector<Number>& LinearAlgebra::VectorSpaceVector< Number >::operator/= ( const Number  factor)
pure virtual

◆ operator+=()

template<typename Number>
virtual VectorSpaceVector<Number>& LinearAlgebra::VectorSpaceVector< Number >::operator+= ( const VectorSpaceVector< Number > &  V)
pure virtual

◆ operator-=()

template<typename Number>
virtual VectorSpaceVector<Number>& LinearAlgebra::VectorSpaceVector< Number >::operator-= ( const VectorSpaceVector< Number > &  V)
pure virtual

◆ import()

template<typename Number>
virtual void LinearAlgebra::VectorSpaceVector< Number >::import ( const ReadWriteVector< Number > &  V,
VectorOperation::values  operation,
std::shared_ptr< const CommunicationPatternBase communication_pattern = std::shared_ptr< const CommunicationPatternBase >() 
)
pure virtual

Import all the elements present in the vector's IndexSet from the input vector V. VectorOperation::values operation is used to decide if the elements in V should be added to the current vector or replace the current elements. The last parameter can be used if the same communication pattern is used multiple times. This can be used to improve performance.

Implemented in LinearAlgebra::distributed::Vector< Number, MemorySpace >, LinearAlgebra::distributed::Vector< double >, LinearAlgebra::distributed::Vector< Number >, LinearAlgebra::distributed::BlockVector< Number >, LinearAlgebra::Vector< Number >, LinearAlgebra::CUDAWrappers::Vector< Number >, and LinearAlgebra::EpetraWrappers::Vector.

◆ operator*()

template<typename Number>
virtual Number LinearAlgebra::VectorSpaceVector< Number >::operator* ( const VectorSpaceVector< Number > &  V) const
pure virtual

◆ add() [1/3]

template<typename Number>
virtual void LinearAlgebra::VectorSpaceVector< Number >::add ( const Number  a)
pure virtual

◆ add() [2/3]

template<typename Number>
virtual void LinearAlgebra::VectorSpaceVector< Number >::add ( const Number  a,
const VectorSpaceVector< Number > &  V 
)
pure virtual

◆ add() [3/3]

template<typename Number>
virtual void LinearAlgebra::VectorSpaceVector< Number >::add ( const Number  a,
const VectorSpaceVector< Number > &  V,
const Number  b,
const VectorSpaceVector< Number > &  W 
)
pure virtual

◆ sadd()

template<typename Number>
virtual void LinearAlgebra::VectorSpaceVector< Number >::sadd ( const Number  s,
const Number  a,
const VectorSpaceVector< Number > &  V 
)
pure virtual

◆ scale()

template<typename Number>
virtual void LinearAlgebra::VectorSpaceVector< Number >::scale ( const VectorSpaceVector< Number > &  scaling_factors)
pure virtual

Scale each element of this vector by the corresponding element in the argument. This function is mostly meant to simulate multiplication (and immediate re-assignment) by a diagonal scaling matrix.

Implemented in LinearAlgebra::distributed::Vector< Number, MemorySpace >, LinearAlgebra::distributed::Vector< double >, LinearAlgebra::distributed::Vector< Number >, LinearAlgebra::distributed::BlockVector< Number >, LinearAlgebra::Vector< Number >, LinearAlgebra::CUDAWrappers::Vector< Number >, and LinearAlgebra::EpetraWrappers::Vector.

◆ equ()

template<typename Number>
virtual void LinearAlgebra::VectorSpaceVector< Number >::equ ( const Number  a,
const VectorSpaceVector< Number > &  V 
)
pure virtual

◆ all_zero()

template<typename Number>
virtual bool LinearAlgebra::VectorSpaceVector< Number >::all_zero ( ) const
pure virtual

◆ mean_value()

template<typename Number>
virtual value_type LinearAlgebra::VectorSpaceVector< Number >::mean_value ( ) const
pure virtual

◆ l1_norm()

template<typename Number>
virtual real_type LinearAlgebra::VectorSpaceVector< Number >::l1_norm ( ) const
pure virtual

◆ l2_norm()

template<typename Number>
virtual real_type LinearAlgebra::VectorSpaceVector< Number >::l2_norm ( ) const
pure virtual

◆ linfty_norm()

template<typename Number>
virtual real_type LinearAlgebra::VectorSpaceVector< Number >::linfty_norm ( ) const
pure virtual

◆ add_and_dot()

template<typename Number>
virtual Number LinearAlgebra::VectorSpaceVector< Number >::add_and_dot ( const Number  a,
const VectorSpaceVector< Number > &  V,
const VectorSpaceVector< Number > &  W 
)
pure virtual

Perform a combined operation of a vector addition and a subsequent inner product, returning the value of the inner product. In other words, the result of this function is the same as if the user called

this->add(a, V);
return_value = *this * W;

The reason this function exists is that this operation involves less memory transfer than calling the two functions separately. This method only needs to load three vectors, this, V, W, whereas calling separate methods means to load the calling vector this twice. Since most vector operations are memory transfer limited, this reduces the time by 25% (or 50% if W equals this).

For complex-valued vectors, the scalar product in the second step is implemented as \(\left<v,w\right>=\sum_i v_i \bar{w_i}\).

Implemented in LinearAlgebra::distributed::Vector< Number, MemorySpace >, LinearAlgebra::distributed::Vector< double >, LinearAlgebra::distributed::Vector< Number >, LinearAlgebra::distributed::BlockVector< Number >, LinearAlgebra::Vector< Number >, LinearAlgebra::CUDAWrappers::Vector< Number >, and LinearAlgebra::EpetraWrappers::Vector.

◆ compress()

template<typename Number>
virtual void LinearAlgebra::VectorSpaceVector< Number >::compress ( VectorOperation::values  )
inlinevirtual

This function does nothing and only exists for backward compatibility.

Definition at line 225 of file vector_space_vector.h.

◆ size()

template<typename Number>
virtual size_type LinearAlgebra::VectorSpaceVector< Number >::size ( ) const
pure virtual

◆ locally_owned_elements()

template<typename Number>
virtual ::IndexSet LinearAlgebra::VectorSpaceVector< Number >::locally_owned_elements ( ) const
pure virtual

Return an index set that describes which elements of this vector are owned by the current processor. As a consequence, the index sets returned on different processors if this is a distributed vector will form disjoint sets that add up to the complete index set. Obviously, if a vector is created on only one processor, then the result would satisfy

vec.locally_owned_elements() == complete_index_set(vec.size())

Implemented in LinearAlgebra::distributed::Vector< Number, MemorySpace >, LinearAlgebra::distributed::Vector< double >, LinearAlgebra::distributed::Vector< Number >, LinearAlgebra::distributed::BlockVector< Number >, LinearAlgebra::Vector< Number >, LinearAlgebra::CUDAWrappers::Vector< Number >, and LinearAlgebra::EpetraWrappers::Vector.

◆ print()

template<typename Number>
virtual void LinearAlgebra::VectorSpaceVector< Number >::print ( std::ostream &  out,
const unsigned int  precision = 3,
const bool  scientific = true,
const bool  across = true 
) const
pure virtual

◆ memory_consumption()

template<typename Number>
virtual std::size_t LinearAlgebra::VectorSpaceVector< Number >::memory_consumption ( ) const
pure virtual

The documentation for this class was generated from the following file: