QMCPACK
test_bessel.cpp
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2016 Jeongnim Kim and QMCPACK developers.
6 //
7 // File developed by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
8 //
9 // File created by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
13 #include "catch.hpp"
14 
15 #include "Numerics/Bessel.h"
16 
17 namespace qmcplusplus
18 {
19 TEST_CASE("Bessel", "[numerics]")
20 {
21  double bessel_array[100];
22  bessel_steed_array_cpu(10, 1.0, bessel_array);
23 
24  CHECK(bessel_array[0] == Approx(0.84147098480789650670));
25  CHECK(bessel_array[1] == Approx(0.30116867893975678925));
26  CHECK(bessel_array[3] == Approx(9.006581117112515480e-03));
27  CHECK(bessel_array[5] == Approx(9.256115861125815763e-05));
28  CHECK(bessel_array[7] == Approx(4.790134198739488623e-07));
29  CHECK(bessel_array[10] == Approx(7.116552640047313024e-11));
30 }
31 
32 } // namespace qmcplusplus
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
TEST_CASE("complex_helper", "[type_traits]")
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
void bessel_steed_array_cpu(const int lmax, const T x, T *jl)
Compute spherical bessel function from 0 to lmax.
Definition: Bessel.h:25