MADNESS 0.10.1
madness::LBNodeDeux< NDIM > Class Template Reference

#include <lbdeux.h>

Collaboration diagram for madness::LBNodeDeux< NDIM >:

Public Member Functions

 LBNodeDeux ()
 LBNodeDeux (const LBNodeDeux< NDIM > &other)
void add (double cost, bool got_kids)
 Accumulates cost into this node.
void deleter (const treeT &tree, const keyT &key)
 Logically deletes this node and its descendants.
double get_total_cost () const
bool has_children () const
bool is_deleted () const
 True if partitioning logically deleted this node, so it is not a subtree root.
LBNodeDeux< NDIM > & operator= (const LBNodeDeux< NDIM > &other)
void partition (const treeT &tree, const keyT &key, double avg)
 Descends tree deleting all except internal nodes and sub-tree parents.
template<typename Archive>
void serialize (Archive &ar)
void sum (const treeT &tree, const keyT &child, double value)
 Accumulates cost up the tree from children.

Private Types

typedef Key< NDIM > keyT
typedef LBNodeDeux< NDIM > nodeT
typedef WorldContainer< keyT, nodeT > treeT

Private Member Functions

int index (const keyT &key)
 Computes index of child key in this node using last bit of translations.

Private Attributes

double child_cost [nchild]
bool deleted
 Set by deleter(). A retained node can have any cost, even a negative one.
bool gotkids
double my_cost
AtomicInt nsummed
double total_cost

Static Private Attributes

static const int nchild = (1<<NDIM)

Member Typedef Documentation

◆ keyT

template<std::size_t NDIM>
typedef Key<NDIM> madness::LBNodeDeux< NDIM >::keyT
private

◆ nodeT

template<std::size_t NDIM>
typedef LBNodeDeux<NDIM> madness::LBNodeDeux< NDIM >::nodeT
private

◆ treeT

template<std::size_t NDIM>
typedef WorldContainer<keyT,nodeT> madness::LBNodeDeux< NDIM >::treeT
private

Constructor & Destructor Documentation

◆ LBNodeDeux() [1/2]

template<std::size_t NDIM>
madness::LBNodeDeux< NDIM >::LBNodeDeux ( )
inline

References child_cost, deleted, gotkids, my_cost, nchild, nsummed, and total_cost.

Referenced by LBNodeDeux(), and operator=().

◆ LBNodeDeux() [2/2]

template<std::size_t NDIM>
madness::LBNodeDeux< NDIM >::LBNodeDeux ( const LBNodeDeux< NDIM > & other)
inline

Member Function Documentation

◆ add()

template<std::size_t NDIM>
void madness::LBNodeDeux< NDIM >::add ( double cost,
bool got_kids )
inline

Accumulates cost into this node.

References gotkids, my_cost, and total_cost.

Referenced by madness::LoadBalanceDeux< NDIM >::add_op< T, costT >::operator()().

◆ deleter()

template<std::size_t NDIM>
void madness::LBNodeDeux< NDIM >::deleter ( const treeT & tree,
const keyT & key )
inline

Logically deletes this node and its descendants.

Cannot actually erase this node from the container since the send() handler is holding an accessor to it.

References deleted, deleter(), has_children(), and task().

Referenced by deleter(), and partition().

◆ get_total_cost()

template<std::size_t NDIM>
double madness::LBNodeDeux< NDIM >::get_total_cost ( ) const
inline

◆ has_children()

template<std::size_t NDIM>
bool madness::LBNodeDeux< NDIM >::has_children ( ) const
inline

◆ index()

template<std::size_t NDIM>
int madness::LBNodeDeux< NDIM >::index ( const keyT & key)
inlineprivate

Computes index of child key in this node using last bit of translations.

References d, NDIM, and madness::Key< NDIM >::translation().

Referenced by partition(), and sum().

◆ is_deleted()

template<std::size_t NDIM>
bool madness::LBNodeDeux< NDIM >::is_deleted ( ) const
inline

True if partitioning logically deleted this node, so it is not a subtree root.

References deleted.

◆ operator=()

template<std::size_t NDIM>
LBNodeDeux< NDIM > & madness::LBNodeDeux< NDIM >::operator= ( const LBNodeDeux< NDIM > & other)
inline

◆ partition()

template<std::size_t NDIM>
void madness::LBNodeDeux< NDIM >::partition ( const treeT & tree,
const keyT & key,
double avg )
inline

Descends tree deleting all except internal nodes and sub-tree parents.

References child_cost, deleter(), has_children(), index(), nchild, partition(), task(), and total_cost.

Referenced by madness::LoadBalanceDeux< NDIM >::load_balance(), and partition().

◆ serialize()

template<std::size_t NDIM>
template<typename Archive>
void madness::LBNodeDeux< NDIM >::serialize ( Archive & ar)
inline

◆ sum()

template<std::size_t NDIM>
void madness::LBNodeDeux< NDIM >::sum ( const treeT & tree,
const keyT & child,
double value )
inline

Member Data Documentation

◆ child_cost

template<std::size_t NDIM>
double madness::LBNodeDeux< NDIM >::child_cost[nchild]
private

◆ deleted

template<std::size_t NDIM>
bool madness::LBNodeDeux< NDIM >::deleted
private

Set by deleter(). A retained node can have any cost, even a negative one.

Referenced by LBNodeDeux(), LBNodeDeux(), deleter(), is_deleted(), and operator=().

◆ gotkids

template<std::size_t NDIM>
bool madness::LBNodeDeux< NDIM >::gotkids
private

◆ my_cost

template<std::size_t NDIM>
double madness::LBNodeDeux< NDIM >::my_cost
private

Referenced by LBNodeDeux(), LBNodeDeux(), add(), and operator=().

◆ nchild

template<std::size_t NDIM>
const int madness::LBNodeDeux< NDIM >::nchild = (1<<NDIM)
staticprivate

◆ nsummed

template<std::size_t NDIM>
AtomicInt madness::LBNodeDeux< NDIM >::nsummed
private

Referenced by LBNodeDeux(), LBNodeDeux(), operator=(), and sum().

◆ total_cost

template<std::size_t NDIM>
double madness::LBNodeDeux< NDIM >::total_cost
private

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