MADNESS 0.10.1
madness::CoeffTracker< T, NDIM > Class Template Reference

a class to track where relevant (parent) coeffs are More...

#include <funcimpl.h>

Collaboration diagram for madness::CoeffTracker< T, NDIM >:

Public Member Functions

 CoeffTracker ()
 default ctor
 CoeffTracker (const CoeffTracker &other)
 copy ctor
 CoeffTracker (const CoeffTracker &other, const datumT &datum)
 ctor with a pair<keyT,nodeT>
 CoeffTracker (const implT *impl)
 the initial ctor making the root key
Future< CoeffTracker > activate () const
 find the coefficients
const coeffT & coeff () const
 const reference to the coeffs
coeffT coeff (const keyT &key) const
 return the coefficients belonging to the passed-in key
double dnorm (const keyT &key) const
 return the s and dnorm belonging to the passed-in key
const implT * get_impl () const
 const reference to impl
const LeafStatus & is_leaf () const
 const reference to is_leaf flag
const keyT & key () const
 const reference to the key
CoeffTracker make_child (const keyT &child) const
 make a child of this, ignoring the coeffs
CoeffTracker & operator= (const CoeffTracker &other)=default
template<typename Archive>
void serialize (const Archive &ar)
 serialization

Private Types

typedef GenTensor< T > coeffT
typedef std::pair< Key< NDIM >, ShallowNode< T, NDIM > > datumT
typedef FunctionImpl< T, NDIM > implT
typedef Key< NDIM > keyT
enum  LeafStatus { no , yes , unknown }

Private Member Functions

CoeffTracker forward_ctor (const CoeffTracker &other, const datumT &datum) const
 taskq-compatible forwarding to the ctor

Private Attributes

coeffT coeff_
 the coefficients belonging to key
double dnorm_ =-1.0
 norm of d coefficients corresponding to key
const implT * impl
 the funcimpl that has the coeffs
LeafStatus is_leaf_
 flag if key is a leaf node
keyT key_
 the current key, which must exists in impl

Detailed Description

template<typename T, size_t NDIM>
class madness::CoeffTracker< T, NDIM >

a class to track where relevant (parent) coeffs are

E.g. if a 6D function is composed of two 3D functions their coefficients must be tracked. We might need coeffs from a box that does not exist, and to avoid searching for parents we track which are their required respective boxes.

  • CoeffTracker will refer either to a requested key, if it exists, or to its outermost parent.
  • Children must be made in sequential order to be able to track correctly.

Usage: 1. make the child of a given CoeffTracker. If the parent CoeffTracker refers to a leaf node (flag is_leaf) the child will refer to the same node. Otherwise it will refer to the child node.

  1. retrieve its coefficients (possible communication/ returns a Future). Member variable key always refers to an existing node, so we can fetch it. Once we have the node we can determine if it has children which allows us to make a child (see 1. )

Member Typedef Documentation

◆ coeffT

template<typename T, size_t NDIM>
typedef GenTensor<T> madness::CoeffTracker< T, NDIM >::coeffT
private

◆ datumT

template<typename T, size_t NDIM>
typedef std::pair<Key<NDIM>,ShallowNode<T,NDIM> > madness::CoeffTracker< T, NDIM >::datumT
private

◆ implT

template<typename T, size_t NDIM>
typedef FunctionImpl<T,NDIM> madness::CoeffTracker< T, NDIM >::implT
private

◆ keyT

template<typename T, size_t NDIM>
typedef Key<NDIM> madness::CoeffTracker< T, NDIM >::keyT
private

Member Enumeration Documentation

◆ LeafStatus

template<typename T, size_t NDIM>
enum madness::CoeffTracker::LeafStatus
private
Enumerator
no 
yes 
unknown 

Constructor & Destructor Documentation

◆ CoeffTracker() [1/4]

◆ CoeffTracker() [2/4]

template<typename T, size_t NDIM>
madness::CoeffTracker< T, NDIM >::CoeffTracker ( const implT * impl)
inline

the initial ctor making the root key

◆ CoeffTracker() [3/4]

template<typename T, size_t NDIM>
madness::CoeffTracker< T, NDIM >::CoeffTracker ( const CoeffTracker< T, NDIM > & other,
const datumT & datum )
inlineexplicit

ctor with a pair<keyT,nodeT>

◆ CoeffTracker() [4/4]

template<typename T, size_t NDIM>
madness::CoeffTracker< T, NDIM >::CoeffTracker ( const CoeffTracker< T, NDIM > & other)
inline

copy ctor

Member Function Documentation

◆ activate()

template<typename T, size_t NDIM>
Future< CoeffTracker > madness::CoeffTracker< T, NDIM >::activate ( ) const
inline

find the coefficients

this involves communication to a remote node

Returns
a Future<CoeffTracker> with the coefficients that key refers to

◆ coeff() [1/2]

template<typename T, size_t NDIM>
const coeffT & madness::CoeffTracker< T, NDIM >::coeff ( ) const
inline

◆ coeff() [2/2]

template<typename T, size_t NDIM>
coeffT madness::CoeffTracker< T, NDIM >::coeff ( const keyT & key) const
inline

return the coefficients belonging to the passed-in key

if key equals tracked key just return the coeffs, otherwise make the child coefficients.

Parameters
[in]keyreturn coeffs corresponding to this key
Returns
coefficients belonging to key

◆ dnorm()

template<typename T, size_t NDIM>
double madness::CoeffTracker< T, NDIM >::dnorm ( const keyT & key) const
inline

return the s and dnorm belonging to the passed-in key

◆ forward_ctor()

template<typename T, size_t NDIM>
CoeffTracker madness::CoeffTracker< T, NDIM >::forward_ctor ( const CoeffTracker< T, NDIM > & other,
const datumT & datum ) const
inlineprivate

taskq-compatible forwarding to the ctor

Referenced by madness::CoeffTracker< T, LDIM >::activate().

◆ get_impl()

template<typename T, size_t NDIM>
const implT * madness::CoeffTracker< T, NDIM >::get_impl ( ) const
inline

const reference to impl

Referenced by madness::operator<<().

◆ is_leaf()

template<typename T, size_t NDIM>
const LeafStatus & madness::CoeffTracker< T, NDIM >::is_leaf ( ) const
inline

const reference to is_leaf flag

Referenced by madness::operator<<().

◆ key()

template<typename T, size_t NDIM>
const keyT & madness::CoeffTracker< T, NDIM >::key ( ) const
inline

◆ make_child()

template<typename T, size_t NDIM>
CoeffTracker madness::CoeffTracker< T, NDIM >::make_child ( const keyT & child) const
inline

make a child of this, ignoring the coeffs

Referenced by madness::composite_product_op_NS< T, NDIM, opT, LDIM >::make_child().

◆ operator=()

template<typename T, size_t NDIM>
CoeffTracker & madness::CoeffTracker< T, NDIM >::operator= ( const CoeffTracker< T, NDIM > & other)
default

◆ serialize()

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

serialization

Member Data Documentation

◆ coeff_

template<typename T, size_t NDIM>
coeffT madness::CoeffTracker< T, NDIM >::coeff_
private

the coefficients belonging to key

◆ dnorm_

template<typename T, size_t NDIM>
double madness::CoeffTracker< T, NDIM >::dnorm_ =-1.0
private

norm of d coefficients corresponding to key

◆ impl

template<typename T, size_t NDIM>
const implT* madness::CoeffTracker< T, NDIM >::impl
private

the funcimpl that has the coeffs

Referenced by madness::CoeffTracker< T, LDIM >::make_child().

◆ is_leaf_

template<typename T, size_t NDIM>
LeafStatus madness::CoeffTracker< T, NDIM >::is_leaf_
private

flag if key is a leaf node

Referenced by madness::CoeffTracker< T, LDIM >::make_child().

◆ key_

template<typename T, size_t NDIM>
keyT madness::CoeffTracker< T, NDIM >::key_
private

the current key, which must exists in impl

Referenced by madness::CoeffTracker< T, LDIM >::make_child().


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