MADNESS 0.10.1
Classes | Functions | Variables
test_eval.cc File Reference

Targeted unit tests for FunctionImpl::eval_local_only and eval_cube. More...

#include <madness/mra/mra.h>
#include <madness/mra/funcdefaults.h>
#include <madness/world/test_utilities.h>
#include <madness/tensor/tensor.h>
#include <algorithm>
#include <array>
#include <chrono>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <limits>
#include <random>
#include <string>
#include <vector>
Include dependency graph for test_eval.cc:

Classes

class  Constant< T, NDIM >
 
class  Gaussian< T, NDIM >
 
struct  GoldenPoint
 
class  Oscillatory< NDIM >
 

Functions

template<std::size_t NDIM>
void bench_cell (World &world, int k)
 
static double eval_tol (double ref, double k_factor=1.0)
 
template<std::size_t NDIM>
bool golden_check_ndim (World &world, int k, double thresh, double cx, const double raw_pt[3], double &out_ref, double &out_lo)
 
static bool is_heavy (std::size_t ndim, int k, double thresh)
 
int main (int argc, char **argv)
 
template<std::size_t NDIM>
std::vector< Vector< double, NDIM > > random_sim_points (int n, uint64_t seed)
 
template<std::size_t NDIM>
int run_batched_cell (World &world, const std::string &label, int k, double thresh, double L, const std::vector< Vector< double, NDIM > > &user_pts)
 
void run_benchmark (World &world)
 
template<typename FunctorT , std::size_t NDIM>
int run_correctness_cell (World &world, const std::string &label, FunctorT *raw_functor, int k, double thresh, double L, const std::vector< Vector< double, NDIM > > &user_pts)
 
template<std::size_t NDIM>
Vector< double, NDIMsim_to_user (const Vector< double, NDIM > &xsim, const Tensor< double > &cell)
 
template<std::size_t NDIM>
int test_batched_ndim (World &world)
 
int test_contraction_micro ()
 
template<std::size_t NDIM>
int test_correctness_ndim (World &world)
 
int test_general_fast_transform ()
 
int test_golden_values (World &world)
 
int test_output_param_overload (World &world)
 
int test_scaling_factor ()
 

Variables

static const GoldenPoint golden_pts []
 
static const bool print_golden
 
static const bool run_bench
 
static const bool run_heavy
 

Detailed Description

Targeted unit tests for FunctionImpl::eval_local_only and eval_cube.

Covers:

Heavy cells (NDIM==6, k>8, thresh<=1e-8) are compiled but skipped at runtime unless MADNESS_TEST_EVAL_EXHAUSTIVE=1 is set.

Function Documentation

◆ bench_cell()

template<std::size_t NDIM>
void bench_cell ( World world,
int  k 
)

◆ eval_tol()

static double eval_tol ( double  ref,
double  k_factor = 1.0 
)
static

References std::abs(), and e().

Referenced by run_correctness_cell().

◆ golden_check_ndim()

template<std::size_t NDIM>
bool golden_check_ndim ( World world,
int  k,
double  thresh,
double  cx,
const double  raw_pt[3],
double &  out_ref,
double &  out_lo 
)

◆ is_heavy()

static bool is_heavy ( std::size_t  ndim,
int  k,
double  thresh 
)
static

References e(), k, and thresh.

Referenced by test_correctness_ndim().

◆ main()

int main ( int  argc,
char **  argv 
)

◆ random_sim_points()

template<std::size_t NDIM>
std::vector< Vector< double, NDIM > > random_sim_points ( int  n,
uint64_t  seed 
)

References d, dist(), NDIM, and p().

◆ run_batched_cell()

template<std::size_t NDIM>
int run_batched_cell ( World world,
const std::string &  label,
int  k,
double  thresh,
double  L,
const std::vector< Vector< double, NDIM > > &  user_pts 
)

◆ run_benchmark()

void run_benchmark ( World world)

References madness::World::rank(), and madness::World::size().

Referenced by main().

◆ run_correctness_cell()

template<typename FunctorT , std::size_t NDIM>
int run_correctness_cell ( World world,
const std::string &  label,
FunctorT *  raw_functor,
int  k,
double  thresh,
double  L,
const std::vector< Vector< double, NDIM > > &  user_pts 
)

◆ sim_to_user()

template<std::size_t NDIM>
Vector< double, NDIM > sim_to_user ( const Vector< double, NDIM > &  xsim,
const Tensor< double > &  cell 
)

References d, and NDIM.

◆ test_batched_ndim()

template<std::size_t NDIM>
int test_batched_ndim ( World world)

References c, d, e(), k, L, NDIM, p(), and thresh.

◆ test_contraction_micro()

int test_contraction_micro ( )

◆ test_correctness_ndim()

template<std::size_t NDIM>
int test_correctness_ndim ( World world)

References c, d, e(), is_heavy(), k, L, NDIM, p(), q(), run_heavy, and thresh.

◆ test_general_fast_transform()

int test_general_fast_transform ( )

References run_heavy.

Referenced by main().

◆ test_golden_values()

int test_golden_values ( World world)

◆ test_output_param_overload()

int test_output_param_overload ( World world)

◆ test_scaling_factor()

int test_scaling_factor ( )

Variable Documentation

◆ golden_pts

const GoldenPoint golden_pts[]
static
Initial value:
= {
{1, 7, 1e-5, { 0.3, 0.0, 0.0}},
{1, 7, 1e-5, { 0.0, 0.0, 0.0}},
{1, 7, 1e-5, {-0.5, 0.0, 0.0}},
{2, 7, 1e-5, { 0.3, 0.3, 0.0}},
{2, 7, 1e-5, { 0.1, -0.2, 0.0}},
{3, 7, 1e-5, { 0.3, -0.3, 0.3}},
{3, 7, 1e-5, { 0.0, 0.0, 0.0}},
}
void e()
Definition test_sig.cc:75

Referenced by test_golden_values().

◆ print_golden

const bool print_golden
static
Initial value:
=
(std::getenv("MADNESS_TEST_EVAL_PRINT_GOLDEN") != nullptr)

Referenced by golden_check_ndim().

◆ run_bench

const bool run_bench
static
Initial value:
=
(std::getenv("MADNESS_BENCH_EVAL") != nullptr)

Referenced by main().

◆ run_heavy

const bool run_heavy
static
Initial value:
=
(std::getenv("MADNESS_TEST_EVAL_EXHAUSTIVE") != nullptr)

Referenced by main(), test_correctness_ndim(), and test_general_fast_transform().