MADNESS 0.10.1
Classes | Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
madness::KernelRange Class Reference

#include <kernelrange.h>

Classes

struct  Data
 
struct  Restrictor
 restrictor function More...
 

Public Types

enum  Type { Hard , SoftErf }
 types of range restrictor functions More...
 

Public Member Functions

 KernelRange ()=default
 
 KernelRange (unsigned int N)
 
 KernelRange (unsigned int N, double sigma)
 
bool finite () const
 
bool finite_hard () const
 
bool finite_soft () const
 
hashT hash () const
 
int iextent_x2 (double epsilon=extent_default_epsilon) const
 
bool infinite () const
 
unsigned int N () const
 
 operator bool () const
 
double sigma () const
 
Type type () const
 
double value (double r) const
 

Static Public Attributes

static constexpr double extent_default_epsilon = std::numeric_limits<double>::epsilon()
 

Private Member Functions

const Restrictorrestrictor () const
 

Private Attributes

std::optional< Datadata
 

Friends

bool operator== (const KernelRange &r1, const KernelRange &r2)
 

Detailed Description

To limit the range of kernel K(x-y) it is multiplied (in user coordinates) by a restrictor function $ r(N/2 - |x-y|) $, where $ r(x) $ is identity for unrestricted kernel or one of the choices encoded by KernelRange::Type

Member Enumeration Documentation

◆ Type

types of range restrictor functions

Enumerator
Hard 

Heavyside (step) function: $ r(x) \equiv \theta(x)$.

SoftErf 

erf approximation to Heavyside function: $ r(x) \equiv \theta_\sigma(x) \equiv (1 + \erf(x/\sigma))/2 $; in the limit $\sigma\to 0$ this becomes the Heaviside function.

Constructor & Destructor Documentation

◆ KernelRange() [1/3]

madness::KernelRange::KernelRange ( )
default

constructs a null (i.e., infinite) kernel range

Postcondition
this->infinite()==true

◆ KernelRange() [2/3]

madness::KernelRange::KernelRange ( unsigned int  N,
double  sigma 
)
inline

constructs a finite soft (sigma > 0) or hard (sigma==0) kernel range

Parameters
sigmaregularization parameter (lengthscale in simulation [0,1] coordinate units) controls the softness of the range restrictor
Precondition
sigma>=0
Postcondition
this->soft()==true

References Hard, MADNESS_ASSERT, N(), sigma(), and SoftErf.

◆ KernelRange() [3/3]

madness::KernelRange::KernelRange ( unsigned int  N)
inline

constructs a finite (hard) kernel range

Postcondition
this->hard()==true

References N().

Member Function Documentation

◆ finite()

bool madness::KernelRange::finite ( ) const
inline

◆ finite_hard()

bool madness::KernelRange::finite_hard ( ) const
inline
Returns
true if range is limited using a hard window function (Heaviside)

References finite(), Hard, and type().

Referenced by madness::GaussianConvolution1D< Q >::rnlp().

◆ finite_soft()

bool madness::KernelRange::finite_soft ( ) const
inline
Returns
true if range is limited using a soft window function (sigmoid)

References finite(), Hard, and type().

Referenced by madness::GaussianConvolution1D< Q >::rnlp().

◆ hash()

hashT madness::KernelRange::hash ( ) const
inline

◆ iextent_x2()

int madness::KernelRange::iextent_x2 ( double  epsilon = extent_default_epsilon) const
inline
Returns
max value of |x-y| (rounded up, in units of 1/2) for which r(N/2 - |x-y|) is greater than epsilon

References epsilon, infinite(), and MADNESS_ASSERT.

Referenced by madness::GaussianConvolution1D< Q >::rnlp(), and madness::Convolution1D< Q >::rnlp_is_zero().

◆ infinite()

bool madness::KernelRange::infinite ( ) const
inline
Returns
true if range is unlimited

References finite().

Referenced by hash(), iextent_x2(), and value().

◆ N()

unsigned int madness::KernelRange::N ( ) const
inline

◆ operator bool()

madness::KernelRange::operator bool ( ) const
inlineexplicit
Returns
true if range is limited

References finite().

◆ restrictor()

const Restrictor & madness::KernelRange::restrictor ( ) const
inlineprivate

Referenced by hash(), sigma(), type(), and value().

◆ sigma()

double madness::KernelRange::sigma ( ) const
inline

◆ type()

Type madness::KernelRange::type ( ) const
inline

◆ value()

double madness::KernelRange::value ( double  r) const
inline

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( const KernelRange r1,
const KernelRange r2 
)
friend
Returns
true if r1 and r2 are equal

Member Data Documentation

◆ data

std::optional<Data> madness::KernelRange::data
private

◆ extent_default_epsilon

constexpr double madness::KernelRange::extent_default_epsilon = std::numeric_limits<double>::epsilon()
staticconstexpr

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