MADNESS 0.10.1
madness::FunctionImpl< T, NDIM >::add_op Struct Reference

add two functions f and g: result=alpha * f + beta * g More...

#include <funcimpl.h>

Public Types

typedef CoeffTracker< T, NDIM > ctT
typedef add_op this_type

Public Member Functions

 add_op ()=default
 add_op (const ctT &f, const ctT &g, const double alpha, const double beta)
Future< this_type > activate () const
 retrieve the coefficients (parent coeffs might be remote)
this_type forward_ctor (const ctT &f1, const ctT &g1, const double alpha, const double beta)
 taskq-compatible ctor
this_type make_child (const keyT &child) const
std::pair< bool, coeffT > operator() (const keyT &key) const
 if we are at the bottom of the trees, return the sum of the coeffs
bool randomize () const
template<typename Archive>
void serialize (const Archive &ar)

Public Attributes

double alpha
 prefactor for f, g
double beta
ctT f
 tracking coeffs of first and second addend
ctT g

Detailed Description

template<typename T, std::size_t NDIM>
struct madness::FunctionImpl< T, NDIM >::add_op

add two functions f and g: result=alpha * f + beta * g

Member Typedef Documentation

◆ ctT

template<typename T, std::size_t NDIM>
typedef CoeffTracker<T,NDIM> madness::FunctionImpl< T, NDIM >::add_op::ctT

◆ this_type

template<typename T, std::size_t NDIM>
typedef add_op madness::FunctionImpl< T, NDIM >::add_op::this_type

Constructor & Destructor Documentation

◆ add_op() [1/2]

template<typename T, std::size_t NDIM>
madness::FunctionImpl< T, NDIM >::add_op::add_op ( )
default

◆ add_op() [2/2]

template<typename T, std::size_t NDIM>
madness::FunctionImpl< T, NDIM >::add_op::add_op ( const ctT & f,
const ctT & g,
const double alpha,
const double beta )
inline

References alpha, beta, f, and g.

Member Function Documentation

◆ activate()

template<typename T, std::size_t NDIM>
Future< this_type > madness::FunctionImpl< T, NDIM >::add_op::activate ( ) const
inline

retrieve the coefficients (parent coeffs might be remote)

References alpha, beta, f, f1, forward_ctor(), g, g1(), and madness::detail::wrap_mem_fn().

◆ forward_ctor()

template<typename T, std::size_t NDIM>
this_type madness::FunctionImpl< T, NDIM >::add_op::forward_ctor ( const ctT & f1,
const ctT & g1,
const double alpha,
const double beta )
inline

taskq-compatible ctor

References alpha, beta, f1, and g1().

Referenced by activate().

◆ make_child()

template<typename T, std::size_t NDIM>
this_type madness::FunctionImpl< T, NDIM >::add_op::make_child ( const keyT & child) const
inline

References alpha, beta, f, and g.

◆ operator()()

template<typename T, std::size_t NDIM>
std::pair< bool, coeffT > madness::FunctionImpl< T, NDIM >::add_op::operator() ( const keyT & key) const
inline

if we are at the bottom of the trees, return the sum of the coeffs

References alpha, beta, madness::copy(), f, g, madness::GenTensor< T >::gaxpy(), and madness::GenTensor< T >::reduce_rank().

◆ randomize()

template<typename T, std::size_t NDIM>
bool madness::FunctionImpl< T, NDIM >::add_op::randomize ( ) const
inline

◆ serialize()

template<typename T, std::size_t NDIM>
template<typename Archive>
void madness::FunctionImpl< T, NDIM >::add_op::serialize ( const Archive & ar)
inline

References alpha, beta, f, and g.

Member Data Documentation

◆ alpha

template<typename T, std::size_t NDIM>
double madness::FunctionImpl< T, NDIM >::add_op::alpha

prefactor for f, g

Referenced by add_op(), activate(), forward_ctor(), make_child(), operator()(), and serialize().

◆ beta

template<typename T, std::size_t NDIM>
double madness::FunctionImpl< T, NDIM >::add_op::beta

◆ f

template<typename T, std::size_t NDIM>
ctT madness::FunctionImpl< T, NDIM >::add_op::f

tracking coeffs of first and second addend

Referenced by add_op(), activate(), make_child(), operator()(), and serialize().

◆ g

template<typename T, std::size_t NDIM>
ctT madness::FunctionImpl< T, NDIM >::add_op::g

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