1#ifndef LINEARALGEBRA_SRC_MOLPRO_LINALG_ARRAY_ARRAYHANDLERDDISK_H
2#define LINEARALGEBRA_SRC_MOLPRO_LINALG_ARRAY_ARRAYHANDLERDDISK_H
3#include <molpro/Profiler.h>
4#include <molpro/linalg/array/ArrayHandler.h>
5#include <molpro/linalg/array/util/gemm.h>
12template <
class AL,
class AR = AL>
40 AL
copy(
const AR &source)
override {
44 void copy(AL &x,
const AR &y)
override {
68 gemm_outer_distr_distr(alphas, xx, yy);
74 return gemm_inner_distr_distr(xx, yy);
77 std::map<size_t, value_type_abs>
select_max_dot(
size_t n,
const AL &x,
const AR &y)
override {
78 return x.select_max_dot(n, y);
81 std::map<size_t, value_type_abs>
select(
size_t n,
const AL &x,
bool max =
false,
bool ignore_sign =
false)
override {
82 return x.select(n, max, ignore_sign);
Definition: ArrayHandlerDDisk.h:13
ProxyHandle lazy_handle() override
Returns a lazy handle. Most implementations simply need to call the overload: return lazy_handle(*thi...
Definition: ArrayHandlerDDisk.h:35
ArrayHandlerDDisk()
Definition: ArrayHandlerDDisk.h:21
Matrix< value_type > gemm_inner(const CVecRef< AL > &xx, const CVecRef< AR > &yy) override
Definition: ArrayHandlerDDisk.h:71
void gemm_outer(const Matrix< value_type > alphas, const CVecRef< AR > &xx, const VecRef< AL > &yy) override
Definition: ArrayHandlerDDisk.h:66
std::function< AL(const AR &)> m_copy_func
function for making a copy
Definition: ArrayHandlerDDisk.h:86
AL copy(const AR &source) override
Definition: ArrayHandlerDDisk.h:40
std::map< size_t, value_type_abs > 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.
Definition: ArrayHandlerDDisk.h:81
std::map< size_t, value_type_abs > select_max_dot(size_t n, const AL &x, const AR &y) override
Definition: ArrayHandlerDDisk.h:77
void axpy(value_type alpha, const AR &x, AL &y) override
Definition: ArrayHandlerDDisk.h:56
void fill(value_type alpha, AL &x) override
Definition: ArrayHandlerDDisk.h:54
void copy(AL &x, const AR &y) override
Definition: ArrayHandlerDDisk.h:44
void scal(value_type alpha, AL &x) override
Definition: ArrayHandlerDDisk.h:49
ArrayHandlerDDisk(std::function< AL(const AR &)> copy_func)
Constructor taking a copy function.
Definition: ArrayHandlerDDisk.h:32
value_type dot(const AL &x, const AR &y) override
Definition: ArrayHandlerDDisk.h:61
Enhances various operations between pairs of arrays and allows dynamic code injection with uniform in...
Definition: ArrayHandler.h:162
std::unique_ptr< Counter > m_counter
Definition: ArrayHandler.h:176
decltype(value_type_L{} *value_type_R{}) value_type
Definition: ArrayHandler.h:181
virtual void error(const std::string &message)
Throws an error.
Definition: ArrayHandler.h:268
Matrix container that allows simple data access, slicing, copying and resizing without loosing data.
Definition: Matrix.h:28
static std::shared_ptr< Profiler > single()
void gemm_outer_distr_distr(const Matrix< typename array::mapped_or_value_type_t< AL > > alphas, const CVecRef< DistrArrayFile > &xx, const VecRef< AL > &yy)
Definition: gemm.h:59
Matrix< typename array::mapped_or_value_type_t< AL > > gemm_inner_distr_distr(const CVecRef< AL > &yy, const CVecRef< DistrArrayFile > &xx)
Definition: gemm.h:32
Definition: ArrayHandler.h:22