MADNESS  version 0.9
Public Types | Public Member Functions | List of all members
madness::FunctionNode< T, NDIM > Singleton Reference

FunctionNode holds the coefficients, etc., at each node of the 2^NDIM-tree. More...

#include <derivative.h>

Public Types

typedef GenTensor< T > coeffT
 
typedef Tensor< T > tensorT
 
typedef WorldContainer< Key
< NDIM >, FunctionNode< T,
NDIM > > 
dcT
 

Public Member Functions

 FunctionNode ()
 Default constructor makes node without coeff or children. More...
 
 FunctionNode (const coeffT &coeff, bool has_children=false)
 Constructor from given coefficients with optional children. More...
 
 FunctionNode (const coeffT &coeff, double norm_tree, bool has_children)
 
 FunctionNode (const FunctionNode< T, NDIM > &other)
 
FunctionNode< T, NDIM > & operator= (const FunctionNode< T, NDIM > &other)
 
template<typename Q >
FunctionNode< Q, NDIMconvert () const
 Copy with possible type conversion of coefficients, copying all other state. More...
 
bool has_coeff () const
 Returns true if there are coefficients in this node. More...
 
bool exists () const
 
bool has_children () const
 Returns true if this node has children. More...
 
bool is_leaf () const
 Returns true if this does not have children. More...
 
bool is_invalid () const
 Returns true if this node is invalid (no coeffs and no children) More...
 
coeffTcoeff ()
 Returns a non-const reference to the tensor containing the coeffs. More...
 
const coeffTcoeff () const
 Returns a const reference to the tensor containing the coeffs. More...
 
size_t size () const
 Returns the number of coefficients in this node. More...
 
void reduceRank (const double &eps)
 reduces the rank of the coefficients (if applicable) More...
 
Void set_has_children (bool flag)
 Sets has_children attribute to value of flag. More...
 
Void set_has_children_recursive (const typename FunctionNode< T, NDIM >::dcT &c, const Key< NDIM > &key)
 Sets has_children attribute to true recurring up to ensure connected. More...
 
void set_is_leaf (bool flag)
 Sets has_children attribute to value of !flag. More...
 
void set_coeff (const coeffT &coeffs)
 Takes a shallow copy of the coeff — same as this->coeff()=coeff. More...
 
void clear_coeff ()
 Clears the coefficients (has_coeff() will subsequently return false) More...
 
template<typename Q >
void scale (Q a)
 Scale the coefficients of this node. More...
 
Void set_norm_tree (double norm_tree)
 Sets the value of norm_tree. More...
 
double get_norm_tree () const
 Gets the value of norm_tree. More...
 
template<typename Q , typename R >
Void gaxpy_inplace (const T &alpha, const FunctionNode< Q, NDIM > &other, const R &beta)
 General bi-linear operation — this = this*alpha + other*beta. More...
 
double accumulate2 (const tensorT &t, const typename FunctionNode< T, NDIM >::dcT &c, const Key< NDIM > &key)
 Accumulate inplace and if necessary connect node to parent. More...
 
double accumulate (const coeffT &t, const typename FunctionNode< T, NDIM >::dcT &c, const Key< NDIM > &key, const TensorArgs &args)
 Accumulate inplace and if necessary connect node to parent. More...
 
Void consolidate_buffer (const TensorArgs &args)
 
trace_conj (const FunctionNode< T, NDIM > &rhs) const
 
template<typename Archive >
void serialize (Archive &ar)
 

Detailed Description

template<typename T, std::size_t NDIM>
singleton madness::FunctionNode< T, NDIM >

FunctionNode holds the coefficients, etc., at each node of the 2^NDIM-tree.

Member Typedef Documentation

template<typename T, std::size_t NDIM>
typedef GenTensor<T> madness::FunctionNode< T, NDIM >::coeffT
template<typename T, std::size_t NDIM>
typedef WorldContainer<Key<NDIM> , FunctionNode<T, NDIM> > madness::FunctionNode< T, NDIM >::dcT

Type of container holding the nodes

template<typename T, std::size_t NDIM>
typedef Tensor<T> madness::FunctionNode< T, NDIM >::tensorT

Constructor & Destructor Documentation

template<typename T, std::size_t NDIM>
madness::FunctionNode< T, NDIM >::FunctionNode ( )
inline

Default constructor makes node without coeff or children.

template<typename T, std::size_t NDIM>
madness::FunctionNode< T, NDIM >::FunctionNode ( const coeffT coeff,
bool  has_children = false 
)
inlineexplicit

Constructor from given coefficients with optional children.

Note that only a shallow copy of the coeff are taken so you should pass in a deep copy if you want the node to take ownership.

template<typename T, std::size_t NDIM>
madness::FunctionNode< T, NDIM >::FunctionNode ( const coeffT coeff,
double  norm_tree,
bool  has_children 
)
inlineexplicit
template<typename T, std::size_t NDIM>
madness::FunctionNode< T, NDIM >::FunctionNode ( const FunctionNode< T, NDIM > &  other)
inline

Member Function Documentation

template<typename T, std::size_t NDIM>
double madness::FunctionNode< T, NDIM >::accumulate ( const coeffT t,
const typename FunctionNode< T, NDIM >::dcT c,
const Key< NDIM > &  key,
const TensorArgs args 
)
inline
template<typename T, std::size_t NDIM>
double madness::FunctionNode< T, NDIM >::accumulate2 ( const tensorT t,
const typename FunctionNode< T, NDIM >::dcT c,
const Key< NDIM > &  key 
)
inline
template<typename T, std::size_t NDIM>
void madness::FunctionNode< T, NDIM >::clear_coeff ( )
inline
template<typename T, std::size_t NDIM>
coeffT& madness::FunctionNode< T, NDIM >::coeff ( )
inline

Returns a non-const reference to the tensor containing the coeffs.

Returns an empty tensor if there are no coefficients.

References madness::BaseTensor::dim(), and madness::BaseTensor::ndim().

Referenced by madness::FunctionNode< T, NDIM >::accumulate(), madness::FunctionNode< T, NDIM >::accumulate2(), madness::FunctionImpl< T, NDIM >::add_scalar_inplace(), madness::FunctionImpl< T, NDIM >::autorefine_square_test(), madness::FunctionNode< T, NDIM >::clear_coeff(), madness::FunctionNode< T, NDIM >::consolidate_buffer(), madness::FunctionNode< T, NDIM >::convert(), madness::FunctionImpl< T, NDIM >::diff(), madness::FunctionImpl< Q, NDIM >::err_box(), madness::FunctionImpl< T, NDIM >::eval(), madness::FunctionImpl< T, NDIM >::eval_local_only(), madness::FunctionImpl< T, NDIM >::evalR(), madness::FunctionNode< T, NDIM >::gaxpy_inplace(), madness::FunctionImpl< T, NDIM >::norm_tree_spawn(), madness::LBCost::operator()(), madness::FunctionImpl< T, NDIM >::do_truncate_NS_leafs::operator()(), madness::FunctionImpl< T, NDIM >::do_keep_sum_coeffs::operator()(), madness::FunctionImpl< T, NDIM >::do_check_symmetry_local::operator()(), madness::FunctionImpl< T, NDIM >::do_mapdim::operator()(), madness::FunctionImpl< T, NDIM >::do_average::operator()(), madness::FunctionImpl< T, NDIM >::do_change_tensor_type::operator()(), madness::FunctionImpl< T, NDIM >::do_unary_op_value_inplace< opT >::operator()(), madness::detail::scaleinplace< T, NDIM >::operator()(), madness::FunctionImpl< T, NDIM >::do_standard::operator()(), madness::FunctionImpl< T, NDIM >::do_norm2sq_local::operator()(), madness::FunctionImpl< T, NDIM >::do_inner_local< R >::operator()(), madness::FunctionNode< T, NDIM >::operator=(), madness::FunctionImpl< T, NDIM >::print_plane_local(), madness::FunctionImpl< T, NDIM >::print_stats(), madness::FunctionImpl< T, NDIM >::project(), madness::FunctionImpl< T, NDIM >::real_size(), madness::FunctionImpl< T, NDIM >::reconstruct_op(), madness::FunctionNode< T, NDIM >::serialize(), madness::FunctionNode< T, NDIM >::set_coeff(), madness::FunctionImpl< T, NDIM >::sock_it_to_me(), madness::FunctionImpl< T, NDIM >::sock_it_to_me_too(), madness::FunctionImpl< T, NDIM >::sum_down_spawn(), madness::FunctionImpl< T, NDIM >::trace_local(), madness::FunctionImpl< T, NDIM >::trickle_down_op(), madness::FunctionImpl< T, NDIM >::truncate_op(), madness::FunctionImpl< T, NDIM >::truncate_spawn(), madness::FunctionImpl< Q, NDIM >::unary_op_coeff_inplace(), madness::FunctionImpl< T, NDIM >::verify_tree(), and madness::FunctionImpl< Q, NDIM >::vtransform_doit().

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

Returns a const reference to the tensor containing the coeffs.

Returns an empty tensor if there are no coefficeints.

template<typename T, std::size_t NDIM>
Void madness::FunctionNode< T, NDIM >::consolidate_buffer ( const TensorArgs args)
inline
template<typename T, std::size_t NDIM>
template<typename Q >
FunctionNode<Q, NDIM> madness::FunctionNode< T, NDIM >::convert ( ) const
inline

Copy with possible type conversion of coefficients, copying all other state.

Choose to not overload copy and type conversion operators so there are no automatic type conversions.

References madness::FunctionNode< T, NDIM >::coeff(), and madness::copy().

template<typename T, std::size_t NDIM>
bool madness::FunctionNode< T, NDIM >::exists ( ) const
inline
template<typename T, std::size_t NDIM>
template<typename Q , typename R >
Void madness::FunctionNode< T, NDIM >::gaxpy_inplace ( const T &  alpha,
const FunctionNode< Q, NDIM > &  other,
const R beta 
)
inline

General bi-linear operation — this = this*alpha + other*beta.

This/other may not have coefficients. Has_children will be true in the result if either this/other have children.

References beta, madness::FunctionNode< T, NDIM >::coeff(), madness::FunctionNode< T, NDIM >::has_coeff(), and PROFILE_MEMBER_FUNC.

Referenced by madness::FunctionImpl< T, NDIM >::do_merge_trees< Q, R >::operator()().

template<typename T, std::size_t NDIM>
double madness::FunctionNode< T, NDIM >::get_norm_tree ( ) const
inline

Gets the value of norm_tree.

template<typename T, std::size_t NDIM>
bool madness::FunctionNode< T, NDIM >::has_children ( ) const
inline
template<typename T, std::size_t NDIM>
bool madness::FunctionNode< T, NDIM >::has_coeff ( ) const
inline

Returns true if there are coefficients in this node.

References madness::GenTensor< T >::has_data().

Referenced by madness::FunctionNode< T, NDIM >::accumulate(), madness::FunctionNode< T, NDIM >::accumulate2(), madness::FunctionImpl< T, NDIM >::add_scalar_inplace(), madness::FunctionImpl< T, NDIM >::diff(), madness::FunctionImpl< T, NDIM >::eval(), madness::FunctionImpl< T, NDIM >::eval_local_only(), madness::FunctionImpl< T, NDIM >::eval_plot_cube(), madness::FunctionImpl< T, NDIM >::evaldepthpt(), madness::FunctionImpl< T, NDIM >::evalR(), madness::FunctionNode< T, NDIM >::gaxpy_inplace(), madness::FunctionNode< T, NDIM >::is_invalid(), madness::FunctionImpl< T, NDIM >::do_average::operator()(), madness::FunctionImpl< T, NDIM >::do_unary_op_value_inplace< opT >::operator()(), madness::FunctionImpl< T, NDIM >::do_standard::operator()(), madness::FunctionImpl< T, NDIM >::do_err_box< opT >::operator()(), madness::FunctionImpl< T, NDIM >::do_norm2sq_local::operator()(), madness::FunctionImpl< T, NDIM >::do_inner_local< R >::operator()(), madness::FunctionImpl< T, NDIM >::print_plane_local(), madness::FunctionImpl< T, NDIM >::print_stats(), madness::FunctionImpl< T, NDIM >::project(), madness::FunctionImpl< T, NDIM >::real_size(), madness::FunctionImpl< T, NDIM >::reconstruct_op(), madness::FunctionNode< T, NDIM >::set_has_children_recursive(), madness::FunctionImpl< T, NDIM >::size(), madness::FunctionImpl< T, NDIM >::sock_it_to_me(), madness::FunctionImpl< T, NDIM >::sock_it_to_me_too(), madness::FunctionImpl< T, NDIM >::trace_local(), madness::FunctionImpl< T, NDIM >::truncate_op(), madness::FunctionImpl< T, NDIM >::truncate_spawn(), madness::FunctionImpl< Q, NDIM >::unary_op_coeff_inplace(), and madness::FunctionImpl< Q, NDIM >::vtransform_doit().

template<typename T, std::size_t NDIM>
bool madness::FunctionNode< T, NDIM >::is_invalid ( ) const
inline

Returns true if this node is invalid (no coeffs and no children)

References madness::FunctionNode< T, NDIM >::has_children(), and madness::FunctionNode< T, NDIM >::has_coeff().

template<typename T, std::size_t NDIM>
bool madness::FunctionNode< T, NDIM >::is_leaf ( ) const
inline
template<typename T, std::size_t NDIM>
FunctionNode<T, NDIM>& madness::FunctionNode< T, NDIM >::operator= ( const FunctionNode< T, NDIM > &  other)
inline
template<typename T, std::size_t NDIM>
void madness::FunctionNode< T, NDIM >::reduceRank ( const double &  eps)
inline
template<typename T, std::size_t NDIM>
template<typename Q >
void madness::FunctionNode< T, NDIM >::scale ( a)
inline

Scale the coefficients of this node.

Referenced by madness::FunctionImpl< T, NDIM >::do_merge_trees< Q, R >::operator()().

template<typename T, std::size_t NDIM>
template<typename Archive >
void madness::FunctionNode< T, NDIM >::serialize ( Archive &  ar)
inline
template<typename T, std::size_t NDIM>
void madness::FunctionNode< T, NDIM >::set_coeff ( const coeffT coeffs)
inline
template<typename T, std::size_t NDIM>
Void madness::FunctionNode< T, NDIM >::set_has_children ( bool  flag)
inline
template<typename T, std::size_t NDIM>
Void madness::FunctionNode< T, NDIM >::set_has_children_recursive ( const typename FunctionNode< T, NDIM >::dcT c,
const Key< NDIM > &  key 
)
inline
template<typename T, std::size_t NDIM>
void madness::FunctionNode< T, NDIM >::set_is_leaf ( bool  flag)
inline

Sets has_children attribute to value of !flag.

template<typename T, std::size_t NDIM>
Void madness::FunctionNode< T, NDIM >::set_norm_tree ( double  norm_tree)
inline

Sets the value of norm_tree.

References madness::norm_tree().

Referenced by madness::FunctionImpl< T, NDIM >::norm_tree_spawn().

template<typename T, std::size_t NDIM>
size_t madness::FunctionNode< T, NDIM >::size ( ) const
inline

Returns the number of coefficients in this node.

References madness::BaseTensor::size().

Referenced by madness::FunctionImpl< T, NDIM >::size().

template<typename T, std::size_t NDIM>
T madness::FunctionNode< T, NDIM >::trace_conj ( const FunctionNode< T, NDIM > &  rhs) const
inline

The documentation for this singleton was generated from the following files: