5#ifndef MADNESS_MRA_KERNELRANGE_H__INCLUDED
6#define MADNESS_MRA_KERNELRANGE_H__INCLUDED
57 auto f = [](
double x,
double ooσ) {
58 return (1 + std::erf(x *
ooσ)) * 0.5;
76 r1.sigma() ==
r2.sigma()));
109 unsigned int N()
const {
return data.value().N; }
127 if (
r1.finite() !=
r2.finite())
130 return r1.N() ==
r2.N() &&
r1.restrictor() ==
r2.restrictor();
160 return std::numeric_limits<int>::max();
197 const auto arg = (0.5 *
N - x) *
ooσ;
198 const auto fx = (1 + std::erf(
arg)) * 0.5;
200 return std::make_pair(
fx,
dfx);
203 const auto max_iter = 50;
215 auto sign = [](
const auto x) {
return x >= 0 ? 1. : -1.; };
222 return static_cast<int>(
ceil(x * 2.));
226 auto value = [&](
const double r) {
Definition kernelrange.h:19
const Restrictor & restrictor() const
Definition kernelrange.h:246
bool finite_soft() const
Definition kernelrange.h:118
Type type() const
Definition kernelrange.h:110
static constexpr double extent_default_epsilon
Definition kernelrange.h:153
double sigma() const
Definition kernelrange.h:111
friend bool operator==(const KernelRange &r1, const KernelRange &r2)
Definition kernelrange.h:126
int iextent_x2(double epsilon=extent_default_epsilon) const
Definition kernelrange.h:157
hashT hash() const
Definition kernelrange.h:144
bool infinite() const
Definition kernelrange.h:120
bool finite() const
Definition kernelrange.h:114
KernelRange(unsigned int N)
Definition kernelrange.h:107
unsigned int N() const
Definition kernelrange.h:109
Type
types of range restrictor functions
Definition kernelrange.h:23
@ Hard
Heavyside (step) function: .
Definition kernelrange.h:25
@ SoftErf
Definition kernelrange.h:28
double value(double r) const
Definition kernelrange.h:135
KernelRange(unsigned int N, double sigma)
Definition kernelrange.h:98
std::optional< Data > data
Definition kernelrange.h:245
bool finite_hard() const
Definition kernelrange.h:116
static double epsilon
Definition dirac-hatom.cc:20
Tensor< typename Tensor< T >::scalar_type > arg(const Tensor< T > &t)
Return a new tensor holding the argument of each element of t (complex types only)
Definition tensor.h:2503
Defines madness::MadnessException for exception handling.
#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
Namespace for all elements and tools of MADNESS.
Definition DFParameters.h:10
static double r2(const coord_3d &x)
Definition smooth.h:45
void hash_combine(hashT &seed, const T &v)
Combine hash values.
Definition worldhash.h:260
NDIM & f
Definition mra.h:2481
std::size_t hashT
The hash value type.
Definition worldhash.h:145
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
madness::hashT hash_value(const std::array< T, N > &a)
Hash std::array with madness hash.
Definition array_addons.h:78
static long abs(long a)
Definition tensor.h:218
Definition test_ccpairfunction.cc:22
Definition kernelrange.h:168
Restrictor restrictor
Definition kernelrange.h:170
static int compute_iextent_x2(int N, const Restrictor &restrictor, double epsilon)
Definition kernelrange.h:186
int iextent_x2(double epsilon) const
Definition kernelrange.h:177
unsigned int N
Definition kernelrange.h:169
Data(unsigned int n, Restrictor r)
Definition kernelrange.h:173
int iextent_x2_default
Definition kernelrange.h:171
restrictor function
Definition kernelrange.h:32
Restrictor(Type type)
Definition kernelrange.h:34
double sigma_inverse() const
Definition kernelrange.h:50
double sigma() const
Definition kernelrange.h:46
std::optional< std::pair< double, double > > sigma_w_inverse_
Definition kernelrange.h:88
double value(double x) const
Definition kernelrange.h:56
hashT hash() const
Definition kernelrange.h:79
Type type_
Definition kernelrange.h:87
friend bool operator==(const Restrictor &r1, const Restrictor &r2)
Definition kernelrange.h:73
Restrictor(Type type, double sigma)
Definition kernelrange.h:35
Type type() const
Definition kernelrange.h:45
Defines hash functions for use in distributed containers.