Class EvalResult¶
Defined in File eval_result.hpp
Inheritance Relationships¶
Derived Types¶
public sequant::EvalScalar< T >
(Template Class EvalScalar)public sequant::EvalTensorBTAS< T >
(Template Class EvalTensorBTAS)public sequant::EvalTensorOfTensorTA< ArrayT, typename >
(Template Class EvalTensorOfTensorTA)public sequant::EvalTensorTA< ArrayT, typename >
(Template Class EvalTensorTA)
Class Documentation¶
-
class EvalResult¶
A type-erased class for the result of an evaluation. An object of this class can represent a tensor (eg. TA::TArrayD, btas::Tesnor<double>, etc.) or a scalar (eg. double, complex<double> etc.).
Subclassed by sequant::EvalScalar< T >, sequant::EvalTensorBTAS< T >, sequant::EvalTensorOfTensorTA< ArrayT, typename >, sequant::EvalTensorTA< ArrayT, typename >
Public Types
-
using id_t = size_t¶
Public Functions
-
virtual ~EvalResult() noexcept = default¶
-
template<typename T>
inline bool is() const noexcept¶ - Returns:
Returns true if the concrete type of the object is T.
-
template<typename T>
inline T const &as() const¶ - Returns:
T const& where T is the concrete type of the object.
-
virtual ERPtr sum(EvalResult const&, std::array<std::any, 3> const&) const = 0¶
Sum other EvalResult object with this object.
Note
In std::array<std::any, 3> is expected to be [l,r,res] where the elements are the annotations for left, right and result respectively.
-
virtual ERPtr prod(EvalResult const&, std::array<std::any, 3> const&, TA::DeNest DeNestFlag) const = 0¶
Perform product binary operation with this object and other.
Note
In std::array<std::any, 3> is expected to be [l,r,res] where the elements are the annotations for left, right and result respectively.
-
virtual ERPtr permute(std::array<std::any, 2> const&) const = 0¶
Permute this object according to the annotations in the argument.
Note
In std::array<std::any, 2> is expected to be [pre,post] where the elements are the annotations for the eval result before permutation and after permutation respectively.
-
virtual void add_inplace(EvalResult const&) = 0¶
Add other EvalResult object into this object.
-
bool has_value() const noexcept¶
-
template<typename T>
inline T &get()¶ - Template Parameters:
T, and – return a ref.
- Returns:
Cast the type-erased data to the type
-
template<typename T>
inline T const &get() const¶ - Template Parameters:
T, and – return a const ref.
- Returns:
Cast the type-erased data to the type
-
virtual std::size_t size_in_bytes() const = 0¶
- Returns:
the size of the object in bytes
Protected Functions
-
template<typename T, typename = std::enable_if_t<!std::is_convertible_v<T, EvalResult>>>
inline explicit EvalResult(T &&arg) noexcept¶
-
using id_t = size_t¶