32#ifndef MADNESS_MRA_MRA_H__INCLUDED
33#define MADNESS_MRA_MRA_H__INCLUDED
48#define FUNCTION_INSTANTIATE_1
49#define FUNCTION_INSTANTIATE_2
50#define FUNCTION_INSTANTIATE_3
51#if !defined(HAVE_IBMBGP) || !defined(HAVE_IBMBGQ)
52#define FUNCTION_INSTANTIATE_4
53#define FUNCTION_INSTANTIATE_5
54#define FUNCTION_INSTANTIATE_6
96 template<
typename T, std::
size_t NDIM>
99 template<
typename T, std::
size_t NDIM>
102 template<
typename T, std::
size_t NDIM>
105 template<
typename T, std::
size_t NDIM>
106 class FunctionFactory;
108 template<
typename T, std::
size_t NDIM>
109 class FunctionFunctorInterface;
111 template<
typename T, std::
size_t NDIM>
114 template<
typename T, std::
size_t NDIM>
117 template<
typename T, std::
size_t NDIM>
120 template<
typename T, std::
size_t NDIM, std::
size_t LDIM,
typename opT>
123 template<
typename T, std::
size_t NDIM,
typename opT>
126 template<
typename T, std::
size_t NDIM>
138 template <
typename T, std::
size_t NDIM>
146 std::shared_ptr< FunctionImpl<T,NDIM> >
impl;
193 if (
this != &
f)
impl =
f.impl;
201 template <
typename R, std::
size_t MDIM>
213 const double eps=1
e-15;
220 for (std::size_t
d=0;
d<
NDIM; ++
d) {
221 if (
xsim[
d] < -eps) {
224 else if (
xsim[
d] < eps) {
228 if (
xsim[
d] > 1.0+eps) {
231 else if (
xsim[
d] > 1.0-eps) {
246 const double eps=1
e-15;
253 for (std::size_t
d=0;
d<
NDIM; ++
d) {
254 if (
xsim[
d] < -eps) {
257 else if (
xsim[
d] < eps) {
261 if (
xsim[
d] > 1.0+eps) {
264 else if (
xsim[
d] > 1.0-eps) {
279 const double eps=1
e-15;
286 for (std::size_t
d=0;
d<
NDIM; ++
d) {
287 if (
xsim[
d] < -eps) {
290 else if (
xsim[
d] < eps) {
294 if (
xsim[
d] > 1.0+eps) {
297 else if (
xsim[
d] > 1.0-eps) {
316 const double eps=1
e-15;
323 for (std::size_t
d=0;
d<
NDIM; ++
d) {
324 if (
xsim[
d] < -eps) {
327 else if (
xsim[
d] < eps) {
331 if (
xsim[
d] > 1.0+eps) {
334 else if (
xsim[
d] > 1.0-eps) {
356 const std::vector<long>& npt,
360 const double eps=1
e-14;
364 for (std::size_t
d=0;
d<
NDIM; ++
d) {
373 for (std::size_t
d=0;
d<
NDIM; ++
d) {
402 impl->world.gop.broadcast(result);
410 T operator()(
double x,
double y=0,
double z=0,
double xx=0,
double yy=0,
double zz=0)
const {
413 if (
NDIM>=2) r[1] = y;
414 if (
NDIM>=3) r[2] = z;
415 if (
NDIM>=4) r[3] = xx;
416 if (
NDIM>=5) r[4] = yy;
417 if (
NDIM>=6) r[5] = zz;
437 impl->world.gop.broadcast(result);
449 template <
typename funcT>
464 template <
typename funcT>
473 impl->world.gop.fence();
490 return impl->is_compressed();
501 return impl->is_reconstructed();
511 return impl ?
impl->is_nonstandard() :
false;
519 return impl ?
impl->is_redundant() :
false;
527 return impl ?
impl->is_redundant_after_merge() :
false;
534 return impl->tree_size();
540 print(
"function",
name,
"not assigned yet");
550 return impl->max_depth();
558 return impl->max_local_depth();
566 return impl->max_nodes();
573 return impl->min_nodes();
588 return impl->size_local();
595 if (!
impl)
return true;
596 return impl->get_autorefine();
606 impl->set_autorefine(value);
614 if (!
impl)
return 0.0;
615 return impl->get_thresh();
625 impl->set_thresh(value);
634 return impl->get_k();
649 if (!
impl)
return *
this;
659 const std::shared_ptr< FunctionImpl<T,NDIM> >&
get_impl()
const {
677 this->impl->set_functor(functor);
678 print(
"set functor in mra.h");
686 template <
typename R>
688 impl = std::shared_ptr<implT>(
new implT(*
f.get_impl(),
f.get_pmap(), zero));
701 const std::shared_ptr< WorldDCPmapInterface< Key<NDIM> > >&
get_pmap()
const {
704 return impl->get_pmap();
752 "function must be compressed or reconstructed for norm2sq_local");
753 return impl->norm2sq_local();
767 impl->world.gop.fence();
882 template <
typename opT>
893 return impl->autorefine_square_test(key, t);
909 bool fence =
true)
const {
938 if (
impl)
impl->print_tree_json(os);
944 os <<
"digraph G {" << std::endl;
945 if (
impl)
impl->print_tree_graphviz(os);
946 os <<
"}" << std::endl;
975 template <
typename opT>
985 template <
typename opT>
995 template <
typename opT>
1024 template <
typename Q>
1054 template <
typename Q,
typename R>
1075 "gaxpy: this must be reconstructed or redundant_after_merge");
1077 "gaxpy: other must be reconstructed or redundant_after_merge");
1093 template <
typename Q>
1105 return gaxpy(
T(1.0), other,
Q(1.0),
true);
1112 template <
typename Q>
1125 return gaxpy(
T(1.0), other,
Q(-1.0),
true);
1132 template <
typename Q>
1177 if (!
impl)
return 0.0;
1179 return impl->trace_local();
1186 if (!
impl)
return 0.0;
1189 impl->world.gop.fence();
1195 template <
typename R>
1214 return impl->dot_local(*(
g.get_impl()));
1221 template<
typename R>
1227 impl->get_coeffs().clear();
1239 template<
typename opT>
1243 impl->get_coeffs().clear();
1254 impl->get_coeffs().clear();
1262 template<
typename opT>
1266 impl->get_coeffs().clear();
1279 impl->get_coeffs().clear();
1290 template<
typename opT>
1294 impl->get_coeffs().clear();
1307 impl->get_coeffs().clear();
1317 template<
size_t LDIM,
size_t KDIM,
typename opT>
1325 impl->finalize_sum();
1331 template<
size_t LDIM,
size_t KDIM>
1338 impl->finalize_sum();
1347 template <
typename R>
1356 if constexpr (std::is_same_v<T,R>) {
1367 if constexpr (std::is_same_v<R,T>) {
1369 return g.inner_on_demand(*
this);
1370 if (
g.is_on_demand())
1425 impl->world.gop.fence();
1438 const bool leaf_refine=
true)
const {
1441 T local =
impl->inner_adaptive_local(
f, leaf_refine);
1443 impl->world.gop.fence();
1451 template <
typename L>
1466 template<
typename R>
1470 constexpr std::size_t
LDIM=std::max(
NDIM/2,std::size_t(1));
1474 func->replicate_low_dim_functions(
true);
1491 template <
typename R,
size_t LDIM>
1506 this->
get_impl()->project_out(result.
get_impl().get(),
g.get_impl().get(),dim,
true);
1510 result.
get_impl()->trickle_down(
false);
1532 template <
typename Archive>
1536 long magic = 0l,
id = 0l, ndim = 0l,
k = 0l;
1537 ar &
magic &
id & ndim &
k;
1553 template <
typename Archive>
1573 template <
typename Q,
typename opT>
1586 template <
typename Q, std::
size_t D>
1589 std::vector< std::shared_ptr< FunctionImpl<Q,D> > > r(
v.size());
1590 for (
unsigned int i=0; i<
v.size(); ++i) r[i] =
v[i].
get_impl();
1595 template <
typename opT>
1597 std::vector<implT*>
v(
vf.size(),
NULL);
1598 for (
unsigned int i=0; i<
v.size(); ++i) {
1614 template <
typename opT>
1618 const bool fence=
true) {
1620 for (
unsigned int i=0; i<
vin.size(); ++i) {
1624 for (
unsigned int i=0; i<
vout.size(); ++i) {
1635 template <
typename L,
typename R>
1643 std::vector<FunctionImpl<T,NDIM>*>
vresult(right.size());
1644 std::vector<const FunctionImpl<R,NDIM>*>
vright(right.size());
1645 for (
unsigned int i=0; i<right.size(); ++i) {
1646 result[i].set_impl(left,
false);
1647 vresult[i] = result[i].impl.get();
1648 vright[i] = right[i].get_impl().get();
1658 template<
typename L,
typename R>
1676 template <
typename R,
typename Q>
1687 template <
typename L,
typename R>
1707 impl.reset(
new implT(*
f.impl,
f.get_pmap(),
false));
1722 impl.reset(
new implT(*
f.impl,
f.get_pmap(),
false));
1737 const std::vector<long>& map,
const std::vector<long>&
mirror,
1743 for (std::size_t i=0; i<map.size(); ++i)
MADNESS_ASSERT(map[i]>=0 &&
static_cast<std::size_t
>(map[i])<
NDIM);
1745 impl.reset(
new implT(*
f.impl,
f.get_pmap(),
false));
1756 double local =
impl->check_symmetry_local();
1758 impl->world.gop.fence();
1760 if (this->
world().rank()==0)
print(
"asymmetry wrt particle",
asy);
1777 impl->chop_at_level(n,
true);
1784 template <
typename T,
typename opT, std::
size_t NDIM>
1793 template <
typename Q,
typename T, std::
size_t NDIM>
1801 result.get_impl()->scale_oop(
alpha,*
f.get_impl(),
fence);
1807 template <
typename Q,
typename T, std::
size_t NDIM>
1818 template <
typename Q,
typename T, std::
size_t NDIM>
1827 template <
typename Q,
typename T, std::
size_t NDIM>
1834 template <
typename L,
typename R,std::
size_t NDIM>
1851 template <
typename L,
typename R,std::
size_t NDIM>
1858 template <
typename L,
typename R,
typename opT, std::
size_t NDIM>
1872 template <
typename Q,
typename opT, std::
size_t NDIM>
1875 if (!
func.is_reconstructed())
func.reconstruct();
1885 template <
typename Q,
typename opT, std::
size_t NDIM>
1899 template <
typename L,
typename R, std::
size_t D>
1912 template <
typename L,
typename R, std::
size_t NDIM>
1918 return mul(left,right,
true);
1924 template<
typename T, std::
size_t KDIM, std::
size_t LDIM>
1940 std::vector<std::shared_ptr<FunctionImpl<T,KDIM>>>
vleft=
get_impl(left);
1941 std::vector<std::shared_ptr<FunctionImpl<T,LDIM>>>
vright=
get_impl(right);
1950 template<
typename T, std::
size_t KDIM, std::
size_t LDIM>
1953 typedef std::vector<Function<T,KDIM>> vector;
1958 template<
typename T, std::
size_t KDIM, std::
size_t LDIM,
typename opT>
1974 print(
"incomplete FunctionFactory in Function::hartree_product");
1983 std::vector<std::shared_ptr<FunctionImpl<T,KDIM>>>
vleft;
1984 std::vector<std::shared_ptr<FunctionImpl<T,LDIM>>>
vright;
1991 left2.world().gop.fence();
1999 template <
typename L,
typename R,std::
size_t NDIM>
2009 template <
typename L,
typename R,std::
size_t NDIM>
2019 template <
typename L,
typename R,std::
size_t NDIM>
2028 template<
typename T, std::
size_t NDIM>
2044 template <
typename L,
typename R, std::
size_t NDIM>
2058 return add(left,right,
true);
2063 template <
typename L,
typename R,std::
size_t NDIM>
2074 template <
typename L,
typename R, std::
size_t NDIM>
2086 return sub(left,right,
true);
2095 template <
typename T, std::
size_t NDIM>
2098 bool fence =
true) {
2103 result.
set_impl(std::shared_ptr<implT>(
new implT(*
f.get_impl(), pmap,
false)));
2110 template <
typename T, std::
size_t NDIM>
2119 template <
typename T, std::
size_t NDIM>
2127 result.
set_impl(std::make_shared<implT>(
world,*
f.get_impl(), pmap,
false));
2142 template <
typename T,
typename Q, std::
size_t NDIM>
2156 template <
typename T, std::
size_t NDIM>
2173 template <
typename opT,
typename T, std::
size_t LDIM>
2180 typedef std::vector<Function<T,LDIM>>
vecfuncL;
2185 bool same=(
ff1[0].get_impl()==
ff2[0].get_impl());
2192 for (
auto&
f :
f1)
f.make_nonstandard(
true,
false);
2193 for (
auto&
f :
f2)
f.make_nonstandard(
true,
false);
2205 for (
size_t i=0; i<
f1.size(); ++i)
2209 if (
op.print_timings) {
2214 result.
get_impl()->finalize_apply();
2216 if (
op.modified()) {
2217 result.
get_impl()->trickle_down(
true);
2219 result.
get_impl()->reconstruct(
true);
2229 template <
typename opT,
typename R, std::
size_t NDIM>
2234 constexpr std::size_t
OPDIM=opT::opdim;
2240 result.get_impl()->apply(
op, *
f.get_impl(),
fence);
2247 r1.set_impl(
f,
false);
2249 result.get_impl()->reset_timer();
2252 result.get_impl()->apply_source_driven(
op, *
f.get_impl(),
fence);
2275 template <
typename opT,
typename R, std::
size_t NDIM>
2290 if (
op.modified()) {
2295 ff.get_impl()->undo_redundant(
false);
2296 result.
get_impl()->trickle_down(
true);
2306 fff.get_impl()->timer_filter.print(
"filter");
2307 fff.get_impl()->timer_compress_svd.print(
"compress_svd");
2311 ff.world().gop.fence();
2324 result.
get_impl()->reconstruct(
true);
2327 if (
op.destructive()) {
2328 ff.world().gop.fence();
2341 template <
typename opT,
typename R, std::
size_t NDIM>
2352 result.get_impl()->apply_1d_realspace_push(
op,
ff.get_impl().get(),
axis,
fence);
2369 template <
typename T, std::
size_t NDIM>
2381 template <
typename T, std::
size_t NDIM>
2398 template <
typename T, std::
size_t NDIM>
2401 const std::vector<long>&
mirror,
bool fence=
true) {
2412 template <
typename T, std::
size_t NDIM>
2413 typename std::enable_if_t<NDIM%2==0, Function<T,NDIM>>
2416 std::vector<long> map(
NDIM);
2438 template <
typename T, std::
size_t NDIM>
2444 std::vector<long> map(
NDIM);
2448 map[0]=3; map[1]=4; map[2]=5;
2449 map[3]=0; map[4]=1; map[5]=2;
2451 map[0]=0; map[1]=2; map[2]=1;
2452 map[3]=3; map[4]=5; map[5]=4;
2455 map[0]=2; map[1]=1; map[2]=0;
2456 map[3]=5; map[4]=4; map[5]=3;
2459 map[0]=1; map[1]=0; map[2]=2;
2460 map[3]=4; map[4]=3; map[5]=5;
2463 if (
f.world().rank()==0) {
2470 result.
get_impl()->average(*
f.get_impl());
2483 template<
typename T, std::
size_t NDIM, std::
size_t LDIM>
2509 template <
typename T, std::
size_t NDIM>
2527 template <
typename T,
typename R, std::
size_t NDIM>
2539 template<std::size_t
NDIM,
typename T, std::size_t
LDIM,
typename R, std::size_t
KDIM,
2543 const std::array<int, CDIM>
v2,
int task=0) {
2548 static_assert((
KDIM +
LDIM -
NDIM) % 2 == 0,
"faulty dimensions in inner (partial version)");
2549 static_assert(
KDIM +
LDIM - 2 *
CDIM ==
NDIM,
"faulty dimensions in inner (partial version)");
2570 f.get_impl()->compute_snorm_and_dnorm(
false);
2571 for (
auto&
g :
vg)
g.get_impl()->compute_snorm_and_dnorm(
false);
2576 std::vector<Function<resultT,NDIM>> result(
vg.size());
2579 for (
int i=0; i<
vg.size(); ++i) {
2581 .k(
f.k()).thresh(
f.thresh()).empty().nofence();
2582 result[i].get_impl()->partial_inner(*
f.get_impl(),*(
vg[i]).get_impl(),
v1,
v2);
2599 for (
auto it=
funcimpl.get_coeffs().begin(); it!=
funcimpl.get_coeffs().end(); ++it) {
2600 const auto& key=it->first;
2601 const auto&
node=it->second;
2609 for (
auto&
g :
vg) {
2615 f_nc.reconstruct(
false);
2629 template<std::size_t
NDIM,
typename T, std::size_t
LDIM,
typename R, std::size_t
KDIM,
2633 const std::array<int, CDIM>
v2,
int task=0) {
2641 template <
typename T, std::
size_t LDIM,
typename R, std::
size_t KDIM>
2645 std::array<int,1>({std::get<0>(
v1)}),
2646 std::array<int,1>({std::get<0>(
v2)}));
2653 template <
typename T, std::
size_t LDIM,
typename R, std::
size_t KDIM>
2657 std::array<int,2>({std::get<0>(
v1),std::get<1>(
v1)}),
2658 std::array<int,2>({std::get<0>(
v2),std::get<1>(
v2)}));
2665 template <
typename T, std::
size_t LDIM,
typename R, std::
size_t KDIM>
2669 std::array<int,3>({std::get<0>(
v1),std::get<1>(
v1),std::get<2>(
v1)}),
2670 std::array<int,3>({std::get<0>(
v2),std::get<1>(
v2),std::get<2>(
v2)}));
2683 template <
typename T,
typename opT, std::
size_t NDIM>
2686 std::shared_ptr< FunctionFunctorInterface<double,3> >
func(
new opT(
g));
2698 template <
typename T,
typename opT, std::
size_t NDIM>
2703 template <
typename T,
typename R, std::
size_t NDIM>
2706 return (
f*
R(1.0)).add_scalar(r);
2709 template <
typename T,
typename R, std::
size_t NDIM>
2712 return (
f*
R(1.0)).add_scalar(r);
2715 template <
typename T,
typename R, std::
size_t NDIM>
2718 return (
f*
R(1.0)).add_scalar(-r);
2721 template <
typename T,
typename R, std::
size_t NDIM>
2724 return (
f*
R(-1.0)).add_scalar(r);
2728 template <std::
size_t NDIM>
2738 template <std::
size_t NDIM>
2748 template <std::
size_t NDIM>
2759 template <std::
size_t NDIM>
2773 template <std::
size_t NDIM>
2779 template <std::
size_t NDIM>
2785 template <std::
size_t NDIM>
2792 template <
typename T, std::
size_t NDIM>
2796 return result.
square(
true);
2800 template <
typename T, std::
size_t NDIM>
2804 return result.
abs(
true);
2808 template <
typename T, std::
size_t NDIM>
2817 template <
typename T, std::
size_t NDIM>
2824 template <std::
size_t NDIM>
2830 template <std::
size_t NDIM>
2840 template <
typename T, std::
size_t NDIM>
2842 if (
f.is_initialized())
return f.get_impl()->get_tree_state();
2853 template <
typename T, std::
size_t NDIM>
2859 template <
typename R, std::
size_t MDIM>
2861 f1.impl.swap(
f2.impl);
2870 template <
class archiveT,
class T, std::
size_t NDIM>
2877 template <
class archiveT,
class T, std::
size_t NDIM>
2885 template <
class T, std::
size_t NDIM>
2891 template <
class T, std::
size_t NDIM>
2904 template<
typename T, std::
size_t NDIM>
double q(double t)
Definition DKops.h:18
This header should include pretty much everything needed for the parallel runtime.
long dim(int i) const
Returns the size of dimension i.
Definition basetensor.h:147
This class is used to specify boundary conditions for all operators.
Definition bc.h:72
CompositeFunctorInterface implements a wrapper of holding several functions and functors.
Definition function_interface.h:165
FunctionDefaults holds default paramaters as static class members.
Definition funcdefaults.h:100
static const double & get_thresh()
Returns the default threshold.
Definition funcdefaults.h:177
static std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > & get_pmap()
Returns the default process map that was last initialized via set_default_pmap()
Definition funcdefaults.h:390
FunctionFactory implements the named-parameter idiom for Function.
Definition function_factory.h:86
virtual FunctionFactory & thresh(double thresh)
Definition function_factory.h:198
virtual FunctionFactory & k(int k)
Definition function_factory.h:193
Abstract base class interface required for functors used as input to Functions.
Definition function_interface.h:68
FunctionImpl holds all Function state to facilitate shallow copy semantics.
Definition funcimpl.h:945
const dcT & get_coeffs() const
Definition mraimpl.h:343
bool is_on_demand() const
Definition mraimpl.h:283
FunctionNode holds the coefficients, etc., at each node of the 2^NDIM-tree.
Definition funcimpl.h:127
A multiresolution adaptive numerical function.
Definition mra.h:139
void print_tree_json(std::ostream &os=std::cout) const
Definition mra.h:936
Tensor< T > eval_cube(const Tensor< double > &cell, const std::vector< long > &npt, bool eval_refine=false) const
Evaluates a cube/slice of points (probably for plotting) ... collective but no fence necessary.
Definition mra.h:355
TENSOR_RESULT_TYPE(T, R) inner(const Function< R
Returns the inner product.
Function< T, NDIM > & map_and_mirror(const Function< T, NDIM > &f, const std::vector< long > &map, const std::vector< long > &mirror, bool fence)
This is replaced with mirror(map(f)) ... private.
Definition mra.h:1736
void gaxpy_ext(const Function< L, NDIM > &left, T(*f)(const coordT &), T alpha, T beta, double tol, bool fence=true) const
Definition mra.h:1452
T inner_adaptive(const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > f, const bool leaf_refine=true) const
Definition mra.h:1437
void unaryop_coeff(const opT &op, bool fence=true)
Unary operation applied inplace to the coefficients.
Definition mra.h:986
bool is_compressed() const
Returns true if compressed, false otherwise. No communication.
Definition mra.h:487
Function< T, NDIM/2 > dirac_convolution(const bool fence=true) const
Definition mra.h:1516
return impl inner_local * g())
void set_impl(const Function< R, NDIM > &f, bool zero=true)
Replace current FunctionImpl with a new one using the same parameters & map as f.
Definition mra.h:687
bool autorefine() const
Returns value of autorefine flag. No communication.
Definition mra.h:593
TreeState operating_state
Definition mra.h:1378
Function< T, NDIM > & add_scalar(T t, bool fence=true)
Inplace add scalar. No communication except for optional fence.
Definition mra.h:1035
void print_size(const std::string name) const
print some info about this
Definition mra.h:538
Function< T, NDIM > & fill_tree(const Function< R, NDIM > &g, bool fence=true)
With this being an on-demand function, fill the MRA tree according to different criteria.
Definition mra.h:1222
void broaden(const BoundaryConditions< NDIM > &bc=FunctionDefaults< NDIM >::get_bc(), bool fence=true) const
Inplace broadens support in scaling function basis.
Definition mra.h:908
void print_info() const
Print a summary of the load balancing info.
Definition mra.h:952
Function< T, NDIM > & scale(const Q q, bool fence=true)
Inplace, scale the function by a constant. No communication except for optional fence.
Definition mra.h:1025
void norm_tree(bool fence=true) const
Initializes information about the function norm at all length scales.
Definition mra.h:773
void load(World &world, Archive &ar)
Replaces this function with one loaded from an archive using the default processor map.
Definition mra.h:1533
Function< T, NDIM > & abs_square(bool fence=true)
Returns *this for chaining.
Definition mra.h:1162
void replicate(const DistributionType type, bool fence=true) const
Definition mra.h:711
double norm2sq_local() const
Returns the square of the norm of the local function ... no communication.
Definition mra.h:748
IsSupported< TensorTypeData< Q >, Function< T, NDIM > >::type & operator*=(const Q q)
Inplace scaling by a constant.
Definition mra.h:1134
void sum_down(bool fence=true) const
Sums scaling coeffs down tree restoring state with coeffs only at leaves. Optional fence....
Definition mra.h:870
Level depthpt(const coordT &xuser) const
Definition mra.h:431
bool is_redundant() const
Returns true if redundant, false otherwise. No communication.
Definition mra.h:517
Function< T, NDIM > & operator+=(const Function< Q, NDIM > &other)
Inplace addition of functions in the wavelet basis.
Definition mra.h:1094
Function< T, NDIM > & operator=(const Function< T, NDIM > &f)
Assignment is shallow. No communication, works in either basis.
Definition mra.h:191
void set_autorefine(bool value, bool fence=true)
Sets the value of the autorefine flag. Optional global fence.
Definition mra.h:603
World & world() const
Returns the world.
Definition mra.h:693
T trace() const
Returns global value of int(f(x),x) ... global comm required.
Definition mra.h:1184
T typeT
Definition mra.h:157
friend void swap(Function< R, MDIM > &f1, Function< R, MDIM > &f2)
implements swap algorithm
Definition mra.h:2860
Function< T, NDIM > & fill_tree(const opT &op, bool fence=true)
With this being an on-demand function, fill the MRA tree according to different criteria.
Definition mra.h:1240
const Function< T, NDIM > & change_tree_state(const TreeState finalstate, bool fence=true) const
changes tree state to given state
Definition mra.h:857
Function< typename opT::resultT, NDIM > & unary_op_coeffs(const Function< Q, NDIM > &func, const opT &op, bool fence)
This is replaced with left*right ... private.
Definition mra.h:1574
void print_tree_graphviz(std::ostream &os=std::cout) const
Process 0 prints a graphviz-formatted output of all nodes in the tree (collective)
Definition mra.h:942
double norm2() const
Returns the 2-norm of the function ... global sum ... works in either basis.
Definition mra.h:760
Function< T, NDIM > & fill_cuspy_tree(const opT &op, const bool fence=true)
Definition mra.h:1263
void change_tensor_type(const TensorArgs &targs, bool fence=true)
change the tensor type of the coefficients in the FunctionNode
Definition mra.h:1566
const Function< T, NDIM > & refine(bool fence=true) const
Inplace autorefines the function using same test as for squaring.
Definition mra.h:902
TENSOR_RESULT_TYPE(T, R) inner_on_demand(const Function< R
Returns the inner product for one on-demand function.
T operator()(const coordT &xuser) const
Evaluates the function at a point in user coordinates. Collective operation.
Definition mra.h:396
MADNESS_ASSERT(g.is_compressed())
Function< T, NDIM > & square(bool fence=true)
Inplace squaring of function ... global comm only if not reconstructed.
Definition mra.h:1144
Function< T, NDIM > & fill_tree(bool fence=true)
With this being an on-demand function, fill the MRA tree according to different criteria.
Definition mra.h:1251
void verify_tree() const
Verifies the tree data structure ... global sync implied.
Definition mra.h:478
Future< Level > evaldepthpt(const coordT &xuser) const
Definition mra.h:277
void do_hartree_product(const std::vector< std::shared_ptr< FunctionImpl< T, LDIM > > > left, const std::vector< std::shared_ptr< FunctionImpl< T, KDIM > > > right)
perform the hartree product of f*g, invoked by result
Definition mra.h:1332
Function< T, NDIM > & mapdim(const Function< T, NDIM > &f, const std::vector< long > &map, bool fence)
This is replaced with mapdim(f) ... private.
Definition mra.h:1702
int k() const
Returns the number of multiwavelets (k). No communication.
Definition mra.h:631
const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > & get_pmap() const
Returns a shared pointer to the process map.
Definition mra.h:701
double thresh() const
Returns value of truncation threshold. No communication.
Definition mra.h:612
Function< T, NDIM > & gaxpy_oop(T alpha, const Function< L, NDIM > &left, T beta, const Function< R, NDIM > &right, bool fence)
This is replaced with alpha*left + beta*right ... private.
Definition mra.h:1688
void set_thresh(double value, bool fence=true)
Sets the value of the truncation threshold. Optional global fence.
Definition mra.h:622
Function< T, NDIM > & multiop_values(const opT &op, const std::vector< Function< T, NDIM > > &vf)
This is replaced with op(vector of functions) ... private.
Definition mra.h:1596
void distribute(std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > newmap) const
distribute this function according to newmap
Definition mra.h:739
void unaryop(const opT &op, bool fence=true)
Inplace unary operation on function values.
Definition mra.h:976
const std::shared_ptr< FunctionImpl< T, NDIM > > & get_impl() const
Returns a shared-pointer to the implementation.
Definition mra.h:659
void standard(bool fence=true)
Converts the function standard compressed form. Possible non-blocking comm.
Definition mra.h:820
void unaryop_node(const opT &op, bool fence=true)
Unary operation applied inplace to the nodes.
Definition mra.h:996
Function< T, NDIM > & truncate(double tol=0.0, bool fence=true)
Truncate the function with optional fence. Compresses with fence if not compressed.
Definition mra.h:647
Function< T, NDIM > & fill_cuspy_tree(const bool fence=true)
Special refinement on 6D boxes where the electrons come close (meet)
Definition mra.h:1276
std::size_t size() const
Returns the number of coefficients in the function ... collective global sum.
Definition mra.h:578
bool is_on_demand() const
Definition mra.h:681
Function< T, NDIM > & operator-=(const Function< Q, NDIM > &other)
Inplace subtraction of functions in the wavelet basis.
Definition mra.h:1113
bool compressed
Definition mra.h:1198
const Function< T, NDIM > & reconstruct(bool fence=true) const
Reconstructs the function, transforming into scaling function basis. Possible non-blocking comm.
Definition mra.h:847
Function< T, NDIM > & abs(bool fence=true)
Returns *this for chaining.
Definition mra.h:1153
Function< T, NDIM > & reduce_rank(const double thresh=0.0, const bool fence=true)
reduce the rank of the coefficient tensors
Definition mra.h:1766
Function< T, NDIM > & mirror(const Function< T, NDIM > &f, const std::vector< long > &mirrormap, bool fence)
This is replaced with mirror(f) ... private.
Definition mra.h:1717
std::size_t max_nodes() const
Returns the max number of nodes on a processor.
Definition mra.h:563
void do_hartree_product(const std::vector< std::shared_ptr< FunctionImpl< T, LDIM > > > left, const std::vector< std::shared_ptr< FunctionImpl< T, KDIM > > > right, const opT *op)
perform the hartree product of f*g, invoked by result
Definition mra.h:1318
std::shared_ptr< FunctionImpl< T, NDIM > > impl
Definition mra.h:146
void replicate_on_hosts(bool fence=true) const
replicate this function, one copy per host
Definition mra.h:732
void replicate(bool fence=true) const
replicate this function, generating a unique pmap
Definition mra.h:722
T trace_local() const
Returns local contribution to int(f(x),x) ... no communication.
Definition mra.h:1175
void mul_on_demand(const Function< L, NDIM > &f, const Function< R, NDIM > &g, bool fence=true)
Same as operator* but with optional fence and no automatic reconstruction.
Definition mra.h:1659
Function< T, NDIM > & gaxpy(const T &alpha, const Function< Q, NDIM > &other, const R &beta, bool fence=true)
Inplace, general bi-linear operation in wavelet basis. No communication except for optional fence.
Definition mra.h:1055
Vector< double, NDIM > coordT
Type of vector holding coordinates.
Definition mra.h:156
void store(Archive &ar) const
Stores the function to an archive.
Definition mra.h:1554
std::size_t max_local_depth() const
Returns the maximum local depth of the function tree ... no communications.
Definition mra.h:555
void vtransform(const std::vector< Function< R, NDIM > > &v, const Tensor< Q > &c, std::vector< Function< T, NDIM > > &vresult, double tol, bool fence=true)
sparse transformation of a vector of functions ... private
Definition mra.h:1677
TENSOR_RESULT_TYPE(T, R) local
std::size_t max_depth() const
Returns the maximum depth of the function tree ... collective global sum.
Definition mra.h:547
Function()
Default constructor makes uninitialized function. No communication.
Definition mra.h:174
std::size_t tree_size() const
Returns the number of nodes in the function tree ... collective global sum.
Definition mra.h:531
Function< TENSOR_RESULT_TYPE(T, R), NDIM-LDIM > project_out(const Function< R, LDIM > &g, const int dim) const
project this on the low-dim function g: h(x) = <f(x,y) | g(y)>
Definition mra.h:1492
static std::vector< std::shared_ptr< FunctionImpl< Q, D > > > vimpl(const std::vector< Function< Q, D > > &v)
Returns vector of FunctionImpl pointers corresponding to vector of functions.
Definition mra.h:1587
FunctionImpl< T, NDIM > implT
Definition mra.h:153
void clear(bool fence=true)
Clears the function as if constructed uninitialized. Optional fence.
Definition mra.h:919
void refine_general(const opT &op, bool fence=true) const
Inplace autorefines the function. Optional fence. Possible non-blocking comm.
Definition mra.h:883
static void doconj(const Key< NDIM >, Tensor< T > &t)
Definition mra.h:1006
std::pair< bool, T > eval_local_only(const Vector< double, NDIM > &xuser, Level maxlevel) const
Evaluate function only if point is local returning (true,value); otherwise return (false,...
Definition mra.h:245
void set_functor(const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > functor)
Replace the current functor with the provided new one.
Definition mra.h:676
bool impl_initialized() const
Definition mra.h:149
Function< T, NDIM > & fill_nuclear_cuspy_tree(const opT &op, const size_t particle, const bool fence=true)
Definition mra.h:1291
bool is_redundant_after_merge() const
Returns true if redundant_after_merge, false otherwise. No communication.
Definition mra.h:525
return local
Definition mra.h:1393
auto func
Definition mra.h:1471
~Function()
Destruction of any underlying implementation is deferred to next global fence.
Definition mra.h:198
Function(const Function< T, NDIM > &f)
Copy constructor is shallow. No communication, works in either basis.
Definition mra.h:185
void set_impl(const std::shared_ptr< FunctionImpl< T, NDIM > > &impl)
Replace current FunctionImpl with provided new one.
Definition mra.h:666
T operator()(double x, double y=0, double z=0, double xx=0, double yy=0, double zz=0) const
Evaluates the function at a point in user coordinates. Collective operation.
Definition mra.h:410
T inner_ext_local(const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > f, const bool leaf_refine=true, const bool keep_redundant=false) const
Definition mra.h:1404
std::size_t min_nodes() const
Returns the min number of nodes on a processor.
Definition mra.h:570
constexpr std::size_t LDIM
Definition mra.h:1470
static constexpr std::size_t dimT
Definition mra.h:158
change_tree_state(operating_state, false)
bool is_nonstandard() const
Returns true if nonstandard-compressed, false otherwise. No communication.
Definition mra.h:509
void verify() const
Asserts that the function is initialized.
Definition mra.h:162
double err(const funcT &func) const
Returns an estimate of the difference ||this-func|| ... global sum performed.
Definition mra.h:465
T inner_ext(const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > f, const bool leaf_refine=true, const bool keep_redundant=false) const
Definition mra.h:1420
void make_redundant(bool fence=true)
Converts the function to redundant form, i.e. sum coefficients on all levels.
Definition mra.h:832
Function< T, NDIM > & fill_nuclear_cuspy_tree(const size_t particle, const bool fence=true)
Special refinement on 6D boxes for the nuclear potentials (regularized with cusp, non-regularized wit...
Definition mra.h:1304
double check_symmetry() const
check symmetry of a function by computing the 2nd derivative
Definition mra.h:1752
void multi_to_multi_op_values(const opT &op, const std::vector< Function< T, NDIM > > &vin, std::vector< Function< T, NDIM > > &vout, const bool fence=true)
apply op on the input vector yielding an output vector of functions
Definition mra.h:1615
FunctionFactory< T, NDIM > factoryT
Definition mra.h:155
std::size_t size_local() const
Return the number of coefficients in the function on this processor.
Definition mra.h:585
const Function< T, NDIM > & compress(bool fence=true) const
Compresses the function, transforming into wavelet basis. Possible non-blocking comm.
Definition mra.h:793
bool is_initialized() const
Returns true if the function is initialized.
Definition mra.h:167
bool is_reconstructed() const
Returns true if reconstructed, false otherwise. No communication.
Definition mra.h:498
Function< T, NDIM > & chop_at_level(const int n, const bool fence=true)
remove all nodes with level higher than n
Definition mra.h:1774
MADNESS_ASSERT(is_compressed())
void vmulXX(const Function< L, NDIM > &left, const std::vector< Function< R, NDIM > > &right, std::vector< Function< T, NDIM > > &result, double tol, bool fence)
Multiplication of function * vector of functions using recursive algorithm of mulxx.
Definition mra.h:1636
double errsq_local(const funcT &func) const
Returns an estimate of the difference ||this-func||^2 from local data.
Definition mra.h:450
void make_nonstandard(bool keepleaves, bool fence=true) const
Compresses the function retaining scaling function coeffs. Possible non-blocking comm.
Definition mra.h:806
if(VERIFY_TREE) verify_tree()
Future< T > eval(const coordT &xuser) const
Evaluates the function at a point in user coordinates. Possible non-blocking comm.
Definition mra.h:211
void print_tree(std::ostream &os=std::cout) const
Process 0 prints a summary of all nodes in the tree (collective)
Definition mra.h:929
FunctionNode< T, NDIM > nodeT
Definition mra.h:154
bool redundant
Definition mra.h:1199
Future< long > evalR(const coordT &xuser) const
Evaluates the function rank at a point in user coordinates. Possible non-blocking comm.
Definition mra.h:314
Function(const factoryT &factory)
Constructor from FunctionFactory provides named parameter idiom. Possible non-blocking communication.
Definition mra.h:178
NDIM &g const
Definition mra.h:1196
void unaryop(T(*f)(T))
Inplace unary operation on function values.
Definition mra.h:967
Function< T, NDIM > conj(bool fence=true)
Inplace complex conjugate. No communication except for optional fence.
Definition mra.h:1014
A future is a possibly yet unevaluated value.
Definition future.h:369
remote_refT remote_ref(World &world) const
Returns a structure used to pass references to another process.
Definition future.h:671
Key is the index for a node of the 2^NDIM-tree.
Definition key.h:69
Traits class to specify support of numeric types.
Definition type_data.h:56
A tensor is a multidimensional array.
Definition tensor.h:317
Tensor< T > & emul(const Tensor< T > &t)
Inplace multiply by corresponding elements of argument Tensor.
Definition tensor.h:1799
Tensor< T > & conj()
Inplace complex conjugate.
Definition tensor.h:716
A simple, fixed dimension vector.
Definition vector.h:64
void erase(const keyT &key)
Erases entry from container (non-blocking comm if remote)
Definition worlddc.h:1392
Interface to be provided by any process map.
Definition worlddc.h:122
void fence(bool debug=false)
Synchronizes all processes in communicator AND globally ensures no pending AM or tasks.
Definition worldgop.cc:161
bool set_forbid_fence(bool value)
Set forbid_fence flag to new value and return old value.
Definition worldgop.h:676
A parallel world class.
Definition world.h:132
ProcessID rank() const
Returns the process rank in this World (same as MPI_Comm_rank()).
Definition world.h:320
ProcessID size() const
Returns the number of processes in this World (same as MPI_Comm_size()).
Definition world.h:330
WorldGopInterface & gop
Global operations.
Definition world.h:207
World * get_world() const
Returns a pointer to the world.
Definition parallel_archive.h:130
An archive for storing local or parallel data wrapping a BinaryFstreamOutputArchive.
Definition parallel_archive.h:321
Objects that implement their own parallel archive interface should derive from this class.
Definition parallel_archive.h:58
static const double R
Definition csqrt.cc:46
Declaration and initialization of tree traversal functions and generic derivative.
double(* f1)(const coord_3d &)
Definition derivatives.cc:55
double(* f2)(const coord_3d &)
Definition derivatives.cc:56
const double delta
Definition dielectric_external_field.cc:119
Provides FunctionDefaults and utilities for coordinate transformation.
Provides FunctionCommonData, FunctionImpl and FunctionFactory.
Defines/implements plotting interface for functions.
Provides typedefs to hide use of templates and to increase interoperability.
auto T(World &world, response_space &f) -> response_space
Definition global_functions.cc:28
const double beta
Definition gygi_soltion.cc:62
static const double v
Definition hatom_sf_dirac.cc:20
Tensor< double > op(const Tensor< double > &x)
Definition kain.cc:508
Multidimension Key for MRA tree and associated iterators.
Implements (2nd generation) static load/data balancing for functions.
#define MADNESS_CHECK(condition)
Check a condition — even in a release build the condition is always evaluated so it can have side eff...
Definition madness_exception.h:182
#define MADNESS_EXCEPTION(msg, value)
Macro for throwing a MADNESS exception.
Definition madness_exception.h:119
#define MADNESS_ASSERT(condition)
Assert a condition that should be free of side-effects since in release builds this might be a no-op.
Definition madness_exception.h:134
#define MADNESS_CHECK_THROW(condition, msg)
Check a condition — even in a release build the condition is always evaluated so it can have side eff...
Definition madness_exception.h:207
Header to declare stuff which has not yet found a home.
static const bool VERIFY_TREE
Definition mra.h:57
Definition potentialmanager.cc:41
Namespace for all elements and tools of MADNESS.
Definition DFParameters.h:10
double abs(double x)
Definition complexfun.h:48
Function< double, NDIM > abssq(const Function< double_complex, NDIM > &z, bool fence=true)
Returns a new function that is the square of the absolute value of the input.
Definition mra.h:2825
DistributionType
some introspection of how data is distributed
Definition worlddc.h:81
@ NodeReplicated
even if there are several ranks per node
Definition worlddc.h:84
@ RankReplicated
replicate the container over all world ranks
Definition worlddc.h:83
Function< TENSOR_RESULT_TYPE(typename opT::opT, R), NDIM > apply_1d_realspace_push(const opT &op, const Function< R, NDIM > &f, int axis, bool fence=true)
Definition mra.h:2343
Function< TENSOR_RESULT_TYPE(L, R), NDIM > sub(const Function< L, NDIM > &left, const Function< R, NDIM > &right, bool fence=true)
Same as operator- but with optional fence and no automatic compression.
Definition mra.h:2065
Function< TENSOR_RESULT_TYPE(L, R), NDIM > binary_op(const Function< L, NDIM > &left, const Function< R, NDIM > &right, const opT &op, bool fence=true)
Generate new function = op(left,right) where op acts on the function values.
Definition mra.h:1860
Function< Q, NDIM > convert(const Function< T, NDIM > &f, bool fence=true)
Type conversion implies a deep copy. No communication except for optional fence.
Definition mra.h:2143
Function< TENSOR_RESULT_TYPE(Q, T), NDIM > mul(const Q alpha, const Function< T, NDIM > &f, bool fence=true)
Returns new function equal to alpha*f(x) with optional fence.
Definition mra.h:1795
std::enable_if_t< NDIM%2==0, Function< T, NDIM > > swap_particles(const Function< T, NDIM > &f)
swap particles 1 and 2
Definition mra.h:2414
TreeState
Definition funcdefaults.h:59
@ nonstandard_after_apply
s and d coeffs, state after operator application
Definition funcdefaults.h:64
@ redundant_after_merge
s coeffs everywhere, must be summed up to yield the result
Definition funcdefaults.h:66
@ reconstructed
s coeffs at the leaves only
Definition funcdefaults.h:60
@ nonstandard
s and d coeffs in internal nodes
Definition funcdefaults.h:62
@ unknown
Definition funcdefaults.h:68
@ nonstandard_with_leaves
like nonstandard, with s coeffs at the leaves
Definition funcdefaults.h:63
static void user_to_sim(const Vector< double, NDIM > &xuser, Vector< double, NDIM > &xsim)
Convert user coords (cell[][]) to simulation coords ([0,1]^ndim)
Definition funcdefaults.h:444
std::vector< Function< TENSOR_RESULT_TYPE(T, R), NDIM > > innerXX(const Function< T, LDIM > &f, const std::vector< Function< R, KDIM > > &vg, const std::array< int, CDIM > v1, const std::array< int, CDIM > v2, int task=0)
Computes the partial scalar/inner product between two functions, returns a low-dim function.
Definition mra.h:2542
std::vector< CCPairFunction< T, NDIM > > operator*(const double fac, const std::vector< CCPairFunction< T, NDIM > > &arg)
Definition ccpairfunction.h:1089
int Level
Definition key.h:58
TreeState get_tree_state(const Function< T, NDIM > &f)
get tree state of a function
Definition mra.h:2841
std::vector< CCPairFunction< T, NDIM > > operator-(const std::vector< CCPairFunction< T, NDIM > > c1, const std::vector< CCPairFunction< T, NDIM > > &c2)
Definition ccpairfunction.h:1060
Function< TENSOR_RESULT_TYPE(L, R), NDIM > mul_sparse(const Function< L, NDIM > &left, const Function< R, NDIM > &right, double tol, bool fence=true)
Sparse multiplication — left and right must be reconstructed and if tol!=0 have tree of norms already...
Definition mra.h:1836
std::string get_mra_data_dir()
Definition startup.cc:209
Function< T, NDIM > gaxpy_oop_reconstructed(const double alpha, const Function< T, NDIM > &left, const double beta, const Function< T, NDIM > &right, const bool fence=true)
Returns new function alpha*left + beta*right optional fence, having both addends reconstructed.
Definition mra.h:2029
void print(const T &t, const Ts &... ts)
Print items to std::cout (items separated by spaces) and terminate with a new line.
Definition print.h:226
response_space apply(World &world, std::vector< std::vector< std::shared_ptr< real_convolution_3d > > > &op, response_space &f)
Definition basic_operators.cc:43
@ TT_2D
Definition gentensor.h:120
@ TT_FULL
Definition gentensor.h:120
NDIM & f
Definition mra.h:2528
Function< TENSOR_RESULT_TYPE(L, R), NDIM > add(const Function< L, NDIM > &left, const Function< R, NDIM > &right, bool fence=true)
Same as operator+ but with optional fence and no automatic compression.
Definition mra.h:2021
Function< T, NDIM > symmetrize(const Function< T, NDIM > &f, const std::string symmetry, bool fence=true)
symmetrize a function
Definition mra.h:2440
Function< TENSOR_RESULT_TYPE(typename opT::opT, R), NDIM > apply_only(const opT &op, const Function< R, NDIM > &f, bool fence=true)
Apply operator ONLY in non-standard form - required other steps missing !!
Definition mra.h:2231
double inner(response_space &a, response_space &b)
Definition response_functions.h:640
double imag(double x)
Definition complexfun.h:56
Function< typename opT::resultT, NDIM > unary_op(const Function< Q, NDIM > &func, const opT &op, bool fence=true)
Out of place application of unary operation to function values with optional fence.
Definition mra.h:1874
void startup(World &world, int argc, char **argv, bool doprint=false, bool make_stdcout_nice_to_reals=true)
initialize the internal state of the MADmra library
Definition startup.cc:64
std::string type(const PairType &n)
Definition PNOParameters.h:18
static bool print_timings
Definition SCF.cc:106
std::vector< CCPairFunction< T, NDIM > > operator+(const std::vector< CCPairFunction< T, NDIM > > c1, const std::vector< CCPairFunction< T, NDIM > > &c2)
Definition ccpairfunction.h:1052
Function< T, NDIM > multiply(const Function< T, NDIM > f, const Function< T, LDIM > g, const int particle, const bool fence=true)
multiply a high-dimensional function with a low-dimensional function
Definition mra.h:2484
void load(Function< T, NDIM > &f, const std::string name)
Definition mra.h:2892
Function< T, NDIM > project(const Function< T, NDIM > &other, int k=FunctionDefaults< NDIM >::get_k(), double thresh=FunctionDefaults< NDIM >::get_thresh(), bool fence=true)
Definition mra.h:2511
double real(double x)
Definition complexfun.h:52
static XNonlinearSolver< std::vector< Function< T, NDIM > >, T, vector_function_allocator< T, NDIM > > nonlinear_vector_solver(World &world, const long nvec)
Definition nonlinsol.h:371
std::string name(const FuncType &type, const int ex=-1)
Definition ccpairfunction.h:28
void save(const Function< T, NDIM > &f, const std::string name)
Definition mra.h:2886
Function< T, KDIM+LDIM > hartree_product(const std::vector< Function< T, KDIM > > &left, const std::vector< Function< T, LDIM > > &right)
Performs a Hartree/outer product on the two given low-dimensional function vectors.
Definition mra.h:1926
Function< T, NDIM > copy(const Function< T, NDIM > &f, const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > &pmap, bool fence=true)
Create a new copy of the function with different distribution and optional fence.
Definition mra.h:2096
static const double d
Definition nonlinschro.cc:121
Implements most functionality of separated operators.
Implements ParallelInputArchive and ParallelOutputArchive for parallel serialization of data.
double Q(double a)
Definition relops.cc:20
static const double c
Definition relops.cc:10
static const double L
Definition rk.cc:46
Definition test_ar.cc:204
void serialize(Archive &ar)
Definition mra.h:963
T(* f)(T)
Definition mra.h:958
void operator()(const Key< NDIM > &key, Tensor< T > &t) const
Definition mra.h:960
SimpleUnaryOpWrapper(T(*f)(T))
Definition mra.h:959
void serialize(Archive &ar)
Definition mra.h:896
bool operator()(implT *impl, const Key< NDIM > &key, const nodeT &t) const
Definition mra.h:892
Definition type_data.h:146
TensorArgs holds the arguments for creating a LowRankTensor.
Definition gentensor.h:134
Default load of an object via serialize(ar, t).
Definition archive.h:667
static void store(const ParallelOutputArchive< archiveT > &ar, const Function< T, NDIM > &f)
Definition mra.h:2879
Default store of an object via serialize(ar, t).
Definition archive.h:612
Tensor< double > operator()(const Key< NDIM > &key, const Tensor< double_complex > &t) const
Definition mra.h:2762
double resultT
Definition mra.h:2761
void serialize(Archive &ar)
Definition mra.h:2767
void serialize(Archive &ar)
Definition mra.h:2756
Tensor< double > operator()(const Key< NDIM > &key, const Tensor< double_complex > &t) const
Definition mra.h:2751
double resultT
Definition mra.h:2750
Tensor< double > operator()(const Key< NDIM > &key, const Tensor< double_complex > &t) const
Definition mra.h:2741
void serialize(Archive &ar)
Definition mra.h:2745
double resultT
Definition mra.h:2740
Tensor< double > operator()(const Key< NDIM > &key, const Tensor< double_complex > &t) const
Definition mra.h:2731
double resultT
Definition mra.h:2730
void serialize(Archive &ar)
Definition mra.h:2735
Definition funcimpl.h:610
returns true if the result of a hartree_product is a leaf node (compute norm & error)
Definition funcimpl.h:500
Definition funcimpl.h:564
Definition lowrankfunction.h:336
double real(double a)
Definition tdse4.cc:78
Defines and implements most of Tensor.
#define UNARY_OPTIMIZED_ITERATOR(X, x, exp)
Definition tensor_macros.h:658
template Tensor< Tensor< double_complex >::scalar_type > imag(const Tensor< double_complex > &t)
AtomicInt sum
Definition test_atomicint.cc:46
double norm(const T i1)
Definition test_cloud.cc:85
int task(int i)
Definition test_runtime.cpp:4
void e()
Definition test_sig.cc:75
static const double alpha
Definition testcosine.cc:10
constexpr std::size_t NDIM
Definition testgconv.cc:54
std::size_t axis
Definition testpdiff.cc:59
#define TENSOR_RESULT_TYPE(L, R)
This macro simplifies access to TensorResultType.
Definition type_data.h:205
Defines operations on vectors of Functions.
Implements WorldContainer.
#define PROFILE_FUNC
Definition worldprofile.h:209
#define PROFILE_MEMBER_FUNC(classname)
Definition worldprofile.h:210