MADNESS
version 0.9
|
FunctionImpl holds all Function state to facilitate shallow copy semantics. More...
#include <funcdefaults.h>
Classes | |
struct | add_op |
add two functions f and g: result=alpha * f + beta * g More... | |
struct | coeff_value_adaptor |
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_consolidate_buffer |
struct | do_convert_to_color |
class | do_err_box |
struct | do_gaxpy_inplace |
struct | do_inner_ext_local |
struct | do_inner_ext_local_ffi |
struct | do_inner_local |
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_mapdim |
map this on f More... | |
struct | do_merge_trees |
merge the coefficent boxes of this into other's tree 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 | 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 |
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 FunctionImpl< T, NDIM > | implT |
Type of this class (implementation) More... | |
typedef std::shared_ptr < FunctionImpl< T, NDIM > > | pimplT |
pointer to this class More... | |
typedef Tensor< T > | tensorT |
Type of tensor for anything but to hold coeffs. More... | |
typedef Vector< Translation, NDIM > | tranT |
Type of array holding translation. More... | |
typedef Key< NDIM > | keyT |
Type of key. More... | |
typedef FunctionNode< T, NDIM > | nodeT |
Type of node. More... | |
typedef GenTensor< T > | coeffT |
Type of tensor used to hold coeffs. More... | |
typedef WorldContainer< keyT, nodeT > | dcT |
Type of container holding the coefficients. More... | |
typedef std::pair< const keyT, nodeT > | datumT |
Type of entry in container. More... | |
typedef Vector< double, NDIM > | coordT |
Type of vector holding coordinates. More... | |
typedef Range< typename dcT::const_iterator > | rangeT |
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 () |
const std::shared_ptr < WorldDCPmapInterface< Key < NDIM > > > & | get_pmap () const |
template<typename Q > | |
void | copy_coeffs (const FunctionImpl< Q, NDIM > &other, bool fence) |
Copy coeffs from other into self. More... | |
template<typename Q , typename R > | |
void | gaxpy_inplace_reconstructed (const T &alpha, const FunctionImpl< Q, NDIM > &g, const R &beta, const bool fence) |
perform inplace gaxpy: this = alpha*this + beta*other 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... | |
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... | |
template<typename Q , typename R > | |
void | gaxpy_inplace (const T &alpha, const FunctionImpl< Q, NDIM > &other, const R &beta, bool fence) |
Inplace general bilinear operation. More... | |
template<typename Archive > | |
void | load (Archive &ar) |
template<typename Archive > | |
void | store (Archive &ar) |
bool | is_compressed () const |
Returns true if the function is compressed. More... | |
bool | is_redundant () const |
Returns true if the function is redundant. More... | |
bool | is_nonstandard () const |
void | set_functor (const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > functor1) |
std::shared_ptr < FunctionFunctorInterface< T, NDIM > > | get_functor () |
std::shared_ptr < FunctionFunctorInterface< T, NDIM > > | get_functor () const |
void | unset_functor () |
bool & | is_on_demand () |
const bool & | is_on_demand () const |
TensorType | get_tensor_type () const |
TensorArgs | get_tensor_args () const |
double | get_thresh () const |
void | set_thresh (double value) |
bool | get_autorefine () const |
void | set_autorefine (bool value) |
int | get_k () const |
const dcT & | get_coeffs () const |
dcT & | get_coeffs () |
const FunctionCommonData< T, NDIM > & | get_cdata () const |
Void | accumulate_timer (const double time) const |
void | print_timer () const |
void | reset_timer () |
void | add_scalar_inplace (T t, bool fence) |
Adds a constant to the function. Local operation, optional fence. More... | |
void | insert_zero_down_to_initial_level (const keyT &key) |
Initialize nodes to zero function at initial_level of refinement. More... | |
void | truncate (double tol, bool fence) |
Truncate according to the threshold with optional global fence. More... | |
Future< bool > | truncate_spawn (const keyT &key, double tol) |
Returns true if after truncation this node has coefficients. More... | |
bool | truncate_op (const keyT &key, double tol, const std::vector< Future< bool > > &v) |
Actually do the truncate operation. More... | |
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 |
const keyT & | key0 () const |
void | print_tree (std::ostream &os=std::cout, Level maxlevel=10000) const |
void | do_print_tree (const keyT &key, std::ostream &os, Level maxlevel) const |
void | print_tree_graphviz (std::ostream &os=std::cout, Level maxlevel=10000) const |
void | do_print_tree_graphviz (const keyT &key, std::ostream &os, Level maxlevel) const |
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 | 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 | print_grid (const std::string filename) const |
std::vector< keyT > | local_leaf_keys () const |
return the keys of the local leaf boxes More... | |
void | do_print_grid (const std::string filename, const std::vector< keyT > &keys) const |
print the grid in xyz format More... | |
template<size_t FDIM> | |
enable_if_c< 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> | |
enable_if_c< NDIM==FDIM >::type | read_grid2 (const std::string gridfile, std::shared_ptr< FunctionFunctorInterface< double, NDIM > > vnuc_functor) |
read data from a grid More... | |
tensorT | project (const keyT &key) const |
Compute by projection the scaling function coeffs in specified box. More... | |
double | truncate_tol (double tol, const keyT &key) const |
Returns the truncation threshold according to truncate_method. More... | |
std::vector< Slice > | child_patch (const keyT &child) const |
Returns patch referring to coeffs of child in parent box. More... | |
Void | project_refine_op (const keyT &key, bool do_refine, const std::vector< Vector< double, NDIM > > &specialpts) |
Projection with optional refinement. 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... | |
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... | |
Key< NDIM > | simpt2key (const coordT &pt, Level n) const |
Returns the box at level n that contains the given point in simulation coordinates. More... | |
tensorT | coeffs_for_jun (Level n, long q=0) |
Get the scaling function coeffs at level n starting from NS form. More... | |
template<typename Q > | |
GenTensor< Q > | coeffs2values (const keyT &key, const GenTensor< Q > &coeff) const |
template<typename Q > | |
GenTensor< Q > | NScoeffs2values (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... | |
template<typename Q > | |
GenTensor< Q > | NS_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< Q > | values2NScoeffs (const keyT &key, const GenTensor< Q > &values) const |
convert function values of the a child generation directly to NS coeffs More... | |
template<typename Q > | |
Tensor< Q > | coeffs2values (const keyT &key, const Tensor< Q > &coeff) const |
template<typename Q > | |
GenTensor< Q > | values2coeffs (const keyT &key, const GenTensor< Q > &values) const |
template<typename Q > | |
Tensor< Q > | values2coeffs (const keyT &key, const Tensor< Q > &values) const |
template<typename Q > | |
Tensor< Q > | fcube_for_mul (const keyT &child, const keyT &parent, const Tensor< Q > &coeff) const |
Compute the function values for multiplication. More... | |
template<typename Q > | |
GenTensor< Q > | fcube_for_mul (const keyT &child, const keyT &parent, const GenTensor< Q > &coeff) const |
Compute the function values for multiplication. More... | |
template<typename L , typename R > | |
Void | do_mul (const keyT &key, const Tensor< L > &left, const std::pair< keyT, Tensor< R > > &arg) |
Invoked as a task by mul with the actual coefficients. 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 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) |
Invoked as a task by do_binary_op with the actual coefficients. 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 opT > | |
void | unary_op_coeff_inplace (const opT &op, bool fence) |
Unary operation applied inplace to the coefficients WITHOUT refinement, optional fence. More... | |
template<typename opT > | |
void | unary_op_node_inplace (const opT &op, bool fence) |
Unary operation applied inplace to the coefficients WITHOUT refinement, optional fence. More... | |
template<typename opT > | |
void | flo_unary_op_node_inplace (const opT &op, bool fence) |
Unary operation applied inplace to the coefficients WITHOUT refinement, optional fence. More... | |
template<typename opT > | |
void | flo_unary_op_node_inplace (const opT &op, bool fence) const |
Unary operation applied inplace to the coefficients WITHOUT refinement, optional fence. More... | |
Void | erase (const Level &max_level) |
truncate tree at a certain level More... | |
double | check_symmetry_local () const |
Returns some asymmetry measure ... no comms. More... | |
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 | 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... | |
template<typename opT > | |
Void | multiop_values_doit (const keyT &key, const opT &op, const std::vector< implT * > &v) |
template<typename opT > | |
void | multiop_values (const opT &op, const std::vector< implT * > &v) |
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) |
Transforms a vector of functions left[i] = sum[j] right[j]*c[j,i] using sparsity. More... | |
template<typename opT > | |
void | unary_op_value_inplace (const opT &op, bool fence) |
Unary operation applied inplace to the values with optional refinement and fence. More... | |
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) |
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 , 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) |
template<typename Q , typename opT > | |
Void | unaryXXa (const keyT &key, const FunctionImpl< Q, NDIM > *func, const opT &op) |
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 , typename opT > | |
void | binaryXX (const FunctionImpl< L, NDIM > *left, const FunctionImpl< R, NDIM > *right, 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 | unaryXXvalues (const FunctionImpl< Q, NDIM > *func, const opT &op, bool fence) |
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) |
Future< double > | get_norm_tree_recursive (const keyT &key) const |
Void | put_in_box (ProcessID from, long nl, long ni) const |
void | print_info () const |
Prints summary of data distribution. More... | |
void | verify_tree () const |
Verify tree is properly constructed ... global synchronization involved. 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 | 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 |
Tensor< T > | 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. More... | |
std::pair< bool, T > | 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) 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... | |
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... | |
void | tnorm (const tensorT &t, double *lo, double *hi) const |
Computes norm of low/high-order polyn. coeffs for autorefinement test. More... | |
Void | do_square_inplace (const keyT &key) |
Void | do_square_inplace2 (const keyT &parent, const keyT &child, const tensorT &parent_coeff) |
bool | noautorefine (const keyT &key, const tensorT &t) const |
Always returns false (for when autorefine is not wanted) More... | |
bool | autorefine_square_test (const keyT &key, const nodeT &t) const |
Returns true if this block of coeffs needs autorefining. More... | |
void | square_inplace (bool fence) |
Pointwise squaring of function with optional global fence. More... | |
void | abs_inplace (bool fence) |
void | abs_square_inplace (bool fence) |
Void | sum_down_spawn (const keyT &key, const coeffT &s) |
is this the same as trickle_down() ? More... | |
void | sum_down (bool fence) |
After 1d push operator must sum coeffs down the tree to restore correct scaling function coefficients. 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 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 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... | |
template<std::size_t LDIM, typename leaf_opT > | |
Void | hartree_product (const FunctionImpl< T, LDIM > *p1, const FunctionImpl< T, LDIM > *p2, const leaf_opT &leaf_op, bool fence) |
given two functions of LDIM, perform the Hartree/Kronecker/outer product More... | |
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_1d_realspace_push (const opT &op, const FunctionImpl< R, NDIM > *f, int axis, bool fence) |
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 > ¢er, const std::pair< keyT, coeffT > &right) |
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 > ¢er, const std::pair< keyT, coeffT > &right) |
void | diff (const DerivativeBase< T, NDIM > *D, const implT *f, bool fence) |
keyT | neighbor (const keyT &key, const keyT &disp, const std::vector< bool > &is_periodic) const |
Returns key of general neighbor enforcing BC. 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... | |
std::pair< Key< NDIM > , ShallowNode< T, NDIM > > | find_datum (keyT key) const |
return the a std::pair<key, node>, which MUST exist More... | |
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... | |
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... | |
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... | |
void | mapdim (const implT &f, const std::vector< long > &map, bool fence) |
Permute the dimensions of f according to map, result on this. More... | |
void | average (const implT &rhs) |
take the average of two functions, similar to: this=0.5*(this+rhs) More... | |
void | change_tensor_type1 (const TensorArgs &targs, bool fence) |
change the tensor type of the coefficients in the FunctionNode More... | |
void | reduce_rank (const TensorArgs &targs, bool fence) |
reduce the rank of the coefficients tensors More... | |
T | eval_cube (Level n, coordT &x, const tensorT &c) const |
tensorT | filter (const tensorT &s) const |
Transform sum coefficients at level n to sums+differences at level n-1. More... | |
coeffT | filter (const coeffT &s) const |
tensorT | unfilter (const tensorT &s) const |
Transform sums+differences at level n to sum coefficients at level n+1. More... | |
coeffT | unfilter (const coeffT &s) const |
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... | |
coeffT | upsample (const keyT &key, const coeffT &coeff) const |
upsample the sum coefficients of level 1 to sum coeffs on level n+1 More... | |
void | project (const implT &old, bool fence) |
Projects old function into new basis (only in reconstructed form) More... | |
template<typename opT > | |
Void | refine_op (const opT &op, const keyT &key) |
template<typename opT > | |
Void | refine_spawn (const opT &op, const keyT &key) |
template<typename opT > | |
void | refine (const opT &op, bool fence) |
bool | exists_and_has_children (const keyT &key) const |
bool | exists_and_is_leaf (const keyT &key) const |
Void | broaden_op (const keyT &key, const std::vector< Future< bool > > &v) |
void | zero_norm_tree () |
void | broaden (std::vector< bool > is_periodic, bool fence) |
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 | reconstruct (bool fence) |
Void | reconstruct_op (const keyT &key, const coeffT &s) |
void | compress (bool nonstandard, bool keepleaves, bool redundant, bool fence) |
compress the wave function More... | |
Future< coeffT > | compress_spawn (const keyT &key, bool nonstandard, bool keepleaves, bool redundant) |
void | make_redundant (const bool fence) |
convert this to redundant, i.e. have sum coefficients on all levels More... | |
void | undo_redundant (const bool fence) |
convert this from redundant to standard reconstructed form 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) |
Future< coeffT > | truncate_reconstructed_spawn (const keyT &key, const double tol) |
truncate using a tree in reconstructed form More... | |
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... | |
coeffT | compress_op (const keyT &key, const std::vector< Future< coeffT > > &v, bool nonstandard, bool redundant) |
calculate the wavelet coefficients using the sum coefficients of all child nodes More... | |
coeffT | make_redundant_op (const keyT &key, const std::vector< Future< coeffT > > &v) |
similar to compress_op, but insert only the sum coefficients in the tree More... | |
void | standard (bool fence) |
Changes non-standard compressed form to standard compressed form. 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 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 > | |
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 > | |
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 > | |
void | apply_source_driven (opT &op, const FunctionImpl< R, NDIM > &f, bool fence) |
similar to apply, but for low rank coeffs More... | |
double | finalize_apply (const bool fence=true) |
after apply we need to do some cleanup; 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... | |
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... | |
T | trace_local () const |
Returns int(f(x),x) in local volume. More... | |
double | norm2sq_local () const |
Returns the square of the local norm ... no comms. More... | |
template<typename R > | |
TENSOR_RESULT_TYPE (T, R) inner_local(const FunctionImpl<R | |
Returns the inner product ASSUMING same distribution. More... | |
typedef | TENSOR_RESULT_TYPE (T, R) resultT |
MADNESS_ASSERT (this->is_redundant()==g.is_redundant()) | |
return world taskq | reduce (rangeT(coeffs.begin(), coeffs.end()), do_inner_local< R >(&g, leaves_only)) |
T | inner_ext_node (keyT key, tensorT c, T(*f)(const coordT &)) const |
T | inner_ext_node (keyT key, tensorT c, const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > f) const |
T | inner_ext_recursive (keyT key, tensorT c, T(*f)(const coordT &), const bool leaf_refine, T old_inner=T(0)) const |
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 |
T | inner_ext_local (T(*f)(const coordT &), const bool leaf_refine) const |
T | inner_ext_local (const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > f, const bool leaf_refine) const |
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 L > | |
void | gaxpy_ext (const FunctionImpl< L, NDIM > *left, T(*f)(const coordT &), T alpha, T beta, double tol, bool fence) |
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... | |
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... | |
std::size_t | max_local_depth () const |
Returns the maximum local depth of the tree ... no communications. More... | |
std::size_t | max_depth () const |
Returns the maximum depth of the tree ... collective ... global sum/broadcast. More... | |
std::size_t | max_nodes () const |
Returns the max number of nodes on a processor. More... | |
std::size_t | min_nodes () const |
Returns the min number of nodes on a processor. More... | |
std::size_t | tree_size () const |
Returns the size of the tree structure of the function ... collective global sum. More... | |
std::size_t | size () const |
Returns the number of coefficients in the function ... collective global sum. More... | |
std::size_t | real_size () const |
Returns the number of coefficients in the function ... collective global sum. 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 | 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... | |
Public Member Functions inherited from madness::WorldObject< FunctionImpl< T, NDIM > > | |
WorldObject (World &world) | |
Associates object with globally unique ID. More... | |
const uniqueidT & | id () const |
Returns the globally unique object ID. More... | |
World & | get_world () const |
Returns a reference to the world. More... | |
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 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 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 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 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 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 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 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 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 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 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... | |
virtual | ~WorldObject () |
Public Attributes | |
World & | world |
Timer | timer_accumulate |
Timer | timer_lr_result |
Timer | timer_filter |
Timer | timer_compress_svd |
Timer | timer_target_driven |
bool | do_new |
AtomicInt | small |
AtomicInt | large |
long | box_leaf [1000] |
long | box_interior [1000] |
NDIM &g | const |
bool | leaves_only =(this->is_redundant()) |
Public Attributes inherited from madness::WorldObject< FunctionImpl< T, NDIM > > | |
World & | world |
Think globally act locally. More... | |
Friends | |
template<typename Q , std::size_t D> | |
class | FunctionImpl |
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... | |
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.
typedef GenTensor<T> madness::FunctionImpl< T, NDIM >::coeffT |
Type of tensor used to hold coeffs.
typedef Vector<double,NDIM> madness::FunctionImpl< T, NDIM >::coordT |
Type of vector holding coordinates.
typedef std::pair<const keyT,nodeT> madness::FunctionImpl< T, NDIM >::datumT |
Type of entry in container.
typedef WorldContainer<keyT,nodeT> madness::FunctionImpl< T, NDIM >::dcT |
Type of container holding the coefficients.
typedef FunctionImpl<T,NDIM> madness::FunctionImpl< T, NDIM >::implT |
Type of this class (implementation)
typedef Key<NDIM> madness::FunctionImpl< T, NDIM >::keyT |
Type of key.
typedef FunctionNode<T,NDIM> madness::FunctionImpl< T, NDIM >::nodeT |
Type of node.
typedef std::shared_ptr< FunctionImpl<T,NDIM> > madness::FunctionImpl< T, NDIM >::pimplT |
pointer to this class
typedef Range<typename dcT::const_iterator> madness::FunctionImpl< T, NDIM >::rangeT |
typedef Tensor<T> madness::FunctionImpl< T, NDIM >::tensorT |
Type of tensor for anything but to hold coeffs.
typedef Vector<Translation,NDIM> madness::FunctionImpl< T, NDIM >::tranT |
Type of array holding translation.
|
inline |
Initialize function impl from data in factory.
|
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.
|
inlinevirtual |
void madness::FunctionImpl< T, NDIM >::abs_inplace | ( | bool | fence | ) |
void madness::FunctionImpl< T, NDIM >::abs_square_inplace | ( | bool | fence | ) |
Void madness::FunctionImpl< T, NDIM >::accumulate_timer | ( | const double | time | ) | const |
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.
References madness::change_tensor_type(), madness::FunctionNode< T, NDIM >::coeff(), madness::FunctionNode< T, NDIM >::has_coeff(), L, NDIM, sqrt(), madness::TT_FULL, and ttt.
|
inline |
apply an operator on f to return this
|
inline |
|
inline |
|
inline |
similar to apply, but for low rank coeffs
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.
[in] | key | the key of the FunctionNode to which these coeffs belong |
[in] | cket | coefficients of the ket |
[in] | vpotential1 | function values of the potential for particle 1 |
[in] | vpotential2 | function values of the potential for particle 2 |
[in] | veri | function values for the 2-particle potential |
References madness::GenTensor< T >::full_tensor_copy(), madness::GenTensor< T >::has_data(), madness::multiply(), and thresh.
Referenced by madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::make_childrens_sum_coeffs(), and madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::make_sum_coeffs().
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(), test(), and thresh.
Referenced by madness::Function< T, NDIM >::autorefine_square_op::operator()().
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().
|
inline |
|
inline |
Referenced by madness::FunctionImpl< Q, NDIM >::binaryXX().
void madness::FunctionImpl< T, NDIM >::broaden | ( | std::vector< bool > | is_periodic, |
bool | fence | ||
) |
Void madness::FunctionImpl< T, NDIM >::broaden_op | ( | const keyT & | key, |
const std::vector< Future< bool > > & | v | ||
) |
void madness::FunctionImpl< T, NDIM >::change_tensor_type1 | ( | const TensorArgs & | targs, |
bool | fence | ||
) |
change the tensor type of the coefficients in the FunctionNode
[in] | targs | target tensor arguments (threshold and full/low rank) |
double madness::FunctionImpl< T, NDIM >::check_symmetry_local | ( | ) | const |
Returns some asymmetry measure ... no comms.
References PROFILE_MEMBER_FUNC.
std::vector< Slice > madness::FunctionImpl< T, NDIM >::child_patch | ( | const keyT & | child | ) | const |
Returns patch referring to coeffs of child in parent box.
References NDIM, and madness::Key< NDIM >::translation().
Referenced by madness::FunctionImpl< Q, NDIM >::binaryXXa(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::continue_recursion(), madness::FunctionImpl< Q, NDIM >::gaxpy_ext_recursive(), madness::FunctionImpl< Q, NDIM >::inner_ext_recursive(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::make_childrens_sum_coeffs(), madness::FunctionImpl< Q, NDIM >::mulXXa(), madness::FunctionImpl< Q, NDIM >::mulXXveca(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::operator()(), and madness::FunctionImpl< Q, NDIM >::refine_op().
|
inline |
Referenced by madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::eri_values(), madness::FunctionImpl< Q, NDIM >::fcube_for_mul(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::make_childrens_sum_coeffs(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::make_sum_coeffs(), madness::FunctionImpl< Q, NDIM >::multiop_values_doit(), madness::FunctionImpl< T, NDIM >::coeff_value_adaptor< Q, opT >::operator()(), and madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::operator()().
|
inline |
FunctionImpl< T, NDIM >::tensorT madness::FunctionImpl< T, NDIM >::coeffs_for_jun | ( | Level | n, |
long | q = 0 |
||
) |
Get the scaling function coeffs at level n starting from NS form.
References madness::copy(), mpfr::dim(), madness::GenTensor< T >::full_tensor_copy(), madness::Future< T >::get(), N, NDIM, madness::nonstandard(), madness::print(), madness::Future< T >::remote_ref(), and madness::Key< NDIM >::translation().
void madness::FunctionImpl< T, NDIM >::compress | ( | bool | nonstandard, |
bool | keepleaves, | ||
bool | redundant, | ||
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:
[in] | nonstandard | keep sum coeffs at all other levels, except leaves |
[in] | keepleaves | keep sum coeffs (but no diff coeffs) at leaves |
[in] | redundant | keep only sum coeffs at all levels, discard difference coeffs |
References madness::nonstandard().
FunctionImpl< T, NDIM >::coeffT madness::FunctionImpl< T, NDIM >::compress_op | ( | const keyT & | key, |
const std::vector< Future< coeffT > > & | v, | ||
bool | nonstandard, | ||
bool | redundant | ||
) |
calculate the wavelet coefficients using the sum coefficients of all child nodes
[in] | key | this's key |
[in] | v | sum coefficients of the child nodes |
[in] | nonstandard | keep the sum coefficients with the wavelet coefficients |
[in] | redundant | keep only the sum coefficients, discard the wavelet coefficients |
References c, madness::copy(), madness::Key< NDIM >::level(), madness::nonstandard(), madness::print(), PROFILE_MEMBER_FUNC, and madness::TensorArgs::thresh.
Future< GenTensor< T > > madness::FunctionImpl< T, NDIM >::compress_spawn | ( | const keyT & | key, |
bool | nonstandard, | ||
bool | keepleaves, | ||
bool | redundant | ||
) |
References madness::TaskAttributes::hipri(), NDIM, madness::nonstandard(), madness::print(), and PROFILE_BLOCK.
|
inline |
Copy coeffs from other into self.
void madness::FunctionImpl< T, NDIM >::diff | ( | const DerivativeBase< T, NDIM > * | D, |
const implT * | f, | ||
bool | fence | ||
) |
References madness::WorldContainer< keyT, valueT, hashfunT >::begin(), madness::FunctionNode< T, NDIM >::coeff(), madness::WorldContainer< keyT, valueT, hashfunT >::end(), madness::DerivativeBase< T, NDIM >::find_neighbor(), madness::FunctionNode< T, NDIM >::has_coeff(), and madness::TaskAttributes::hipri().
|
inline |
apply an operator on the coeffs c (at node key)
the result is accumulated inplace to this's tree at various FunctionNodes
[in] | op | the operator to act on the source function |
[in] | f | the source function (not used???) |
[in] | key | key of the source FunctionNode of f which is processed |
[in] | c | coeffs of the FunctionNode of f which is processed |
|
inline |
apply an operator on the coeffs c (at node key)
invoked by result; the result is accumulated inplace to this's tree at various FunctionNodes
[in] | op | the operator to act on the source function |
[in] | key | key of the source FunctionNode of f which is processed (see "source") |
[in] | coeff | coeffs of FunctionNode being processed |
[in] | do_kernel | true: do the 0-disp only; false: do everything but the kernel |
Referenced by madness::FunctionImpl< T, NDIM >::recursive_apply_op< opT, LDIM >::operator()(), and madness::FunctionImpl< T, NDIM >::recursive_apply_op2< opT >::operator()().
|
inline |
for fine-grain parallelism: call the apply method of an operator in a separate task
[in] | op | the operator working on our function |
[in] | c | full rank tensor holding the NS coefficients |
[in] | args | laziness holding norm of the coefficients, displacement, destination, .. |
|
inline |
same as do_apply_kernel, but use full rank tensors as input and low rank tensors as output
[in] | op | the operator working on our function |
[in] | c | full rank tensor holding the NS coefficients |
[in] | args | laziness holding norm of the coefficients, displacement, destination, .. |
[in] | apply_targs | TensorArgs with tightened threshold for accumulation |
Referenced by madness::FunctionImpl< Q, NDIM >::do_apply_directed_screening().
|
inline |
same as do_apply_kernel2, but use low rank tensors as input and low rank tensors as output
[in] | op | the operator working on our function |
[in] | c | full rank tensor holding the NS coefficients |
[in] | args | laziness holding norm of the coefficients, displacement, destination, .. |
[in] | apply_targs | TensorArgs with tightened threshold for accumulation |
Referenced by madness::FunctionImpl< Q, NDIM >::do_apply_directed_screening().
|
inline |
Invoked as a task by do_binary_op with the actual coefficients.
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::DerivativeBase< T, NDIM >::do_diff1().
|
inline |
Invoked as a task by mul with the actual coefficients.
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,
[in] | filename | where the quadrature points will be written to |
[in] | keys | all leaf keys |
References c, madness::FunctionDefaults< NDIM >::get_cell(), madness::FunctionDefaults< NDIM >::get_cell_width(), madness::Key< NDIM >::level(), MADNESS_EXCEPTION, NDIM, and madness::Key< NDIM >::translation().
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
References madness::FunctionDefaults< NDIM >::get_cell().
void madness::FunctionImpl< T, NDIM >::do_print_tree | ( | const keyT & | key, |
std::ostream & | os, | ||
Level | maxlevel | ||
) | const |
void madness::FunctionImpl< T, NDIM >::do_print_tree_graphviz | ( | const keyT & | key, |
std::ostream & | os, | ||
Level | maxlevel | ||
) | const |
|
inline |
compute the inner product of two nodes of only some dimensions and accumulate on result
invoked by result
[in] | fcoeff | coefficients of high dimension LDIM+NDIM |
[in] | gpair | key and coeffs of low dimension LDIM (possibly a parent node) |
[in] | gkey | key of actual low dim node (possibly the same as gpair.first, iff gnode exists) |
[in] | dest | destination node for the result |
[in] | dim | which dimensions should be contracted: 0..LDIM-1 or LDIM..NDIM+LDIM-1 |
Void madness::FunctionImpl< T, NDIM >::do_square_inplace | ( | const keyT & | key | ) |
Void madness::FunctionImpl< T, NDIM >::do_square_inplace2 | ( | const keyT & | parent, |
const keyT & | child, | ||
const tensorT & | parent_coeff | ||
) |
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
[in] | key | key of level n |
[in] | v | vector of sum coefficients of level n+1 |
[in] | args | TensorArguments for possible low rank approximations |
References madness::general_transform(), and NDIM.
Void madness::FunctionImpl< T, NDIM >::erase | ( | const Level & | max_level | ) |
truncate tree at a certain level
References madness::Key< NDIM >::level(), and madness::FunctionNode< T, NDIM >::set_has_children().
|
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
Referenced by madness::FunctionImpl< T, NDIM >::do_err_box< opT >::operator()().
|
inline |
Returns the sum of squares of errors from local info ... no comms.
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(), NDIM, PROFILE_BLOCK, PROFILE_MEMBER_FUNC, madness::ref(), and madness::Key< NDIM >::translation().
T madness::FunctionImpl< T, NDIM >::eval_cube | ( | Level | n, |
coordT & | x, | ||
const tensorT & | c | ||
) | const |
References c, madness::legendre_scaling_functions(), MADNESS_EXCEPTION, NDIM, PROFILE_MEMBER_FUNC, sqrt(), mpfr::sum(), and std::tr1::T().
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(), NDIM, and madness::Key< NDIM >::translation().
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
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(), NDIM, and PROFILE_MEMBER_FUNC.
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(), NDIM, PROFILE_BLOCK, PROFILE_MEMBER_FUNC, madness::ref(), and madness::Key< NDIM >::translation().
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(), NDIM, PROFILE_BLOCK, PROFILE_MEMBER_FUNC, madness::GenTensor< T >::rank(), madness::ref(), and madness::Key< NDIM >::translation().
bool madness::FunctionImpl< T, NDIM >::exists_and_has_children | ( | const keyT & | key | ) | const |
bool madness::FunctionImpl< T, NDIM >::exists_and_is_leaf | ( | const keyT & | key | ) | const |
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.
References madness::fcube().
Referenced by madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::eri_values(), madness::FunctionImpl< Q, NDIM >::err_box(), and madness::FunctionImpl< Q, NDIM >::inner_ext_node().
void madness::FunctionImpl< T, NDIM >::fcube | ( | const keyT & | key, |
T(*)(const coordT &) | f, | ||
const Tensor< double > & | qx, | ||
tensorT & | fval | ||
) | const |
References madness::f, and madness::fcube().
|
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
Referenced by madness::FunctionImpl< Q, NDIM >::do_binary_op(), madness::FunctionImpl< Q, NDIM >::do_mul(), and madness::FunctionImpl< T, NDIM >::do_unary_op_value_inplace< opT >::operator()().
|
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
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.
Returns a new tensor and has no side effects. Works for any number of dimensions.
No communication involved.
References madness::fast_transform().
Referenced by madness::FunctionImpl< Q, NDIM >::gaxpy_ext_recursive(), and madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::operator()().
FunctionImpl< T, NDIM >::coeffT madness::FunctionImpl< T, NDIM >::filter | ( | const coeffT & | s | ) | const |
References madness::transform().
double madness::FunctionImpl< T, NDIM >::finalize_apply | ( | const bool | fence = true | ) |
after apply we need to do some cleanup;
References madness::nonstandard(), madness::TensorArgs::thresh, and madness::wall_time().
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
Referenced by madness::CoeffTracker< T, LDIM >::activate().
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
References madness::TaskAttributes::hipri(), PROFILE_BLOCK, PROFILE_MEMBER_FUNC, and madness::Future< T >::remote_ref().
|
inline |
Unary operation applied inplace to the coefficients WITHOUT refinement, optional fence.
Referenced by madness::FunctionImpl< T, NDIM >::average(), and madness::FunctionImpl< Q, NDIM >::merge_trees().
|
inline |
Unary operation applied inplace to the coefficients WITHOUT refinement, optional fence.
|
inline |
traverse a non-existing tree
part II: activate coeff_op, i.e. retrieve all the necessary remote boxes (communication)
[in] | coeff_op | operator making the coefficients that needs activation |
[in] | apply_op | just passing thru |
[in] | key | the key we are working on |
Referenced by madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::continue_recursion().
|
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.
|
inline |
|
inline |
Return the gaxpy product with an external function on a specified function node.
[in] | key | Key of the function node on which to compute gaxpy |
[in] | lc | Tensor of coefficients for the function at the function node given by key |
[in] | f | Pointer to function of type T that takes coordT arguments. This is the externally provided function and the right argument of gaxpy. |
[in] | alpha | prefactor of c Tensor for gaxpy |
[in] | beta | prefactor of fcoeffs for gaxpy |
Referenced by madness::FunctionImpl< Q, NDIM >::gaxpy_ext_recursive().
|
inline |
Return out of place gaxpy using recursive descent.
[in] | key | Key of the function node on which to compute gaxpy |
[in] | left | FunctionImpl, left argument of gaxpy |
[in] | lc | coefficients of left at this node |
[in] | c | coefficients of gaxpy product at this node |
[in] | f | pointer to function of type T that takes coordT arguments. This is the externally provided function and the right argument of gaxpy. |
[in] | alpha | prefactor of left argument for gaxpy |
[in] | beta | prefactor of right argument for gaxpy |
[in] | tol | convergence tolerance...when the norm of the gaxpy's difference coefficients is less than tol, we are done. |
|
inline |
Inplace general bilinear operation.
|
inline |
perform inplace gaxpy: this = alpha*this + beta*other
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.
[in] | alpha | prefactor for f |
[in] | f | first addend |
[in] | beta | prefactor for g |
[in] | g | second addend |
References madness::FunctionImpl< T, NDIM >::is_compressed().
bool madness::FunctionImpl< T, NDIM >::get_autorefine | ( | ) | const |
const FunctionCommonData< T, NDIM > & madness::FunctionImpl< T, NDIM >::get_cdata | ( | ) | const |
const FunctionImpl< T, NDIM >::dcT & madness::FunctionImpl< T, NDIM >::get_coeffs | ( | ) | const |
Referenced by madness::FunctionImpl< Q, NDIM >::apply_source_driven(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::continue_recursion(), madness::DerivativeBase< T, NDIM >::do_diff1(), madness::DerivativeBase< T, NDIM >::find_neighbor(), madness::DerivativeBase< T, NDIM >::forward_do_diff1(), madness::FunctionImpl< Q, NDIM >::hartree_product(), madness::leaf_op< T, NDIM >::operator()(), madness::insert_op< T, NDIM >::operator()(), madness::FunctionImpl< T, NDIM >::do_check_symmetry_local::operator()(), madness::FunctionImpl< T, NDIM >::do_merge_trees< Q, R >::operator()(), madness::FunctionImpl< T, NDIM >::do_mapdim::operator()(), madness::FunctionImpl< T, NDIM >::do_average::operator()(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::operator()(), and madness::FunctionImpl< T, NDIM >::project_out_op< LDIM >::operator()().
FunctionImpl< T, NDIM >::dcT & madness::FunctionImpl< T, NDIM >::get_coeffs | ( | ) |
std::shared_ptr< FunctionFunctorInterface< T, NDIM > > madness::FunctionImpl< T, NDIM >::get_functor | ( | ) |
std::shared_ptr< FunctionFunctorInterface< T, NDIM > > madness::FunctionImpl< T, NDIM >::get_functor | ( | ) | const |
int madness::FunctionImpl< T, NDIM >::get_k | ( | ) | const |
Referenced by madness::FunctionImpl< Q, NDIM >::NS_fcube_for_mul(), madness::FunctionImpl< Q, NDIM >::NScoeffs2values(), madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::operator()(), madness::FunctionImpl< T, NDIM >::recursive_apply_op< opT, LDIM >::operator()(), madness::FunctionImpl< T, NDIM >::parent_to_child_NS(), and madness::FunctionImpl< Q, NDIM >::values2NScoeffs().
Future< double > madness::FunctionImpl< T, NDIM >::get_norm_tree_recursive | ( | const keyT & | key | ) | const |
const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > & madness::FunctionImpl< T, NDIM >::get_pmap | ( | ) | const |
TensorArgs madness::FunctionImpl< T, NDIM >::get_tensor_args | ( | ) | const |
Referenced by madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::continue_recursion(), madness::DerivativeBase< T, NDIM >::find_neighbor(), madness::FunctionImpl< T, NDIM >::do_mapdim::operator()(), madness::FunctionImpl< T, NDIM >::do_unary_op_value_inplace< opT >::operator()(), madness::FunctionImpl< T, NDIM >::add_op::operator()(), madness::FunctionImpl< T, NDIM >::hartree_op< LDIM, leaf_opT >::operator()(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::operator()(), and madness::FunctionImpl< T, NDIM >::parent_to_child_NS().
TensorType madness::FunctionImpl< T, NDIM >::get_tensor_type | ( | ) | const |
double madness::FunctionImpl< T, NDIM >::get_thresh | ( | ) | const |
References thresh.
Referenced by madness::FunctionImpl< T, NDIM >::recursive_apply_op< opT, LDIM >::finalize(), madness::FunctionImpl< T, NDIM >::recursive_apply_op2< opT >::finalize(), madness::error_leaf_op< T, NDIM >::operator()(), madness::hartree_leaf_op< T, NDIM >::operator()(), madness::op_leaf_op< T, NDIM, opT >::operator()(), madness::hartree_convolute_leaf_op< T, NDIM, LDIM, opT >::operator()(), madness::FunctionImpl< T, NDIM >::do_truncate_NS_leafs::operator()(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::operator()(), and madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::screen().
|
inline |
given two functions of LDIM, perform the Hartree/Kronecker/outer product
|Phi(1,2)> = |phi(1)> x |phi(2)>
[in] | p1 | FunctionImpl of particle 1 |
[in] | p2 | FunctionImpl of particle 2 |
[in] | leaf_op | operator determining of a given box will be a leaf |
|
inline |
Return the local part of inner product with external function ... no communication.
[in] | f | Pointer to function of type T that take coordT arguments. This is the externally provided function |
[in] | leaf_refine | boolean switch to turn on/off refinement past leaf nodes |
|
inline |
Return the local part of inner product with external function ... no communication.
[in] | f | Reference to FunctionFunctorInterface. This is the externally provided function |
[in] | leaf_refine | boolean switch to turn on/off refinement past leaf nodes |
|
inline |
Return the inner product with an external function on a specified function node.
[in] | key | Key of the function node to compute the inner product on. (the domain of integration) |
[in] | c | Tensor of coefficients for the function at the function node given by key |
[in] | f | Pointer to function of type T that take coordT arguments. This is the externally provided function |
Referenced by madness::FunctionImpl< Q, NDIM >::inner_ext_recursive().
|
inline |
Return the inner product with an external function on a specified function node.
[in] | key | Key of the function node to compute the inner product on. (the domain of integration) |
[in] | c | Tensor of coefficients for the function at the function node given by key |
[in] | f | Reference to FunctionFunctorInterface. This is the externally provided function |
|
inline |
Call inner_ext_node recursively until convergence.
[in] | key | Key of the function node on which to compute inner product (the domain of integration) |
[in] | c | coeffs for the function at the node given by key |
[in] | f | Pointer to function of type T that take coordT arguments. This is the externally provided function |
[in] | leaf_refine | boolean switch to turn on/off refinement past leaf nodes |
[in] | old_inner | the inner product on the parent function node |
Referenced by madness::FunctionImpl< Q, NDIM >::inner_ext_recursive(), madness::FunctionImpl< T, NDIM >::do_inner_ext_local::operator()(), and madness::FunctionImpl< T, NDIM >::do_inner_ext_local_ffi::operator()().
|
inline |
Call inner_ext_node recursively until convergence.
[in] | key | Key of the function node on which to compute inner product (the domain of integration) |
[in] | c | coeffs for the function at the node given by key |
[in] | f | Reference to FunctionFunctorInterface. This is the externally provided function |
[in] | leaf_refine | boolean switch to turn on/off refinement past leaf nodes |
[in] | old_inner | the inner product on the parent function node |
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< Q, NDIM >::FunctionImpl().
bool madness::FunctionImpl< T, NDIM >::is_compressed | ( | ) | const |
Returns true if the function is compressed.
Referenced by madness::FunctionImpl< Q, NDIM >::apply_1d_realspace_push(), madness::CoeffTracker< T, LDIM >::coeff(), and madness::FunctionImpl< T, NDIM >::gaxpy_oop_reconstructed().
bool madness::FunctionImpl< T, NDIM >::is_nonstandard | ( | ) | const |
References madness::nonstandard().
Referenced by madness::CoeffTracker< T, LDIM >::coeff().
bool & madness::FunctionImpl< T, NDIM >::is_on_demand | ( | ) |
Referenced by madness::CompositeFunctorInterface< T, NDIM, MDIM >::CompositeFunctorInterface(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::eri_values(), madness::FunctionImpl< Q, NDIM >::FunctionImpl(), madness::Function< double, 6 >::mul_on_demand(), and madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::Vphi_op_NS().
const bool & madness::FunctionImpl< T, NDIM >::is_on_demand | ( | ) | const |
bool madness::FunctionImpl< T, NDIM >::is_redundant | ( | ) | const |
Returns true if the function is redundant.
const FunctionImpl< T, NDIM >::keyT & madness::FunctionImpl< T, NDIM >::key0 | ( | ) | const |
|
inline |
std::vector< typename FunctionImpl< T, NDIM >::keyT > madness::FunctionImpl< T, NDIM >::local_leaf_keys | ( | ) | const |
return the keys of the local leaf boxes
References madness::FunctionNode< T, NDIM >::is_leaf().
madness::FunctionImpl< T, NDIM >::MADNESS_ASSERT | ( | this-> | is_redundant() = =g.is_redundant() | ) |
Referenced by madness::FunctionImpl< Q, NDIM >::apply(), madness::FunctionImpl< Q, NDIM >::apply_1d_realspace_push(), madness::FunctionImpl< Q, NDIM >::apply_source_driven(), madness::FunctionImpl< Q, NDIM >::binaryXXa(), madness::FunctionImpl< Q, NDIM >::do_apply_kernel2(), madness::FunctionImpl< Q, NDIM >::do_project_out(), madness::FunctionImpl< Q, NDIM >::forward_traverse(), madness::FunctionImpl< Q, NDIM >::FunctionImpl(), madness::FunctionImpl< Q, NDIM >::gaxpy_ext_recursive(), madness::FunctionImpl< Q, NDIM >::gaxpy_inplace(), madness::FunctionImpl< T, NDIM >::hartree_op< LDIM, leaf_opT >::hartree_op(), madness::FunctionImpl< Q, NDIM >::hartree_product(), madness::FunctionImpl< Q, NDIM >::load(), madness::archive::ArchiveLoadImpl< Archive, const FunctionImpl< T, NDIM > * >::load(), madness::archive::ArchiveLoadImpl< Archive, FunctionImpl< T, NDIM > * >::load(), madness::FunctionImpl< Q, NDIM >::make_Vphi(), madness::FunctionImpl< Q, NDIM >::merge_trees(), madness::FunctionImpl< Q, NDIM >::mulXXa(), madness::FunctionImpl< Q, NDIM >::mulXXveca(), madness::FunctionImpl< Q, NDIM >::NS_fcube_for_mul(), madness::FunctionImpl< Q, NDIM >::NScoeffs2values(), madness::FunctionImpl< T, NDIM >::do_check_symmetry_local::operator()(), madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::operator()(), madness::FunctionImpl< T, NDIM >::project_out_op< LDIM >::operator()(), madness::FunctionImpl< Q, NDIM >::read_grid(), madness::FunctionImpl< Q, NDIM >::read_grid2(), madness::FunctionImpl< T, NDIM >::recursive_apply_op< opT, LDIM >::recursive_apply_op(), madness::FunctionImpl< Q, NDIM >::refine_op(), madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::screen(), madness::FunctionImpl< Q, NDIM >::traverse_tree(), madness::FunctionImpl< Q, NDIM >::values2NScoeffs(), and madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::Vphi_op_NS().
void madness::FunctionImpl< T, NDIM >::make_redundant | ( | const bool | fence | ) |
convert this to redundant, i.e. have sum coefficients on all levels
References madness::compress(), madness::reconstruct(), and madness::standard().
Referenced by madness::CompositeFunctorInterface< T, NDIM, MDIM >::CompositeFunctorInterface(), madness::multiply(), and madness::Function< double, 6 >::project_out().
FunctionImpl< T, NDIM >::coeffT madness::FunctionImpl< T, NDIM >::make_redundant_op | ( | const keyT & | key, |
const std::vector< Future< coeffT > > & | v | ||
) |
similar to compress_op, but insert only the sum coefficients in the tree
[in] | key | this's key |
[in] | v | sum coefficients of the child nodes |
References madness::TensorArgs::thresh.
|
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.
[in] | leaf_op | operator to decide if a given node is a leaf node |
[in] | fence | global fence |
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.
std::size_t madness::FunctionImpl< T, NDIM >::max_depth | ( | ) | const |
Returns the maximum depth of the tree ... collective ... global sum/broadcast.
std::size_t madness::FunctionImpl< T, NDIM >::max_local_depth | ( | ) | const |
Returns the maximum local depth of the tree ... no communications.
References N.
std::size_t madness::FunctionImpl< T, NDIM >::max_nodes | ( | ) | const |
Returns the max number of nodes on a processor.
|
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
[in] | alpha | prefactor for this |
[in] | beta | prefactor for other |
[in] | other | the other function, reconstructed |
Referenced by madness::FunctionImpl< Q, NDIM >::gaxpy_inplace_reconstructed().
std::size_t madness::FunctionImpl< T, NDIM >::min_nodes | ( | ) | const |
Returns the min number of nodes on a processor.
|
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!
[in] | c1 | a tensor holding coefficients |
[in] | c2 | another tensor holding coeffs |
[in] | npt | number of grid points (optional, default is cdata.npt) |
|
inline |
|
inline |
|
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
[in] | f | the NDIM function f=f(1,2) |
[in] | g | the LDIM function g(1) (or g(2)) |
[in] | particle | 1 or 2, as in g(1) or g(2) |
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)
[in] | val_ket | function values of f(1,2) |
[in] | val_pot | function values of g(1) |
[in] | particle | if 0 then g(1), if 1 then g(2) |
References madness::GenTensor< T >::config(), madness::copy(), madness::GenTensor< T >::full_tensor(), madness::GenTensor< T >::rank(), madness::GenTensor< T >::tensor_type(), madness::TT_2D, and madness::TT_FULL.
|
inline |
|
inline |
Referenced by madness::FunctionImpl< Q, NDIM >::mulXX().
|
inline |
|
inline |
Referenced by madness::FunctionImpl< Q, NDIM >::mulXXvec().
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.
References madness::Key< NDIM >::level(), NDIM, and madness::Key< NDIM >::translation().
Referenced by madness::FunctionImpl< Q, NDIM >::do_apply(), and madness::FunctionImpl< Q, NDIM >::do_apply_directed_screening().
bool madness::FunctionImpl< T, NDIM >::noautorefine | ( | const keyT & | key, |
const tensorT & | t | ||
) | const |
Always returns false (for when autorefine is not wanted)
double madness::FunctionImpl< T, NDIM >::norm2sq_local | ( | ) | const |
Returns the square of the local norm ... no comms.
References PROFILE_MEMBER_FUNC.
void madness::FunctionImpl< T, NDIM >::norm_tree | ( | bool | fence | ) |
compute for each FunctionNode the norm of the function inside that node
double madness::FunctionImpl< T, NDIM >::norm_tree_op | ( | const keyT & | key, |
const std::vector< Future< double > > & | v | ||
) |
References PROFILE_MEMBER_FUNC, sqrt(), and mpfr::sum().
Future< double > madness::FunctionImpl< T, NDIM >::norm_tree_spawn | ( | const keyT & | key | ) |
|
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
[in] | child | key of the box in which we compute values |
[in] | parent | key of the parent box holding the coeffs |
[in] | coeff | coeffs of the parent box |
[in] | s_only | sanity check to avoid unintended discard of d coeffs |
|
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().
[in] | key | the key of the current S or NS coeffs, level n |
[in] | coeff | coeffs in S or NS form; if S then d coeffs are assumed zero |
[in] | s_only | sanity check to avoid unintended discard of d coeffs |
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
References madness::Key< NDIM >::is_invalid(), NDIM, PROFILE_MEMBER_FUNC, sqrt(), and madness::transform().
Referenced by madness::CoeffTracker< T, LDIM >::coeff(), madness::FunctionImpl< Q, NDIM >::do_project_out(), madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::operator()(), madness::FunctionImpl< T, NDIM >::add_op::operator()(), madness::FunctionImpl< T, NDIM >::project_out_op< LDIM >::operator()(), and madness::FunctionImpl< T, NDIM >::parent_to_child_NS().
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
[in] | child | the key whose coeffs we are requesting |
[in] | parent | the (leaf) key of our function |
[in] | coeff | the (leaf) coeffs belonging to parent |
References madness::BaseTensor::dim(), madness::f, madness::GenTensor< T >::full_tensor_copy(), madness::FunctionImpl< T, NDIM >::get_k(), madness::FunctionImpl< T, NDIM >::get_tensor_args(), madness::Key< NDIM >::level(), MADNESS_EXCEPTION, and madness::FunctionImpl< T, NDIM >::parent_to_child().
Referenced by madness::CoeffTracker< T, LDIM >::coeff().
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.
References madness::legendre_scaling_functions(), mu, PROFILE_MEMBER_FUNC, and madness::scale().
Referenced by madness::FunctionImpl< Q, NDIM >::fcube_for_mul(), and madness::FunctionImpl< Q, NDIM >::NS_fcube_for_mul().
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 |
References madness::Key< NDIM >::level(), max, mpfr::min(), NDIM, mpfr::round(), std::tr1::T(), and madness::Key< NDIM >::translation().
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
void madness::FunctionImpl< T, NDIM >::print_info | ( | ) | const |
Prints summary of data distribution.
References madness::FunctionNode< T, NDIM >::is_leaf().
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
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
[in] | xaxis | the x-axis in the plot (can be any axis of the MRA box) |
[in] | yaxis | the y-axis in the plot (can be any axis of the MRA box) |
[in] | el2 |
References 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(), madness::Key< NDIM >::level(), op(), madness::GenTensor< T >::rank(), madness::scale(), sqrt(), madness::Key< NDIM >::thisKeyContains(), and madness::Key< NDIM >::translation().
void madness::FunctionImpl< T, NDIM >::print_size | ( | const std::string | name | ) | const |
print tree size and size
References madness::norm(), sqrt(), std::tr1::T(), and madness::wall_time().
void madness::FunctionImpl< T, NDIM >::print_stats | ( | ) | const |
print the number of configurations per node
References madness::FunctionNode< T, NDIM >::coeff(), mpfr::dim(), madness::FunctionNode< T, NDIM >::has_coeff(), m, NDIM, madness::print(), madness::GenTensor< T >::rank(), and madness::TT_FULL.
void madness::FunctionImpl< T, NDIM >::print_timer | ( | ) | const |
void madness::FunctionImpl< T, NDIM >::print_tree | ( | std::ostream & | os = std::cout , |
Level | maxlevel = 10000 |
||
) | const |
void madness::FunctionImpl< T, NDIM >::print_tree_graphviz | ( | std::ostream & | os = std::cout , |
Level | maxlevel = 10000 |
||
) | const |
Tensor< T > madness::FunctionImpl< T, NDIM >::project | ( | const keyT & | key | ) | const |
Compute by projection the scaling function coeffs in specified box.
References madness::fast_transform(), madness::fcube(), madness::Key< NDIM >::level(), MADNESS_EXCEPTION, NDIM, PROFILE_MEMBER_FUNC, and sqrt().
void madness::FunctionImpl< T, NDIM >::project | ( | const implT & | old, |
bool | fence | ||
) |
Projects old function into new basis (only in reconstructed form)
References madness::WorldContainer< keyT, valueT, hashfunT >::begin(), c, madness::FunctionNode< T, NDIM >::coeff(), madness::WorldContainer< keyT, valueT, hashfunT >::end(), madness::FunctionNode< T, NDIM >::has_coeff(), mpfr::min(), and NDIM.
|
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
[in] | result | lo-dim function of NDIM-LDIM |
[in] | g | lo-dim function of LDIM |
[in] | dim | over which dimensions to be integrated: 0..LDIM or LDIM..LDIM+NDIM-1 |
|
inline |
project the low-dim function g on the hi-dim function f: this(x) = <f(x,y) | g(y)>
invoked by result, a function of NDIM
[in] | f | hi-dim function of LDIM+NDIM |
[in] | g | lo-dim function of LDIM |
[in] | dim | over which dimensions to be integrated: 0..LDIM or LDIM..LDIM+NDIM-1 |
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.
project the functor into this functionimpl, and "return" a tree in reconstructed, rank-reduced form.
[in] | key | current FunctionNode |
[in] | do_refine | |
[in] | specialpts | in case these are very spiky functions – don't undersample |
References madness::copy(), madness::FunctionDefaults< NDIM >::get_bc(), madness::Key< NDIM >::is_neighbor_of(), madness::BoundaryConditions< NDIM >::is_periodic(), madness::Key< NDIM >::level(), PROFILE_BLOCK, PROFILE_MEMBER_FUNC, madness::project(), simpt2key(), std::tr1::T(), and thresh.
Referenced by madness::FunctionImpl< Q, NDIM >::FunctionImpl().
Void madness::FunctionImpl< T, NDIM >::put_in_box | ( | ProcessID | from, |
long | nl, | ||
long | ni | ||
) | const |
|
inline |
read data from a grid
[in] | keyfile | file with keys and grid points for each key |
[in] | gridfile | file with grid points, w/o key, but with same ordering |
[in] | vnuc_functor | subtract the values of this functor if regularization is needed |
|
inline |
read data from a grid
[in] | gridfile | file with keys and grid points and values for each key |
[in] | vnuc_functor | subtract the values of this functor if regularization is needed |
std::size_t madness::FunctionImpl< T, NDIM >::real_size | ( | ) | const |
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 mpfr::sum().
void madness::FunctionImpl< T, NDIM >::reconstruct | ( | bool | fence | ) |
References madness::nonstandard().
Void madness::FunctionImpl< T, NDIM >::reconstruct_op | ( | const keyT & | key, |
const coeffT & | s | ||
) |
References madness::FunctionNode< T, NDIM >::clear_coeff(), madness::FunctionNode< T, NDIM >::coeff(), madness::copy(), madness::BaseTensor::dim(), madness::FunctionNode< T, NDIM >::has_children(), madness::FunctionNode< T, NDIM >::has_coeff(), madness::GenTensor< T >::has_data(), madness::GenTensor< T >::has_no_data(), madness::FunctionNode< T, NDIM >::is_leaf(), madness::Key< NDIM >::level(), PROFILE_BLOCK, PROFILE_MEMBER_FUNC, madness::GenTensor< T >::reduce_rank(), madness::FunctionNode< T, NDIM >::set_coeff(), madness::FunctionNode< T, NDIM >::set_has_children(), and thresh.
|
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.
[in] | op | the operator acting on the NS tree |
[in] | fimpl | the funcimpl of the function of particle 1 |
[in] | gimpl | the funcimpl of the function of particle 2 |
|
inline |
traverse an existing tree and apply an operator
invoked by result
[in] | op | the operator acting on the NS tree |
[in] | fimpl | the funcimpl of the source function |
[in] | rimpl | a dummy function for recursive_op to insert data |
return world taskq madness::FunctionImpl< T, NDIM >::reduce | ( | rangeT(coeffs.begin(), coeffs.end()) | , |
do_inner_local< R > &, | leaves_only | ||
) |
void madness::FunctionImpl< T, NDIM >::reduce_rank | ( | const TensorArgs & | targs, |
bool | fence | ||
) |
reduce the rank of the coefficients tensors
[in] | targs | target tensor arguments (threshold and full/low rank) |
|
inline |
|
inline |
|
inline |
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.
v] | is the vector of functions we are refining. |
key] | is the current node. |
c] | is the vector of coefficients passed from above. |
References madness::copy().
void madness::FunctionImpl< T, NDIM >::reset_timer | ( | ) |
void madness::FunctionImpl< T, NDIM >::scale_inplace | ( | const T | q, |
bool | fence | ||
) |
In-place scale by a constant.
Referenced by madness::FunctionImpl< Q, NDIM >::gaxpy_inplace().
|
inline |
Out-of-place scale by a constant.
void madness::FunctionImpl< T, NDIM >::set_autorefine | ( | bool | value | ) |
void madness::FunctionImpl< T, NDIM >::set_functor | ( | const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > | functor1 | ) |
void madness::FunctionImpl< T, NDIM >::set_thresh | ( | double | value | ) |
References thresh.
Key< NDIM > madness::FunctionImpl< T, NDIM >::simpt2key | ( | const coordT & | pt, |
Level | n | ||
) | const |
Returns the box at level n that contains the given point in simulation coordinates.
References NDIM.
std::size_t madness::FunctionImpl< T, NDIM >::size | ( | ) | const |
Returns the number of coefficients in the function ... collective global sum.
References madness::FunctionNode< T, NDIM >::has_coeff(), NDIM, madness::FunctionNode< T, NDIM >::size(), and mpfr::sum().
Referenced by madness::FunctionImpl< Q, NDIM >::mulXXveca().
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.
References madness::FunctionNode< T, NDIM >::coeff(), madness::FunctionNode< T, NDIM >::has_coeff(), madness::TaskAttributes::hipri(), madness::Key< NDIM >::parent(), PROFILE_BLOCK, PROFILE_MEMBER_FUNC, madness::ref(), and madness::Future< T >::set().
Referenced by madness::DerivativeBase< T, NDIM >::find_neighbor(), and madness::FunctionImpl< Q, NDIM >::project_out2().
Void madness::FunctionImpl< T, NDIM >::sock_it_to_me_too | ( | const keyT & | key, |
const RemoteReference< FutureImpl< std::pair< keyT, coeffT > > > & | ref | ||
) | const |
As above, except 3) The coeffs are constructed from the avg of nodes further down the tree
References madness::FunctionNode< T, NDIM >::coeff(), madness::FunctionNode< T, NDIM >::has_coeff(), madness::TaskAttributes::hipri(), madness::Key< NDIM >::parent(), PROFILE_BLOCK, PROFILE_MEMBER_FUNC, madness::project(), madness::ref(), and madness::Future< T >::set().
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.
void madness::FunctionImpl< T, NDIM >::standard | ( | bool | fence | ) |
Changes non-standard compressed form to standard compressed form.
References madness::nonstandard().
|
inline |
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.
Void madness::FunctionImpl< T, NDIM >::sum_down_spawn | ( | const keyT & | key, |
const coeffT & | s | ||
) |
is this the same as trickle_down() ?
References c, madness::FunctionNode< T, NDIM >::clear_coeff(), madness::FunctionNode< T, NDIM >::coeff(), madness::copy(), madness::FunctionNode< T, NDIM >::has_children(), madness::GenTensor< T >::has_data(), and madness::BaseTensor::size().
Referenced by madness::FunctionImpl< Q, NDIM >::gaxpy_inplace_reconstructed().
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< Q, NDIM >::mul().
typedef madness::FunctionImpl< T, NDIM >::TENSOR_RESULT_TYPE | ( | T | , |
R | |||
) |
void madness::FunctionImpl< T, NDIM >::tnorm | ( | const tensorT & | t, |
double * | lo, | ||
double * | hi | ||
) | const |
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(), and PROFILE_MEMBER_FUNC.
Referenced by madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::screen().
T madness::FunctionImpl< T, NDIM >::trace_local | ( | ) | const |
Returns int(f(x),x)
in local volume.
References madness::FunctionNode< T, NDIM >::coeff(), madness::GenTensor< T >::full_tensor_copy(), madness::FunctionNode< T, NDIM >::has_coeff(), madness::Key< NDIM >::level(), NDIM, PROFILE_MEMBER_FUNC, sqrt(), mpfr::sum(), and std::tr1::T().
|
inline |
traverse a non-existing tree
part I: make the coefficients, process them and continue the recursion if necessary
[in] | coeff_op | operator making the coefficients and determining them being leaves |
[in] | apply_op | operator processing the coefficients |
[in] | key | the key we are currently working on |
std::size_t madness::FunctionImpl< T, NDIM >::tree_size | ( | ) | const |
Returns the size of the tree structure of the function ... collective global sum.
References mpfr::sum(), and mpfr::mpreal::sum.
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::nonstandard().
Void madness::FunctionImpl< T, NDIM >::trickle_down_op | ( | const keyT & | key, |
const coeffT & | s | ||
) |
sum all the contributions from all scales after applying an operator in mod-NS form
cf reconstruct_op
References madness::FunctionNode< T, NDIM >::clear_coeff(), madness::FunctionNode< T, NDIM >::coeff(), madness::FunctionNode< T, NDIM >::has_children(), madness::GenTensor< T >::has_no_data(), madness::Key< NDIM >::level(), PROFILE_BLOCK, madness::GenTensor< T >::reduce_rank(), and thresh.
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
References thresh.
bool madness::FunctionImpl< T, NDIM >::truncate_op | ( | const keyT & | key, |
double | tol, | ||
const std::vector< Future< bool > > & | v | ||
) |
Actually do the truncate operation.
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, PROFILE_MEMBER_FUNC, madness::FunctionNode< T, NDIM >::set_coeff(), and madness::FunctionNode< T, NDIM >::set_has_children().
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
References madness::copy(), madness::error(), madness::FunctionNode< T, NDIM >::set_has_children(), and sqrt().
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::TaskAttributes::hipri(), and 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.
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, and PROFILE_MEMBER_FUNC.
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, mpfr::min(), and NDIM.
Referenced by madness::FunctionImpl< Q, NDIM >::apply_1d_realspace_push_op(), madness::FunctionImpl< Q, NDIM >::do_apply(), madness::FunctionImpl< Q, 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< Q, NDIM >::gaxpy_ext_recursive(), madness::FunctionImpl< Q, NDIM >::mulXXa(), madness::FunctionImpl< Q, NDIM >::mulXXveca(), madness::error_leaf_op< T, NDIM >::operator()(), madness::hartree_leaf_op< T, NDIM >::operator()(), madness::op_leaf_op< T, NDIM, opT >::operator()(), madness::hartree_convolute_leaf_op< T, NDIM, LDIM, opT >::operator()(), madness::FunctionImpl< T, NDIM >::do_truncate_NS_leafs::operator()(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::operator()(), madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::screen(), and madness::FunctionImpl< Q, NDIM >::vtransform_doit().
|
inline |
Unary operation applied inplace to the coefficients WITHOUT refinement, optional fence.
|
inline |
Unary operation applied inplace to the coefficients WITHOUT refinement, optional fence.
|
inline |
Unary operation applied inplace to the values with optional refinement and fence.
|
inline |
|
inline |
|
inline |
void madness::FunctionImpl< T, NDIM >::undo_redundant | ( | const bool | fence | ) |
convert this from redundant to standard reconstructed form
References madness::nonstandard().
Referenced by madness::FunctionImpl< Q, NDIM >::make_Vphi(), madness::multiply(), and madness::Function< double, 6 >::project_out().
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.
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.
References madness::fast_transform().
Referenced by madness::FunctionImpl< Q, NDIM >::binaryXXa(), madness::FunctionImpl< Q, NDIM >::gaxpy_ext_recursive(), madness::FunctionImpl< Q, NDIM >::inner_ext_recursive(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::make_childrens_sum_coeffs(), madness::FunctionImpl< Q, NDIM >::mulXXa(), and madness::FunctionImpl< Q, NDIM >::refine_op().
FunctionImpl< T, NDIM >::coeffT madness::FunctionImpl< T, NDIM >::unfilter | ( | const coeffT & | s | ) | const |
References madness::transform().
void madness::FunctionImpl< T, NDIM >::unset_functor | ( | ) |
Referenced by madness::FunctionImpl< Q, NDIM >::make_Vphi().
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
[in] | key | key of level n+1 |
[in] | coeff | sum coefficients of level n (does NOT belong to key!!) |
[in] | args | TensorArguments for possible low rank approximations |
References madness::general_transform(), NDIM, and madness::Key< NDIM >::translation().
Referenced by madness::error_leaf_op< T, NDIM >::operator()().
|
inline |
Referenced by madness::FunctionImpl< Q, NDIM >::gaxpy_ext_node(), madness::FunctionImpl< Q, NDIM >::inner_ext_node(), madness::FunctionImpl< Q, NDIM >::multiop_values_doit(), madness::FunctionImpl< T, NDIM >::coeff_value_adaptor< Q, opT >::operator()(), madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::operator()(), madness::FunctionImpl< Q, NDIM >::read_grid(), and madness::FunctionImpl< Q, NDIM >::read_grid2().
|
inline |
|
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().
[in] | key | key of the parent of the generation |
[in] | values | tensor holding function values of the 2^NDIM children of key |
void madness::FunctionImpl< T, NDIM >::verify_tree | ( | ) | const |
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::BaseTensor::dim(), madness::FunctionNode< T, NDIM >::has_children(), madness::GenTensor< T >::has_data(), madness::Key< NDIM >::level(), MADNESS_EXCEPTION, madness::Key< NDIM >::parent(), madness::print(), and PROFILE_MEMBER_FUNC.
|
inline |
Transforms a vector of functions left[i] = sum[j] right[j]*c[j,i] using sparsity.
|
inline |
void madness::FunctionImpl< T, NDIM >::zero_norm_tree | ( | ) |
|
friend |
|
mutable |
|
mutable |
NDIM& g madness::FunctionImpl< T, NDIM >::const |
bool madness::FunctionImpl< T, NDIM >::do_new |
AtomicInt madness::FunctionImpl< T, NDIM >::large |
bool madness::FunctionImpl< T, NDIM >::leaves_only =(this->is_redundant()) |
AtomicInt madness::FunctionImpl< T, NDIM >::small |
Timer madness::FunctionImpl< T, NDIM >::timer_accumulate |
Timer madness::FunctionImpl< T, NDIM >::timer_compress_svd |
Timer madness::FunctionImpl< T, NDIM >::timer_filter |
Timer madness::FunctionImpl< T, NDIM >::timer_lr_result |
Timer madness::FunctionImpl< T, NDIM >::timer_target_driven |
World& madness::FunctionImpl< T, NDIM >::world |
Referenced by 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 >::do_check_symmetry_local::operator()(), madness::FunctionImpl< T, NDIM >::recursive_apply_op< opT, LDIM >::operator()(), and madness::FunctionImpl< T, NDIM >::recursive_apply_op2< opT >::operator()().