Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
uni20::krylov::BlockTensorVectorOps< Tensor > Class Template Reference

Krylov vector algebra for one exact owning BlockTensor structure. More...

#include <block_tensor_vector.hpp>

Inheritance diagram for uni20::krylov::BlockTensorVectorOps< Tensor >:
[legend]

Public Types

using codomain_type = typename tensor_type::codomain_type
 
using domain_type = typename tensor_type::domain_type
 
using key_type = typename tensor_type::key_type
 
using real_type = make_real_t< scalar_type >
 
using scalar_type = typename tensor_type::value_type
 
using tensor_type = std::remove_cvref_t< Tensor >
 

Public Member Functions

auto allocate_like (tensor_type const &vector) const -> tensor_type
 Allocate a vector with the frozen structure and unspecified values.
 
template<BorrowedBlockTensorView View>
requires detail::CompatibleBlockVector<View, tensor_type>
auto allocate_like (View const &view) const -> tensor_type
 Allocate owning workspace from retained view metadata and its leaf context.
 
void axpy (tensor_type &output, scalar_type factor, tensor_type const &input) const
 Add a scalar multiple of one input to an output.
 
 BlockTensorVectorOps (tensor_type const &prototype)
 Freeze the Krylov vector space represented by a prototype tensor.
 
void copy (tensor_type &output, tensor_type const &input) const
 Copy one vector into another without changing either structure.
 
auto inner_product (tensor_type const &lhs, tensor_type const &rhs) const -> scalar_type
 Return the conjugate-linear inner product as a host scalar.
 
auto norm (tensor_type const &vector) const -> real_type
 Return the Euclidean norm as a host scalar.
 
auto problem_dimension () const noexcept -> std::size_t
 Return the number of stored numerical degrees of freedom.
 
template<class Vector >
requires detail::CompatibleBlockVector<Vector, tensor_type> && (std::is_lvalue_reference_v<Vector&&> || BorrowedBlockTensorView<Vector>)
auto prototype_view (Vector &&vector) const
 Own prototype metadata while borrowing its numerical payload and allocation context.
 
void scal (tensor_type &vector, scalar_type factor) const
 Scale one vector in place.
 
void set_zero (tensor_type &vector) const
 Set every stored numerical block to zero.
 
template<class Vector >
requires detail::CompatibleBlockVector<Vector, tensor_type>
auto vector_dimension (Vector const &vector) const -> std::size_t
 Validate a vector and return the frozen problem dimension.
 

Detailed Description

template<class Tensor>
class uni20::krylov::BlockTensorVectorOps< Tensor >

Krylov vector algebra for one exact owning BlockTensor structure.

The prototype supplied at construction fixes the vector space: symmetry, domain, codomain, stored-key pattern, scalar type, and storage policy. allocate_like reproduces that structure without flattening it. An operator-specific adapter may derive from or contain this class and add matvec.

Template Parameters
TensorOwning BlockTensor value type.

Member Typedef Documentation

◆ codomain_type

template<class Tensor >
using uni20::krylov::BlockTensorVectorOps< Tensor >::codomain_type = typename tensor_type::codomain_type

◆ domain_type

template<class Tensor >
using uni20::krylov::BlockTensorVectorOps< Tensor >::domain_type = typename tensor_type::domain_type

◆ key_type

template<class Tensor >
using uni20::krylov::BlockTensorVectorOps< Tensor >::key_type = typename tensor_type::key_type

◆ real_type

template<class Tensor >
using uni20::krylov::BlockTensorVectorOps< Tensor >::real_type = make_real_t<scalar_type>

◆ scalar_type

template<class Tensor >
using uni20::krylov::BlockTensorVectorOps< Tensor >::scalar_type = typename tensor_type::value_type

◆ tensor_type

template<class Tensor >
using uni20::krylov::BlockTensorVectorOps< Tensor >::tensor_type = std::remove_cvref_t<Tensor>

Constructor & Destructor Documentation

◆ BlockTensorVectorOps()

template<class Tensor >
uni20::krylov::BlockTensorVectorOps< Tensor >::BlockTensorVectorOps ( tensor_type const &  prototype)
inlineexplicit

Freeze the Krylov vector space represented by a prototype tensor.

Member Function Documentation

◆ allocate_like() [1/2]

template<class Tensor >
auto uni20::krylov::BlockTensorVectorOps< Tensor >::allocate_like ( tensor_type const &  vector) const -> tensor_type
inline

Allocate a vector with the frozen structure and unspecified values.

Krylov algorithms overwrite the result through copy, matvec, or set_zero before any read.

Exceptions
std::invalid_argumentIf vector is not a member of this vector space.

◆ allocate_like() [2/2]

template<class Tensor >
template<BorrowedBlockTensorView View>
requires detail::CompatibleBlockVector<View, tensor_type>
auto uni20::krylov::BlockTensorVectorOps< Tensor >::allocate_like ( View const &  view) const -> tensor_type
inline

Allocate owning workspace from retained view metadata and its leaf context.

◆ axpy()

template<class Tensor >
void uni20::krylov::BlockTensorVectorOps< Tensor >::axpy ( tensor_type &  output,
scalar_type  factor,
tensor_type const &  input 
) const
inline

Add a scalar multiple of one input to an output.

◆ copy()

template<class Tensor >
void uni20::krylov::BlockTensorVectorOps< Tensor >::copy ( tensor_type &  output,
tensor_type const &  input 
) const
inline

Copy one vector into another without changing either structure.

◆ inner_product()

template<class Tensor >
auto uni20::krylov::BlockTensorVectorOps< Tensor >::inner_product ( tensor_type const &  lhs,
tensor_type const &  rhs 
) const -> scalar_type
inline

Return the conjugate-linear inner product as a host scalar.

◆ norm()

template<class Tensor >
auto uni20::krylov::BlockTensorVectorOps< Tensor >::norm ( tensor_type const &  vector) const -> real_type
inline

Return the Euclidean norm as a host scalar.

◆ problem_dimension()

template<class Tensor >
auto uni20::krylov::BlockTensorVectorOps< Tensor >::problem_dimension ( ) const -> std::size_t
inlinenoexcept

Return the number of stored numerical degrees of freedom.

◆ prototype_view()

template<class Tensor >
template<class Vector >
requires detail::CompatibleBlockVector<Vector, tensor_type> && (std::is_lvalue_reference_v<Vector&&> || BorrowedBlockTensorView<Vector>)
auto uni20::krylov::BlockTensorVectorOps< Tensor >::prototype_view ( Vector &&  vector) const
inline

Own prototype metadata while borrowing its numerical payload and allocation context.

Temporary borrowed views are accepted; temporary owners are not.

◆ scal()

template<class Tensor >
void uni20::krylov::BlockTensorVectorOps< Tensor >::scal ( tensor_type &  vector,
scalar_type  factor 
) const
inline

Scale one vector in place.

◆ set_zero()

template<class Tensor >
void uni20::krylov::BlockTensorVectorOps< Tensor >::set_zero ( tensor_type &  vector) const
inline

Set every stored numerical block to zero.

◆ vector_dimension()

template<class Tensor >
template<class Vector >
requires detail::CompatibleBlockVector<Vector, tensor_type>
auto uni20::krylov::BlockTensorVectorOps< Tensor >::vector_dimension ( Vector const &  vector) const -> std::size_t
inline

Validate a vector and return the frozen problem dimension.

Exceptions
std::invalid_argumentIf the vector does not belong to this exact BlockTensor vector space.

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