diff options
author | Srinivas Vasudevan <srvasude@google.com> | 2019-09-14 12:16:47 -0400 |
---|---|---|
committer | Srinivas Vasudevan <srvasude@google.com> | 2019-09-14 12:16:47 -0400 |
commit | 6e215cf109073da9ffb5b491171613b8db24fd9d (patch) | |
tree | 1c171abbf72628ed0dbe37574e8d07c7953b4816 /unsupported/test/special_functions.cpp | |
parent | facdec5aa7d947d5462c9dbaefa7a50c4cabff3b (diff) |
Add Bessel functions to SpecialFunctions.
- Split SpecialFunctions files in to a separate BesselFunctions file.
In particular add:
- Modified bessel functions of the second kind k0, k1, k0e, k1e
- Bessel functions of the first kind j0, j1
- Bessel functions of the second kind y0, y1
Diffstat (limited to 'unsupported/test/special_functions.cpp')
-rw-r--r-- | unsupported/test/special_functions.cpp | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/unsupported/test/special_functions.cpp b/unsupported/test/special_functions.cpp index 140a5e4c1..c104ac3c5 100644 --- a/unsupported/test/special_functions.cpp +++ b/unsupported/test/special_functions.cpp @@ -357,47 +357,7 @@ template<typename ArrayType> void array_special_functions() } #endif // EIGEN_HAS_C99_MATH - // Test Bessel function i0e. Reference results obtained with SciPy. - { - ArrayType x(21); - ArrayType expected(21); - ArrayType res(21); - - x << -20.0, -18.0, -16.0, -14.0, -12.0, -10.0, -8.0, -6.0, -4.0, -2.0, 0.0, - 2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0; - - expected << 0.0897803118848, 0.0947062952128, 0.100544127361, - 0.107615251671, 0.116426221213, 0.127833337163, 0.143431781857, - 0.16665743264, 0.207001921224, 0.308508322554, 1.0, 0.308508322554, - 0.207001921224, 0.16665743264, 0.143431781857, 0.127833337163, - 0.116426221213, 0.107615251671, 0.100544127361, 0.0947062952128, - 0.0897803118848; - - CALL_SUBTEST(res = i0e(x); - verify_component_wise(res, expected);); - } - - // Test Bessel function i1e. Reference results obtained with SciPy. - { - ArrayType x(21); - ArrayType expected(21); - ArrayType res(21); - - x << -20.0, -18.0, -16.0, -14.0, -12.0, -10.0, -8.0, -6.0, -4.0, -2.0, 0.0, - 2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0; - - expected << -0.0875062221833, -0.092036796872, -0.0973496147565, - -0.103697667463, -0.11146429929, -0.121262681384, -0.134142493293, - -0.152051459309, -0.178750839502, -0.215269289249, 0.0, 0.215269289249, - 0.178750839502, 0.152051459309, 0.134142493293, 0.121262681384, - 0.11146429929, 0.103697667463, 0.0973496147565, 0.092036796872, - 0.0875062221833; - - CALL_SUBTEST(res = i1e(x); - verify_component_wise(res, expected);); - } - - /* Code to generate the data for the following two test cases. + /* Code to generate the data for the following two test cases. N = 5 np.random.seed(3) |