MADNESS
0.10.1
|
Key is the index for a node of the 2^NDIM-tree. More...
#include <key.h>
Public Member Functions | |
Key () | |
Default constructor makes an uninitialized key. More... | |
Key (int n) | |
Constructor with given n and l=0. More... | |
Key (Level n, const Vector< Translation, NDIM > &l) | |
Constructor with given n, l. More... | |
template<std::size_t LDIM, std::size_t KDIM> | |
void | break_apart (Key< LDIM > &key1, Key< KDIM > &key2) const |
break key into two low-dimensional keys More... | |
uint64_t | distsq () const |
template<std::size_t VDIM> | |
Key< NDIM-VDIM > | extract_complement_key (const std::array< int, VDIM > &v) const |
extract a new key with the Translations complementary to the ones indicated in the v array More... | |
template<std::size_t VDIM> | |
Key< VDIM > | extract_key (const std::array< int, VDIM > &v) const |
extract a new key with the Translations indicated in the v array More... | |
hashT | hash () const |
bool | is_child_of (const Key &key) const |
bool | is_farther_out_than (const Key< NDIM > &other) const |
return if the other key is pointing in the same direction and is farther out More... | |
bool | is_invalid () const |
Checks if a key is invalid. More... | |
bool | is_neighbor_of (const Key &key, const std::vector< bool > &bperiodic) const |
Assuming keys are at the same level, returns true if displaced by no more than 1 in any direction. More... | |
bool | is_parent_of (const Key &key) const |
bool | is_valid () const |
Checks if a key is valid. More... | |
Level | level () const |
template<std::size_t LDIM> | |
Key< NDIM+LDIM > | merge_with (const Key< LDIM > &rhs) const |
merge with other key (ie concatenate), use level of rhs, not of this More... | |
Key | neighbor (const Key< NDIM > &disp) const |
given a displacement, generate a neighbor key; ignore boundary conditions and disp's level More... | |
bool | operator!= (const Key &other) const |
bool | operator< (const Key &other) const |
Comparison operator less than to enable storage in STL map. More... | |
bool | operator== (const Key &other) const |
Equality test. More... | |
Key | parent (int generation=1) const |
Returns the key of the parent. More... | |
void | rehash () |
Recomputes hashval ... presently only done when reading from external storage. More... | |
bool | thisKeyContains (const Vector< double, NDIM > &x, const unsigned int &dim0, const unsigned int &dim1) const |
check if this MultiIndex contains point x, disregarding these two dimensions More... | |
const Vector< Translation, NDIM > & | translation () const |
Static Public Member Functions | |
static Key< NDIM > | invalid () |
Returns an invalid key. More... | |
Static Public Attributes | |
static const std::size_t | static_size = NDIM |
Private Attributes | |
hashT | hashval |
Vector< Translation, NDIM > | l |
Level | n |
Friends | |
class | KeyChildIterator< NDIM > |
Key is the index for a node of the 2^NDIM-tree.
See KeyChildIterator for facile generation of children, and foreach_child(parent,op) for facile applicaiton of operators to child keys.
|
inline |
Default constructor makes an uninitialized key.
Referenced by madness::Key< NDIM >::neighbor(), and madness::Key< NDIM >::parent().
|
inline |
Constructor with given n, l.
References madness::Key< NDIM >::rehash().
|
inline |
Constructor with given n and l=0.
References madness::Key< NDIM >::rehash().
|
inline |
break key into two low-dimensional keys
References KeyChildIterator::i, madness::Key< NDIM >::l, MADNESS_ASSERT, MADNESS_PRAGMA_GCC, madness::Key< NDIM >::n, NDIM, and madness::pop().
Referenced by madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::compute_error_from_inaccurate_refinement(), madness::FunctionImpl< T, NDIM >::dirac_convolution_op(), madness::FunctionImpl< T, NDIM >::do_dirac_convolution(), madness::SeparatedConvolution< Q, NDIM >::get_source_key(), madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::make_child(), madness::FunctionImpl< T, NDIM >::hartree_op< LDIM, leaf_opT >::make_child(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::make_child(), madness::FunctionImpl< T, NDIM >::recursive_apply_op< opT, LDIM >::make_child(), madness::FunctionImpl< T, NDIM >::project_out_op< LDIM >::make_child(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::make_sum_coeffs(), madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::operator()(), madness::FunctionImpl< T, NDIM >::hartree_op< LDIM, leaf_opT >::operator()(), madness::FunctionImpl< T, NDIM >::recursive_apply_op< opT, LDIM >::operator()(), madness::FunctionImpl< T, NDIM >::project_out_op< LDIM >::operator()(), madness::ElectronCuspyBox_op< T, NDIM >::operator()(), madness::NuclearCuspyBox_op< T, NDIM >::operator()(), madness::FunctionImpl< T, NDIM >::pointwise_multiplier< LDIM >::operator()(), madness::FunctionImpl< T, NDIM >::do_inner_local_on_demand< R >::operator()(), madness::FunctionImpl< T, NDIM >::partial_inner_contract(), and madness::FunctionImpl< T, NDIM >::project_out2().
|
inline |
References d(), dist(), madness::Key< NDIM >::l, and NDIM.
|
inline |
extract a new key with the Translations complementary to the ones indicated in the v array
References madness::Key< NDIM >::extract_key(), KeyChildIterator::i, NDIM, and v.
Referenced by madness::FunctionImpl< T, NDIM >::recur_down_for_contraction_map().
|
inline |
extract a new key with the Translations indicated in the v array
References KeyChildIterator::i, madness::Key< NDIM >::level(), and madness::Key< NDIM >::translation().
Referenced by madness::Key< NDIM >::extract_complement_key(), and madness::FunctionImpl< T, NDIM >::recur_down_for_contraction_map().
|
inline |
References madness::Key< NDIM >::hashval.
Referenced by operator<<(), LevelPmap::owner(), LevelPmapX::owner(), PartitionPmap::owner(), and madness::MyPmap< D >::simple_hash().
|
inlinestatic |
Returns an invalid key.
Referenced by madness::DerivativeBase< T, NDIM >::neighbor().
|
inline |
References KeyChildIterator::key(), Key::n, and madness::Key< NDIM >::parent().
Referenced by madness::CoeffTracker< T, NDIM >::dnorm().
|
inline |
return if the other key is pointing in the same direction and is farther out
unlike in distsq() the direction is taken into account, and other must be longer than this in each dimension
[in] | other | a key |
References KeyChildIterator::i, madness::Key< NDIM >::l, NDIM, and madness::Key< NDIM >::translation().
|
inline |
Checks if a key is invalid.
References madness::Key< NDIM >::n.
Referenced by madness::DerivativeBase< T, NDIM >::find_neighbor(), and madness::FunctionImpl< T, NDIM >::parent_to_child().
|
inline |
Assuming keys are at the same level, returns true if displaced by no more than 1 in any direction.
Assumes key and this are at the same level
References std::abs(), dist(), KeyChildIterator::i, KeyChildIterator::key(), madness::Key< NDIM >::l, max, madness::Key< NDIM >::n, and NDIM.
Referenced by madness::Specialbox_op< T, NDIM >::check_special_points(), and madness::FunctionImpl< T, NDIM >::project_refine_op().
|
inline |
References KeyChildIterator::key().
|
inline |
Checks if a key is valid.
References madness::Key< NDIM >::n.
Referenced by madness::FunctionImpl< T, NDIM >::do_apply(), and madness::FunctionImpl< T, NDIM >::do_apply_directed_screening().
|
inline |
References madness::Key< NDIM >::n.
Referenced by madness::FunctionNode< T, NDIM >::accumulate(), madness::FunctionNode< T, NDIM >::accumulate2(), madness::FunctionImpl< T, NDIM >::apply_1d_realspace_push_op(), madness::Specialbox_op< T, NDIM >::box_is_at_boundary(), madness::Specialbox_op< T, NDIM >::check_special_points(), madness::FunctionCommonFunctionality< T, NDIM >::coeffs2values(), madness::FunctionImpl< T, NDIM >::coeffs2values(), madness::Leaf_op< T, NDIM, opT, specialboxT >::compare_to_parent(), madness::FunctionImpl< T, NDIM >::do_apply(), madness::FunctionImpl< T, NDIM >::do_apply_directed_screening(), madness::FunctionImpl< T, NDIM >::do_binary_op(), madness::Derivative< T, NDIM >::do_diff2b(), madness::Derivative< T, NDIM >::do_diff2i(), madness::FunctionImpl< T, NDIM >::do_mul(), madness::FunctionImpl< T, NDIM >::do_print_grid(), madness::FunctionImpl< T, NDIM >::do_print_tree(), madness::FunctionImpl< T, NDIM >::do_print_tree_graphviz(), madness::FunctionImpl< T, NDIM >::do_print_tree_json(), madness::FunctionImpl< T, NDIM >::erase(), madness::FunctionImpl< T, NDIM >::err_box(), madness::FunctionImpl< T, NDIM >::eval(), madness::FunctionImpl< T, NDIM >::eval_local_only(), madness::FunctionImpl< T, NDIM >::evaldepthpt(), madness::FunctionImpl< T, NDIM >::evalR(), madness::Key< NDIM >::extract_key(), madness::fcube(), madness::FunctionImpl< T, NDIM >::fcube_for_mul(), madness::FunctionImpl< T, NDIM >::recursive_apply_op< opT, LDIM >::finalize(), madness::FunctionImpl< T, NDIM >::recursive_apply_op2< opT >::finalize(), madness::FunctionImpl< T, NDIM >::get_contraction_node_lists(), madness::FunctionImpl< T, NDIM >::get_norm_tree_recursive(), madness::FunctionImpl< T, NDIM >::insert_zero_down_to_initial_level(), madness::CoeffTracker< T, NDIM >::make_child(), madness::TwoElectronInterface< T, NDIM >::make_coeff(), madness::Key< NDIM >::merge_with(), madness::Convolution1D< Q >::mod_nonstandard(), madness::FunctionImpl< T, NDIM >::mul(), madness::Key< NDIM >::neighbor(), madness::DerivativeBase< T, NDIM >::neighbor(), madness::MyPmap< D >::not_so_simple_hash(), madness::FunctionImpl< T, NDIM >::NS_fcube_for_mul(), madness::FunctionImpl< T, NDIM >::NScoeffs2values(), LBCost::operator()(), YetAnotherWrapperClass::operator()(), madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::operator()(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::operator()(), madness::ElectronCuspyBox_op< T, NDIM >::operator()(), madness::NuclearCuspyBox_op< T, NDIM >::operator()(), DirichletLBCost< NDIM >::operator()(), lbcost< T, NDIM >::operator()(), madness::lbcost< T, NDIM >::operator()(), madness::op_leaf_op< T, NDIM, opT >::operator()(), madness::hartree_leaf_op< T, NDIM >::operator()(), madness::hartree_convolute_leaf_op< T, NDIM, LDIM, opT >::operator()(), true_if_n_gt_op::operator()(), madness::FunctionImpl< T, NDIM >::do_check_symmetry_local::operator()(), madness::FunctionImpl< T, NDIM >::do_mapdim::operator()(), madness::FunctionImpl< T, NDIM >::do_mirror::operator()(), madness::FunctionImpl< T, NDIM >::do_map_and_mirror::operator()(), madness::FunctionImpl< T, NDIM >::do_unary_op_value_inplace< opT >::operator()(), madness::FunctionImpl< T, NDIM >::do_standard::operator()(), madness::operator<<(), LevelPmap::owner(), LevelPmapX::owner(), PartitionPmap::owner(), madness::LBDeuxPmap< NDIM >::owner(), madness::FunctionImpl< T, NDIM >::parent_to_child(), madness::FunctionImpl< T, NDIM >::parent_to_child_NS(), madness::FunctionImpl< T, NDIM >::partial_inner_contract(), madness::Leaf_op< T, NDIM, opT, specialboxT >::post_screening(), madness::FunctionImpl< T, NDIM >::print_plane_local(), madness::FunctionImpl< T, NDIM >::project(), madness::FunctionImpl< T, NDIM >::project_refine_op(), madness::FunctionImpl< T, NDIM >::read_grid(), madness::FunctionImpl< T, NDIM >::read_grid2(), madness::FunctionImpl< T, NDIM >::reconstruct_op(), madness::FunctionImpl< T, NDIM >::recur_down_for_contraction_map(), madness::FunctionImpl< T, NDIM >::refine_op(), madness::FunctionNode< T, NDIM >::set_has_children_recursive(), madness::MyPmap< D >::simple_hash(), madness::Leaf_op< T, NDIM, opT, specialboxT >::special_refinement_needed(), madness::LoadBalanceDeux< NDIM >::sum(), madness::LBNodeDeux< NDIM >::sum(), madness::FunctionImpl< T, NDIM >::trace_local(), madness::FunctionImpl< T, NDIM >::truncate_op(), madness::FunctionImpl< T, NDIM >::truncate_reconstructed_op(), madness::FunctionImpl< T, NDIM >::truncate_spawn(), madness::FunctionImpl< T, NDIM >::truncate_tol(), madness::FunctionCommonFunctionality< T, NDIM >::values2coeffs(), madness::FunctionImpl< T, NDIM >::values2coeffs(), madness::FunctionImpl< T, NDIM >::values2NScoeffs(), and madness::FunctionImpl< T, NDIM >::vtransform_doit().
|
inline |
merge with other key (ie concatenate), use level of rhs, not of this
References KeyChildIterator::i, madness::Key< NDIM >::level(), NDIM, and madness::Key< NDIM >::translation().
Referenced by madness::FunctionImpl< T, NDIM >::do_apply_directed_screening(), madness::SeparatedConvolution< Q, NDIM >::getop_modified(), and madness::FunctionImpl< T, NDIM >::recur_down_for_contraction_map().
|
inline |
given a displacement, generate a neighbor key; ignore boundary conditions and disp's level
[in] | disp | the displacement |
References madness::Key< NDIM >::Key(), madness::Key< NDIM >::l, madness::Key< NDIM >::level(), and madness::Key< NDIM >::translation().
|
inline |
|
inline |
Comparison operator less than to enable storage in STL map.
References madness::Key< NDIM >::hashval, KeyChildIterator::i, madness::Key< NDIM >::l, madness::Key< NDIM >::n, and NDIM.
|
inline |
Equality test.
References madness::Key< NDIM >::hashval, KeyChildIterator::i, madness::Key< NDIM >::l, madness::Key< NDIM >::n, and NDIM.
|
inline |
Returns the key of the parent.
Default is the immediate parent (generation=1). To get the grandparent use generation=2, and similarly for great-grandparents.
!! If there is no such parent it quietly returns the closest match (which may be self if this is the top of the tree).
References madness::Key< NDIM >::Key(), KeyChildIterator::i, madness::Key< NDIM >::l, madness::Key< NDIM >::n, and NDIM.
Referenced by madness::FunctionNode< T, NDIM >::accumulate(), madness::FunctionNode< T, NDIM >::accumulate2(), madness::FunctionImpl< T, NDIM >::get_contraction_node_lists(), madness::FunctionImpl< T, NDIM >::get_norm_tree_recursive(), madness::Key< NDIM >::is_child_of(), madness::MyPmap< D >::not_so_simple_hash(), madness::FunctionImpl< T, NDIM >::do_inner_local_on_demand< R >::operator()(), LevelPmapX::owner(), PartitionPmap::owner(), madness::LBDeuxPmap< NDIM >::owner(), madness::FunctionImpl< T, NDIM >::read_grid(), madness::FunctionImpl< T, NDIM >::read_grid2(), madness::FunctionNode< T, NDIM >::set_has_children_recursive(), madness::MyPmap< D >::simple_hash(), madness::FunctionImpl< T, NDIM >::sock_it_to_me(), madness::FunctionImpl< T, NDIM >::sock_it_to_me_too(), madness::LoadBalanceDeux< NDIM >::sum(), madness::LBNodeDeux< NDIM >::sum(), and madness::FunctionImpl< T, NDIM >::vtransform_doit().
|
inline |
Recomputes hashval ... presently only done when reading from external storage.
References madness::hash_combine(), madness::hash_value(), madness::Key< NDIM >::hashval, madness::Key< NDIM >::l, and madness::Key< NDIM >::n.
Referenced by madness::Key< NDIM >::Key(), and madness::archive::ArchiveLoadImpl< BinaryFstreamInputArchive, Key< NDIM > >::load().
|
inline |
check if this MultiIndex contains point x, disregarding these two dimensions
References KeyChildIterator::i, madness::Key< NDIM >::l, MADNESS_ASSERT, madness::Key< NDIM >::n, NDIM, and pow().
Referenced by madness::FunctionImpl< T, NDIM >::print_plane_local().
|
inline |
References madness::Key< NDIM >::l.
Referenced by madness::FunctionImpl< T, NDIM >::apply_1d_realspace_push_op(), madness::Specialbox_op< T, NDIM >::box_is_at_boundary(), madness::FunctionImpl< T, NDIM >::child_patch(), madness::DerivativeBase< T, NDIM >::do_diff1(), madness::Derivative< T, NDIM >::do_diff2b(), madness::FunctionImpl< T, NDIM >::do_print_grid(), madness::FunctionImpl< T, NDIM >::do_print_tree_graphviz(), madness::FunctionImpl< T, NDIM >::do_print_tree_json(), madness::FunctionImpl< T, NDIM >::eval(), madness::FunctionImpl< T, NDIM >::eval_local_only(), madness::FunctionImpl< T, NDIM >::evaldepthpt(), madness::FunctionImpl< T, NDIM >::evalR(), madness::Key< NDIM >::extract_key(), madness::fcube(), madness::FunctionImpl< T, NDIM >::fcube_for_mul(), madness::FunctionImpl< T, NDIM >::get_contraction_node_lists(), madness::SeparatedConvolution< Q, NDIM >::getmuop(), madness::SeparatedConvolution< Q, NDIM >::getmuop_modified(), madness::SimpleCache< Q, NDIM >::getptr(), madness::LBNodeDeux< NDIM >::index(), madness::Key< NDIM >::is_farther_out_than(), madness::TwoElectronInterface< T, NDIM >::make_coeff(), madness::Key< NDIM >::merge_with(), madness::Convolution1D< Q >::mod_nonstandard(), madness::Key< NDIM >::neighbor(), madness::FunctionImpl< T, NDIM >::neighbor(), madness::DerivativeBase< T, NDIM >::neighbor(), madness::MyPmap< D >::not_so_simple_hash(), madness::FunctionImpl< T, NDIM >::NS_fcube_for_mul(), YetAnotherWrapperClass::operator()(), madness::FunctionImpl< T, NDIM >::do_check_symmetry_local::operator()(), madness::FunctionImpl< T, NDIM >::do_mapdim::operator()(), madness::FunctionImpl< T, NDIM >::do_mirror::operator()(), madness::FunctionImpl< T, NDIM >::do_map_and_mirror::operator()(), madness::operator<<(), madness::SeparatedConvolution< Q, NDIM >::partial_upsample(), madness::FunctionImpl< T, NDIM >::print_plane_local(), madness::FunctionImpl< T, NDIM >::read_grid(), madness::FunctionImpl< T, NDIM >::read_grid2(), madness::SimpleCache< Q, NDIM >::set(), madness::SeparatedConvolution< Q, NDIM >::upsample(), and madness::FunctionImpl< T, NDIM >::upsample().
|
friend |
|
private |
|
private |
Referenced by madness::Key< NDIM >::break_apart(), madness::Key< NDIM >::distsq(), madness::Key< NDIM >::is_farther_out_than(), madness::Key< NDIM >::is_neighbor_of(), madness::Key< NDIM >::neighbor(), madness::Key< NDIM >::operator<(), madness::Key< NDIM >::operator==(), madness::Key< NDIM >::parent(), madness::Key< NDIM >::rehash(), madness::Key< NDIM >::thisKeyContains(), and madness::Key< NDIM >::translation().
|
private |
Referenced by madness::Key< NDIM >::break_apart(), madness::Key< NDIM >::is_invalid(), madness::Key< NDIM >::is_neighbor_of(), madness::Key< NDIM >::is_valid(), madness::Key< NDIM >::level(), KeyChildIterator::operator++(), madness::Key< NDIM >::operator<(), operator<<(), madness::Key< NDIM >::operator==(), madness::Key< NDIM >::parent(), Node::random_insert(), Node::recursive_print(), madness::Key< NDIM >::rehash(), and madness::Key< NDIM >::thisKeyContains().
|
static |