template<typename AL, typename AR = AL>
class molpro::linalg::array::ArrayHandlerIterable< AL, AR >
Array handler for two containers both of which can be iterated through using begin() and end() member functions, and have a copy constructor.
|
| | ArrayHandlerIterable ()=default |
| |
| | ArrayHandlerIterable (const ArrayHandlerIterable< AL, AR > &)=default |
| |
| AL | copy (const AR &source) override |
| |
| void | copy (AL &x, const AR &y) override |
| | Copy content of y into x.
|
| |
| void | scal (value_type alpha, AL &x) override |
| |
| void | fill (value_type alpha, AL &x) override |
| |
| void | axpy (value_type alpha, const AR &x, AL &y) override |
| |
| value_type | dot (const AL &x, const AR &y) override |
| | The hermitian inner product <x|y>, i.e. conjugate-linear in x and linear in y.
|
| |
| void | gemm_outer (const Matrix< value_type > alphas, const CVecRef< AR > &xx, const VecRef< AL > &yy) override |
| |
| Matrix< value_type > | gemm_inner (const CVecRef< AL > &xx, const CVecRef< AR > &yy) override |
| |
| std::map< size_t, value_type_abs > | select_max_dot (size_t n, const AL &x, const AR &y) override |
| | Select n indices with largest by absolute value contributions to the dot product.
|
| |
| std::map< size_t, value_type > | select (size_t n, const AL &x, bool max=false, bool ignore_sign=false) override |
| | Select n indices with largest (or smallest) actual (or absolute) value.
|
| |
| ProxyHandle | lazy_handle () override |
| | Returns a lazy handle. Most implementations simply need to call the overload: return lazy_handle(*this);.
|
| |
Public Member Functions inherited from molpro::linalg::array::ArrayHandler< AL, AR > |
| const Counter & | counter () const |
| |
| std::string | counter_to_string (std::string L, std::string R) |
| |
| void | clear_counter () |
| |
| virtual | ~ArrayHandler () |
| | Destroys ArrayHandler instance and invalidates any LazyHandler it created. Invalidated handler will not evaluate.
|
| |
|
| template<typename T , typename S , typename std::enable_if_t< util::is_array_v< T >, std::nullptr_t > = nullptr> |
| T | copyAny (const S &source) |
| |
| template<typename T , typename S , typename std::enable_if_t<!util::is_array_v< T > &&util::is_allocatable_v< T >, int > = 0> |
| T | copyAny (const S &source) |
| |
| template<typename T , typename S , typename std::enable_if_t<!util::is_array_v< T > &&!util::is_allocatable_v< T >, int > = 0> |
| T | copyAny (const S &source) |
| |
Protected Member Functions inherited from molpro::linalg::array::ArrayHandler< AL, AR > |
| | ArrayHandler () |
| |
| | ArrayHandler (const ArrayHandler &)=default |
| |
| virtual void | error (const std::string &message) |
| | Throws an error.
|
| |
| virtual void | fused_axpy (const std::vector< std::tuple< size_t, size_t, size_t > > ®, const std::vector< value_type > &alphas, const std::vector< std::reference_wrapper< const AR > > &xx, std::vector< std::reference_wrapper< AL > > &yy) |
| | Default implementation of fused_axpy without any simplification.
|
| |
| virtual void | fused_dot (const std::vector< std::tuple< size_t, size_t, size_t > > ®, const std::vector< std::reference_wrapper< const AL > > &xx, const std::vector< std::reference_wrapper< const AR > > &yy, std::vector< std::reference_wrapper< value_type > > &out) |
| | Default implementation of fused_dot without any simplification.
|
| |
| void | save_handle (const std::shared_ptr< LazyHandle > &handle) |
| | Save weak ptr to a lazy handle.
|
| |
| ProxyHandle | lazy_handle (ArrayHandler< AL, AR > &handler) |
| |
template<typename AL , typename AR = AL>
The hermitian inner product <x|y>, i.e. conjugate-linear in x and linear in y.
The real case is selected at compile time and is the plain product this function computed before conjugation was introduced. A release build optimises the conjugating lambda away entirely – the two are within noise of each other at -O3 on both GCC and clang – but at -O0 nothing is inlined and the extra call per element costs slightly over a factor of two on this loop, so the branch is worth the four lines.
Implements molpro::linalg::array::ArrayHandler< AL, AR >.