1#ifndef MADNESS_MRA_SUPBOUND_H__INCLUDED
2#define MADNESS_MRA_SUPBOUND_H__INCLUDED
32#include <unordered_map>
37 template <std::
size_t NDIM>
43 static constexpr double unbounded() {
return 1e300; }
48 for (
int i = 0; i <
k; ++i) w1(i) = std::sqrt(2.0 * i + 1.0);
58 if (
c.size() == 0)
return 0.0;
61 const T*
p =
cc.ptr();
64 for (
long i = 0; i <
cc.size(); ++i) s +=
std::abs(
p[i]) *
w[i];
74 for (
bool below =
false;; below =
true) {
75 const auto it =
bound_.find(key);
77 if (below_leaf) *below_leaf = below;
double w(double t, double eps)
Definition DKops.h:22
static double get_cell_volume()
Returns the volume of the user cell.
Definition funcdefaults.h:410
Key is the index for a node of the 2^NDIM-tree.
Definition key.h:71
Level level() const
Definition key.h:170
Key parent(int generation=1) const
Returns the key of the parent.
Definition key.h:366
static Tensor< double > leaf_weights(const int k)
the weights of the leaf bound, prod_d sqrt(2 i_d + 1), for k coefficients per dimension
Definition supbound.h:46
static constexpr double unbounded()
the answer for a box the map holds no bound for
Definition supbound.h:43
SupBoundMap(mapT bound)
Definition supbound.h:69
static double leaf_bound(const Key< NDIM > &key, const Tensor< T > &c, const Tensor< double > &weights)
Definition supbound.h:57
double operator()(Key< NDIM > key, bool *below_leaf=nullptr) const
Definition supbound.h:73
std::unordered_map< Key< NDIM >, double, Hash< Key< NDIM > > > mapT
Definition supbound.h:40
std::size_t size() const
the number of boxes held
Definition supbound.h:86
mapT bound_
Definition supbound.h:89
A tensor is a multidimensional array.
Definition tensor.h:313
char * p(char *buf, const char *name, int k, int initial_level, double thresh, int order)
Definition derivatives.cc:72
Provides FunctionDefaults and utilities for coordinate transformation.
Multidimension Key for MRA tree and associated iterators.
#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
Namespace for all elements and tools of MADNESS.
Definition DFConvergence.h:9
int FunctionDefaults< NDIM >::k
Definition mraimpl.h:3878
static Tensor< double > weights[max_npt+1]
Definition legendre.cc:99
std::enable_if< std::is_base_of< ProjectorBase, projT >::value, OuterProjector< projT, projQ > >::type outer(const projT &p0, const projQ &p1)
Definition projector.h:476
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:2239
static long abs(long a)
Definition tensor.h:214
const double cc
Definition navstokes_cosines.cc:107
static const double d
Definition nonlinschro.cc:121
static const double c
Definition relops.cc:10
Hash functor.
Definition worldhash.h:234
Defines and implements most of Tensor.
constexpr std::size_t NDIM
Definition testgconv.cc:54
Defines hash functions for use in distributed containers.