MADNESS
version 0.9
|
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, NDIM > | convert () 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... | |
coeffT & | coeff () |
Returns a non-const reference to the tensor containing the coeffs. More... | |
const coeffT & | coeff () 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) |
T | trace_conj (const FunctionNode< T, NDIM > &rhs) const |
template<typename Archive > | |
void | serialize (Archive &ar) |
FunctionNode holds the coefficients, etc., at each node of the 2^NDIM-tree.
typedef GenTensor<T> madness::FunctionNode< T, NDIM >::coeffT |
typedef WorldContainer<Key<NDIM> , FunctionNode<T, NDIM> > madness::FunctionNode< T, NDIM >::dcT |
Type of container holding the nodes
typedef Tensor<T> madness::FunctionNode< T, NDIM >::tensorT |
|
inline |
Default constructor makes node without coeff or children.
|
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.
|
inlineexplicit |
|
inline |
|
inline |
Accumulate inplace and if necessary connect node to parent.
References madness::GenTensor< T >::add_SVD(), c, madness::FunctionNode< T, NDIM >::coeff(), madness::copy(), madness::FunctionNode< T, NDIM >::has_coeff(), madness::GenTensor< T >::has_data(), madness::Key< NDIM >::level(), madness::Key< NDIM >::parent(), madness::GenTensor< T >::rank(), and madness::TensorArgs::thresh.
Referenced by madness::FunctionImpl< Q, NDIM >::do_apply_kernel2(), and madness::FunctionImpl< Q, NDIM >::do_apply_kernel3().
|
inline |
Accumulate inplace and if necessary connect node to parent.
References c, madness::FunctionNode< T, NDIM >::coeff(), madness::FunctionNode< T, NDIM >::has_coeff(), madness::Key< NDIM >::level(), madness::Key< NDIM >::parent(), and madness::TT_FULL.
Referenced by madness::FunctionImpl< Q, NDIM >::apply_1d_realspace_push_op(), madness::FunctionImpl< Q, NDIM >::do_apply(), madness::FunctionImpl< Q, NDIM >::do_apply_kernel(), and madness::FunctionImpl< Q, NDIM >::do_project_out().
|
inline |
Clears the coefficients (has_coeff() will subsequently return false)
References madness::FunctionNode< T, NDIM >::coeff().
Referenced by madness::FunctionImpl< T, NDIM >::remove_internal_coeffs::operator()(), madness::FunctionImpl< T, NDIM >::do_standard::operator()(), madness::FunctionImpl< T, NDIM >::reconstruct_op(), madness::FunctionImpl< T, NDIM >::sum_down_spawn(), madness::FunctionImpl< T, NDIM >::trickle_down_op(), madness::FunctionImpl< T, NDIM >::truncate_op(), and madness::FunctionImpl< T, NDIM >::truncate_spawn().
|
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().
|
inline |
Returns a const reference to the tensor containing the coeffs.
Returns an empty tensor if there are no coefficeints.
|
inline |
|
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().
|
inline |
|
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()().
|
inline |
Gets the value of norm_tree.
|
inline |
Returns true if this node has children.
Referenced by madness::FunctionImpl< T, NDIM >::do_print_tree(), madness::FunctionImpl< T, NDIM >::do_print_tree_graphviz(), madness::FunctionNode< T, NDIM >::is_invalid(), madness::FunctionImpl< T, NDIM >::norm_tree_spawn(), madness::FunctionImpl< T, NDIM >::remove_internal_coeffs::operator()(), madness::FunctionImpl< T, NDIM >::do_check_symmetry_local::operator()(), madness::FunctionImpl< T, NDIM >::do_mapdim::operator()(), madness::FunctionImpl< T, NDIM >::do_standard::operator()(), madness::FunctionImpl< T, NDIM >::reconstruct_op(), madness::FunctionImpl< Q, NDIM >::refine_spawn(), madness::FunctionNode< T, NDIM >::set_has_children_recursive(), madness::FunctionImpl< T, NDIM >::sum_down_spawn(), madness::FunctionImpl< T, NDIM >::trickle_down_op(), madness::FunctionImpl< T, NDIM >::truncate_op(), madness::FunctionImpl< T, NDIM >::truncate_spawn(), and madness::FunctionImpl< T, NDIM >::verify_tree().
|
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().
|
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().
|
inline |
Returns true if this does not have children.
Referenced by madness::FunctionImpl< T, NDIM >::local_leaf_keys(), DirichletLBCost< NDIM >::operator()(), madness::lbcost< T, NDIM >::operator()(), madness::FunctionImpl< T, NDIM >::do_truncate_NS_leafs::operator()(), madness::FunctionImpl< T, NDIM >::do_inner_local< R >::operator()(), madness::FunctionImpl< T, NDIM >::print_info(), madness::FunctionImpl< T, NDIM >::print_plane_local(), and madness::FunctionImpl< T, NDIM >::reconstruct_op().
|
inline |
References madness::FunctionNode< T, NDIM >::coeff(), and madness::copy().
|
inline |
reduces the rank of the coefficients (if applicable)
References madness::GenTensor< T >::reduce_rank().
Referenced by madness::FunctionImpl< T, NDIM >::do_reduce_rank::operator()(), and madness::FunctionImpl< T, NDIM >::do_standard::operator()().
|
inline |
Scale the coefficients of this node.
Referenced by madness::FunctionImpl< T, NDIM >::do_merge_trees< Q, R >::operator()().
|
inline |
References madness::FunctionNode< T, NDIM >::coeff().
|
inline |
Takes a shallow copy of the coeff — same as this->coeff()=coeff
.
References madness::FunctionNode< T, NDIM >::coeff(), madness::BaseTensor::dim(), madness::GenTensor< T >::has_data(), and madness::print().
Referenced by madness::FunctionImpl< T, NDIM >::reconstruct_op(), madness::FunctionImpl< T, NDIM >::truncate_op(), and madness::FunctionImpl< Q, NDIM >::vtransform_doit().
|
inline |
Sets has_children
attribute to value of flag
.
Referenced by madness::FunctionImpl< T, NDIM >::erase(), madness::FunctionImpl< T, NDIM >::reconstruct_op(), madness::FunctionImpl< T, NDIM >::truncate_op(), and madness::FunctionImpl< T, NDIM >::truncate_reconstructed_op().
|
inline |
Sets has_children
attribute to true recurring up to ensure connected.
References c, madness::FunctionNode< T, NDIM >::has_children(), madness::FunctionNode< T, NDIM >::has_coeff(), madness::TaskAttributes::hipri(), madness::Key< NDIM >::level(), madness::Key< NDIM >::parent(), and PROFILE_MEMBER_FUNC.
Referenced by madness::FunctionImpl< Q, NDIM >::vtransform_doit().
|
inline |
Sets has_children
attribute to value of !flag
.
|
inline |
Sets the value of norm_tree.
References madness::norm_tree().
Referenced by madness::FunctionImpl< T, NDIM >::norm_tree_spawn().
|
inline |
Returns the number of coefficients in this node.
References madness::BaseTensor::size().
Referenced by madness::FunctionImpl< T, NDIM >::size().
|
inline |