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

Combine fixed BlockTensor vector algebra with an owned matrix-free apply operation. More...

#include <block_tensor_vector.hpp>

Inheritance diagram for uni20::krylov::BlockTensorMatrixFreeOps< Tensor, Operator >:
[legend]
Collaboration diagram for uni20::krylov::BlockTensorMatrixFreeOps< Tensor, Operator >:
[legend]

Public Types

using base_type = BlockTensorVectorOps< Tensor >
 
using operator_type = std::remove_cvref_t< Operator >
 
using tensor_type = typename base_type::tensor_type
 
- Public Types inherited from uni20::krylov::BlockTensorVectorOps< Tensor >
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

 BlockTensorMatrixFreeOps (tensor_type const &prototype, operator_type operation)
 Freeze a vector structure and take ownership of its apply operation.
 
void matvec (tensor_type &output, tensor_type const &input)
 Apply the stored matrix-free operation as output <- OP*input.
 
- Public Member Functions inherited from uni20::krylov::BlockTensorVectorOps< Tensor >
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 Operator>
class uni20::krylov::BlockTensorMatrixFreeOps< Tensor, Operator >

Combine fixed BlockTensor vector algebra with an owned matrix-free apply operation.

The operation is invoked as operation(output, input) only after both vectors have been validated against the exact structure frozen by the prototype. The operation object may retain immutable Hamiltonian or environment state needed by repeated Krylov applies.

Template Parameters
TensorOwning sparse BlockTensor value type.
OperatorOutput-first matrix-free operation object.

Member Typedef Documentation

◆ base_type

template<class Tensor , class Operator >
using uni20::krylov::BlockTensorMatrixFreeOps< Tensor, Operator >::base_type = BlockTensorVectorOps<Tensor>

◆ operator_type

template<class Tensor , class Operator >
using uni20::krylov::BlockTensorMatrixFreeOps< Tensor, Operator >::operator_type = std::remove_cvref_t<Operator>

◆ tensor_type

template<class Tensor , class Operator >
using uni20::krylov::BlockTensorMatrixFreeOps< Tensor, Operator >::tensor_type = typename base_type::tensor_type

Constructor & Destructor Documentation

◆ BlockTensorMatrixFreeOps()

template<class Tensor , class Operator >
uni20::krylov::BlockTensorMatrixFreeOps< Tensor, Operator >::BlockTensorMatrixFreeOps ( tensor_type const &  prototype,
operator_type  operation 
)
inline

Freeze a vector structure and take ownership of its apply operation.

Member Function Documentation

◆ matvec()

template<class Tensor , class Operator >
void uni20::krylov::BlockTensorMatrixFreeOps< Tensor, Operator >::matvec ( tensor_type &  output,
tensor_type const &  input 
)
inline

Apply the stored matrix-free operation as output <- OP*input.

Exceptions
std::invalid_argumentIf either vector is outside the frozen space.

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