MADNESS  0.10.1
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
madness::FunctionImpl< T, NDIM > Class Template Reference

FunctionImpl holds all Function state to facilitate shallow copy semantics. More...

#include <funcimpl.h>

Inheritance diagram for madness::FunctionImpl< T, NDIM >:
Inheritance graph
[legend]
Collaboration diagram for madness::FunctionImpl< T, NDIM >:
Collaboration graph
[legend]

Classes

struct  add_op
 add two functions f and g: result=alpha * f + beta * g More...
 
struct  coeff_value_adaptor
 
struct  do_accumulate_trees
 merge the coefficent boxes of this into result's tree More...
 
struct  do_average
 "put" this on g More...
 
struct  do_change_tensor_type
 change representation of nodes' coeffs to low rank, optional fence More...
 
struct  do_check_symmetry_local
 check symmetry wrt particle exchange More...
 
struct  do_compute_snorm_and_dnorm
 compute the norm of the wavelet coefficients More...
 
struct  do_consolidate_buffer
 
struct  do_convert_to_color
 
class  do_err_box
 
struct  do_gaxpy_inplace
 functor for the gaxpy_inplace method More...
 
struct  do_inner_ext_local_ffi
 
struct  do_inner_local
 compute the inner product of this range with other More...
 
struct  do_inner_local_on_demand
 compute the inner product of this range with other More...
 
struct  do_keep_sum_coeffs
 keep only the sum coefficients in each node More...
 
struct  do_map_and_mirror
 mirror dimensions of this, write result on f More...
 
struct  do_mapdim
 map this on f More...
 
struct  do_merge_trees
 merge the coefficent boxes of this into other's tree More...
 
struct  do_mirror
 mirror dimensions of this, write result on f More...
 
struct  do_norm2sq_local
 
struct  do_op_args
 laziness More...
 
struct  do_reduce_rank
 reduce the rank of the nodes, optional fence More...
 
struct  do_standard
 Changes non-standard compressed form to standard compressed form. More...
 
struct  do_truncate_NS_leafs
 given an NS tree resulting from a convolution, truncate leafs if appropriate More...
 
struct  do_unary_op_value_inplace
 
struct  hartree_op
 Hartree product of two LDIM functions to yield a NDIM = 2*LDIM function. More...
 
struct  multiply_op
 perform this multiplication: h(1,2) = f(1,2) * g(1) More...
 
struct  pointwise_multiplier
 
struct  project_out_op
 project the low-dim function g on the hi-dim function f: result(x) = <f(x,y) | g(y)> More...
 
struct  recursive_apply_op
 recursive part of recursive_apply More...
 
struct  recursive_apply_op2
 recursive part of recursive_apply More...
 
struct  remove_internal_coeffs
 remove all coefficients of internal nodes More...
 
struct  remove_leaf_coeffs
 remove all coefficients of leaf nodes More...
 
struct  true_refine_test
 
struct  Vphi_op_NS
 given a ket and the 1- and 2-electron potentials, construct the function V phi More...
 

Public Types

typedef GenTensor< TcoeffT
 Type of tensor used to hold coeffs. More...
 
typedef Vector< double, NDIMcoordT
 Type of vector holding coordinates. More...
 
typedef std::pair< const keyT, nodeTdatumT
 Type of entry in container. More...
 
typedef WorldContainer< keyT, nodeTdcT
 Type of container holding the coefficients. More...
 
typedef FunctionImpl< T, NDIMimplT
 Type of this class (implementation) More...
 
typedef Key< NDIMkeyT
 Type of key. More...
 
typedef ConcurrentHashMap< keyT, mapvecTmapT
 Type of the map returned by make_key_vec_map. More...
 
typedef std::vector< std::pair< int, const coeffT * > > mapvecT
 Type of the entry in the map returned by make_key_vec_map. More...
 
typedef FunctionNode< T, NDIMnodeT
 Type of node. More...
 
typedef std::shared_ptr< FunctionImpl< T, NDIM > > pimplT
 pointer to this class More...
 
typedef Range< typename dcT::const_iteratorrangeT
 
typedef Range< typename dcT::const_iteratorrangeT
 
typedef Tensor< TtensorT
 Type of tensor for anything but to hold coeffs. More...
 
typedef Vector< Translation, NDIMtranT
 Type of array holding translation. More...
 
typedef T typeT
 
- Public Types inherited from madness::WorldObject< FunctionImpl< T, NDIM > >
typedef WorldObject< FunctionImpl< T, NDIM > > objT
 

Public Member Functions

 FunctionImpl (const FunctionFactory< T, NDIM > &factory)
 Initialize function impl from data in factory. More...
 
template<typename Q >
 FunctionImpl (const FunctionImpl< Q, NDIM > &other, const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > &pmap, bool dozero)
 Copy constructor. More...
 
virtual ~FunctionImpl ()
 
void abs_inplace (bool fence)
 
void abs_square_inplace (bool fence)
 
void accumulate_timer (const double time) const
 
template<typename Q , typename R >
void accumulate_trees (FunctionImpl< Q, NDIM > &result, const R alpha, const bool fence=true) const
 merge the trees of this and other, while multiplying them with the alpha or beta, resp More...
 
void add_keys_to_map (mapT *map, int index) const
 Adds keys to union of local keys with specified index. More...
 
void add_scalar_inplace (T t, bool fence)
 Adds a constant to the function. Local operation, optional fence. More...
 
template<typename opT , typename R >
void apply (opT &op, const FunctionImpl< R, NDIM > &f, bool fence)
 apply an operator on f to return this More...
 
template<typename opT , typename R >
void apply_1d_realspace_push (const opT &op, const FunctionImpl< R, NDIM > *f, int axis, bool fence)
 
template<typename opT , typename R >
void apply_1d_realspace_push_op (const archive::archive_ptr< const opT > &pop, int axis, const keyT &key, const Tensor< R > &c)
 
template<typename opT , typename R >
void apply_source_driven (opT &op, const FunctionImpl< R, NDIM > &f, bool fence)
 similar to apply, but for low rank coeffs More...
 
coeffT assemble_coefficients (const keyT &key, const coeffT &coeff_ket, const coeffT &vpotential1, const coeffT &vpotential2, const tensorT &veri) const
 given several coefficient tensors, assemble a result tensor More...
 
bool autorefine_square_test (const keyT &key, const nodeT &t) const
 Returns true if this block of coeffs needs autorefining. More...
 
void average (const implT &rhs)
 take the average of two functions, similar to: this=0.5*(this+rhs) More...
 
template<typename L , typename R , typename opT >
void binaryXX (const FunctionImpl< L, NDIM > *left, const FunctionImpl< R, NDIM > *right, const opT &op, bool fence)
 
template<typename L , typename R , typename opT >
void binaryXXa (const keyT &key, const FunctionImpl< L, NDIM > *left, const Tensor< L > &lcin, const FunctionImpl< R, NDIM > *right, const Tensor< R > &rcin, const opT &op)
 
void broaden (std::vector< bool > is_periodic, bool fence)
 
void broaden_op (const keyT &key, const std::vector< Future< bool > > &v)
 
void change_tensor_type1 (const TensorArgs &targs, bool fence)
 change the tensor type of the coefficients in the FunctionNode More...
 
void change_tree_state (const TreeState finalstate, bool fence=true)
 change the tree state of this function, might or might not respect fence! More...
 
double check_symmetry_local () const
 Returns some asymmetry measure ... no comms. More...
 
std::vector< Slicechild_patch (const keyT &child) const
 Returns patch referring to coeffs of child in parent box. More...
 
void chop_at_level (const int n, const bool fence=true)
 remove all nodes with level higher than n More...
 
template<typename Q >
GenTensor< Qcoeffs2values (const keyT &key, const GenTensor< Q > &coeff) const
 
template<typename Q >
Tensor< Qcoeffs2values (const keyT &key, const Tensor< Q > &coeff) const
 
tensorT coeffs_for_jun (Level n, long q=0)
 Get the scaling function coeffs at level n starting from NS form. More...
 
void compress (const TreeState newstate, bool fence)
 compress the wave function More...
 
std::pair< coeffT, double > compress_op (const keyT &key, const std::vector< Future< std::pair< coeffT, double >> > &v, bool nonstandard)
 calculate the wavelet coefficients using the sum coefficients of all child nodes More...
 
Future< std::pair< coeffT, double > > compress_spawn (const keyT &key, bool nonstandard, bool keepleaves, bool redundant1)
 Invoked on node where key is local. More...
 
void compute_snorm_and_dnorm (bool fence=true)
 compute norm of s and d coefficients for all nodes More...
 
template<typename Q >
void copy_coeffs (const FunctionImpl< Q, NDIM > &other, bool fence)
 Copy coeffs from other into self. More...
 
void diff (const DerivativeBase< T, NDIM > *D, const implT *f, bool fence)
 
template<std::size_t LDIM>
void dirac_convolution_op (const keyT &key, const nodeT &node, FunctionImpl< T, LDIM > *f) const
 The operator. More...
 
void distribute (std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > newmap) const
 
template<typename opT , typename R >
void do_apply (const opT *op, const keyT &key, const Tensor< R > &c)
 apply an operator on the coeffs c (at node key) More...
 
template<typename opT , typename R >
double do_apply_directed_screening (const opT *op, const keyT &key, const coeffT &coeff, const bool &do_kernel)
 apply an operator on the coeffs c (at node key) More...
 
template<typename opT , typename R , size_t OPDIM>
void do_apply_kernel (const opT *op, const Tensor< R > &c, const do_op_args< OPDIM > &args)
 for fine-grain parallelism: call the apply method of an operator in a separate task More...
 
template<typename opT , typename R , size_t OPDIM>
double do_apply_kernel2 (const opT *op, const Tensor< R > &c, const do_op_args< OPDIM > &args, const TensorArgs &apply_targs)
 same as do_apply_kernel, but use full rank tensors as input and low rank tensors as output More...
 
template<typename opT , typename R , size_t OPDIM>
double do_apply_kernel3 (const opT *op, const GenTensor< R > &coeff, const do_op_args< OPDIM > &args, const TensorArgs &apply_targs)
 same as do_apply_kernel2, but use low rank tensors as input and low rank tensors as output More...
 
template<typename L , typename R , typename opT >
void do_binary_op (const keyT &key, const Tensor< L > &left, const std::pair< keyT, Tensor< R > > &arg, const opT &op)
 Functor for the binary_op method. More...
 
void do_diff1 (const DerivativeBase< T, NDIM > *D, const implT *f, const keyT &key, const std::pair< keyT, coeffT > &left, const std::pair< keyT, coeffT > &center, const std::pair< keyT, coeffT > &right)
 
template<std::size_t LDIM>
void do_dirac_convolution (FunctionImpl< T, LDIM > *f, bool fence) const
 
template<typename L , typename R >
void do_mul (const keyT &key, const Tensor< L > &left, const std::pair< keyT, Tensor< R > > &arg)
 Functor for the mul method. More...
 
void do_print_grid (const std::string filename, const std::vector< keyT > &keys) const
 print the grid in xyz format More...
 
void do_print_plane (const std::string filename, std::vector< Tensor< double > > plotinfo, const int xaxis, const int yaxis, const coordT el2)
 print the MRA structure More...
 
void do_print_tree (const keyT &key, std::ostream &os, Level maxlevel) const
 Functor for the do_print_tree method. More...
 
void do_print_tree_graphviz (const keyT &key, std::ostream &os, Level maxlevel) const
 Functor for the do_print_tree method (using GraphViz) More...
 
void do_print_tree_json (const keyT &key, std::multimap< Level, std::tuple< tranT, std::string >> &data, Level maxlevel) const
 Functor for the do_print_tree_json method. More...
 
template<size_t LDIM>
void do_project_out (const coeffT &fcoeff, const std::pair< keyT, coeffT > gpair, const keyT &gkey, const Key< NDIM > &dest, const int dim) const
 compute the inner product of two nodes of only some dimensions and accumulate on result More...
 
void do_square_inplace (const keyT &key)
 
void do_square_inplace2 (const keyT &parent, const keyT &child, const tensorT &parent_coeff)
 
tensorT downsample (const keyT &key, const std::vector< Future< coeffT > > &v) const
 downsample the sum coefficients of level n+1 to sum coeffs on level n More...
 
void erase (const Level &max_level)
 truncate tree at a certain level More...
 
template<typename opT >
double err_box (const keyT &key, const nodeT &node, const opT &func, int npt, const Tensor< double > &qx, const Tensor< double > &quad_phit, const Tensor< double > &quad_phiw) const
 Returns the square of the error norm in the box labeled by key. More...
 
template<typename opT >
double errsq_local (const opT &func) const
 Returns the sum of squares of errors from local info ... no comms. More...
 
void eval (const Vector< double, NDIM > &xin, const keyT &keyin, const typename Future< T >::remote_refT &ref)
 Evaluate the function at a point in simulation coordinates. More...
 
T eval_cube (Level n, coordT &x, const tensorT &c) const
 
std::pair< bool, Teval_local_only (const Vector< double, NDIM > &xin, Level maxlevel)
 Evaluate function only if point is local returning (true,value); otherwise return (false,0.0) More...
 
Tensor< Teval_plot_cube (const coordT &plotlo, const coordT &plothi, const std::vector< long > &npt, const bool eval_refine=false) const
 
void evaldepthpt (const Vector< double, NDIM > &xin, const keyT &keyin, const typename Future< Level >::remote_refT &ref)
 Get the depth of the tree at a point in simulation coordinates. More...
 
void evalR (const Vector< double, NDIM > &xin, const keyT &keyin, const typename Future< long >::remote_refT &ref)
 Get the rank of leaf box of the tree at a point in simulation coordinates. More...
 
bool exists_and_has_children (const keyT &key) const
 
bool exists_and_is_leaf (const keyT &key) const
 
void fcube (const keyT &key, const FunctionFunctorInterface< T, NDIM > &f, const Tensor< double > &qx, tensorT &fval) const
 Evaluate function at quadrature points in the specified box. More...
 
void fcube (const keyT &key, T(*f)(const coordT &), const Tensor< double > &qx, tensorT &fval) const
 Evaluate function at quadrature points in the specified box. More...
 
template<typename Q >
GenTensor< Qfcube_for_mul (const keyT &child, const keyT &parent, const GenTensor< Q > &coeff) const
 Compute the function values for multiplication. More...
 
template<typename Q >
Tensor< Qfcube_for_mul (const keyT &child, const keyT &parent, const Tensor< Q > &coeff) const
 Compute the function values for multiplication. More...
 
coeffT filter (const coeffT &s) const
 
tensorT filter (const tensorT &s) const
 Transform sum coefficients at level n to sums+differences at level n-1. More...
 
double finalize_apply ()
 after apply we need to do some cleanup; More...
 
void finalize_sum ()
 after summing up we need to do some cleanup; More...
 
std::pair< Key< NDIM >, ShallowNode< T, NDIM > > find_datum (keyT key) const
 return the a std::pair<key, node>, which MUST exist More...
 
Future< std::pair< keyT, coeffT > > find_me (const keyT &key) const
 find_me. Called by diff_bdry to get coefficients of boundary function More...
 
template<typename opT >
void flo_unary_op_node_inplace (const opT &op, bool fence)
 
template<typename opT >
void flo_unary_op_node_inplace (const opT &op, bool fence) const
 
void forward_do_diff1 (const DerivativeBase< T, NDIM > *D, const implT *f, const keyT &key, const std::pair< keyT, coeffT > &left, const std::pair< keyT, coeffT > &center, const std::pair< keyT, coeffT > &right)
 
template<typename coeff_opT , typename apply_opT >
void forward_traverse (const coeff_opT &coeff_op, const apply_opT &apply_op, const keyT &key) const
 traverse a non-existing tree More...
 
template<typename L , typename R >
void gaxpy (T alpha, const FunctionImpl< L, NDIM > &left, T beta, const FunctionImpl< R, NDIM > &right, bool fence)
 Invoked by result to perform result += alpha*left+beta*right in wavelet basis. More...
 
template<typename L >
void gaxpy_ext (const FunctionImpl< L, NDIM > *left, T(*f)(const coordT &), T alpha, T beta, double tol, bool fence)
 
template<typename L >
tensorT gaxpy_ext_node (keyT key, Tensor< L > lc, T(*f)(const coordT &), T alpha, T beta) const
 
template<typename L >
void gaxpy_ext_recursive (const keyT &key, const FunctionImpl< L, NDIM > *left, Tensor< L > lcin, tensorT c, T(*f)(const coordT &), T alpha, T beta, double tol, bool below_leaf)
 
template<typename Q , typename R >
void gaxpy_inplace (const T &alpha, const FunctionImpl< Q, NDIM > &other, const R &beta, bool fence)
 
template<typename Q , typename R >
void gaxpy_inplace_reconstructed (const T &alpha, const FunctionImpl< Q, NDIM > &g, const R &beta, const bool fence)
 
void gaxpy_oop_reconstructed (const double alpha, const implT &f, const double beta, const implT &g, const bool fence)
 perform: this= alpha*f + beta*g, invoked by result More...
 
bool get_autorefine () const
 
const FunctionCommonData< T, NDIM > & get_cdata () const
 
dcTget_coeffs ()
 
const dcTget_coeffs () const
 
template<std::size_t CDIM>
std::tuple< std::set< Key< NDIM > >, std::map< Key< CDIM >, double > > get_contraction_node_lists (const std::size_t n, const std::array< int, CDIM > &v) const
 for contraction two functions f(x,z) = \int g(x,y) h(y,z) dy More...
 
std::shared_ptr< FunctionFunctorInterface< T, NDIM > > get_functor ()
 
std::shared_ptr< FunctionFunctorInterface< T, NDIM > > get_functor () const
 
int get_initial_level () const
 getter More...
 
int get_k () const
 
Future< double > get_norm_tree_recursive (const keyT &key) const
 
const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > & get_pmap () const
 
int get_special_level () const
 
const std::vector< Vector< double, NDIM > > & get_special_points () const
 
TensorArgs get_tensor_args () const
 
TensorType get_tensor_type () const
 
double get_thresh () const
 
TreeState get_tree_state () const
 
template<std::size_t LDIM, typename leaf_opT >
void hartree_product (const std::vector< std::shared_ptr< FunctionImpl< T, LDIM >>> p1, const std::vector< std::shared_ptr< FunctionImpl< T, LDIM >>> p2, const leaf_opT &leaf_op, bool fence)
 given two functions of LDIM, perform the Hartree/Kronecker/outer product More...
 
bool has_leaves () const
 
T inner_adaptive_local (const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > f, const bool leaf_refine) const
 
T inner_adaptive_recursive (keyT key, const tensorT &c, const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > f, const bool leaf_refine, T old_inner=T(0)) const
 
T inner_ext_local (const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > f, const bool leaf_refine) const
 
T inner_ext_node (keyT key, tensorT c, const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > f) const
 Return the inner product with an external function on a specified function node. More...
 
T inner_ext_recursive (keyT key, tensorT c, const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > f, const bool leaf_refine, T old_inner=T(0)) const
 
void insert_zero_down_to_initial_level (const keyT &key)
 Initialize nodes to zero function at initial_level of refinement. More...
 
bool is_compressed () const
 Returns true if the function is compressed. More...
 
bool is_nonstandard () const
 
bool is_nonstandard_with_leaves () const
 
bool is_on_demand () const
 
bool is_reconstructed () const
 Returns true if the function is compressed. More...
 
bool is_redundant () const
 Returns true if the function is redundant. More...
 
const keyTkey0 () const
 Returns cdata.key0. More...
 
template<typename Archive >
void load (Archive &ar)
 
std::vector< keyTlocal_leaf_keys () const
 return the keys of the local leaf boxes More...
 
 MADNESS_ASSERT (this->is_redundant()==g.is_redundant())
 
 MADNESS_CHECK (this->is_reconstructed())
 
std::pair< coeffT, double > make_redundant_op (const keyT &key, const std::vector< Future< std::pair< coeffT, double > > > &v)
 similar to compress_op, but insert only the sum coefficients in the tree More...
 
template<typename opT >
void make_Vphi (const opT &leaf_op, const bool fence=true)
 assemble the function V*phi using V and phi given from the functor More...
 
template<typename opT , std::size_t LDIM>
void make_Vphi_only (const opT &leaf_op, FunctionImpl< T, NDIM > *ket, FunctionImpl< T, LDIM > *v1, FunctionImpl< T, LDIM > *v2, FunctionImpl< T, LDIM > *p1, FunctionImpl< T, LDIM > *p2, FunctionImpl< T, NDIM > *eri, const bool fence=true)
 assemble the function V*phi using V and phi given from the functor More...
 
void map_and_mirror (const implT &f, const std::vector< long > &map, const std::vector< long > &mirror, bool fence)
 map and mirror the translation index and the coefficients, result on this More...
 
void mapdim (const implT &f, const std::vector< long > &map, bool fence)
 Permute the dimensions of f according to map, result on this. More...
 
std::size_t max_depth () const
 Returns the maximum depth of the tree ... collective ... global sum/broadcast. More...
 
std::size_t max_local_depth () const
 Returns the maximum local depth of the tree ... no communications. More...
 
std::size_t max_nodes () const
 Returns the max number of nodes on a processor. More...
 
template<typename Q , typename R >
void merge_trees (const T alpha, const FunctionImpl< Q, NDIM > &other, const R beta, const bool fence=true)
 merge the trees of this and other, while multiplying them with the alpha or beta, resp More...
 
std::size_t min_nodes () const
 Returns the min number of nodes on a processor. More...
 
void mirror (const implT &f, const std::vector< long > &mirror, bool fence)
 mirror the dimensions of f according to map, result on this More...
 
template<typename R >
Tensor< TENSOR_RESULT_TYPE(T, R)> mul (const Tensor< T > &c1, const Tensor< R > &c2, const int npt, const keyT &key) const
 multiply the values of two coefficient tensors using a custom number of grid points More...
 
template<typename opT >
void multi_to_multi_op_values (const opT &op, const std::vector< implT * > &vin, std::vector< implT * > &vout, const bool fence=true)
 Inplace operate on many functions (impl's) with an operator within a certain box. More...
 
template<typename opT >
void multi_to_multi_op_values_doit (const keyT &key, const opT &op, const std::vector< implT * > &vin, std::vector< implT * > &vout)
 Inplace operate on many functions (impl's) with an operator within a certain box. More...
 
template<typename opT >
void multiop_values (const opT &op, const std::vector< implT * > &v)
 
template<typename opT >
void multiop_values_doit (const keyT &key, const opT &op, const std::vector< implT * > &v)
 
coeffT multiply (const coeffT &val_ket, const coeffT &val_pot, int particle) const
 multiply the ket with a one-electron potential rr(1,2)= f(1,2)*g(1) More...
 
template<size_t LDIM>
void multiply (const implT *f, const FunctionImpl< T, LDIM > *g, const int particle)
 multiply f (a pair function of NDIM) with an orbital g (LDIM=NDIM/2) More...
 
template<typename L , typename R >
void mulXX (const FunctionImpl< L, NDIM > *left, const FunctionImpl< R, NDIM > *right, double tol, bool fence)
 
template<typename L , typename R >
void mulXXa (const keyT &key, const FunctionImpl< L, NDIM > *left, const Tensor< L > &lcin, const FunctionImpl< R, NDIM > *right, const Tensor< R > &rcin, double tol)
 
template<typename L , typename R >
void mulXXvec (const FunctionImpl< L, NDIM > *left, const std::vector< const FunctionImpl< R, NDIM > * > &vright, const std::vector< FunctionImpl< T, NDIM > * > &vresult, double tol, bool fence)
 
template<typename L , typename R >
void mulXXveca (const keyT &key, const FunctionImpl< L, NDIM > *left, const Tensor< L > &lcin, const std::vector< const FunctionImpl< R, NDIM > * > vrightin, const std::vector< Tensor< R > > &vrcin, const std::vector< FunctionImpl< T, NDIM > * > vresultin, double tol)
 
std::size_t nCoeff () const
 Returns the number of coefficients in the function ... collective global sum. More...
 
keyT neighbor (const keyT &key, const keyT &disp, const std::vector< bool > &is_periodic) const
 Returns key of general neighbor enforcing BC. More...
 
bool noautorefine (const keyT &key, const tensorT &t) const
 Always returns false (for when autorefine is not wanted) More...
 
double norm2sq_local () const
 Returns the square of the local norm ... no comms. More...
 
void norm_tree (bool fence)
 compute for each FunctionNode the norm of the function inside that node More...
 
double norm_tree_op (const keyT &key, const std::vector< Future< double > > &v)
 
Future< double > norm_tree_spawn (const keyT &key)
 
template<typename Q >
GenTensor< QNS_fcube_for_mul (const keyT &child, const keyT &parent, const GenTensor< Q > &coeff, const bool s_only) const
 Compute the function values for multiplication. More...
 
template<typename Q >
GenTensor< QNScoeffs2values (const keyT &key, const GenTensor< Q > &coeff, const bool s_only) const
 convert S or NS coeffs to values on a 2k grid of the children More...
 
const coeffT parent_to_child (const coeffT &s, const keyT &parent, const keyT &child) const
 Directly project parent coeffs to child coeffs. More...
 
coeffT parent_to_child_NS (const keyT &child, const keyT &parent, const coeffT &coeff) const
 Directly project parent NS coeffs to child NS coeffs. More...
 
template<typename Q , std::size_t LDIM, typename R , std::size_t KDIM, std::size_t CDIM = (KDIM + LDIM - NDIM) / 2>
void partial_inner (const FunctionImpl< Q, LDIM > &g, const FunctionImpl< R, KDIM > &h, const std::array< int, CDIM > v1, const std::array< int, CDIM > v2)
 invoked by result More...
 
template<typename Q , std::size_t LDIM, typename R , std::size_t KDIM, std::size_t CDIM = (KDIM + LDIM - NDIM) / 2>
void partial_inner_contract (const FunctionImpl< Q, LDIM > *g, const FunctionImpl< R, KDIM > *h, const std::array< int, CDIM > v1, const std::array< int, CDIM > v2, const Key< NDIM > &key, const std::list< Key< CDIM >> &j_key_list)
 tensor contraction part of partial_inner More...
 
void phi_for_mul (Level np, Translation lp, Level nc, Translation lc, Tensor< double > &phi) const
 Compute the Legendre scaling functions for multiplication. More...
 
void plot_cube_kernel (archive::archive_ptr< Tensor< T > > ptr, const keyT &key, const coordT &plotlo, const coordT &plothi, const std::vector< long > &npt, bool eval_refine) const
 
void print_grid (const std::string filename) const
 
void print_info () const
 Prints summary of data distribution. More...
 
void print_plane (const std::string filename, const int xaxis, const int yaxis, const coordT &el2)
 Print a plane ("xy", "xz", or "yz") containing the point x to file. More...
 
Tensor< double > print_plane_local (const int xaxis, const int yaxis, const coordT &el2)
 collect the data for a plot of the MRA structure locally on each node More...
 
void print_size (const std::string name) const
 print tree size and size More...
 
void print_stats () const
 print the number of configurations per node More...
 
void print_timer () const
 
void print_tree (std::ostream &os=std::cout, Level maxlevel=10000) const
 
void print_tree_graphviz (std::ostream &os=std::cout, Level maxlevel=10000) const
 
void print_tree_json (std::ostream &os=std::cout, Level maxlevel=10000) const
 
template<typename R >
void print_type_in_compilation_error (R &&)
 
void project (const implT &old, bool fence)
 Projects old function into new basis (only in reconstructed form) More...
 
tensorT project (const keyT &key) const
 
template<size_t LDIM>
void project_out (FunctionImpl< T, NDIM-LDIM > *result, const FunctionImpl< T, LDIM > *gimpl, const int dim, const bool fence)
 project the low-dim function g on the hi-dim function f: result(x) = <this(x,y) | g(y)> More...
 
template<size_t LDIM>
void project_out2 (const FunctionImpl< T, LDIM+NDIM > *f, const FunctionImpl< T, LDIM > *g, const int dim)
 project the low-dim function g on the hi-dim function f: this(x) = <f(x,y) | g(y)> More...
 
void project_refine_op (const keyT &key, bool do_refine, const std::vector< Vector< double, NDIM > > &specialpts)
 
void put_in_box (ProcessID from, long nl, long ni) const
 
rangeT range (coeffs.begin(), coeffs.end())
 
template<size_t FDIM>
std::enable_if< NDIM==FDIM >::type read_grid (const std::string keyfile, const std::string gridfile, std::shared_ptr< FunctionFunctorInterface< double, NDIM > > vnuc_functor)
 read data from a grid More...
 
template<size_t FDIM>
std::enable_if< NDIM==FDIM >::type read_grid2 (const std::string gridfile, std::shared_ptr< FunctionFunctorInterface< double, NDIM > > vnuc_functor)
 read data from a grid More...
 
std::size_t real_size () const
 Returns the number of coefficients in the function ... collective global sum. More...
 
void reconstruct (bool fence)
 reconstruct this tree – respects fence More...
 
void reconstruct_op (const keyT &key, const coeffT &s, const bool accumulate_NS=true)
 
template<std::size_t CDIM, std::size_t ODIM, std::size_t FDIM = NDIM+ODIM-2*CDIM>
std::multimap< Key< FDIM >, std::list< Key< CDIM > > > recur_down_for_contraction_map (const keyT &key, const nodeT &node, const std::array< int, CDIM > &v_this, const std::array< int, CDIM > &v_other, const std::set< Key< ODIM >> &ij_other_list, const std::map< Key< CDIM >, double > &j_other_list, bool this_first, const double thresh)
 make a map of all nodes that will contribute to a partial inner product More...
 
template<typename opT , std::size_t LDIM>
void recursive_apply (opT &apply_op, const FunctionImpl< T, LDIM > *fimpl, const FunctionImpl< T, LDIM > *gimpl, const bool fence)
 traverse a non-existing tree, make its coeffs and apply an operator More...
 
template<typename opT >
void recursive_apply (opT &apply_op, const implT *fimpl, implT *rimpl, const bool fence)
 traverse an existing tree and apply an operator More...
 
return world taskq reduce (range, do_inner_local_on_demand< R >(this, &gimpl))
 
return world taskq reduce (rangeT(coeffs.begin(), coeffs.end()), do_inner_local< R >(&g, leaves_only))
 
void reduce_rank (const double thresh, bool fence)
 reduce the rank of the coefficients tensors More...
 
template<typename opT >
void refine (const opT &op, bool fence)
 
template<typename opT >
void refine_op (const opT &op, const keyT &key)
 
template<typename opT >
void refine_spawn (const opT &op, const keyT &key)
 
void refine_to_common_level (const std::vector< FunctionImpl< T, NDIM > * > &v, const std::vector< tensorT > &c, const keyT key)
 Refine multiple functions down to the same finest level. More...
 
void remove_internal_coefficients (const bool fence)
 
void remove_leaf_coefficients (const bool fence)
 
void replicate (bool fence=true)
 
void reset_timer ()
 
void scale_inplace (const T q, bool fence)
 In-place scale by a constant. More...
 
template<typename Q , typename F >
void scale_oop (const Q q, const FunctionImpl< F, NDIM > &f, bool fence)
 Out-of-place scale by a constant. More...
 
void set_autorefine (bool value)
 
void set_functor (const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > functor1)
 
void set_tensor_args (const TensorArgs &t)
 
void set_thresh (double value)
 
void set_tree_state (const TreeState &state)
 
std::size_t size () const
 Returns the number of coefficients in the function ... collective global sum. More...
 
void sock_it_to_me (const keyT &key, const RemoteReference< FutureImpl< std::pair< keyT, coeffT > > > &ref) const
 Walk up the tree returning pair(key,node) for first node with coefficients. More...
 
void sock_it_to_me_too (const keyT &key, const RemoteReference< FutureImpl< std::pair< keyT, coeffT > > > &ref) const
 
void square_inplace (bool fence)
 Pointwise squaring of function with optional global fence. More...
 
void standard (bool fence)
 Changes non-standard compressed form to standard compressed form. More...
 
template<typename Archive >
void store (Archive &ar)
 
void sum_down (bool fence)
 After 1d push operator must sum coeffs down the tree to restore correct scaling function coefficients. More...
 
void sum_down_spawn (const keyT &key, const coeffT &s)
 is this the same as trickle_down() ? More...
 
template<typename R >
 TENSOR_RESULT_TYPE (T, R) inner_local(const FunctionImpl< R
 Returns the inner product ASSUMING same distribution. More...
 
template<typename R >
 TENSOR_RESULT_TYPE (T, R) inner_local_on_demand(const FunctionImpl< R
 Returns the inner product of this with function g constructed on-the-fly. More...
 
typedef TENSOR_RESULT_TYPE (T, R) resultT
 
T trace_local () const
 Returns int(f(x),x) in local volume. More...
 
template<typename coeff_opT , typename apply_opT >
void traverse_tree (const coeff_opT &coeff_op, const apply_opT &apply_op, const keyT &key) const
 traverse a non-existing tree More...
 
std::size_t tree_size () const
 Returns the size of the tree structure of the function ... collective global sum. More...
 
void trickle_down (bool fence)
 sum all the contributions from all scales after applying an operator in mod-NS form More...
 
void trickle_down_op (const keyT &key, const coeffT &s)
 sum all the contributions from all scales after applying an operator in mod-NS form More...
 
void truncate (double tol, bool fence)
 Truncate according to the threshold with optional global fence. More...
 
bool truncate_op (const keyT &key, double tol, const std::vector< Future< bool > > &v)
 
coeffT truncate_reconstructed_op (const keyT &key, const std::vector< Future< coeffT > > &v, const double tol)
 given the sum coefficients of all children, truncate or not More...
 
Future< coeffTtruncate_reconstructed_spawn (const keyT &key, const double tol)
 truncate using a tree in reconstructed form More...
 
Future< bool > truncate_spawn (const keyT &key, double tol)
 Returns true if after truncation this node has coefficients. More...
 
double truncate_tol (double tol, const keyT &key) const
 Returns the truncation threshold according to truncate_method. More...
 
template<typename opT >
void unary_op_coeff_inplace (const opT &op, bool fence)
 
template<typename opT >
void unary_op_node_inplace (const opT &op, bool fence)
 
template<typename opT >
void unary_op_value_inplace (const opT &op, bool fence)
 
template<typename Q , typename opT >
void unaryXX (const FunctionImpl< Q, NDIM > *func, const opT &op, bool fence)
 
template<typename Q , typename opT >
void unaryXXa (const keyT &key, const FunctionImpl< Q, NDIM > *func, const opT &op)
 
template<typename Q , typename opT >
void unaryXXvalues (const FunctionImpl< Q, NDIM > *func, const opT &op, bool fence)
 
void undo_redundant (const bool fence)
 convert this from redundant to standard reconstructed form More...
 
coeffT unfilter (const coeffT &s) const
 
tensorT unfilter (const tensorT &s) const
 Transform sums+differences at level n to sum coefficients at level n+1. More...
 
void unset_functor ()
 
coeffT upsample (const keyT &key, const coeffT &coeff) const
 upsample the sum coefficients of level 1 to sum coeffs on level n+1 More...
 
template<typename Q >
GenTensor< Qvalues2coeffs (const keyT &key, const GenTensor< Q > &values) const
 
template<typename Q >
Tensor< Qvalues2coeffs (const keyT &key, const Tensor< Q > &values) const
 
template<typename Q >
GenTensor< Qvalues2NScoeffs (const keyT &key, const GenTensor< Q > &values) const
 convert function values of the a child generation directly to NS coeffs More...
 
void verify_tree () const
 Verify tree is properly constructed ... global synchronization involved. More...
 
double vol_nsphere (int n, double R)
 
template<typename Q , typename R >
void vtransform (const std::vector< std::shared_ptr< FunctionImpl< R, NDIM > > > &vright, const Tensor< Q > &c, const std::vector< std::shared_ptr< FunctionImpl< T, NDIM > > > &vleft, double tol, bool fence)
 
template<typename Q , typename R >
void vtransform_doit (const std::shared_ptr< FunctionImpl< R, NDIM > > &right, const Tensor< Q > &c, const std::vector< std::shared_ptr< FunctionImpl< T, NDIM > > > &vleft, double tol)
 
void zero_norm_tree ()
 
- Public Member Functions inherited from madness::WorldObject< FunctionImpl< T, NDIM > >
 WorldObject (const WorldObject &other)
 
 WorldObject (World &world)
 Constructor that associates an object (via the derived class) with a globally unique ID. More...
 
virtual ~WorldObject ()
 
Worldget_world () const
 Returns a reference to the world. More...
 
const uniqueidTid () const
 Returns the globally unique object ID. More...
 
WorldObjectoperator= (const WorldObject &)=delete
 
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn) const
 
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1) const
 
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2) const
 
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3) const
 
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4) const
 
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5) const
 
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6) const
 
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7) const
 
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8) const
 
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const a9T &a9) const
 
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const a9T &a9, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4,a5,a6,a7,a8,a9). More...
 
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4,a5,a6,a7,a8). More...
 
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4,a5,a6,a7). More...
 
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4,a5,a6). More...
 
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4,a5). More...
 
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4). More...
 
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2,a3). More...
 
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2). More...
 
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1). More...
 
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(). More...
 
- Public Member Functions inherited from madness::WorldObjectBase
virtual ~WorldObjectBase ()=default
 

Static Public Member Functions

static std::complex< double > conj (const std::complex< double > x)
 
static double conj (float x)
 
template<typename R >
static void do_inner_localX (const typename mapT::iterator lstart, const typename mapT::iterator lend, typename FunctionImpl< R, NDIM >::mapT *rmap_ptr, const bool sym, Tensor< TENSOR_RESULT_TYPE(T, R) > *result_ptr, Mutex *mutex)
 
template<typename R >
static Tensor< TENSOR_RESULT_TYPE(T, R) > inner_local (const std::vector< const FunctionImpl< T, NDIM > * > &left, const std::vector< const FunctionImpl< R, NDIM > * > &right, bool sym)
 
static mapT make_key_vec_map (const std::vector< const FunctionImpl< T, NDIM > * > &v)
 Returns map of union of local keys to vector of indexes of functions containing that key. More...
 
static void tnorm (const GenTensor< T > &t, double *lo, double *hi)
 
static void tnorm (const SVDTensor< T > &t, double *lo, double *hi, const int particle)
 
static void tnorm (const tensorT &t, double *lo, double *hi)
 Computes norm of low/high-order polyn. coeffs for autorefinement test. More...
 

Public Attributes

long box_interior [1000]
 
long box_leaf [1000]
 
NDIM &g const
 
NDIM &gimpl const
 
AtomicInt large
 
bool leaves_only =(this->is_redundant())
 
AtomicInt small
 
Timer timer_accumulate
 
Timer timer_change_tensor_type
 
Timer timer_compress_svd
 
Timer timer_filter
 
Timer timer_lr_result
 
Timer timer_target_driven
 
Worldworld
 

Private Types

typedef WorldObject< FunctionImpl< T, NDIM > > woT
 Base class world object type. More...
 

Private Member Functions

 FunctionImpl (const FunctionImpl< T, NDIM > &p)
 
void make_redundant (const bool fence)
 convert this to redundant, i.e. have sum coefficients on all levels More...
 

Private Attributes

bool autorefine
 If true, autorefine where appropriate. More...
 
const FunctionCommonData< T, NDIM > & cdata
 
dcT coeffs
 The coefficients. More...
 
std::shared_ptr< FunctionFunctorInterface< T, NDIM > > functor
 
int initial_level
 Initial level for refinement. More...
 
int k
 Wavelet order. More...
 
int max_refine_level
 Do not refine below this level. More...
 
int special_level
 Minimium level for refinement on special points. More...
 
std::vector< Vector< double, NDIM > > special_points
 special points for further refinement (needed for composite functions or multiplication) More...
 
TensorArgs targs
 type of tensor to be used in the FunctionNodes More...
 
double thresh
 Screening threshold. More...
 
TreeState tree_state
 
int truncate_mode
 0=default=(|d|<thresh), 1=(|d|<thresh/2^n), 1=(|d|<thresh/4^n); More...
 
bool truncate_on_project
 If true projection inserts at level n-1 not n. More...
 

Friends

template<typename Q , std::size_t D>
class FunctionImpl
 
hashT hash_value (const FunctionImpl< T, NDIM > *pimpl)
 Hash a pointer to FunctionImpl. More...
 
hashT hash_value (const std::shared_ptr< FunctionImpl< T, NDIM >> impl)
 Hash a shared_ptr to FunctionImpl. More...
 

Additional Inherited Members

- Protected Member Functions inherited from madness::WorldObject< FunctionImpl< T, NDIM > >
void process_pending ()
 To be called from derived constructor to process pending messages. More...
 

Detailed Description

template<typename T, std::size_t NDIM>
class madness::FunctionImpl< T, NDIM >

FunctionImpl holds all Function state to facilitate shallow copy semantics.

Since Function assignment and copy constructors are shallow it greatly simplifies maintaining consistent state to have all (permanent) state encapsulated in a single class. The state is shared between instances using a shared_ptr<FunctionImpl>.

The FunctionImpl inherits all of the functionality of WorldContainer (to store the coefficients) and WorldObject<WorldContainer> (used for RMI and for its unqiue id).

The class methods are public to avoid painful multiple friend template declarations for Function and FunctionImpl ... but this trust should not be abused ... NOTHING except FunctionImpl methods should mess with FunctionImplData. The LB stuff might have to be an exception.

Member Typedef Documentation

◆ coeffT

template<typename T , std::size_t NDIM>
typedef GenTensor<T> madness::FunctionImpl< T, NDIM >::coeffT

Type of tensor used to hold coeffs.

◆ coordT

template<typename T , std::size_t NDIM>
typedef Vector<double,NDIM> madness::FunctionImpl< T, NDIM >::coordT

Type of vector holding coordinates.

◆ datumT

template<typename T , std::size_t NDIM>
typedef std::pair<const keyT,nodeT> madness::FunctionImpl< T, NDIM >::datumT

Type of entry in container.

◆ dcT

template<typename T , std::size_t NDIM>
typedef WorldContainer<keyT,nodeT> madness::FunctionImpl< T, NDIM >::dcT

Type of container holding the coefficients.

◆ implT

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

Type of this class (implementation)

◆ keyT

template<typename T , std::size_t NDIM>
typedef Key<NDIM> madness::FunctionImpl< T, NDIM >::keyT

Type of key.

◆ mapT

template<typename T , std::size_t NDIM>
typedef ConcurrentHashMap< keyT, mapvecT > madness::FunctionImpl< T, NDIM >::mapT

Type of the map returned by make_key_vec_map.

◆ mapvecT

template<typename T , std::size_t NDIM>
typedef std::vector< std::pair<int,const coeffT*> > madness::FunctionImpl< T, NDIM >::mapvecT

Type of the entry in the map returned by make_key_vec_map.

◆ nodeT

template<typename T , std::size_t NDIM>
typedef FunctionNode<T,NDIM> madness::FunctionImpl< T, NDIM >::nodeT

Type of node.

◆ pimplT

template<typename T , std::size_t NDIM>
typedef std::shared_ptr< FunctionImpl<T,NDIM> > madness::FunctionImpl< T, NDIM >::pimplT

pointer to this class

◆ rangeT [1/2]

template<typename T , std::size_t NDIM>
typedef Range<typename dcT::const_iterator> madness::FunctionImpl< T, NDIM >::rangeT

◆ rangeT [2/2]

template<typename T , std::size_t NDIM>
typedef Range<typename dcT::const_iterator> madness::FunctionImpl< T, NDIM >::rangeT

◆ tensorT

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

Type of tensor for anything but to hold coeffs.

◆ tranT

template<typename T , std::size_t NDIM>
typedef Vector<Translation,NDIM> madness::FunctionImpl< T, NDIM >::tranT

Type of array holding translation.

◆ typeT

template<typename T , std::size_t NDIM>
typedef T madness::FunctionImpl< T, NDIM >::typeT

◆ woT

template<typename T , std::size_t NDIM>
typedef WorldObject< FunctionImpl<T,NDIM> > madness::FunctionImpl< T, NDIM >::woT
private

Base class world object type.

Constructor & Destructor Documentation

◆ FunctionImpl() [1/3]

template<typename T , std::size_t NDIM>
madness::FunctionImpl< T, NDIM >::FunctionImpl ( const FunctionImpl< T, NDIM > &  p)
private

◆ FunctionImpl() [2/3]

template<typename T , std::size_t NDIM>
madness::FunctionImpl< T, NDIM >::FunctionImpl ( const FunctionFactory< T, NDIM > &  factory)
inline

◆ FunctionImpl() [3/3]

template<typename T , std::size_t NDIM>
template<typename Q >
madness::FunctionImpl< T, NDIM >::FunctionImpl ( const FunctionImpl< Q, NDIM > &  other,
const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > &  pmap,
bool  dozero 
)
inline

Copy constructor.

Allocates a new function in preparation for a deep copy

By default takes pmap from other but can also specify a different pmap. Does not copy the coefficients ... creates an empty container.

References madness::FunctionImpl< T, NDIM >::cdata, madness::FunctionImpl< T, NDIM >::coeffs, madness::FunctionImpl< T, NDIM >::initial_level, madness::FunctionImpl< T, NDIM >::insert_zero_down_to_initial_level(), madness::WorldObject< FunctionImpl< T, NDIM > >::process_pending(), and madness::WorldContainer< keyT, valueT, hashfunT >::process_pending().

◆ ~FunctionImpl()

template<typename T , std::size_t NDIM>
virtual madness::FunctionImpl< T, NDIM >::~FunctionImpl ( )
inlinevirtual

Member Function Documentation

◆ abs_inplace()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::abs_inplace ( bool  fence)

◆ abs_square_inplace()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::abs_square_inplace ( bool  fence)

◆ accumulate_timer()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::accumulate_timer ( const double  time) const

◆ accumulate_trees()

template<typename T , std::size_t NDIM>
template<typename Q , typename R >
void madness::FunctionImpl< T, NDIM >::accumulate_trees ( FunctionImpl< Q, NDIM > &  result,
const R  alpha,
const bool  fence = true 
) const
inline

merge the trees of this and other, while multiplying them with the alpha or beta, resp

result and rhs do not have to have the same distribution or live in the same world result+=alpha* this

Parameters
[in]alphaprefactor for this

References alpha, and madness::FunctionImpl< T, NDIM >::flo_unary_op_node_inplace().

◆ add_keys_to_map()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::add_keys_to_map ( mapT map,
int  index 
) const
inline

◆ add_scalar_inplace()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::add_scalar_inplace ( T  t,
bool  fence 
)

Adds a constant to the function. Local operation, optional fence.

In scaling function basis must add value to first polyn in each box with appropriate scaling for level. In wavelet basis need only add at level zero.

Parameters
[in]tthe scalar to be added

References madness::change_tensor_type(), madness::FunctionNode< T, NDIM >::coeff(), madness::GenTensor< T >::full_tensor(), madness::FunctionNode< T, NDIM >::has_coeff(), L, MADNESS_ASSERT, NDIM, pow(), madness::TT_FULL, and madness::ttt.

◆ apply()

template<typename T , std::size_t NDIM>
template<typename opT , typename R >
void madness::FunctionImpl< T, NDIM >::apply ( opT &  op,
const FunctionImpl< R, NDIM > &  f,
bool  fence 
)
inline

◆ apply_1d_realspace_push()

template<typename T , std::size_t NDIM>
template<typename opT , typename R >
void madness::FunctionImpl< T, NDIM >::apply_1d_realspace_push ( const opT &  op,
const FunctionImpl< R, NDIM > *  f,
int  axis,
bool  fence 
)
inline

◆ apply_1d_realspace_push_op()

template<typename T , std::size_t NDIM>
template<typename opT , typename R >
void madness::FunctionImpl< T, NDIM >::apply_1d_realspace_push_op ( const archive::archive_ptr< const opT > &  pop,
int  axis,
const keyT key,
const Tensor< R > &  c 
)
inline

◆ apply_source_driven()

template<typename T , std::size_t NDIM>
template<typename opT , typename R >
void madness::FunctionImpl< T, NDIM >::apply_source_driven ( opT &  op,
const FunctionImpl< R, NDIM > &  f,
bool  fence 
)
inline

◆ assemble_coefficients()

template<typename T , std::size_t NDIM>
FunctionImpl< T, NDIM >::coeffT madness::FunctionImpl< T, NDIM >::assemble_coefficients ( const keyT key,
const coeffT coeff_ket,
const coeffT vpotential1,
const coeffT vpotential2,
const tensorT veri 
) const

given several coefficient tensors, assemble a result tensor

the result looks like: (v(1,2) + v(1) + v(2)) |ket(1,2)> or (v(1,2) + v(1) + v(2)) |p(1) p(2)> i.e. coefficients for the ket and coefficients for the two particles are mutually exclusive. All potential terms are optional, just pass in empty coeffs.

Parameters
[in]keythe key of the FunctionNode to which these coeffs belong
[in]coeff_ketcoefficients of the ket
[in]vpotential1function values of the potential for particle 1
[in]vpotential2function values of the potential for particle 2
[in]verifunction values for the 2-particle potential

the result looks like: (v(1,2) + v(1) + v(2)) |ket(1,2)> or (v(1,2) + v(1) + v(2)) |p(1) p(2)> i.e. coefficients for the ket and coefficients for the two particles are mutually exclusive. All potential terms are optional, just pass in empty coeffs.

Parameters
[in]keythe key of the FunctionNode to which these coeffs belong
[in]cketcoefficients of the ket
[in]vpotential1function values of the potential for particle 1
[in]vpotential2function values of the potential for particle 2
[in]verifunction values for the 2-particle potential

References madness::GenTensor< T >::convert(), madness::GenTensor< T >::dims(), madness::GenTensor< T >::full_tensor_copy(), madness::GenTensor< T >::has_data(), madness::Tensor< T >::has_data(), MADNESS_ASSERT, madness::multiply(), madness::GenTensor< T >::ndim(), madness::GenTensor< T >::reduce_rank(), thresh, and madness::TT_2D.

◆ autorefine_square_test()

template<typename T , std::size_t NDIM>
bool madness::FunctionImpl< T, NDIM >::autorefine_square_test ( const keyT key,
const nodeT t 
) const

Returns true if this block of coeffs needs autorefining.

References madness::FunctionNode< T, NDIM >::coeff(), madness::GenTensor< T >::full_tensor_copy(), lo, test(), and thresh.

◆ average()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::average ( const implT rhs)

take the average of two functions, similar to: this=0.5*(this+rhs)

works in either basis and also in nonstandard form

References madness::FunctionImpl< T, NDIM >::flo_unary_op_node_inplace().

◆ binaryXX()

template<typename T , std::size_t NDIM>
template<typename L , typename R , typename opT >
void madness::FunctionImpl< T, NDIM >::binaryXX ( const FunctionImpl< L, NDIM > *  left,
const FunctionImpl< R, NDIM > *  right,
const opT &  op,
bool  fence 
)
inline

Performs binary operation on two functions (impl's). Delegates to the binaryXXa() method

Parameters
[in]leftpointer to the left function impl
[in]rightpointer to the right function impl
[in]opthe binary operator

References madness::FunctionImpl< T, NDIM >::binaryXXa(), madness::FunctionImpl< T, NDIM >::cdata, madness::FunctionImpl< T, NDIM >::coeffs, madness::WorldGopInterface::fence(), madness::World::gop, op(), madness::WorldContainer< keyT, valueT, hashfunT >::owner(), madness::World::rank(), and madness::FunctionImpl< T, NDIM >::world.

◆ binaryXXa()

template<typename T , std::size_t NDIM>
template<typename L , typename R , typename opT >
void madness::FunctionImpl< T, NDIM >::binaryXXa ( const keyT key,
const FunctionImpl< L, NDIM > *  left,
const Tensor< L > &  lcin,
const FunctionImpl< R, NDIM > *  right,
const Tensor< R > &  rcin,
const opT &  op 
)
inline

Both left and right functions are in the scaling function basis

Parameters
[in]keythe key to the current function node (box)
[in]leftthe function impl associated with the left function
[in]lcinthe scaling function coefficients associated with the current box in the left function
[in]rightthe function impl associated with the right function
[in]rcinthe scaling function coefficients associated with the current box in the right function
[in]opthe binary operator

References madness::___, madness::FunctionImpl< T, NDIM >::cdata, madness::FunctionImpl< T, NDIM >::child_patch(), madness::FunctionImpl< T, NDIM >::coeffs, madness::copy(), madness::WorldContainer< keyT, valueT, hashfunT >::end(), madness::WorldContainer< keyT, valueT, hashfunT >::find(), madness::FunctionImpl< T, NDIM >::MADNESS_ASSERT(), op(), madness::WorldContainer< keyT, valueT, hashfunT >::owner(), madness::WorldContainer< keyT, valueT, hashfunT >::replace(), madness::BaseTensor::size(), madness::WorldObject< FunctionImpl< T, NDIM > >::task(), and madness::FunctionImpl< T, NDIM >::unfilter().

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

◆ broaden()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::broaden ( std::vector< bool >  is_periodic,
bool  fence 
)

◆ broaden_op()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::broaden_op ( const keyT key,
const std::vector< Future< bool > > &  v 
)

◆ change_tensor_type1()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::change_tensor_type1 ( const TensorArgs targs,
bool  fence 
)

change the tensor type of the coefficients in the FunctionNode

Parameters
[in]targstarget tensor arguments (threshold and full/low rank)

◆ change_tree_state()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::change_tree_state ( const TreeState  finalstate,
bool  fence = true 
)

◆ check_symmetry_local()

template<typename T , std::size_t NDIM>
double madness::FunctionImpl< T, NDIM >::check_symmetry_local

Returns some asymmetry measure ... no comms.

References PROFILE_MEMBER_FUNC.

◆ child_patch()

template<typename T , std::size_t NDIM>
std::vector< Slice > madness::FunctionImpl< T, NDIM >::child_patch ( const keyT child) const

◆ chop_at_level()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::chop_at_level ( const int  n,
const bool  fence = true 
)

remove all nodes with level higher than n

reduce the rank of the coefficients tensors

Parameters
[in]targstarget tensor arguments (threshold and full/low rank)

References madness::Key< NDIM >::level(), and madness::FunctionNode< T, NDIM >::set_is_leaf().

◆ coeffs2values() [1/2]

template<typename T , std::size_t NDIM>
template<typename Q >
GenTensor<Q> madness::FunctionImpl< T, NDIM >::coeffs2values ( const keyT key,
const GenTensor< Q > &  coeff 
) const
inline

Return the values when given the coeffs in scaling function basis

Parameters
[in]keythe key of the function node (box)
[in]coeffthe tensor of scaling function coefficients for function node (box)
Returns
function values for function node (box)

References madness::FunctionImpl< T, NDIM >::cdata, madness::Key< NDIM >::level(), NDIM, pow(), madness::scale(), and madness::transform().

Referenced by madness::FunctionImpl< T, NDIM >::fcube_for_mul(), madness::FunctionImpl< T, NDIM >::multi_to_multi_op_values_doit(), madness::FunctionImpl< T, NDIM >::multiop_values_doit(), madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::operator()(), and madness::FunctionImpl< T, NDIM >::coeff_value_adaptor< Q, opT >::operator()().

◆ coeffs2values() [2/2]

template<typename T , std::size_t NDIM>
template<typename Q >
Tensor<Q> madness::FunctionImpl< T, NDIM >::coeffs2values ( const keyT key,
const Tensor< Q > &  coeff 
) const
inline

Return the scaling function coeffs when given the function values at the quadrature points

Parameters
[in]keythe key of the function node (box)
Returns
function values for function node (box)

References madness::FunctionImpl< T, NDIM >::cdata, madness::Key< NDIM >::level(), NDIM, pow(), madness::scale(), and madness::transform().

◆ coeffs_for_jun()

template<typename T , std::size_t NDIM>
FunctionImpl< T, NDIM >::tensorT madness::FunctionImpl< T, NDIM >::coeffs_for_jun ( Level  n,
long  q = 0 
)

◆ compress()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::compress ( const TreeState  newstate,
bool  fence 
)

compress the wave function

after application there will be sum coefficients at the root level, and difference coefficients at all other levels; furthermore:

Parameters
[in]nonstandardkeep sum coeffs at all other levels, except leaves
[in]keepleaveskeep sum coeffs (but no diff coeffs) at leaves
[in]redundantkeep only sum coeffs at all levels, discard difference coeffs

References MADNESS_CHECK_THROW, madness::nonstandard, madness::nonstandard_with_leaves, and madness::redundant.

◆ compress_op()

template<typename T , std::size_t NDIM>
std::pair< typename FunctionImpl< T, NDIM >::coeffT, double > madness::FunctionImpl< T, NDIM >::compress_op ( const keyT key,
const std::vector< Future< std::pair< coeffT, double >> > &  v,
bool  nonstandard 
)

calculate the wavelet coefficients using the sum coefficients of all child nodes

also compute the norm tree for all nodes

Parameters
[in]keythis's key
[in]vsum coefficients of the child nodes
[in]nonstandardkeep the sum coefficients with the wavelet coefficients
[in]redundantkeep only the sum coefficients, discard the wavelet coefficients
Returns
the sum coefficients
Parameters
[in]keythis's key
[in]vsum coefficients of the child nodes
[in]nonstandardkeep the sum coefficients with the wavelet coefficients
[in]redundantkeep only the sum coefficients, discard the wavelet coefficients
Returns
the sum coefficients

References madness::copy(), madness::cpu_time(), d(), madness::Key< NDIM >::level(), MADNESS_CHECK, MADNESS_CHECK_THROW, madness::norm_tree(), madness::GenTensor< T >::normf(), madness::TensorArgs::thresh, and v.

◆ compress_spawn()

template<typename T , std::size_t NDIM>
Future< std::pair< GenTensor< T >, double > > madness::FunctionImpl< T, NDIM >::compress_spawn ( const keyT key,
bool  nonstandard1,
bool  keepleaves,
bool  redundant1 
)

Invoked on node where key is local.

will insert

Returns
s coefficient and norm_tree for key

◆ compute_snorm_and_dnorm()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::compute_snorm_and_dnorm ( bool  fence = true)

compute norm of s and d coefficients for all nodes

Parameters
[in]targstarget tensor arguments (threshold and full/low rank)

◆ conj() [1/2]

template<typename T , std::size_t NDIM>
static std::complex<double> madness::FunctionImpl< T, NDIM >::conj ( const std::complex< double >  x)
inlinestatic

References madness::conj().

◆ conj() [2/2]

template<typename T , std::size_t NDIM>
static double madness::FunctionImpl< T, NDIM >::conj ( float  x)
inlinestatic

◆ copy_coeffs()

template<typename T , std::size_t NDIM>
template<typename Q >
void madness::FunctionImpl< T, NDIM >::copy_coeffs ( const FunctionImpl< Q, NDIM > &  other,
bool  fence 
)
inline

◆ diff()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::diff ( const DerivativeBase< T, NDIM > *  D,
const implT f,
bool  fence 
)

◆ dirac_convolution_op()

template<typename T , std::size_t NDIM>
template<std::size_t LDIM>
void madness::FunctionImpl< T, NDIM >::dirac_convolution_op ( const keyT key,
const nodeT node,
FunctionImpl< T, LDIM > *  f 
) const
inline

◆ distribute()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::distribute ( std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > >  newmap) const
inline

◆ do_apply()

template<typename T , std::size_t NDIM>
template<typename opT , typename R >
void madness::FunctionImpl< T, NDIM >::do_apply ( const opT *  op,
const keyT key,
const Tensor< R > &  c 
)
inline

◆ do_apply_directed_screening()

template<typename T , std::size_t NDIM>
template<typename opT , typename R >
double madness::FunctionImpl< T, NDIM >::do_apply_directed_screening ( const opT *  op,
const keyT key,
const coeffT coeff,
const bool &  do_kernel 
)
inline

◆ do_apply_kernel()

template<typename T , std::size_t NDIM>
template<typename opT , typename R , size_t OPDIM>
void madness::FunctionImpl< T, NDIM >::do_apply_kernel ( const opT *  op,
const Tensor< R > &  c,
const do_op_args< OPDIM > &  args 
)
inline

◆ do_apply_kernel2()

template<typename T , std::size_t NDIM>
template<typename opT , typename R , size_t OPDIM>
double madness::FunctionImpl< T, NDIM >::do_apply_kernel2 ( const opT *  op,
const Tensor< R > &  c,
const do_op_args< OPDIM > &  args,
const TensorArgs apply_targs 
)
inline

◆ do_apply_kernel3()

template<typename T , std::size_t NDIM>
template<typename opT , typename R , size_t OPDIM>
double madness::FunctionImpl< T, NDIM >::do_apply_kernel3 ( const opT *  op,
const GenTensor< R > &  coeff,
const do_op_args< OPDIM > &  args,
const TensorArgs apply_targs 
)
inline

◆ do_binary_op()

template<typename T , std::size_t NDIM>
template<typename L , typename R , typename opT >
void madness::FunctionImpl< T, NDIM >::do_binary_op ( const keyT key,
const Tensor< L > &  left,
const std::pair< keyT, Tensor< R > > &  arg,
const opT &  op 
)
inline

◆ do_diff1()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::do_diff1 ( const DerivativeBase< T, NDIM > *  D,
const implT f,
const keyT key,
const std::pair< keyT, coeffT > &  left,
const std::pair< keyT, coeffT > &  center,
const std::pair< keyT, coeffT > &  right 
)

References madness::f.

◆ do_dirac_convolution()

template<typename T , std::size_t NDIM>
template<std::size_t LDIM>
void madness::FunctionImpl< T, NDIM >::do_dirac_convolution ( FunctionImpl< T, LDIM > *  f,
bool  fence 
) const
inline

◆ do_inner_localX()

template<typename T , std::size_t NDIM>
template<typename R >
static void madness::FunctionImpl< T, NDIM >::do_inner_localX ( const typename mapT::iterator  lstart,
const typename mapT::iterator  lend,
typename FunctionImpl< R, NDIM >::mapT rmap_ptr,
const bool  sym,
Tensor< TENSOR_RESULT_TYPE(T, R) > *  result_ptr,
Mutex mutex 
)
inlinestatic

◆ do_mul()

template<typename T , std::size_t NDIM>
template<typename L , typename R >
void madness::FunctionImpl< T, NDIM >::do_mul ( const keyT key,
const Tensor< L > &  left,
const std::pair< keyT, Tensor< R > > &  arg 
)
inline

◆ do_print_grid()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::do_print_grid ( const std::string  filename,
const std::vector< keyT > &  keys 
) const

print the grid in xyz format

the quadrature points and the key information will be written to file,

Parameters
[in]filenamewhere the quadrature points will be written to
[in]keysall leaf keys

References c, d(), madness::BaseTensor::dim(), madness::filename, madness::FunctionDefaults< NDIM >::get_cell(), madness::FunctionDefaults< NDIM >::get_cell_width(), h(), k, madness::Key< NDIM >::level(), MADNESS_ASSERT, MADNESS_EXCEPTION, NDIM, pow(), and madness::Key< NDIM >::translation().

◆ do_print_plane()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::do_print_plane ( const std::string  filename,
std::vector< Tensor< double > >  plotinfo,
const int  xaxis,
const int  yaxis,
const coordT  el2 
)

print the MRA structure

Functor for the print_plane method

Parameters
[in]filenamethe filename for the output
[in]plotinfoplotting parameters
[in]xaxisthe x-axis in the plot (can be any axis of the MRA box)
[in]yaxisthe y-axis in the plot (can be any axis of the MRA box)

References madness::BaseTensor::dim(), madness::Tensor< T >::end(), madness::filename, madness::FunctionDefaults< NDIM >::get_cell(), madness::Tensor< T >::has_data(), and MADNESS_ASSERT.

◆ do_print_tree()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::do_print_tree ( const keyT key,
std::ostream &  os,
Level  maxlevel 
) const

Functor for the do_print_tree method.

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

◆ do_print_tree_graphviz()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::do_print_tree_graphviz ( const keyT key,
std::ostream &  os,
Level  maxlevel 
) const

Functor for the do_print_tree method (using GraphViz)

References madness::FunctionNode< T, NDIM >::has_children(), madness::Key< NDIM >::level(), NDIM, and madness::Key< NDIM >::translation().

◆ do_print_tree_json()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::do_print_tree_json ( const keyT key,
std::multimap< Level, std::tuple< tranT, std::string >> &  data,
Level  maxlevel 
) const

◆ do_project_out()

template<typename T , std::size_t NDIM>
template<size_t LDIM>
void madness::FunctionImpl< T, NDIM >::do_project_out ( const coeffT fcoeff,
const std::pair< keyT, coeffT gpair,
const keyT gkey,
const Key< NDIM > &  dest,
const int  dim 
) const
inline

compute the inner product of two nodes of only some dimensions and accumulate on result

invoked by result

Parameters
[in]fcoeffcoefficients of high dimension LDIM+NDIM
[in]gpairkey and coeffs of low dimension LDIM (possibly a parent node)
[in]gkeykey of actual low dim node (possibly the same as gpair.first, iff gnode exists)
[in]destdestination node for the result
[in]dimwhich dimensions should be contracted: 0..LDIM-1 or LDIM..NDIM+LDIM-1

References madness::_(), madness::FunctionNode< T, NDIM >::accumulate2(), madness::FunctionImpl< T, NDIM >::cdata, madness::FunctionImpl< T, NDIM >::coeffs, madness::GenTensor< T >::config(), madness::GenTensor< T >::dim(), madness::GenTensor< T >::full_tensor(), madness::GenTensor< T >::has_no_data(), madness::TaskAttributes::hipri(), madness::FunctionImpl< T, NDIM >::k, madness::FunctionImpl< T, NDIM >::MADNESS_ASSERT(), madness::FunctionImpl< T, NDIM >::parent_to_child(), madness::GenTensor< T >::rank(), madness::WorldContainer< keyT, valueT, hashfunT >::task(), madness::GenTensor< T >::tensor_type(), madness::TT_2D, and madness::TT_FULL.

◆ do_square_inplace()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::do_square_inplace ( const keyT key)

◆ do_square_inplace2()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::do_square_inplace2 ( const keyT parent,
const keyT child,
const tensorT parent_coeff 
)

◆ downsample()

template<typename T , std::size_t NDIM>
FunctionImpl< T, NDIM >::tensorT madness::FunctionImpl< T, NDIM >::downsample ( const keyT key,
const std::vector< Future< coeffT > > &  v 
) const

downsample the sum coefficients of level n+1 to sum coeffs on level n

specialization of the filter method, will yield only the sum coefficients

Parameters
[in]keykey of level n
[in]vvector of sum coefficients of level n+1
Returns
sum coefficients on level n in full tensor format

specialization of the filter method, will yield only the sum coefficients

Parameters
[in]keykey of level n
[in]vvector of sum coefficients of level n+1
[in]argsTensorArguments for possible low rank approximations
Returns
sum coefficients on level n in full tensor format

◆ erase()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::erase ( const Level max_level)

truncate tree at a certain level

truncate tree at a certain level

Parameters
[in]max_leveltruncate tree below this level

References madness::Key< NDIM >::level(), madness::make_redundant(), and madness::FunctionNode< T, NDIM >::set_has_children().

◆ err_box()

template<typename T , std::size_t NDIM>
template<typename opT >
double madness::FunctionImpl< T, NDIM >::err_box ( const keyT key,
const nodeT node,
const opT &  func,
int  npt,
const Tensor< double > &  qx,
const Tensor< double > &  quad_phit,
const Tensor< double > &  quad_phiw 
) const
inline

Returns the square of the error norm in the box labeled by key.

Assumed to be invoked locally but it would be easy to eliminate this assumption

References madness::FunctionNode< T, NDIM >::coeff(), madness::fast_transform(), madness::FunctionImpl< T, NDIM >::fcube(), madness::GenTensor< T >::full_tensor_copy(), madness::func(), IND, ITERATOR, madness::Key< NDIM >::level(), NDIM, pow(), and madness::scale().

Referenced by madness::FunctionImpl< T, NDIM >::do_err_box< opT >::operator()().

◆ errsq_local()

template<typename T , std::size_t NDIM>
template<typename opT >
double madness::FunctionImpl< T, NDIM >::errsq_local ( const opT &  func) const
inline

◆ eval()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::eval ( const Vector< double, NDIM > &  xin,
const keyT keyin,
const typename Future< T >::remote_refT &  ref 
)

Evaluate the function at a point in simulation coordinates.

Only the invoking process will get the result via the remote reference to a future. Active messages may be sent to other nodes.

References madness::FunctionNode< T, NDIM >::coeff(), madness::GenTensor< T >::full_tensor_copy(), madness::Future< T >::get(), madness::FunctionNode< T, NDIM >::has_coeff(), madness::TaskAttributes::hipri(), madness::Key< NDIM >::level(), me, NDIM, PROFILE_MEMBER_FUNC, madness::Future< T >::set(), task(), madness::Key< NDIM >::translation(), and xi.

◆ eval_cube()

template<typename T , std::size_t NDIM>
T madness::FunctionImpl< T, NDIM >::eval_cube ( Level  n,
coordT x,
const tensorT c 
) const

◆ eval_local_only()

template<typename T , std::size_t NDIM>
std::pair< bool, T > madness::FunctionImpl< T, NDIM >::eval_local_only ( const Vector< double, NDIM > &  xin,
Level  maxlevel 
)

Evaluate function only if point is local returning (true,value); otherwise return (false,0.0)

maxlevel is the maximum depth to search down to — the max local depth can be computed with max_local_depth();

References madness::FunctionNode< T, NDIM >::coeff(), madness::GenTensor< T >::full_tensor_copy(), madness::Future< T >::get(), madness::FunctionNode< T, NDIM >::has_coeff(), madness::Key< NDIM >::level(), me, NDIM, madness::Key< NDIM >::translation(), and xi.

◆ eval_plot_cube()

template<typename T , std::size_t NDIM>
Tensor< T > madness::FunctionImpl< T, NDIM >::eval_plot_cube ( const coordT plotlo,
const coordT plothi,
const std::vector< long > &  npt,
const bool  eval_refine = false 
) const

Evaluate a cube/slice of points ... plotlo and plothi are already in simulation coordinates No communications

Parameters
[in]plotlothe coordinate of the starting point
[in]plothithe coordinate of the ending point
[in]nptthe number of points in each dimension

Set plot_refine=true to get a plot of the refinment levels of the given function (defaulted to false in prototype).

References madness::FunctionNode< T, NDIM >::has_coeff(), MADNESS_ASSERT, NDIM, PROFILE_MEMBER_FUNC, madness::Tensor< T >::ptr(), madness::BaseTensor::size(), and task().

◆ evaldepthpt()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::evaldepthpt ( const Vector< double, NDIM > &  xin,
const keyT keyin,
const typename Future< Level >::remote_refT &  ref 
)

Get the depth of the tree at a point in simulation coordinates.

Only the invoking process will get the result via the remote reference to a future. Active messages may be sent to other nodes.

This function is a minimally-modified version of eval()

References madness::Future< T >::get(), madness::FunctionNode< T, NDIM >::has_coeff(), madness::TaskAttributes::hipri(), madness::Key< NDIM >::level(), me, NDIM, PROFILE_MEMBER_FUNC, madness::Future< T >::set(), task(), madness::Key< NDIM >::translation(), and xi.

◆ evalR()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::evalR ( const Vector< double, NDIM > &  xin,
const keyT keyin,
const typename Future< long >::remote_refT &  ref 
)

Get the rank of leaf box of the tree at a point in simulation coordinates.

Only the invoking process will get the result via the remote reference to a future. Active messages may be sent to other nodes.

This function is a minimally-modified version of eval()

References madness::FunctionNode< T, NDIM >::coeff(), madness::Future< T >::get(), madness::FunctionNode< T, NDIM >::has_coeff(), madness::TaskAttributes::hipri(), madness::Key< NDIM >::level(), me, NDIM, PROFILE_MEMBER_FUNC, madness::GenTensor< T >::rank(), madness::Future< T >::set(), task(), madness::Key< NDIM >::translation(), and xi.

◆ exists_and_has_children()

template<typename T , std::size_t NDIM>
bool madness::FunctionImpl< T, NDIM >::exists_and_has_children ( const keyT key) const

◆ exists_and_is_leaf()

template<typename T , std::size_t NDIM>
bool madness::FunctionImpl< T, NDIM >::exists_and_is_leaf ( const keyT key) const

◆ fcube() [1/2]

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::fcube ( const keyT key,
const FunctionFunctorInterface< T, NDIM > &  f,
const Tensor< double > &  qx,
tensorT fval 
) const

Evaluate function at quadrature points in the specified box.

Parameters
[in]keythe key indicating where the quadrature points are located
[in]fthe interface to the elementary function
[in]qxquadrature points on a level=0 box
[out]fvalvalues

References madness::f, and madness::fcube().

Referenced by madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::eri_coeffs(), madness::FunctionImpl< T, NDIM >::err_box(), and madness::FunctionImpl< T, NDIM >::inner_ext_node().

◆ fcube() [2/2]

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::fcube ( const keyT key,
T(*)(const coordT &)  f,
const Tensor< double > &  qx,
tensorT fval 
) const

Evaluate function at quadrature points in the specified box.

Parameters
[in]keythe key indicating where the quadrature points are located
[in]fthe interface to the elementary function
[in]qxquadrature points on a level=0 box
[out]fvalvalues

References madness::f, and madness::fcube().

◆ fcube_for_mul() [1/2]

template<typename T , std::size_t NDIM>
template<typename Q >
GenTensor<Q> madness::FunctionImpl< T, NDIM >::fcube_for_mul ( const keyT child,
const keyT parent,
const GenTensor< Q > &  coeff 
) const
inline

Compute the function values for multiplication.

Given coefficients from a parent cell, compute the value of the functions at the quadrature points of a child

Parameters
[in]childthe key for the child function node (box)
[in]parentthe key for the parent function node (box)
[in]coeffthe coefficients of scaling function basis of the parent box

References madness::FunctionImpl< T, NDIM >::cdata, madness::FunctionImpl< T, NDIM >::coeffs2values(), d(), madness::general_transform(), madness::Key< NDIM >::level(), MADNESS_EXCEPTION, NDIM, madness::FunctionImpl< T, NDIM >::phi_for_mul(), and madness::Key< NDIM >::translation().

◆ fcube_for_mul() [2/2]

template<typename T , std::size_t NDIM>
template<typename Q >
Tensor<Q> madness::FunctionImpl< T, NDIM >::fcube_for_mul ( const keyT child,
const keyT parent,
const Tensor< Q > &  coeff 
) const
inline

Compute the function values for multiplication.

Given coefficients from a parent cell, compute the value of the functions at the quadrature points of a child

Parameters
[in]childthe key for the child function node (box)
[in]parentthe key for the parent function node (box)
[in]coeffthe coefficients of scaling function basis of the parent box

References madness::FunctionImpl< T, NDIM >::cdata, madness::FunctionImpl< T, NDIM >::coeffs2values(), d(), madness::general_transform(), madness::Key< NDIM >::level(), MADNESS_EXCEPTION, NDIM, madness::FunctionImpl< T, NDIM >::phi_for_mul(), and madness::Key< NDIM >::translation().

Referenced by madness::FunctionImpl< T, NDIM >::do_binary_op(), madness::FunctionImpl< T, NDIM >::do_mul(), and madness::FunctionImpl< T, NDIM >::do_unary_op_value_inplace< opT >::operator()().

◆ filter() [1/2]

template<typename T , std::size_t NDIM>
FunctionImpl< T, NDIM >::coeffT madness::FunctionImpl< T, NDIM >::filter ( const coeffT s) const

◆ filter() [2/2]

template<typename T , std::size_t NDIM>
FunctionImpl< T, NDIM >::tensorT madness::FunctionImpl< T, NDIM >::filter ( const tensorT s) const

Transform sum coefficients at level n to sums+differences at level n-1.

Given scaling function coefficients s[n][l][i] and s[n][l+1][i] return the scaling function and wavelet coefficients at the coarser level. I.e., decompose Vn using Vn = Vn-1 + Wn-1.

s_i = sum(j) h0_ij*s0_j + h1_ij*s1_j
d_i = sum(j) g0_ij*s0_j + g1_ij*s1_j
//
Function< T, NDIM > sum(World &world, const std::vector< Function< T, NDIM > > &f, bool fence=true)
Returns new function — q = sum_i f[i].
Definition: vmra.h:1421

Returns a new tensor and has no side effects. Works for any number of dimensions.

No communication involved.

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

◆ finalize_apply()

template<typename T , std::size_t NDIM>
double madness::FunctionImpl< T, NDIM >::finalize_apply

after apply we need to do some cleanup;

forces fence

References madness::nonstandard_after_apply, madness::print_timings, madness::TensorArgs::thresh, and madness::wall_time().

◆ finalize_sum()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::finalize_sum

after summing up we need to do some cleanup;

forces fence

References madness::reconstructed.

◆ find_datum()

template<typename T , std::size_t NDIM>
std::pair< Key< NDIM >, ShallowNode< T, NDIM > > madness::FunctionImpl< T, NDIM >::find_datum ( keyT  key) const

return the a std::pair<key, node>, which MUST exist

References MADNESS_ASSERT.

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

◆ find_me()

template<typename T , std::size_t NDIM>
Future< std::pair< Key< NDIM >, GenTensor< T > > > madness::FunctionImpl< T, NDIM >::find_me ( const keyT key) const

find_me. Called by diff_bdry to get coefficients of boundary function

◆ flo_unary_op_node_inplace() [1/2]

template<typename T , std::size_t NDIM>
template<typename opT >
void madness::FunctionImpl< T, NDIM >::flo_unary_op_node_inplace ( const opT &  op,
bool  fence 
)
inline

◆ flo_unary_op_node_inplace() [2/2]

template<typename T , std::size_t NDIM>
template<typename opT >
void madness::FunctionImpl< T, NDIM >::flo_unary_op_node_inplace ( const opT &  op,
bool  fence 
) const
inline

◆ forward_do_diff1()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::forward_do_diff1 ( const DerivativeBase< T, NDIM > *  D,
const implT f,
const keyT key,
const std::pair< keyT, coeffT > &  left,
const std::pair< keyT, coeffT > &  center,
const std::pair< keyT, coeffT > &  right 
)

References madness::f.

◆ forward_traverse()

template<typename T , std::size_t NDIM>
template<typename coeff_opT , typename apply_opT >
void madness::FunctionImpl< T, NDIM >::forward_traverse ( const coeff_opT &  coeff_op,
const apply_opT &  apply_op,
const keyT key 
) const
inline

traverse a non-existing tree

part II: activate coeff_op, i.e. retrieve all the necessary remote boxes (communication)

Parameters
[in]coeff_opoperator making the coefficients that needs activation
[in]apply_opjust passing thru
[in]keythe key we are working on

References madness::FunctionImpl< T, NDIM >::coeffs, madness::WorldContainer< keyT, valueT, hashfunT >::is_local(), madness::FunctionImpl< T, NDIM >::MADNESS_ASSERT(), madness::World::rank(), madness::WorldObject< FunctionImpl< T, NDIM > >::task(), and madness::FunctionImpl< T, NDIM >::world.

Referenced by madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::continue_recursion().

◆ gaxpy()

template<typename T , std::size_t NDIM>
template<typename L , typename R >
void madness::FunctionImpl< T, NDIM >::gaxpy ( T  alpha,
const FunctionImpl< L, NDIM > &  left,
T  beta,
const FunctionImpl< R, NDIM > &  right,
bool  fence 
)
inline

Invoked by result to perform result += alpha*left+beta*right in wavelet basis.

Does not assume that any of result, left, right have the same distribution. For most purposes result will start as an empty so actually are implementing out of place gaxpy. If all functions have the same distribution there is no communication except for the optional fence.

References alpha, madness::WorldContainer< keyT, valueT, hashfunT >::begin(), beta, madness::FunctionImpl< T, NDIM >::coeffs, madness::WorldContainer< keyT, valueT, hashfunT >::end(), madness::WorldGopInterface::fence(), madness::World::gop, madness::WorldContainer< keyT, valueT, hashfunT >::send(), and madness::FunctionImpl< T, NDIM >::world.

◆ gaxpy_ext()

template<typename T , std::size_t NDIM>
template<typename L >
void madness::FunctionImpl< T, NDIM >::gaxpy_ext ( const FunctionImpl< L, NDIM > *  left,
T(*)(const coordT &)  f,
T  alpha,
T  beta,
double  tol,
bool  fence 
)
inline

◆ gaxpy_ext_node()

template<typename T , std::size_t NDIM>
template<typename L >
tensorT madness::FunctionImpl< T, NDIM >::gaxpy_ext_node ( keyT  key,
Tensor< L lc,
T(*)(const coordT &)  f,
T  alpha,
T  beta 
) const
inline

Return the gaxpy product with an external function on a specified function node.

Parameters
[in]keyKey of the function node on which to compute gaxpy
[in]lcTensor of coefficients for the function at the function node given by key
[in]fPointer to function of type T that takes coordT arguments. This is the externally provided function and the right argument of gaxpy.
[in]alphaprefactor of c Tensor for gaxpy
[in]betaprefactor of fcoeffs for gaxpy
Returns
Returns coefficient tensor of the gaxpy product at specified key, no guarantee of accuracy.

References alpha, beta, madness::FunctionImpl< T, NDIM >::cdata, madness::copy(), madness::f, madness::fcube(), madness::Tensor< T >::gaxpy(), and madness::FunctionImpl< T, NDIM >::values2coeffs().

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

◆ gaxpy_ext_recursive()

template<typename T , std::size_t NDIM>
template<typename L >
void madness::FunctionImpl< T, NDIM >::gaxpy_ext_recursive ( const keyT key,
const FunctionImpl< L, NDIM > *  left,
Tensor< L lcin,
tensorT  c,
T(*)(const coordT &)  f,
T  alpha,
T  beta,
double  tol,
bool  below_leaf 
)
inline

Return out of place gaxpy using recursive descent.

Parameters
[in]keyKey of the function node on which to compute gaxpy
[in]leftFunctionImpl, left argument of gaxpy
[in]lcincoefficients of left at this node
[in]ccoefficients of gaxpy product at this node
[in]fpointer to function of type T that takes coordT arguments. This is the externally provided function and the right argument of gaxpy.
[in]alphaprefactor of left argument for gaxpy
[in]betaprefactor of right argument for gaxpy
[in]tolconvergence tolerance...when the norm of the gaxpy's difference coefficients is less than tol, we are done.

References alpha, beta, c, madness::FunctionImpl< T, NDIM >::cdata, madness::FunctionImpl< T, NDIM >::child_patch(), madness::FunctionImpl< T, NDIM >::coeffs, madness::copy(), d(), madness::WorldContainer< keyT, valueT, hashfunT >::end(), madness::f, madness::FunctionImpl< T, NDIM >::filter(), madness::WorldContainer< keyT, valueT, hashfunT >::find(), madness::FunctionImpl< T, NDIM >::gaxpy_ext_node(), L, madness::FunctionImpl< T, NDIM >::MADNESS_ASSERT(), madness::WorldContainer< keyT, valueT, hashfunT >::owner(), madness::WorldContainer< keyT, valueT, hashfunT >::replace(), madness::BaseTensor::size(), T(), madness::FunctionImpl< T, NDIM >::targs, madness::WorldObject< FunctionImpl< T, NDIM > >::task(), madness::FunctionImpl< T, NDIM >::truncate_tol(), and madness::FunctionImpl< T, NDIM >::unfilter().

◆ gaxpy_inplace()

template<typename T , std::size_t NDIM>
template<typename Q , typename R >
void madness::FunctionImpl< T, NDIM >::gaxpy_inplace ( const T alpha,
const FunctionImpl< Q, NDIM > &  other,
const R beta,
bool  fence 
)
inline

◆ gaxpy_inplace_reconstructed()

template<typename T , std::size_t NDIM>
template<typename Q , typename R >
void madness::FunctionImpl< T, NDIM >::gaxpy_inplace_reconstructed ( const T alpha,
const FunctionImpl< Q, NDIM > &  g,
const R beta,
const bool  fence 
)
inline

◆ gaxpy_oop_reconstructed()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::gaxpy_oop_reconstructed ( const double  alpha,
const implT f,
const double  beta,
const implT g,
const bool  fence 
)

perform: this= alpha*f + beta*g, invoked by result

f and g are reconstructed, so we can save on the compress operation, walk down the joint tree, and add leaf coefficients; effectively refines to common finest level. nothing returned, but leaves this's tree reconstructed and as sum of f and g

Parameters
[in]alphaprefactor for f
[in]ffirst addend
[in]betaprefactor for g
[in]gsecond addend

f and g are reconstructed, so we can save on the compress operation, walk down the joint tree, and add leaf coefficients; effectively refines to common finest level.

Parameters
[in]alphaprefactor for f
[in]ffirst addend
[in]betaprefactor for g
[in]gsecond addend
Returns
nothing, but leaves this's tree reconstructed and as sum of f and g

References alpha, beta, madness::f, madness::g, MADNESS_ASSERT, madness::reconstructed, and task().

◆ get_autorefine()

template<typename T , std::size_t NDIM>
bool madness::FunctionImpl< T, NDIM >::get_autorefine

◆ get_cdata()

template<typename T , std::size_t NDIM>
const FunctionCommonData< T, NDIM > & madness::FunctionImpl< T, NDIM >::get_cdata

◆ get_coeffs() [1/2]

template<typename T , std::size_t NDIM>
FunctionImpl< T, NDIM >::dcT & madness::FunctionImpl< T, NDIM >::get_coeffs

◆ get_coeffs() [2/2]

template<typename T , std::size_t NDIM>
const FunctionImpl< T, NDIM >::dcT & madness::FunctionImpl< T, NDIM >::get_coeffs

◆ get_contraction_node_lists()

template<typename T , std::size_t NDIM>
template<std::size_t CDIM>
std::tuple<std::set<Key<NDIM> >, std::map<Key<CDIM>,double> > madness::FunctionImpl< T, NDIM >::get_contraction_node_lists ( const std::size_t  n,
const std::array< int, CDIM > &  v 
) const
inline

for contraction two functions f(x,z) = \int g(x,y) h(y,z) dy

find all nodes with d coefficients and return a list of complete keys and of keys holding only the y dimension, also the maximum norm of all d for the j dimension

Parameters
[in]nthe scale
[in]varray holding the indices of the integration variable
Returns
ijlist: list of all nodes with d coeffs; jlist: j-part of ij list only

References madness::WorldContainer< keyT, valueT, hashfunT >::begin(), madness::FunctionImpl< T, NDIM >::cdata, madness::FunctionNode< T, NDIM >::coeff(), madness::WorldContainer< keyT, valueT, hashfunT >::end(), madness::FunctionImpl< T, NDIM >::get_cdata(), madness::FunctionImpl< T, NDIM >::get_coeffs(), madness::FunctionNode< T, NDIM >::get_dnorm(), madness::Key< NDIM >::level(), max, madness::Key< NDIM >::parent(), madness::Key< NDIM >::translation(), and v.

◆ get_functor() [1/2]

template<typename T , std::size_t NDIM>
std::shared_ptr< FunctionFunctorInterface< T, NDIM > > madness::FunctionImpl< T, NDIM >::get_functor

◆ get_functor() [2/2]

template<typename T , std::size_t NDIM>
std::shared_ptr< FunctionFunctorInterface< T, NDIM > > madness::FunctionImpl< T, NDIM >::get_functor

References MADNESS_ASSERT.

◆ get_initial_level()

template<typename T , std::size_t NDIM>
int madness::FunctionImpl< T, NDIM >::get_initial_level ( ) const
inline

◆ get_k()

template<typename T , std::size_t NDIM>
int madness::FunctionImpl< T, NDIM >::get_k

◆ get_norm_tree_recursive()

template<typename T , std::size_t NDIM>
Future< double > madness::FunctionImpl< T, NDIM >::get_norm_tree_recursive ( const keyT key) const

◆ get_pmap()

template<typename T , std::size_t NDIM>
const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > & madness::FunctionImpl< T, NDIM >::get_pmap

◆ get_special_level()

template<typename T , std::size_t NDIM>
int madness::FunctionImpl< T, NDIM >::get_special_level ( ) const
inline

◆ get_special_points()

template<typename T , std::size_t NDIM>
const std::vector<Vector<double,NDIM> >& madness::FunctionImpl< T, NDIM >::get_special_points ( ) const
inline

◆ get_tensor_args()

template<typename T , std::size_t NDIM>
TensorArgs madness::FunctionImpl< T, NDIM >::get_tensor_args

◆ get_tensor_type()

template<typename T , std::size_t NDIM>
TensorType madness::FunctionImpl< T, NDIM >::get_tensor_type

◆ get_thresh()

template<typename T , std::size_t NDIM>
double madness::FunctionImpl< T, NDIM >::get_thresh

◆ get_tree_state()

template<typename T , std::size_t NDIM>
TreeState madness::FunctionImpl< T, NDIM >::get_tree_state ( ) const
inline

◆ hartree_product()

template<typename T , std::size_t NDIM>
template<std::size_t LDIM, typename leaf_opT >
void madness::FunctionImpl< T, NDIM >::hartree_product ( const std::vector< std::shared_ptr< FunctionImpl< T, LDIM >>>  p1,
const std::vector< std::shared_ptr< FunctionImpl< T, LDIM >>>  p2,
const leaf_opT &  leaf_op,
bool  fence 
)
inline

◆ has_leaves()

template<typename T , std::size_t NDIM>
bool madness::FunctionImpl< T, NDIM >::has_leaves

◆ inner_adaptive_local()

template<typename T , std::size_t NDIM>
T madness::FunctionImpl< T, NDIM >::inner_adaptive_local ( const std::shared_ptr< FunctionFunctorInterface< T, NDIM > >  f,
const bool  leaf_refine 
) const
inline

Return the local part of inner product with external function ... no communication.

Parameters
[in]fReference to FunctionFunctorInterface. This is the externally provided function
[in]leaf_refineboolean switch to turn on/off refinement past leaf nodes
Returns
Returns local part of the inner product, i.e. over the domain of all function nodes on this compute node.

References madness::WorldContainer< keyT, valueT, hashfunT >::begin(), madness::FunctionImpl< T, NDIM >::coeffs, madness::WorldContainer< keyT, valueT, hashfunT >::end(), madness::f, madness::WorldTaskQueue::reduce(), T(), madness::World::taskq, and madness::FunctionImpl< T, NDIM >::world.

◆ inner_adaptive_recursive()

template<typename T , std::size_t NDIM>
T madness::FunctionImpl< T, NDIM >::inner_adaptive_recursive ( keyT  key,
const tensorT c,
const std::shared_ptr< FunctionFunctorInterface< T, NDIM > >  f,
const bool  leaf_refine,
T  old_inner = T(0) 
) const
inline

Call inner_ext_node recursively until convergence.

Parameters
[in]keyKey of the function node on which to compute inner product (the domain of integration)
[in]ccoeffs for the function at the node given by key
[in]fReference to FunctionFunctorInterface. This is the externally provided function
[in]leaf_refineboolean switch to turn on/off refinement past leaf nodes
[in]old_innerthe inner product on the parent function node
Returns
Returns the inner product over the domain of a single function, checks for convergence.

References std::abs(), c, cc, madness::FunctionImpl< T, NDIM >::cdata, madness::FunctionImpl< T, NDIM >::child_patch(), madness::copy(), d(), madness::f, madness::FunctionImpl< T, NDIM >::inner_ext_node(), T(), madness::FunctionImpl< T, NDIM >::thresh, madness::FunctionImpl< T, NDIM >::truncate_tol(), and madness::FunctionImpl< T, NDIM >::unfilter().

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

◆ inner_ext_local()

template<typename T , std::size_t NDIM>
T madness::FunctionImpl< T, NDIM >::inner_ext_local ( const std::shared_ptr< FunctionFunctorInterface< T, NDIM > >  f,
const bool  leaf_refine 
) const
inline

Return the local part of inner product with external function ... no communication.

Parameters
[in]fReference to FunctionFunctorInterface. This is the externally provided function
[in]leaf_refineboolean switch to turn on/off refinement past leaf nodes
Returns
Returns local part of the inner product, i.e. over the domain of all function nodes on this compute node.

References madness::WorldContainer< keyT, valueT, hashfunT >::begin(), madness::FunctionImpl< T, NDIM >::coeffs, madness::WorldContainer< keyT, valueT, hashfunT >::end(), madness::f, madness::WorldTaskQueue::reduce(), T(), madness::World::taskq, and madness::FunctionImpl< T, NDIM >::world.

◆ inner_ext_node()

template<typename T , std::size_t NDIM>
T madness::FunctionImpl< T, NDIM >::inner_ext_node ( keyT  key,
tensorT  c,
const std::shared_ptr< FunctionFunctorInterface< T, NDIM > >  f 
) const
inline

Return the inner product with an external function on a specified function node.

Parameters
[in]keyKey of the function node to compute the inner product on. (the domain of integration)
[in]cTensor of coefficients for the function at the function node given by key
[in]fReference to FunctionFunctorInterface. This is the externally provided function
Returns
Returns the inner product over the domain of a single function node, no guarantee of accuracy.

References c, madness::FunctionImpl< T, NDIM >::cdata, madness::f, madness::FunctionImpl< T, NDIM >::fcube(), madness::FunctionImpl< T, NDIM >::values2coeffs(), and madness::FunctionCommonData< T, NDIM >::vk.

Referenced by madness::FunctionImpl< T, NDIM >::inner_adaptive_recursive(), and madness::FunctionImpl< T, NDIM >::inner_ext_recursive().

◆ inner_ext_recursive()

template<typename T , std::size_t NDIM>
T madness::FunctionImpl< T, NDIM >::inner_ext_recursive ( keyT  key,
tensorT  c,
const std::shared_ptr< FunctionFunctorInterface< T, NDIM > >  f,
const bool  leaf_refine,
T  old_inner = T(0) 
) const
inline

Call inner_ext_node recursively until convergence.

Parameters
[in]keyKey of the function node on which to compute inner product (the domain of integration)
[in]ccoeffs for the function at the node given by key
[in]fReference to FunctionFunctorInterface. This is the externally provided function
[in]leaf_refineboolean switch to turn on/off refinement past leaf nodes
[in]old_innerthe inner product on the parent function node
Returns
Returns the inner product over the domain of a single function, checks for convergence.

References std::abs(), c, cc, madness::FunctionImpl< T, NDIM >::cdata, madness::FunctionImpl< T, NDIM >::child_patch(), madness::FunctionImpl< T, NDIM >::coeffs, madness::copy(), d(), madness::f, madness::WorldContainer< keyT, valueT, hashfunT >::find(), madness::FunctionImpl< T, NDIM >::inner_ext_node(), NDIM, pow(), madness::Tensor< T >::sum(), T(), madness::FunctionImpl< T, NDIM >::thresh, and madness::FunctionImpl< T, NDIM >::unfilter().

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

◆ inner_local()

template<typename T , std::size_t NDIM>
template<typename R >
static Tensor< TENSOR_RESULT_TYPE(T,R) > madness::FunctionImpl< T, NDIM >::inner_local ( const std::vector< const FunctionImpl< T, NDIM > * > &  left,
const std::vector< const FunctionImpl< R, NDIM > * > &  right,
bool  sym 
)
inlinestatic

◆ insert_zero_down_to_initial_level()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::insert_zero_down_to_initial_level ( const keyT key)

Initialize nodes to zero function at initial_level of refinement.

Works for either basis. No communication.

References madness::Key< NDIM >::level(), max, and PROFILE_MEMBER_FUNC.

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

◆ is_compressed()

template<typename T , std::size_t NDIM>
bool madness::FunctionImpl< T, NDIM >::is_compressed

Returns true if the function is compressed.

References madness::compressed.

Referenced by madness::CoeffTracker< T, NDIM >::coeff().

◆ is_nonstandard()

template<typename T , std::size_t NDIM>
bool madness::FunctionImpl< T, NDIM >::is_nonstandard

◆ is_nonstandard_with_leaves()

template<typename T , std::size_t NDIM>
bool madness::FunctionImpl< T, NDIM >::is_nonstandard_with_leaves

◆ is_on_demand()

template<typename T , std::size_t NDIM>
bool madness::FunctionImpl< T, NDIM >::is_on_demand

◆ is_reconstructed()

template<typename T , std::size_t NDIM>
bool madness::FunctionImpl< T, NDIM >::is_reconstructed

Returns true if the function is compressed.

Returns true if the function is reconstructed.

References madness::reconstructed.

◆ is_redundant()

template<typename T , std::size_t NDIM>
bool madness::FunctionImpl< T, NDIM >::is_redundant

Returns true if the function is redundant.

References madness::redundant.

◆ key0()

template<typename T , std::size_t NDIM>
const FunctionImpl< T, NDIM >::keyT & madness::FunctionImpl< T, NDIM >::key0

◆ load()

template<typename T , std::size_t NDIM>
template<typename Archive >
void madness::FunctionImpl< T, NDIM >::load ( Archive &  ar)
inline

◆ local_leaf_keys()

template<typename T , std::size_t NDIM>
std::vector< typename FunctionImpl< T, NDIM >::keyT > madness::FunctionImpl< T, NDIM >::local_leaf_keys

return the keys of the local leaf boxes

References madness::FunctionNode< T, NDIM >::is_leaf().

◆ MADNESS_ASSERT()

template<typename T , std::size_t NDIM>
madness::FunctionImpl< T, NDIM >::MADNESS_ASSERT ( this->  is_redundant() = =g.is_redundant())

Referenced by madness::FunctionImpl< T, NDIM >::FunctionImpl(), madness::FunctionImpl< T, NDIM >::hartree_op< LDIM, leaf_opT >::hartree_op(), madness::FunctionImpl< T, NDIM >::recursive_apply_op< opT, LDIM >::recursive_apply_op(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::Vphi_op_NS(), madness::FunctionImpl< T, NDIM >::apply(), madness::FunctionImpl< T, NDIM >::apply_1d_realspace_push(), madness::FunctionImpl< T, NDIM >::apply_source_driven(), madness::FunctionImpl< T, NDIM >::binaryXXa(), madness::FunctionImpl< T, NDIM >::dirac_convolution_op(), madness::FunctionImpl< T, NDIM >::do_apply_kernel2(), madness::FunctionImpl< T, NDIM >::do_project_out(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::eri_coeffs(), madness::FunctionImpl< T, NDIM >::forward_traverse(), madness::FunctionImpl< T, NDIM >::gaxpy_ext_recursive(), madness::FunctionImpl< T, NDIM >::load(), madness::FunctionImpl< T, NDIM >::make_Vphi(), madness::FunctionImpl< T, NDIM >::merge_trees(), madness::FunctionImpl< T, NDIM >::multi_to_multi_op_values(), madness::FunctionImpl< T, NDIM >::multi_to_multi_op_values_doit(), madness::FunctionImpl< T, NDIM >::multiop_values(), madness::FunctionImpl< T, NDIM >::mulXXa(), madness::FunctionImpl< T, NDIM >::mulXXveca(), madness::FunctionImpl< T, NDIM >::NS_fcube_for_mul(), madness::FunctionImpl< T, NDIM >::NScoeffs2values(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::operator()(), madness::FunctionImpl< T, NDIM >::project_out_op< LDIM >::operator()(), madness::FunctionImpl< T, NDIM >::pointwise_multiplier< LDIM >::operator()(), madness::FunctionImpl< T, NDIM >::do_inner_local_on_demand< R >::operator()(), madness::FunctionImpl< T, NDIM >::do_check_symmetry_local::operator()(), madness::FunctionImpl< T, NDIM >::do_standard::operator()(), madness::FunctionImpl< T, NDIM >::read_grid(), madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::screen(), madness::FunctionImpl< T, NDIM >::traverse_tree(), and madness::FunctionImpl< T, NDIM >::values2NScoeffs().

◆ MADNESS_CHECK()

template<typename T , std::size_t NDIM>
madness::FunctionImpl< T, NDIM >::MADNESS_CHECK ( this->  is_reconstructed())

◆ make_key_vec_map()

template<typename T , std::size_t NDIM>
static mapT madness::FunctionImpl< T, NDIM >::make_key_vec_map ( const std::vector< const FunctionImpl< T, NDIM > * > &  v)
inlinestatic

Returns map of union of local keys to vector of indexes of functions containing that key.

Local concurrency and synchronization only; no communication

References v.

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

◆ make_redundant()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::make_redundant ( const bool  fence)
private

convert this to redundant, i.e. have sum coefficients on all levels

References madness::compress(), MADNESS_CHECK_THROW, and madness::redundant.

◆ make_redundant_op()

template<typename T , std::size_t NDIM>
std::pair< typename FunctionImpl< T, NDIM >::coeffT, double > madness::FunctionImpl< T, NDIM >::make_redundant_op ( const keyT key,
const std::vector< Future< std::pair< coeffT, double > > > &  v 
)

similar to compress_op, but insert only the sum coefficients in the tree

also compute the norm tree for all nodes

Parameters
[in]keythis's key
[in]vsum coefficients of the child nodes
Returns
the sum coefficients

also sets snorm, dnorm and norm_tree for all nodes

Parameters
[in]keythis's key
[in]vsum coefficients of the child nodes
Returns
the sum coefficients

References madness::copy(), d(), MADNESS_CHECK, madness::norm_tree(), madness::TensorArgs::thresh, and v.

◆ make_Vphi()

template<typename T , std::size_t NDIM>
template<typename opT >
void madness::FunctionImpl< T, NDIM >::make_Vphi ( const opT &  leaf_op,
const bool  fence = true 
)
inline

◆ make_Vphi_only()

template<typename T , std::size_t NDIM>
template<typename opT , std::size_t LDIM>
void madness::FunctionImpl< T, NDIM >::make_Vphi_only ( const opT &  leaf_op,
FunctionImpl< T, NDIM > *  ket,
FunctionImpl< T, LDIM > *  v1,
FunctionImpl< T, LDIM > *  v2,
FunctionImpl< T, LDIM > *  p1,
FunctionImpl< T, LDIM > *  p2,
FunctionImpl< T, NDIM > *  eri,
const bool  fence = true 
)
inline

assemble the function V*phi using V and phi given from the functor

this function must have been constructed using the CompositeFunctorInterface. The interface provides one- and two-electron potentials, and the ket, which are assembled to give V*phi.

Parameters
[in]leaf_opoperator to decide if a given node is a leaf node
[in]fenceglobal fence

References madness::FunctionImpl< T, NDIM >::cdata, madness::FunctionImpl< T, NDIM >::coeffs, madness::WorldGopInterface::fence(), madness::World::gop, madness::WorldContainer< keyT, valueT, hashfunT >::owner(), madness::World::rank(), madness::redundant_after_merge, madness::FunctionImpl< T, NDIM >::set_tree_state(), madness::WorldObject< FunctionImpl< T, NDIM > >::task(), and madness::FunctionImpl< T, NDIM >::world.

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

◆ map_and_mirror()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::map_and_mirror ( const implT f,
const std::vector< long > &  map,
const std::vector< long > &  mirror,
bool  fence 
)

map and mirror the translation index and the coefficients, result on this

first map the dimensions, the mirror! this = mirror(map(f))

◆ mapdim()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::mapdim ( const implT f,
const std::vector< long > &  map,
bool  fence 
)

Permute the dimensions of f according to map, result on this.

References madness::f, and PROFILE_MEMBER_FUNC.

◆ max_depth()

template<typename T , std::size_t NDIM>
std::size_t madness::FunctionImpl< T, NDIM >::max_depth

Returns the maximum depth of the tree ... collective ... global sum/broadcast.

◆ max_local_depth()

template<typename T , std::size_t NDIM>
std::size_t madness::FunctionImpl< T, NDIM >::max_local_depth

Returns the maximum local depth of the tree ... no communications.

References N.

◆ max_nodes()

template<typename T , std::size_t NDIM>
std::size_t madness::FunctionImpl< T, NDIM >::max_nodes

Returns the max number of nodes on a processor.

◆ merge_trees()

template<typename T , std::size_t NDIM>
template<typename Q , typename R >
void madness::FunctionImpl< T, NDIM >::merge_trees ( const T  alpha,
const FunctionImpl< Q, NDIM > &  other,
const R  beta,
const bool  fence = true 
)
inline

merge the trees of this and other, while multiplying them with the alpha or beta, resp

first step in an inplace gaxpy operation for reconstructed functions; assuming the same distribution for this and other on output, this = alpha *this + beta * other

Parameters
[in]alphaprefactor for this
[in]betaprefactor for other
[in]otherthe other function, reconstructed

References alpha, beta, madness::WorldGopInterface::fence(), madness::FunctionImpl< T, NDIM >::flo_unary_op_node_inplace(), madness::FunctionImpl< T, NDIM >::get_pmap(), madness::World::gop, madness::FunctionImpl< T, NDIM >::MADNESS_ASSERT(), and madness::FunctionImpl< T, NDIM >::world.

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

◆ min_nodes()

template<typename T , std::size_t NDIM>
std::size_t madness::FunctionImpl< T, NDIM >::min_nodes

Returns the min number of nodes on a processor.

◆ mirror()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::mirror ( const implT f,
const std::vector< long > &  mirror,
bool  fence 
)

mirror the dimensions of f according to map, result on this

mirror the dimensions of f according to mirror, result on this

References madness::f, and PROFILE_MEMBER_FUNC.

◆ mul()

template<typename T , std::size_t NDIM>
template<typename R >
Tensor<TENSOR_RESULT_TYPE(T,R)> madness::FunctionImpl< T, NDIM >::mul ( const Tensor< T > &  c1,
const Tensor< R > &  c2,
const int  npt,
const keyT key 
) const
inline

multiply the values of two coefficient tensors using a custom number of grid points

note both coefficient tensors have to refer to the same key!

Parameters
[in]c1a tensor holding coefficients
[in]c2another tensor holding coeffs
[in]nptnumber of grid points (optional, default is cdata.npt)
Returns
coefficient tensor holding the product of the values of c1 and c2

References madness::copy(), madness::FunctionCommonData< T, NDIM >::get(), madness::Key< NDIM >::level(), NDIM, pow(), madness::FunctionCommonData< T, NDIM >::quad_phit, madness::FunctionCommonData< T, NDIM >::quad_phiw, R, madness::FunctionCommonData< T, NDIM >::s0, madness::scale(), T(), madness::FunctionImpl< T, NDIM >::TENSOR_RESULT_TYPE(), TERNARY_OPTIMIZED_ITERATOR, madness::transform(), and madness::FunctionCommonData< T, NDIM >::vk.

◆ multi_to_multi_op_values()

template<typename T , std::size_t NDIM>
template<typename opT >
void madness::FunctionImpl< T, NDIM >::multi_to_multi_op_values ( const opT &  op,
const std::vector< implT * > &  vin,
std::vector< implT * > &  vout,
const bool  fence = true 
)
inline

Inplace operate on many functions (impl's) with an operator within a certain box.

Assumes all functions have been refined down to the same level

Parameters
[in]opthe operator
[in]vinthe vector of function impl's on which to be operated
[out]voutthe resulting vector of function impl's

References madness::WorldTaskQueue::add(), madness::WorldContainer< keyT, valueT, hashfunT >::begin(), madness::FunctionImpl< T, NDIM >::coeffs, madness::WorldGopInterface::fence(), madness::World::gop, madness::FunctionImpl< T, NDIM >::MADNESS_ASSERT(), op(), madness::WorldContainer< keyT, valueT, hashfunT >::size(), madness::World::taskq, and madness::FunctionImpl< T, NDIM >::world.

◆ multi_to_multi_op_values_doit()

template<typename T , std::size_t NDIM>
template<typename opT >
void madness::FunctionImpl< T, NDIM >::multi_to_multi_op_values_doit ( const keyT key,
const opT &  op,
const std::vector< implT * > &  vin,
std::vector< implT * > &  vout 
)
inline

Inplace operate on many functions (impl's) with an operator within a certain box.

Parameters
[in]keythe key of the current function node (box)
[in]opthe operator
[in]vinthe vector of function impl's on which to be operated
[out]voutthe resulting vector of function impl's

References c, cc, madness::FunctionImpl< T, NDIM >::coeffs, madness::FunctionImpl< T, NDIM >::coeffs2values(), madness::WorldContainer< keyT, valueT, hashfunT >::find(), madness::FunctionImpl< T, NDIM >::MADNESS_ASSERT(), op(), madness::FunctionImpl< T, NDIM >::targs, and madness::FunctionImpl< T, NDIM >::values2coeffs().

◆ multiop_values()

template<typename T , std::size_t NDIM>
template<typename opT >
void madness::FunctionImpl< T, NDIM >::multiop_values ( const opT &  op,
const std::vector< implT * > &  v 
)
inline

◆ multiop_values_doit()

template<typename T , std::size_t NDIM>
template<typename opT >
void madness::FunctionImpl< T, NDIM >::multiop_values_doit ( const keyT key,
const opT &  op,
const std::vector< implT * > &  v 
)
inline

Inplace operate on many functions (impl's) with an operator within a certain box

Parameters
[in]keythe key of the current function node (box)
[in]opthe operator
[in]vthe vector of function impl's on which to be operated

References c, cc, madness::FunctionImpl< T, NDIM >::coeffs, madness::FunctionImpl< T, NDIM >::coeffs2values(), madness::WorldContainer< keyT, valueT, hashfunT >::find(), op(), madness::WorldContainer< keyT, valueT, hashfunT >::replace(), madness::FunctionImpl< T, NDIM >::targs, v, and madness::FunctionImpl< T, NDIM >::values2coeffs().

◆ multiply() [1/2]

template<typename T , std::size_t NDIM>
FunctionImpl< T, NDIM >::coeffT madness::FunctionImpl< T, NDIM >::multiply ( const coeffT val_ket,
const coeffT val_pot,
int  particle 
) const

multiply the ket with a one-electron potential rr(1,2)= f(1,2)*g(1)

Parameters
[in]val_ketfunction values of f(1,2)
[in]val_potfunction values of g(1)
[in]particleif 0 then g(1), if 1 then g(2)
Returns
the resulting function values

References madness::copy(), madness::GenTensor< T >::emul(), madness::GenTensor< T >::full_tensor(), madness::GenTensor< T >::is_full_tensor(), madness::GenTensor< T >::is_svd_tensor(), MADNESS_ASSERT, NDIM, madness::outer(), and madness::GenTensor< T >::tensor_type().

◆ multiply() [2/2]

template<typename T , std::size_t NDIM>
template<size_t LDIM>
void madness::FunctionImpl< T, NDIM >::multiply ( const implT f,
const FunctionImpl< T, LDIM > *  g,
const int  particle 
)
inline

multiply f (a pair function of NDIM) with an orbital g (LDIM=NDIM/2)

as in (with h(1,2)=*this) : h(1,2) = g(1) * f(1,2) use tnorm as a measure to determine if f (=*this) must be refined

Parameters
[in]fthe NDIM function f=f(1,2)
[in]gthe LDIM function g(1) (or g(2))
[in]particle1 or 2, as in g(1) or g(2)

References madness::FunctionImpl< T, NDIM >::coeffs, madness::f, madness::g, madness::FunctionImpl< T, NDIM >::key0(), madness::WorldContainer< keyT, valueT, hashfunT >::owner(), p(), madness::World::rank(), madness::reconstructed, madness::FunctionImpl< T, NDIM >::set_tree_state(), madness::WorldObject< FunctionImpl< T, NDIM > >::task(), and madness::FunctionImpl< T, NDIM >::world.

Referenced by madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::operator()().

◆ mulXX()

template<typename T , std::size_t NDIM>
template<typename L , typename R >
void madness::FunctionImpl< T, NDIM >::mulXX ( const FunctionImpl< L, NDIM > *  left,
const FunctionImpl< R, NDIM > *  right,
double  tol,
bool  fence 
)
inline

Multiplies two functions (impl's) together. Delegates to the mulXXa() method

Parameters
[in]leftpointer to the left function impl
[in]rightpointer to the right function impl
[in]tolnumerical tolerance

References madness::FunctionImpl< T, NDIM >::cdata, madness::FunctionImpl< T, NDIM >::coeffs, madness::WorldGopInterface::fence(), madness::World::gop, madness::FunctionImpl< T, NDIM >::mulXXa(), madness::WorldContainer< keyT, valueT, hashfunT >::owner(), madness::World::rank(), and madness::FunctionImpl< T, NDIM >::world.

◆ mulXXa()

template<typename T , std::size_t NDIM>
template<typename L , typename R >
void madness::FunctionImpl< T, NDIM >::mulXXa ( const keyT key,
const FunctionImpl< L, NDIM > *  left,
const Tensor< L > &  lcin,
const FunctionImpl< R, NDIM > *  right,
const Tensor< R > &  rcin,
double  tol 
)
inline

Multiplication using recursive descent and assuming same distribution Both left and right functions are in the scaling function basis

Parameters
[in]keythe key to the current function node (box)
[in]leftthe function impl associated with the left function
[in]lcinthe scaling function coefficients associated with the current box in the left function
[in]rightthe function impl associated with the right function
[in]rcinthe scaling function coefficients associated with the current box in the right function

References madness::___, madness::FunctionImpl< T, NDIM >::cdata, madness::FunctionImpl< T, NDIM >::child_patch(), madness::FunctionImpl< T, NDIM >::coeffs, madness::copy(), madness::WorldContainer< keyT, valueT, hashfunT >::end(), madness::WorldContainer< keyT, valueT, hashfunT >::find(), madness::FunctionImpl< T, NDIM >::MADNESS_ASSERT(), madness::Tensor< T >::normf(), madness::WorldContainer< keyT, valueT, hashfunT >::owner(), madness::WorldContainer< keyT, valueT, hashfunT >::replace(), madness::BaseTensor::size(), madness::FunctionImpl< T, NDIM >::targs, madness::WorldObject< FunctionImpl< T, NDIM > >::task(), madness::FunctionImpl< T, NDIM >::truncate_tol(), and madness::FunctionImpl< T, NDIM >::unfilter().

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

◆ mulXXvec()

template<typename T , std::size_t NDIM>
template<typename L , typename R >
void madness::FunctionImpl< T, NDIM >::mulXXvec ( const FunctionImpl< L, NDIM > *  left,
const std::vector< const FunctionImpl< R, NDIM > * > &  vright,
const std::vector< FunctionImpl< T, NDIM > * > &  vresult,
double  tol,
bool  fence 
)
inline

Multiplies a function (impl) with a vector of functions (impl's). Delegates to the mulXXveca() method.

Parameters
[in]leftpointer to the left function impl
[in]vrightvector of pointers to the right function impl's
[in]tolnumerical tolerance
[out]vresultvector of pointers to the resulting function impl's

References madness::FunctionImpl< T, NDIM >::cdata, madness::FunctionImpl< T, NDIM >::coeffs, madness::WorldGopInterface::fence(), madness::World::gop, madness::FunctionImpl< T, NDIM >::mulXXveca(), madness::WorldContainer< keyT, valueT, hashfunT >::owner(), madness::World::rank(), and madness::FunctionImpl< T, NDIM >::world.

◆ mulXXveca()

template<typename T , std::size_t NDIM>
template<typename L , typename R >
void madness::FunctionImpl< T, NDIM >::mulXXveca ( const keyT key,
const FunctionImpl< L, NDIM > *  left,
const Tensor< L > &  lcin,
const std::vector< const FunctionImpl< R, NDIM > * >  vrightin,
const std::vector< Tensor< R > > &  vrcin,
const std::vector< FunctionImpl< T, NDIM > * >  vresultin,
double  tol 
)
inline

Both left and right functions are in the scaling function basis

Parameters
[in]keythe key to the current function node (box)
[in]leftthe function impl associated with the left function
[in]lcinthe scaling function coefficients associated with the current box in the left function
[in]vrightinthe vector of function impl's associated with the vector of right functions
[in]vrcinthe vector scaling function coefficients associated with the current box in the right functions
[out]vresultinthe vector of resulting functions (impl's)

References madness::___, madness::FunctionImpl< T, NDIM >::cdata, madness::FunctionImpl< T, NDIM >::child_patch(), madness::FunctionImpl< T, NDIM >::coeffs, madness::copy(), madness::WorldContainer< keyT, valueT, hashfunT >::end(), madness::WorldContainer< keyT, valueT, hashfunT >::find(), madness::FunctionImpl< T, NDIM >::MADNESS_ASSERT(), madness::Tensor< T >::normf(), madness::WorldContainer< keyT, valueT, hashfunT >::owner(), madness::World::rank(), madness::WorldContainer< keyT, valueT, hashfunT >::replace(), madness::FunctionImpl< T, NDIM >::size(), madness::BaseTensor::size(), madness::FunctionImpl< T, NDIM >::targs, madness::WorldObject< Derived >::task(), madness::WorldObject< FunctionImpl< T, NDIM > >::task(), madness::FunctionImpl< T, NDIM >::truncate_tol(), madness::FunctionImpl< T, NDIM >::unfilter(), and madness::FunctionImpl< T, NDIM >::world.

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

◆ nCoeff()

template<typename T , std::size_t NDIM>
std::size_t madness::FunctionImpl< T, NDIM >::nCoeff

Returns the number of coefficients in the function ... collective global sum.

References madness::FunctionNode< T, NDIM >::coeff(), madness::FunctionNode< T, NDIM >::has_coeff(), madness::GenTensor< T >::nCoeff(), and madness::sum().

◆ neighbor()

template<typename T , std::size_t NDIM>
Key< NDIM > madness::FunctionImpl< T, NDIM >::neighbor ( const keyT key,
const keyT disp,
const std::vector< bool > &  is_periodic 
) const

Returns key of general neighbor enforcing BC.

Out of volume keys are mapped to enforce the BC as follows.

  • Periodic BC map back into the volume and return the correct key
  • Zero BC - returns invalid() to indicate out of volume

Referenced by madness::FunctionImpl< T, NDIM >::do_apply(), and madness::FunctionImpl< T, NDIM >::do_apply_directed_screening().

◆ noautorefine()

template<typename T , std::size_t NDIM>
bool madness::FunctionImpl< T, NDIM >::noautorefine ( const keyT key,
const tensorT t 
) const

Always returns false (for when autorefine is not wanted)

◆ norm2sq_local()

template<typename T , std::size_t NDIM>
double madness::FunctionImpl< T, NDIM >::norm2sq_local

Returns the square of the local norm ... no comms.

References PROFILE_MEMBER_FUNC.

◆ norm_tree()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::norm_tree ( bool  fence)

compute for each FunctionNode the norm of the function inside that node

◆ norm_tree_op()

template<typename T , std::size_t NDIM>
double madness::FunctionImpl< T, NDIM >::norm_tree_op ( const keyT key,
const std::vector< Future< double > > &  v 
)

References madness::sum().

◆ norm_tree_spawn()

template<typename T , std::size_t NDIM>
Future< double > madness::FunctionImpl< T, NDIM >::norm_tree_spawn ( const keyT key)

◆ NS_fcube_for_mul()

template<typename T , std::size_t NDIM>
template<typename Q >
GenTensor<Q> madness::FunctionImpl< T, NDIM >::NS_fcube_for_mul ( const keyT child,
const keyT parent,
const GenTensor< Q > &  coeff,
const bool  s_only 
) const
inline

Compute the function values for multiplication.

Given S or NS coefficients from a parent cell, compute the value of the functions at the quadrature points of a child currently restricted to special cases

Parameters
[in]childkey of the box in which we compute values
[in]parentkey of the parent box holding the coeffs
[in]coeffcoeffs of the parent box
[in]s_onlysanity check to avoid unintended discard of d coeffs
Returns
function values on the quadrature points of the children of child (!)

References madness::_(), madness::FunctionImpl< T, NDIM >::cdata, d(), madness::GenTensor< T >::dim(), madness::general_transform(), madness::FunctionImpl< T, NDIM >::k, madness::Key< NDIM >::level(), madness::FunctionImpl< T, NDIM >::MADNESS_ASSERT(), MADNESS_EXCEPTION, NDIM, madness::FunctionImpl< T, NDIM >::phi_for_mul(), madness::scale(), and madness::Key< NDIM >::translation().

◆ NScoeffs2values()

template<typename T , std::size_t NDIM>
template<typename Q >
GenTensor<Q> madness::FunctionImpl< T, NDIM >::NScoeffs2values ( const keyT key,
const GenTensor< Q > &  coeff,
const bool  s_only 
) const
inline

convert S or NS coeffs to values on a 2k grid of the children

equivalent to unfiltering the NS coeffs and then converting all child S-coeffs to values in their respective boxes. If only S coeffs are provided d coeffs are assumed to be zero. Reverse operation to values2NScoeffs().

Parameters
[in]keythe key of the current S or NS coeffs, level n
[in]coeffcoeffs in S or NS form; if S then d coeffs are assumed zero
[in]s_onlysanity check to avoid unintended discard of d coeffs
Returns
function values on the quadrature points of the children of child (!)

References madness::_(), madness::FunctionImpl< T, NDIM >::cdata, madness::GenTensor< T >::dim(), madness::inner(), madness::FunctionImpl< T, NDIM >::k, madness::Key< NDIM >::level(), madness::FunctionImpl< T, NDIM >::MADNESS_ASSERT(), NDIM, pow(), madness::scale(), and madness::transform().

◆ parent_to_child()

template<typename T , std::size_t NDIM>
const GenTensor< T > madness::FunctionImpl< T, NDIM >::parent_to_child ( const coeffT s,
const keyT parent,
const keyT child 
) const

Directly project parent coeffs to child coeffs.

Currently used by diff, but other uses can be anticipated

Todo:
is this documentation correct?
Parameters
[in]childthe key whose coeffs we are requesting
[in]parentthe (leaf) key of our function
[in]sthe (leaf) coeffs belonging to parent
Returns
coeffs

Referenced by madness::CoeffTracker< T, NDIM >::coeff(), madness::Derivative< T, NDIM >::do_diff2b(), madness::Derivative< T, NDIM >::do_diff2i(), madness::FunctionImpl< T, NDIM >::do_project_out(), madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::operator()(), madness::FunctionImpl< T, NDIM >::project_out_op< LDIM >::operator()(), and madness::FunctionImpl< T, NDIM >::add_op::operator()().

◆ parent_to_child_NS()

template<typename T , std::size_t NDIM>
FunctionImpl< T, NDIM >::coeffT madness::FunctionImpl< T, NDIM >::parent_to_child_NS ( const keyT child,
const keyT parent,
const coeffT coeff 
) const

Directly project parent NS coeffs to child NS coeffs.

return the NS coefficients if parent and child are the same, or construct sum coeffs from the parents and "add" zero wavelet coeffs

Parameters
[in]childthe key whose coeffs we are requesting
[in]parentthe (leaf) key of our function
[in]coeffthe (leaf) coeffs belonging to parent
Returns
coeffs in NS form

References madness::GenTensor< T >::dim(), madness::f, madness::Key< NDIM >::level(), MADNESS_ASSERT, MADNESS_EXCEPTION, and madness::GenTensor< T >::tensor_type().

Referenced by madness::CoeffTracker< T, NDIM >::coeff().

◆ partial_inner()

template<typename T , std::size_t NDIM>
template<typename Q , std::size_t LDIM, typename R , std::size_t KDIM, std::size_t CDIM = (KDIM + LDIM - NDIM) / 2>
void madness::FunctionImpl< T, NDIM >::partial_inner ( const FunctionImpl< Q, LDIM > &  g,
const FunctionImpl< R, KDIM > &  h,
const std::array< int, CDIM >  v1,
const std::array< int, CDIM >  v2 
)
inline

◆ partial_inner_contract()

template<typename T , std::size_t NDIM>
template<typename Q , std::size_t LDIM, typename R , std::size_t KDIM, std::size_t CDIM = (KDIM + LDIM - NDIM) / 2>
void madness::FunctionImpl< T, NDIM >::partial_inner_contract ( const FunctionImpl< Q, LDIM > *  g,
const FunctionImpl< R, KDIM > *  h,
const std::array< int, CDIM >  v1,
const std::array< int, CDIM >  v2,
const Key< NDIM > &  key,
const std::list< Key< CDIM >> &  j_key_list 
)
inline

◆ phi_for_mul()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::phi_for_mul ( Level  np,
Translation  lp,
Level  nc,
Translation  lc,
Tensor< double > &  phi 
) const

Compute the Legendre scaling functions for multiplication.

Evaluate parent polyn at quadrature points of a child. The prefactor of 2^n/2 is included. The tensor must be preallocated as phi(k,npt). Refer to the implementation notes for more info.

Todo:
Robert please verify this comment. I don't understand this method.
Parameters
[in]nplevel of the parent function node (box)
[in]nclevel of the child function node (box)
[in]lptranslation of the parent function node (box)
[in]lctranslation of the child function node (box)
[out]phitensor of the legendre scaling functions

References p().

Referenced by madness::FunctionImpl< T, NDIM >::fcube_for_mul(), and madness::FunctionImpl< T, NDIM >::NS_fcube_for_mul().

◆ plot_cube_kernel()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::plot_cube_kernel ( archive::archive_ptr< Tensor< T > >  ptr,
const keyT key,
const coordT plotlo,
const coordT plothi,
const std::vector< long > &  npt,
bool  eval_refine 
) const

◆ print_grid()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::print_grid ( const std::string  filename) const

print the grid (the roots of the quadrature of each leaf box) of this function in user xyz coordinates

Parameters
[in]filenamethe filename for the output

print the grid (the roots of the quadrature of each leaf box) of this function in user xyz coordinates

References madness::filename.

◆ print_info()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::print_info

Prints summary of data distribution.

References madness::FunctionNode< T, NDIM >::is_leaf().

◆ print_plane()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::print_plane ( const std::string  filename,
const int  xaxis,
const int  yaxis,
const coordT el2 
)

Print a plane ("xy", "xz", or "yz") containing the point x to file.

works for all dimensions; we walk through the tree, and if a leaf node inside the sub-cell touches the plane we print it in pstricks format

References madness::filename.

◆ print_plane_local()

template<typename T , std::size_t NDIM>
Tensor< double > madness::FunctionImpl< T, NDIM >::print_plane_local ( const int  xaxis,
const int  yaxis,
const coordT el2 
)

collect the data for a plot of the MRA structure locally on each node

Parameters
[in]xaxisthe x-axis in the plot (can be any axis of the MRA box)
[in]yaxisthe y-axis in the plot (can be any axis of the MRA box)
[in]el2needs a description
Todo:
Provide a description for el2
Parameters
[in]xaxisthe x-axis in the plot (can be any axis of the MRA box)
[in]yaxisthe y-axis in the plot (can be any axis of the MRA box)
[in]el2

References madness::_(), madness::FunctionCommonData< T, NDIM >::_init_quadrature(), madness::FunctionNode< T, NDIM >::coeff(), madness::error(), madness::FunctionDefaults< NDIM >::get_cell(), madness::FunctionDefaults< NDIM >::get_cell_width(), madness::FunctionNode< T, NDIM >::has_coeff(), madness::FunctionNode< T, NDIM >::is_leaf(), k, madness::Key< NDIM >::level(), op(), pow(), madness::GenTensor< T >::rank(), madness::scale(), madness::Key< NDIM >::thisKeyContains(), and madness::Key< NDIM >::translation().

◆ print_size()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::print_size ( const std::string  name) const

print tree size and size

References bufsize, d(), madness::detail::norm(), madness::print(), T(), and madness::wall_time().

◆ print_stats()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::print_stats

◆ print_timer()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::print_timer

◆ print_tree()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::print_tree ( std::ostream &  os = std::cout,
Level  maxlevel = 10000 
) const

Prints the coeffs tree of the current function impl

Parameters
[in]maxlevelthe maximum level of the tree for printing
[out]osthe ostream to where the output is sent

◆ print_tree_graphviz()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::print_tree_graphviz ( std::ostream &  os = std::cout,
Level  maxlevel = 10000 
) const

Prints the coeffs tree of the current function impl (using GraphViz)

Parameters
[in]maxlevelthe maximum level of the tree for printing
[out]osthe ostream to where the output is sent

◆ print_tree_json()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::print_tree_json ( std::ostream &  os = std::cout,
Level  maxlevel = 10000 
) const

Same as print_tree() but in JSON format

Parameters
[out]osthe ostream to where the output is sent
[in]maxlevelthe maximum level of the tree for printing

◆ print_type_in_compilation_error()

template<typename T , std::size_t NDIM>
template<typename R >
void madness::FunctionImpl< T, NDIM >::print_type_in_compilation_error ( R &&  )
inline

◆ project() [1/2]

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::project ( const implT old,
bool  fence 
)

◆ project() [2/2]

template<typename T , std::size_t NDIM>
Tensor< T > madness::FunctionImpl< T, NDIM >::project ( const keyT key) const

Compute by projection the scaling function coeffs in specified box

Parameters
[in]keythe key to the current function node (box)

References madness::fast_transform(), madness::fcube(), madness::Key< NDIM >::level(), MADNESS_ASSERT, MADNESS_EXCEPTION, NDIM, pow(), and madness::Tensor< T >::scale().

◆ project_out()

template<typename T , std::size_t NDIM>
template<size_t LDIM>
void madness::FunctionImpl< T, NDIM >::project_out ( FunctionImpl< T, NDIM-LDIM > *  result,
const FunctionImpl< T, LDIM > *  gimpl,
const int  dim,
const bool  fence 
)
inline

project the low-dim function g on the hi-dim function f: result(x) = <this(x,y) | g(y)>

invoked by the hi-dim function, a function of NDIM+LDIM Upon return, result matches this, with contributions on all scales

Parameters
[in]resultlo-dim function of NDIM-LDIM
Todo:
Should this be param[out]?
Parameters
[in]gimpllo-dim function of LDIM
[in]dimover which dimensions to be integrated: 0..LDIM or LDIM..LDIM+NDIM-1

References madness::FunctionImpl< T, NDIM >::cdata, madness::FunctionImpl< T, NDIM >::coeffs, madness::WorldGopInterface::fence(), madness::World::gop, madness::FunctionImpl< T, NDIM >::key0(), madness::WorldContainer< keyT, valueT, hashfunT >::owner(), madness::World::rank(), madness::WorldObject< FunctionImpl< T, NDIM > >::task(), and madness::FunctionImpl< T, NDIM >::world.

◆ project_out2()

template<typename T , std::size_t NDIM>
template<size_t LDIM>
void madness::FunctionImpl< T, NDIM >::project_out2 ( const FunctionImpl< T, LDIM+NDIM > *  f,
const FunctionImpl< T, LDIM > *  g,
const int  dim 
)
inline

◆ project_refine_op()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::project_refine_op ( const keyT key,
bool  do_refine,
const std::vector< Vector< double, NDIM > > &  specialpts 
)

Projection with optional refinement w/ special points

Parameters
[in]keythe key to the current function node (box)
[in]do_refineshould we continue refinement?
[in]specialptsvector of special points in the function where we need to refine at a much finer level

project the functor into this functionimpl, and "return" a tree in reconstructed, rank-reduced form.

Parameters
[in]keycurrent FunctionNode
[in]do_refine
[in]specialptsin case these are very spiky functions – don't undersample

References madness::copy(), d(), madness::FunctionDefaults< NDIM >::get_bc(), madness::Key< NDIM >::is_neighbor_of(), madness::BoundaryConditions< NDIM >::is_periodic(), madness::Key< NDIM >::level(), p(), madness::project(), s0, madness::simpt2key(), T(), task(), thresh, and madness::user_to_sim().

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

◆ put_in_box()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::put_in_box ( ProcessID  from,
long  nl,
long  ni 
) const

◆ range()

template<typename T , std::size_t NDIM>
rangeT madness::FunctionImpl< T, NDIM >::range ( coeffs.  begin(),
coeffs.  end() 
)

◆ read_grid()

template<typename T , std::size_t NDIM>
template<size_t FDIM>
std::enable_if<NDIM==FDIM>::type madness::FunctionImpl< T, NDIM >::read_grid ( const std::string  keyfile,
const std::string  gridfile,
std::shared_ptr< FunctionFunctorInterface< double, NDIM > >  vnuc_functor 
)
inline

◆ read_grid2()

template<typename T , std::size_t NDIM>
template<size_t FDIM>
std::enable_if<NDIM==FDIM>::type madness::FunctionImpl< T, NDIM >::read_grid2 ( const std::string  gridfile,
std::shared_ptr< FunctionFunctorInterface< double, NDIM > >  vnuc_functor 
)
inline

◆ real_size()

template<typename T , std::size_t NDIM>
std::size_t madness::FunctionImpl< T, NDIM >::real_size

Returns the number of coefficients in the function ... collective global sum.

References madness::FunctionNode< T, NDIM >::coeff(), madness::FunctionNode< T, NDIM >::has_coeff(), madness::GenTensor< T >::real_size(), and madness::sum().

◆ reconstruct()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::reconstruct ( bool  fence)

reconstruct this tree – respects fence

References MADNESS_EXCEPTION, madness::nonstandard_after_apply, madness::reconstructed, and task().

Referenced by madness::innerXX().

◆ reconstruct_op()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::reconstruct_op ( const keyT key,
const coeffT s,
const bool  accumulate_NS = true 
)

◆ recur_down_for_contraction_map()

template<typename T , std::size_t NDIM>
template<std::size_t CDIM, std::size_t ODIM, std::size_t FDIM = NDIM+ODIM-2*CDIM>
std::multimap<Key<FDIM>, std::list<Key<CDIM> > > madness::FunctionImpl< T, NDIM >::recur_down_for_contraction_map ( const keyT key,
const nodeT node,
const std::array< int, CDIM > &  v_this,
const std::array< int, CDIM > &  v_other,
const std::set< Key< ODIM >> &  ij_other_list,
const std::map< Key< CDIM >, double > &  j_other_list,
bool  this_first,
const double  thresh 
)
inline

make a map of all nodes that will contribute to a partial inner product

given the list of d coefficient-holding nodes of the other function: recur down h if snorm * dnorm > tol and key n−jx ∈ other−ij-list. Make s coefficients if necessary. Make list of nodes n − ijk as map(n-ik, list(j)).

!! WILL ADD NEW S NODES TO THIS TREE THAT MUST BE REMOVED TO AVOID INCONSISTENT TREE STRUCTURE !!

Parameters
[in]keyfor recursion
[in]nodecorresponds to key
[in]v_thisthis' dimension that are contracted
[in]v_otherother's dimension that are contracted
[in]ij_other_listlist of nodes of the other function that will be contracted (and their parents)
[in]j_other_listlist of column nodes of the other function that will be contracted (and their parents)
[in]max_d_normmax d coeff norm of the nodes in j_list
[in]this_firstare the remaining coeffs of this functions first or last in the result function
[in]threshthreshold for including nodes in the contraction: snorm*dnorm > thresh
Template Parameters
CDIMdimension to be contracted
ODIMdimensions of the other function
FDIMdimensions of the final function

References madness::FunctionImpl< T, NDIM >::cdata, madness::FunctionImpl< T, NDIM >::child_patch(), madness::FunctionNode< T, NDIM >::coeff(), madness::copy(), d(), madness::Key< NDIM >::extract_complement_key(), madness::Key< NDIM >::extract_key(), madness::WorldContainer< keyT, valueT, hashfunT >::find(), madness::FunctionImpl< T, NDIM >::get_cdata(), madness::FunctionImpl< T, NDIM >::get_coeffs(), madness::FunctionNode< T, NDIM >::get_snorm(), madness::FunctionImpl< T, NDIM >::get_tensor_args(), madness::FunctionNode< T, NDIM >::has_children(), madness::Key< NDIM >::level(), madness::FunctionImpl< T, NDIM >::MADNESS_CHECK(), madness::Key< NDIM >::merge_with(), madness::FunctionNode< T, NDIM >::recompute_snorm_and_dnorm(), madness::WorldContainer< keyT, valueT, hashfunT >::replace(), madness::FunctionImpl< T, NDIM >::thresh, madness::FunctionImpl< T, NDIM >::truncate_tol(), and madness::FunctionImpl< T, NDIM >::unfilter().

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

◆ recursive_apply() [1/2]

template<typename T , std::size_t NDIM>
template<typename opT , std::size_t LDIM>
void madness::FunctionImpl< T, NDIM >::recursive_apply ( opT &  apply_op,
const FunctionImpl< T, LDIM > *  fimpl,
const FunctionImpl< T, LDIM > *  gimpl,
const bool  fence 
)
inline

traverse a non-existing tree, make its coeffs and apply an operator

invoked by result here we use the fact that the hi-dim NS coefficients on all scales are exactly the outer product of the underlying low-dim functions (also in NS form), so we don't need to construct the full hi-dim tree and then turn it into NS form.

Parameters
[in]apply_opthe operator acting on the NS tree
[in]fimplthe funcimpl of the function of particle 1
[in]gimplthe funcimpl of the function of particle 2

References madness::FunctionImpl< T, NDIM >::cdata, madness::FunctionImpl< T, NDIM >::coeffs, madness::WorldGopInterface::fence(), madness::World::gop, madness::FunctionImpl< T, NDIM >::key0(), madness::nonstandard_after_apply, madness::WorldContainer< keyT, valueT, hashfunT >::owner(), p(), madness::World::rank(), madness::FunctionImpl< T, NDIM >::set_tree_state(), madness::WorldObject< FunctionImpl< T, NDIM > >::task(), and madness::FunctionImpl< T, NDIM >::world.

◆ recursive_apply() [2/2]

template<typename T , std::size_t NDIM>
template<typename opT >
void madness::FunctionImpl< T, NDIM >::recursive_apply ( opT &  apply_op,
const implT fimpl,
implT rimpl,
const bool  fence 
)
inline

◆ reduce() [1/2]

template<typename T , std::size_t NDIM>
return world taskq madness::FunctionImpl< T, NDIM >::reduce ( range  ,
do_inner_local_on_demand< R this, &gimpl 
)

◆ reduce() [2/2]

template<typename T , std::size_t NDIM>
return world taskq madness::FunctionImpl< T, NDIM >::reduce ( rangeT(coeffs.begin(), coeffs.end())  ,
do_inner_local< R > &,  leaves_only 
)

◆ reduce_rank()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::reduce_rank ( const double  thresh,
bool  fence 
)

reduce the rank of the coefficients tensors

Parameters
[in]targstarget tensor arguments (threshold and full/low rank)

References thresh.

◆ refine()

template<typename T , std::size_t NDIM>
template<typename opT >
void madness::FunctionImpl< T, NDIM >::refine ( const opT &  op,
bool  fence 
)
inline

◆ refine_op()

template<typename T , std::size_t NDIM>
template<typename opT >
void madness::FunctionImpl< T, NDIM >::refine_op ( const opT &  op,
const keyT key 
)
inline

◆ refine_spawn()

template<typename T , std::size_t NDIM>
template<typename opT >
void madness::FunctionImpl< T, NDIM >::refine_spawn ( const opT &  op,
const keyT key 
)
inline

◆ refine_to_common_level()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::refine_to_common_level ( const std::vector< FunctionImpl< T, NDIM > * > &  v,
const std::vector< tensorT > &  c,
const keyT  key 
)

Refine multiple functions down to the same finest level.

Parameters
vthe vector of functions we are refining.
keythe current node.
cthe vector of coefficients passed from above.
[v]is the vector of functions we are refining.
[key]is the current node.
[c]is the vector of coefficients passed from above.

References c, madness::copy(), d(), MADNESS_ASSERT, MADNESS_CHECK, madness::refine_to_common_level(), task(), and v.

◆ remove_internal_coefficients()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::remove_internal_coefficients ( const bool  fence)

◆ remove_leaf_coefficients()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::remove_leaf_coefficients ( const bool  fence)

◆ replicate()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::replicate ( bool  fence = true)
inline

◆ reset_timer()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::reset_timer

◆ scale_inplace()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::scale_inplace ( const T  q,
bool  fence 
)

In-place scale by a constant.

References q().

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

◆ scale_oop()

template<typename T , std::size_t NDIM>
template<typename Q , typename F >
void madness::FunctionImpl< T, NDIM >::scale_oop ( const Q  q,
const FunctionImpl< F, NDIM > &  f,
bool  fence 
)
inline

◆ set_autorefine()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::set_autorefine ( bool  value)

◆ set_functor()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::set_functor ( const std::shared_ptr< FunctionFunctorInterface< T, NDIM > >  functor1)

References madness::on_demand.

◆ set_tensor_args()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::set_tensor_args ( const TensorArgs t)

◆ set_thresh()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::set_thresh ( double  value)

References thresh.

◆ set_tree_state()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::set_tree_state ( const TreeState state)
inline

◆ size()

template<typename T , std::size_t NDIM>
std::size_t madness::FunctionImpl< T, NDIM >::size

◆ sock_it_to_me()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::sock_it_to_me ( const keyT key,
const RemoteReference< FutureImpl< std::pair< keyT, coeffT > > > &  ref 
) const

Walk up the tree returning pair(key,node) for first node with coefficients.

Three possibilities.

1) The coeffs are present and returned with the key of the containing node.

2) The coeffs are further up the tree ... the request is forwarded up.

3) The coeffs are futher down the tree ... an empty tensor is returned.

!! This routine is crying out for an optimization to manage the number of messages being sent ... presently each parent is fetched 2^(n*d) times where n is the no. of levels between the level of evaluation and the parent. Alternatively, reimplement multiply as a downward tree walk and just pass the parent down. Slightly less parallelism but much less communication.

Todo:
Robert .... help!

References madness::FunctionNode< T, NDIM >::coeff(), madness::FunctionNode< T, NDIM >::has_coeff(), madness::TaskAttributes::hipri(), madness::Key< NDIM >::parent(), madness::Future< T >::set(), and task().

Referenced by madness::DerivativeBase< T, NDIM >::find_neighbor(), and madness::FunctionImpl< T, NDIM >::project_out2().

◆ sock_it_to_me_too()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::sock_it_to_me_too ( const keyT key,
const RemoteReference< FutureImpl< std::pair< keyT, coeffT > > > &  ref 
) const

◆ square_inplace()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::square_inplace ( bool  fence)

Pointwise squaring of function with optional global fence.

If not autorefining, local computation only if not fencing. If autorefining, may result in asynchronous communication.

◆ standard()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::standard ( bool  fence)

Changes non-standard compressed form to standard compressed form.

References madness::compressed.

◆ store()

template<typename T , std::size_t NDIM>
template<typename Archive >
void madness::FunctionImpl< T, NDIM >::store ( Archive &  ar)
inline

◆ sum_down()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::sum_down ( bool  fence)

After 1d push operator must sum coeffs down the tree to restore correct scaling function coefficients.

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

◆ sum_down_spawn()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::sum_down_spawn ( const keyT key,
const coeffT s 
)

◆ TENSOR_RESULT_TYPE() [1/3]

template<typename T , std::size_t NDIM>
template<typename R >
madness::FunctionImpl< T, NDIM >::TENSOR_RESULT_TYPE ( T  ,
R   
) const

Returns the inner product ASSUMING same distribution.

handles compressed and redundant form

Referenced by madness::FunctionImpl< T, NDIM >::do_inner_localX(), madness::FunctionImpl< T, NDIM >::inner_local(), and madness::FunctionImpl< T, NDIM >::mul().

◆ TENSOR_RESULT_TYPE() [2/3]

template<typename T , std::size_t NDIM>
template<typename R >
madness::FunctionImpl< T, NDIM >::TENSOR_RESULT_TYPE ( T  ,
R   
) const

Returns the inner product of this with function g constructed on-the-fly.

the leaf boxes of this' MRA tree defines the inner product

◆ TENSOR_RESULT_TYPE() [3/3]

template<typename T , std::size_t NDIM>
typedef madness::FunctionImpl< T, NDIM >::TENSOR_RESULT_TYPE ( T  ,
R   
)

◆ tnorm() [1/3]

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::tnorm ( const GenTensor< T > &  t,
double *  lo,
double *  hi 
)
static

◆ tnorm() [2/3]

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::tnorm ( const SVDTensor< T > &  t,
double *  lo,
double *  hi,
const int  particle 
)
static

◆ tnorm() [3/3]

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::tnorm ( const tensorT t,
double *  lo,
double *  hi 
)
static

Computes norm of low/high-order polyn. coeffs for autorefinement test.

t is a k^d tensor. In order to screen the autorefinement during multiplication compute the norms of ... lo ... the block of t for all polynomials of order < k/2 ... hi ... the block of t for all polynomials of order >= k/2

k=5 0,1,2,3,4 --> 0,1,2 ... 3,4 k=6 0,1,2,3,4,5 --> 0,1,2 ... 3,4,5

k=number of wavelets, so k=5 means max order is 4, so max exactly representable squarable polynomial is of order 2.

References madness::copy(), madness::BaseTensor::dim(), madness::Tensor< T >::fill(), madness::FunctionCommonData< T, NDIM >::get(), lo, and madness::Tensor< T >::normf().

Referenced by madness::FunctionImpl< T, NDIM >::pointwise_multiplier< LDIM >::pointwise_multiplier(), madness::FunctionImpl< T, NDIM >::pointwise_multiplier< LDIM >::operator()(), refop::operator()(), and madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::screen().

◆ trace_local()

template<typename T , std::size_t NDIM>
T madness::FunctionImpl< T, NDIM >::trace_local

Returns int(f(x),x) in local volume.

References NDIM, PROFILE_MEMBER_FUNC, madness::sum(), and T().

◆ traverse_tree()

template<typename T , std::size_t NDIM>
template<typename coeff_opT , typename apply_opT >
void madness::FunctionImpl< T, NDIM >::traverse_tree ( const coeff_opT &  coeff_op,
const apply_opT &  apply_op,
const keyT key 
) const
inline

traverse a non-existing tree

part I: make the coefficients, process them and continue the recursion if necessary

Parameters
[in]coeff_opoperator making the coefficients and determining them being leaves
[in]apply_opoperator processing the coefficients
[in]keythe key we are currently working on

References madness::arg(), madness::FunctionImpl< T, NDIM >::coeffs, madness::WorldContainer< keyT, valueT, hashfunT >::is_local(), madness::FunctionImpl< T, NDIM >::MADNESS_ASSERT(), madness::WorldContainer< keyT, valueT, hashfunT >::owner(), p(), and madness::WorldObject< FunctionImpl< T, NDIM > >::task().

◆ tree_size()

template<typename T , std::size_t NDIM>
std::size_t madness::FunctionImpl< T, NDIM >::tree_size

Returns the size of the tree structure of the function ... collective global sum.

References madness::sum().

◆ trickle_down()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::trickle_down ( bool  fence)

sum all the contributions from all scales after applying an operator in mod-NS form

References madness::reconstructed, and task().

◆ trickle_down_op()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::trickle_down_op ( const keyT key,
const coeffT s 
)

◆ truncate()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::truncate ( double  tol,
bool  fence 
)

Truncate according to the threshold with optional global fence.

If thresh<=0 the default value of this->thresh is used

Parameters
[in]tolthe truncation tolerance

If thresh<=0 the default value of this->thresh is used

References thresh.

◆ truncate_op()

template<typename T , std::size_t NDIM>
bool madness::FunctionImpl< T, NDIM >::truncate_op ( const keyT key,
double  tol,
const std::vector< Future< bool > > &  v 
)

Actually do the truncate operation

Parameters
[in]keythe key to the current function node being evaluated for truncation
[in]tolthe tolerance for thresholding
[in]vvector of Future<bool>'s that specify whether the current nodes children have coeffs

References madness::FunctionNode< T, NDIM >::clear_coeff(), madness::FunctionNode< T, NDIM >::coeff(), madness::FunctionNode< T, NDIM >::has_children(), madness::FunctionNode< T, NDIM >::has_coeff(), madness::Key< NDIM >::level(), NDIM, madness::GenTensor< T >::normf(), madness::FunctionNode< T, NDIM >::set_coeff(), madness::FunctionNode< T, NDIM >::set_has_children(), and v.

◆ truncate_reconstructed_op()

template<typename T , std::size_t NDIM>
FunctionImpl< T, NDIM >::coeffT madness::FunctionImpl< T, NDIM >::truncate_reconstructed_op ( const keyT key,
const std::vector< Future< coeffT > > &  v,
const double  tol 
)

given the sum coefficients of all children, truncate or not

Returns
new sum coefficients (empty if internal, not empty, if new leaf); might delete its children

References madness::copy(), d(), madness::error(), madness::Key< NDIM >::level(), MADNESS_ASSERT, MADNESS_CHECK, madness::FunctionNode< T, NDIM >::set_has_children(), and v.

◆ truncate_reconstructed_spawn()

template<typename T , std::size_t NDIM>
Future< typename FunctionImpl< T, NDIM >::coeffT > madness::FunctionImpl< T, NDIM >::truncate_reconstructed_spawn ( const keyT key,
const double  tol 
)

truncate using a tree in reconstructed form

must be invoked where key is local

References madness::FunctionNode< T, NDIM >::coeff(), madness::FunctionNode< T, NDIM >::has_children(), madness::TaskAttributes::hipri(), MADNESS_ASSERT, NDIM, task(), and v.

◆ truncate_spawn()

template<typename T , std::size_t NDIM>
Future< bool > madness::FunctionImpl< T, NDIM >::truncate_spawn ( const keyT key,
double  tol 
)

Returns true if after truncation this node has coefficients.

Assumed to be invoked on process owning key. Possible non-blocking communication.

Parameters
[in]keythe key of the current function node

References madness::FunctionNode< T, NDIM >::clear_coeff(), madness::FunctionNode< T, NDIM >::coeff(), madness::TaskAttributes::generator(), madness::FunctionNode< T, NDIM >::has_children(), madness::FunctionNode< T, NDIM >::has_coeff(), madness::Key< NDIM >::level(), NDIM, madness::GenTensor< T >::normf(), task(), and v.

◆ truncate_tol()

template<typename T , std::size_t NDIM>
double madness::FunctionImpl< T, NDIM >::truncate_tol ( double  tol,
const keyT key 
) const

Returns the truncation threshold according to truncate_method.

here is our handwaving argument: this threshold will give each FunctionNode an error of less than tol. The total error can then be as high as sqrt(#nodes) * tol. Therefore in order to account for higher dimensions: divide tol by about the root of number of siblings (2^NDIM) that have a large error when we refine along a deep branch of the tree.

References madness::FunctionDefaults< NDIM >::get_cell_min_width(), L, madness::Key< NDIM >::level(), MADNESS_EXCEPTION, NDIM, pow(), and truncate_mode.

Referenced by madness::FunctionImpl< T, NDIM >::apply_1d_realspace_push_op(), 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 >::recursive_apply_op< opT, LDIM >::finalize(), madness::FunctionImpl< T, NDIM >::recursive_apply_op2< opT >::finalize(), madness::FunctionImpl< T, NDIM >::gaxpy_ext_recursive(), madness::FunctionImpl< T, NDIM >::inner_adaptive_recursive(), madness::FunctionImpl< T, NDIM >::mulXXa(), madness::FunctionImpl< T, NDIM >::mulXXveca(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::operator()(), madness::op_leaf_op< T, NDIM, opT >::operator()(), refop::operator()(), madness::FunctionImpl< T, NDIM >::do_truncate_NS_leafs::operator()(), madness::Leaf_op< T, NDIM, opT, specialboxT >::post_screening(), madness::FunctionImpl< T, NDIM >::recur_down_for_contraction_map(), madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::screen(), and madness::FunctionImpl< T, NDIM >::vtransform_doit().

◆ unary_op_coeff_inplace()

template<typename T , std::size_t NDIM>
template<typename opT >
void madness::FunctionImpl< T, NDIM >::unary_op_coeff_inplace ( const opT &  op,
bool  fence 
)
inline

◆ unary_op_node_inplace()

template<typename T , std::size_t NDIM>
template<typename opT >
void madness::FunctionImpl< T, NDIM >::unary_op_node_inplace ( const opT &  op,
bool  fence 
)
inline

Unary operation applied inplace to the coefficients WITHOUT refinement, optional fence

Parameters
[in]opthe unary operator for the coefficients

References madness::WorldContainer< keyT, valueT, hashfunT >::begin(), madness::FunctionImpl< T, NDIM >::coeffs, madness::WorldContainer< keyT, valueT, hashfunT >::end(), madness::WorldGopInterface::fence(), madness::World::gop, op(), and madness::FunctionImpl< T, NDIM >::world.

◆ unary_op_value_inplace()

template<typename T , std::size_t NDIM>
template<typename opT >
void madness::FunctionImpl< T, NDIM >::unary_op_value_inplace ( const opT &  op,
bool  fence 
)
inline

◆ unaryXX()

template<typename T , std::size_t NDIM>
template<typename Q , typename opT >
void madness::FunctionImpl< T, NDIM >::unaryXX ( const FunctionImpl< Q, NDIM > *  func,
const opT &  op,
bool  fence 
)
inline

◆ unaryXXa()

template<typename T , std::size_t NDIM>
template<typename Q , typename opT >
void madness::FunctionImpl< T, NDIM >::unaryXXa ( const keyT key,
const FunctionImpl< Q, NDIM > *  func,
const opT &  op 
)
inline

Out of place unary operation on function impl The skeleton algorithm should resemble something like

*this = op(*func)

Parameters
[in]keythe key of the current function node (box)
[in]functhe function impl on which to be operated
[in]opthe unary operator

References madness::FunctionImpl< T, NDIM >::coeffs, madness::func(), op(), madness::WorldContainer< keyT, valueT, hashfunT >::owner(), madness::WorldContainer< keyT, valueT, hashfunT >::replace(), madness::BaseTensor::size(), madness::FunctionImpl< T, NDIM >::targs, and madness::WorldObject< FunctionImpl< T, NDIM > >::task().

Referenced by madness::FunctionImpl< T, NDIM >::unaryXX(), and madness::FunctionImpl< T, NDIM >::unaryXXvalues().

◆ unaryXXvalues()

template<typename T , std::size_t NDIM>
template<typename Q , typename opT >
void madness::FunctionImpl< T, NDIM >::unaryXXvalues ( const FunctionImpl< Q, NDIM > *  func,
const opT &  op,
bool  fence 
)
inline

◆ undo_redundant()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::undo_redundant ( const bool  fence)

convert this from redundant to standard reconstructed form

References MADNESS_CHECK_THROW, and madness::reconstructed.

Referenced by madness::partial_mul().

◆ unfilter() [1/2]

template<typename T , std::size_t NDIM>
FunctionImpl< T, NDIM >::coeffT madness::FunctionImpl< T, NDIM >::unfilter ( const coeffT s) const

◆ unfilter() [2/2]

template<typename T , std::size_t NDIM>
FunctionImpl< T, NDIM >::tensorT madness::FunctionImpl< T, NDIM >::unfilter ( const tensorT s) const

Transform sums+differences at level n to sum coefficients at level n+1.

Given scaling function and wavelet coefficients (s and d) returns the scaling function coefficients at the next finer level. I.e., reconstruct Vn using Vn = Vn-1 + Wn-1.

s0 = sum(j) h0_ji*s_j + g0_ji*d_j
s1 = sum(j) h1_ji*s_j + g1_ji*d_j
static const double s0
Definition: tdse4.cc:83

Returns a new tensor and has no side effects

If (sonly) ... then ss is only the scaling function coeff (and assume the d are zero). Works for any number of dimensions.

No communication involved.

Referenced by madness::FunctionImpl< T, NDIM >::binaryXXa(), madness::FunctionImpl< T, NDIM >::gaxpy_ext_recursive(), madness::FunctionImpl< T, NDIM >::inner_adaptive_recursive(), madness::FunctionImpl< T, NDIM >::inner_ext_recursive(), madness::FunctionImpl< T, NDIM >::mulXXa(), madness::FunctionImpl< T, NDIM >::mulXXveca(), madness::FunctionImpl< T, NDIM >::recur_down_for_contraction_map(), and madness::FunctionImpl< T, NDIM >::refine_op().

◆ unset_functor()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::unset_functor

◆ upsample()

template<typename T , std::size_t NDIM>
FunctionImpl< T, NDIM >::coeffT madness::FunctionImpl< T, NDIM >::upsample ( const keyT key,
const coeffT coeff 
) const

upsample the sum coefficients of level 1 to sum coeffs on level n+1

specialization of the unfilter method, will transform only the sum coefficients

Parameters
[in]keykey of level n+1
[in]coeffsum coefficients of level n (does NOT belong to key!!)
Returns
sum coefficients on level n+1

specialization of the unfilter method, will transform only the sum coefficients

Parameters
[in]keykey of level n+1
[in]coeffsum coefficients of level n (does NOT belong to key!!)
[in]argsTensorArguments for possible low rank approximations
Returns
sum coefficients on level n+1

Referenced by madness::Leaf_op< T, NDIM, opT, specialboxT >::compare_to_parent().

◆ values2coeffs() [1/2]

template<typename T , std::size_t NDIM>
template<typename Q >
GenTensor<Q> madness::FunctionImpl< T, NDIM >::values2coeffs ( const keyT key,
const GenTensor< Q > &  values 
) const
inline

◆ values2coeffs() [2/2]

template<typename T , std::size_t NDIM>
template<typename Q >
Tensor<Q> madness::FunctionImpl< T, NDIM >::values2coeffs ( const keyT key,
const Tensor< Q > &  values 
) const
inline

◆ values2NScoeffs()

template<typename T , std::size_t NDIM>
template<typename Q >
GenTensor<Q> madness::FunctionImpl< T, NDIM >::values2NScoeffs ( const keyT key,
const GenTensor< Q > &  values 
) const
inline

convert function values of the a child generation directly to NS coeffs

equivalent to converting the function values to 2^NDIM S coeffs and then filtering them to NS coeffs. Reverse operation to NScoeffs2values().

Parameters
[in]keykey of the parent of the generation
[in]valuestensor holding function values of the 2^NDIM children of key
Returns
NS coeffs belonging to key

References madness::FunctionImpl< T, NDIM >::cdata, madness::GenTensor< T >::dim(), madness::inner(), madness::Key< NDIM >::level(), madness::FunctionImpl< T, NDIM >::MADNESS_ASSERT(), NDIM, pow(), madness::scale(), and madness::transform().

◆ verify_tree()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::verify_tree

Verify tree is properly constructed ... global synchronization involved.

If an inconsistency is detected, prints a message describing the error and then throws a madness exception.

This is a reasonably quick and scalable operation that is useful for debugging and paranoia.

References madness::FunctionNode< T, NDIM >::coeff(), madness::GenTensor< T >::dim(), madness::FunctionNode< T, NDIM >::has_children(), madness::GenTensor< T >::has_data(), and PROFILE_MEMBER_FUNC.

◆ vol_nsphere()

template<typename T , std::size_t NDIM>
double madness::FunctionImpl< T, NDIM >::vol_nsphere ( int  n,
double  R 
)
inline

◆ vtransform()

template<typename T , std::size_t NDIM>
template<typename Q , typename R >
void madness::FunctionImpl< T, NDIM >::vtransform ( const std::vector< std::shared_ptr< FunctionImpl< R, NDIM > > > &  vright,
const Tensor< Q > &  c,
const std::vector< std::shared_ptr< FunctionImpl< T, NDIM > > > &  vleft,
double  tol,
bool  fence 
)
inline

Transforms a vector of functions left[i] = sum[j] right[j]*c[j,i] using sparsity

Parameters
[in]vrightvector of functions (impl's) on which to be transformed
[in]cthe tensor (matrix) transformer
[in]vleftvector of of the newly transformed functions (impl's)

References madness::_(), madness::WorldTaskQueue::add(), c, madness::copy(), madness::WorldGopInterface::fence(), madness::World::gop, madness::World::taskq, and madness::FunctionImpl< T, NDIM >::world.

◆ vtransform_doit()

template<typename T , std::size_t NDIM>
template<typename Q , typename R >
void madness::FunctionImpl< T, NDIM >::vtransform_doit ( const std::shared_ptr< FunctionImpl< R, NDIM > > &  right,
const Tensor< Q > &  c,
const std::vector< std::shared_ptr< FunctionImpl< T, NDIM > > > &  vleft,
double  tol 
)
inline

◆ zero_norm_tree()

template<typename T , std::size_t NDIM>
void madness::FunctionImpl< T, NDIM >::zero_norm_tree

Friends And Related Function Documentation

◆ FunctionImpl

template<typename T , std::size_t NDIM>
template<typename Q , std::size_t D>
friend class FunctionImpl
friend

◆ hash_value [1/2]

template<typename T , std::size_t NDIM>
hashT hash_value ( const FunctionImpl< T, NDIM > *  pimpl)
friend

Hash a pointer to FunctionImpl.

Parameters
[in]implpointer to a FunctionImpl
Returns
The hash.

◆ hash_value [2/2]

template<typename T , std::size_t NDIM>
hashT hash_value ( const std::shared_ptr< FunctionImpl< T, NDIM >>  impl)
friend

Hash a shared_ptr to FunctionImpl.

Parameters
[in]implpointer to a FunctionImpl
Returns
The hash.

Member Data Documentation

◆ autorefine

template<typename T , std::size_t NDIM>
bool madness::FunctionImpl< T, NDIM >::autorefine
private

If true, autorefine where appropriate.

Referenced by madness::FunctionImpl< T, NDIM >::load(), and madness::FunctionImpl< T, NDIM >::store().

◆ box_interior

template<typename T , std::size_t NDIM>
long madness::FunctionImpl< T, NDIM >::box_interior[1000]
mutable

◆ box_leaf

template<typename T , std::size_t NDIM>
long madness::FunctionImpl< T, NDIM >::box_leaf[1000]
mutable

◆ cdata

template<typename T , std::size_t NDIM>
const FunctionCommonData<T,NDIM>& madness::FunctionImpl< T, NDIM >::cdata
private

Referenced by madness::FunctionImpl< T, NDIM >::FunctionImpl(), madness::FunctionImpl< T, NDIM >::binaryXX(), madness::FunctionImpl< T, NDIM >::binaryXXa(), madness::FunctionImpl< T, NDIM >::coeffs2values(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::compute_error_from_inaccurate_refinement(), madness::FunctionImpl< T, NDIM >::do_binary_op(), madness::FunctionImpl< T, NDIM >::do_mul(), madness::FunctionImpl< T, NDIM >::do_project_out(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::eri_coeffs(), madness::FunctionImpl< T, NDIM >::errsq_local(), madness::FunctionImpl< T, NDIM >::fcube_for_mul(), madness::FunctionImpl< T, NDIM >::gaxpy_ext(), madness::FunctionImpl< T, NDIM >::gaxpy_ext_node(), madness::FunctionImpl< T, NDIM >::gaxpy_ext_recursive(), madness::FunctionImpl< T, NDIM >::gaxpy_inplace_reconstructed(), madness::FunctionImpl< T, NDIM >::get_contraction_node_lists(), madness::FunctionImpl< T, NDIM >::hartree_product(), madness::FunctionImpl< T, NDIM >::inner_adaptive_recursive(), madness::FunctionImpl< T, NDIM >::inner_ext_node(), madness::FunctionImpl< T, NDIM >::inner_ext_recursive(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::make_sum_coeffs(), madness::FunctionImpl< T, NDIM >::make_Vphi_only(), madness::FunctionImpl< T, NDIM >::mulXX(), madness::FunctionImpl< T, NDIM >::mulXXa(), madness::FunctionImpl< T, NDIM >::mulXXvec(), madness::FunctionImpl< T, NDIM >::mulXXveca(), madness::FunctionImpl< T, NDIM >::NS_fcube_for_mul(), madness::FunctionImpl< T, NDIM >::NScoeffs2values(), 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::FunctionImpl< T, NDIM >::pointwise_multiplier< LDIM >::operator()(), madness::FunctionImpl< T, NDIM >::do_truncate_NS_leafs::operator()(), madness::FunctionImpl< T, NDIM >::do_keep_sum_coeffs::operator()(), madness::FunctionImpl< T, NDIM >::do_unary_op_value_inplace< opT >::operator()(), madness::FunctionImpl< T, NDIM >::do_standard::operator()(), madness::FunctionImpl< T, NDIM >::project(), madness::FunctionImpl< T, NDIM >::project_out(), madness::FunctionImpl< T, NDIM >::read_grid(), madness::FunctionImpl< T, NDIM >::read_grid2(), madness::FunctionImpl< T, NDIM >::recur_down_for_contraction_map(), madness::FunctionImpl< T, NDIM >::recursive_apply(), madness::FunctionImpl< T, NDIM >::refine(), madness::FunctionImpl< T, NDIM >::refine_op(), madness::FunctionImpl< T, NDIM >::unaryXX(), madness::FunctionImpl< T, NDIM >::unaryXXvalues(), madness::FunctionImpl< T, NDIM >::values2coeffs(), madness::FunctionImpl< T, NDIM >::values2NScoeffs(), and madness::FunctionImpl< T, NDIM >::vtransform_doit().

◆ coeffs

template<typename T , std::size_t NDIM>
dcT madness::FunctionImpl< T, NDIM >::coeffs
private

The coefficients.

Referenced by madness::FunctionImpl< T, NDIM >::FunctionImpl(), madness::FunctionImpl< T, NDIM >::add_keys_to_map(), madness::FunctionImpl< T, NDIM >::apply(), madness::FunctionImpl< T, NDIM >::apply_1d_realspace_push_op(), madness::FunctionImpl< T, NDIM >::apply_source_driven(), madness::FunctionImpl< T, NDIM >::binaryXX(), madness::FunctionImpl< T, NDIM >::binaryXXa(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::continue_recursion(), madness::FunctionImpl< T, NDIM >::copy_coeffs(), madness::FunctionImpl< T, NDIM >::distribute(), madness::FunctionImpl< T, NDIM >::do_apply(), madness::FunctionImpl< T, NDIM >::do_apply_kernel(), madness::FunctionImpl< T, NDIM >::do_apply_kernel2(), madness::FunctionImpl< T, NDIM >::do_apply_kernel3(), madness::FunctionImpl< T, NDIM >::do_binary_op(), madness::FunctionImpl< T, NDIM >::do_dirac_convolution(), madness::FunctionImpl< T, NDIM >::do_mul(), madness::FunctionImpl< T, NDIM >::do_project_out(), madness::FunctionImpl< T, NDIM >::errsq_local(), madness::FunctionImpl< T, NDIM >::flo_unary_op_node_inplace(), madness::FunctionImpl< T, NDIM >::forward_traverse(), madness::FunctionImpl< T, NDIM >::gaxpy(), madness::FunctionImpl< T, NDIM >::gaxpy_ext(), madness::FunctionImpl< T, NDIM >::gaxpy_ext_recursive(), madness::FunctionImpl< T, NDIM >::gaxpy_inplace(), madness::FunctionImpl< T, NDIM >::gaxpy_inplace_reconstructed(), madness::FunctionImpl< T, NDIM >::inner_adaptive_local(), madness::FunctionImpl< T, NDIM >::inner_ext_local(), madness::FunctionImpl< T, NDIM >::inner_ext_recursive(), madness::FunctionImpl< T, NDIM >::load(), madness::FunctionImpl< T, NDIM >::make_Vphi_only(), madness::FunctionImpl< T, NDIM >::multi_to_multi_op_values(), madness::FunctionImpl< T, NDIM >::multi_to_multi_op_values_doit(), madness::FunctionImpl< T, NDIM >::multiop_values(), madness::FunctionImpl< T, NDIM >::multiop_values_doit(), madness::FunctionImpl< T, NDIM >::multiply(), madness::FunctionImpl< T, NDIM >::mulXX(), madness::FunctionImpl< T, NDIM >::mulXXa(), madness::FunctionImpl< T, NDIM >::mulXXvec(), madness::FunctionImpl< T, NDIM >::mulXXveca(), madness::FunctionImpl< T, NDIM >::project_out_op< LDIM >::operator()(), madness::FunctionImpl< T, NDIM >::do_inner_local< R >::operator()(), madness::FunctionImpl< T, NDIM >::partial_inner(), madness::FunctionImpl< T, NDIM >::partial_inner_contract(), madness::FunctionImpl< T, NDIM >::project(), madness::FunctionImpl< T, NDIM >::project_out(), madness::FunctionImpl< T, NDIM >::project_out2(), madness::FunctionImpl< T, NDIM >::read_grid(), madness::FunctionImpl< T, NDIM >::read_grid2(), madness::FunctionImpl< T, NDIM >::recursive_apply(), madness::FunctionImpl< T, NDIM >::refine(), madness::FunctionImpl< T, NDIM >::refine_op(), madness::FunctionImpl< T, NDIM >::refine_spawn(), madness::FunctionImpl< T, NDIM >::replicate(), madness::FunctionImpl< T, NDIM >::scale_oop(), madness::FunctionImpl< T, NDIM >::store(), madness::FunctionImpl< T, NDIM >::traverse_tree(), madness::FunctionImpl< T, NDIM >::unary_op_coeff_inplace(), madness::FunctionImpl< T, NDIM >::unary_op_node_inplace(), madness::FunctionImpl< T, NDIM >::unary_op_value_inplace(), madness::FunctionImpl< T, NDIM >::unaryXX(), madness::FunctionImpl< T, NDIM >::unaryXXa(), madness::FunctionImpl< T, NDIM >::unaryXXvalues(), and madness::FunctionImpl< T, NDIM >::vtransform_doit().

◆ const [1/2]

template<typename T , std::size_t NDIM>
NDIM& g madness::FunctionImpl< T, NDIM >::const
Initial value:
{
friend class FunctionImpl
Definition: funcimpl.h:958
#define PROFILE_MEMBER_FUNC(classname)
Definition: worldprofile.h:210

◆ const [2/2]

template<typename T , std::size_t NDIM>
NDIM& gimpl madness::FunctionImpl< T, NDIM >::const

◆ functor

template<typename T , std::size_t NDIM>
std::shared_ptr< FunctionFunctorInterface<T,NDIM> > madness::FunctionImpl< T, NDIM >::functor
private

◆ initial_level

template<typename T , std::size_t NDIM>
int madness::FunctionImpl< T, NDIM >::initial_level
private

◆ k

template<typename T , std::size_t NDIM>
int madness::FunctionImpl< T, NDIM >::k
private

◆ large

template<typename T , std::size_t NDIM>
AtomicInt madness::FunctionImpl< T, NDIM >::large

◆ leaves_only

template<typename T , std::size_t NDIM>
bool madness::FunctionImpl< T, NDIM >::leaves_only =(this->is_redundant())

◆ max_refine_level

template<typename T , std::size_t NDIM>
int madness::FunctionImpl< T, NDIM >::max_refine_level
private

◆ small

template<typename T , std::size_t NDIM>
AtomicInt madness::FunctionImpl< T, NDIM >::small

◆ special_level

template<typename T , std::size_t NDIM>
int madness::FunctionImpl< T, NDIM >::special_level
private

Minimium level for refinement on special points.

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

◆ special_points

template<typename T , std::size_t NDIM>
std::vector<Vector<double,NDIM> > madness::FunctionImpl< T, NDIM >::special_points
private

special points for further refinement (needed for composite functions or multiplication)

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

◆ targs

template<typename T , std::size_t NDIM>
TensorArgs madness::FunctionImpl< T, NDIM >::targs
private

◆ thresh

template<typename T , std::size_t NDIM>
double madness::FunctionImpl< T, NDIM >::thresh
private

◆ timer_accumulate

template<typename T , std::size_t NDIM>
Timer madness::FunctionImpl< T, NDIM >::timer_accumulate

◆ timer_change_tensor_type

template<typename T , std::size_t NDIM>
Timer madness::FunctionImpl< T, NDIM >::timer_change_tensor_type

◆ timer_compress_svd

template<typename T , std::size_t NDIM>
Timer madness::FunctionImpl< T, NDIM >::timer_compress_svd

◆ timer_filter

template<typename T , std::size_t NDIM>
Timer madness::FunctionImpl< T, NDIM >::timer_filter

◆ timer_lr_result

template<typename T , std::size_t NDIM>
Timer madness::FunctionImpl< T, NDIM >::timer_lr_result

◆ timer_target_driven

template<typename T , std::size_t NDIM>
Timer madness::FunctionImpl< T, NDIM >::timer_target_driven

◆ tree_state

template<typename T , std::size_t NDIM>
TreeState madness::FunctionImpl< T, NDIM >::tree_state
private

◆ truncate_mode

template<typename T , std::size_t NDIM>
int madness::FunctionImpl< T, NDIM >::truncate_mode
private

0=default=(|d|<thresh), 1=(|d|<thresh/2^n), 1=(|d|<thresh/4^n);

Referenced by madness::FunctionImpl< T, NDIM >::load(), and madness::FunctionImpl< T, NDIM >::store().

◆ truncate_on_project

template<typename T , std::size_t NDIM>
bool madness::FunctionImpl< T, NDIM >::truncate_on_project
private

If true projection inserts at level n-1 not n.

Referenced by madness::FunctionImpl< T, NDIM >::load(), and madness::FunctionImpl< T, NDIM >::store().

◆ world

template<typename T , std::size_t NDIM>
World& madness::FunctionImpl< T, NDIM >::world

Referenced by madness::FunctionImpl< T, NDIM >::FunctionImpl(), madness::CoeffTracker< T, NDIM >::activate(), madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::activate(), madness::FunctionImpl< T, NDIM >::add_op::activate(), madness::FunctionImpl< T, NDIM >::hartree_op< LDIM, leaf_opT >::activate(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::activate(), madness::FunctionImpl< T, NDIM >::recursive_apply_op< opT, LDIM >::activate(), madness::FunctionImpl< T, NDIM >::recursive_apply_op2< opT >::activate(), madness::FunctionImpl< T, NDIM >::project_out_op< LDIM >::activate(), madness::FunctionImpl< T, NDIM >::apply(), madness::FunctionImpl< T, NDIM >::apply_1d_realspace_push(), madness::FunctionImpl< T, NDIM >::apply_source_driven(), madness::FunctionImpl< T, NDIM >::binaryXX(), madness::FunctionImpl< T, NDIM >::copy_coeffs(), madness::FunctionImpl< T, NDIM >::distribute(), madness::FunctionImpl< T, NDIM >::do_apply_kernel(), madness::FunctionImpl< T, NDIM >::do_dirac_convolution(), madness::FunctionImpl< T, NDIM >::errsq_local(), madness::FunctionImpl< T, NDIM >::flo_unary_op_node_inplace(), madness::FunctionImpl< T, NDIM >::forward_traverse(), madness::FunctionImpl< T, NDIM >::gaxpy(), madness::FunctionImpl< T, NDIM >::gaxpy_ext(), madness::FunctionImpl< T, NDIM >::gaxpy_inplace(), madness::FunctionImpl< T, NDIM >::gaxpy_inplace_reconstructed(), madness::FunctionImpl< T, NDIM >::hartree_product(), madness::FunctionImpl< T, NDIM >::inner_adaptive_local(), madness::FunctionImpl< T, NDIM >::inner_ext_local(), madness::FunctionImpl< T, NDIM >::load(), madness::FunctionImpl< T, NDIM >::make_Vphi(), madness::FunctionImpl< T, NDIM >::make_Vphi_only(), madness::FunctionImpl< T, NDIM >::merge_trees(), madness::FunctionImpl< T, NDIM >::multi_to_multi_op_values(), madness::FunctionImpl< T, NDIM >::multiop_values(), madness::FunctionImpl< T, NDIM >::multiply(), madness::FunctionImpl< T, NDIM >::mulXX(), madness::FunctionImpl< T, NDIM >::mulXXvec(), madness::FunctionImpl< T, NDIM >::mulXXveca(), madness::FunctionImpl< T, NDIM >::recursive_apply_op< opT, LDIM >::operator()(), madness::FunctionImpl< T, NDIM >::recursive_apply_op2< opT >::operator()(), madness::FunctionImpl< T, NDIM >::do_check_symmetry_local::operator()(), madness::FunctionImpl< T, NDIM >::project_out(), madness::FunctionImpl< T, NDIM >::project_out2(), madness::FunctionImpl< T, NDIM >::recursive_apply(), madness::FunctionImpl< T, NDIM >::refine(), madness::FunctionImpl< T, NDIM >::scale_oop(), madness::FunctionImpl< T, NDIM >::store(), madness::FunctionImpl< T, NDIM >::unary_op_coeff_inplace(), madness::FunctionImpl< T, NDIM >::unary_op_node_inplace(), madness::FunctionImpl< T, NDIM >::unary_op_value_inplace(), madness::FunctionImpl< T, NDIM >::unaryXX(), madness::FunctionImpl< T, NDIM >::unaryXXvalues(), and madness::FunctionImpl< T, NDIM >::vtransform().


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