Home
last modified time | relevance | path

Searched refs:Real (Results 1 – 25 of 558) sorted by relevance

12345678910>>...23

/third_party/boost/boost/math/filters/
Ddaubechies.hpp15 template <typename Real, unsigned p>
16 constexpr std::array<Real, 2*p> daubechies_scaling_filter() in daubechies_scaling_filter()
20Real, std::numeric_limits<Real>::digits, 0.7071067811865475244008443621048490392848359376884740365… in daubechies_scaling_filter()
23Real, std::numeric_limits<Real>::digits, 0.4829629131445341433748715998644486838169524195042022752… in daubechies_scaling_filter()
26Real, std::numeric_limits<Real>::digits, 0.3326705529500826159985115891390056300129233992450683597… in daubechies_scaling_filter()
29Real, std::numeric_limits<Real>::digits, 0.2303778133088965008632911830440708500016152482483092977… in daubechies_scaling_filter()
32Real, std::numeric_limits<Real>::digits, 0.1601023979741929144807237480204207336505441246250578327… in daubechies_scaling_filter()
35Real, std::numeric_limits<Real>::digits, 0.1115407433501094636213239172409234390425395919844216759… in daubechies_scaling_filter()
38Real, std::numeric_limits<Real>::digits, 0.0778520540850091790199635219578937483791830529279556843… in daubechies_scaling_filter()
41Real, std::numeric_limits<Real>::digits, 0.0544158422431040099550094052029993550359955429473305039… in daubechies_scaling_filter()
[all …]
/third_party/boost/libs/math/test/
Dtanh_sinh_quadrature_test.cpp134 template <class Real>
135 std::pair<std::vector<std::vector<Real>>, std::vector<std::vector<Real>> > generate_constants(unsig… in generate_constants()
140 auto g = [](Real t) { return tanh(half_pi<Real>()*sinh(t)); }; in generate_constants()
141 …auto w = [](Real t) { Real cs = cosh(half_pi<Real>() * sinh(t)); return half_pi<Real>() * cosh(t)… in generate_constants()
142 auto gc = [](Real t) { Real u2 = half_pi<Real>() * sinh(t); return 1 / (exp(u2) *cosh(u2)); }; in generate_constants()
150 std::vector<std::vector<Real>> abscissa, weights; in generate_constants()
152 std::vector<Real> temp; in generate_constants()
156 Real h = 1; in generate_constants()
174 for (Real t = h; t < max_index - 1; t += 2 * h) in generate_constants()
183 for (Real t = h; t < max_index - 1; t += 2 * h) in generate_constants()
[all …]
Dnaive_monte_carlo_test.cpp26 template<class Real>
29 … (multithreaded) using Monte-Carlo on type " << boost::typeindex::type_id<Real>().pretty_name() <<… in test_pi_multithreaded()
30 auto g = [](std::vector<Real> const & x)->Real { in test_pi_multithreaded()
31 Real r = x[0]*x[0]+x[1]*x[1]; in test_pi_multithreaded()
38 std::vector<std::pair<Real, Real>> bounds{{Real(0), Real(1)}, {Real(0), Real(1)}}; in test_pi_multithreaded()
39 Real error_goal = 0.0002; in test_pi_multithreaded()
40 naive_monte_carlo<Real, decltype(g)> mc(g, bounds, error_goal, in test_pi_multithreaded()
43 Real pi_estimated = task.get(); in test_pi_multithreaded()
44 if (abs(pi_estimated - pi<Real>())/pi<Real>() > 0.005) { in test_pi_multithreaded()
48 BOOST_CHECK_CLOSE_FRACTION(pi_estimated, pi<Real>(), 0.005); in test_pi_multithreaded()
[all …]
Dcardinal_b_spline_test.cpp27 template<class Real>
30 Real t = cardinal_b_spline<0>(Real(1.1)); in test_box()
31 Real expected = 0; in test_box()
33 CHECK_ULP_CLOSE(expected, cardinal_b_spline_prime<0>(Real(1.1)), 0); in test_box()
35 t = cardinal_b_spline<0>(Real(-1.1)); in test_box()
39 Real h = Real(1)/Real(256); in test_box()
40 for (t = -Real(1)/Real(2)+h; t < Real(1)/Real(2); t += h) in test_box()
45 CHECK_ULP_CLOSE(expected, cardinal_b_spline_prime<0>(Real(1.1)), 0); in test_box()
55 template<class Real>
58 Real t = cardinal_b_spline<1>(Real(2.1)); in test_hat()
[all …]
Dexp_sinh_quadrature_test.cpp99 template <class Real, class TargetType>
100 std::pair<std::vector<std::vector<Real>>, std::vector<std::vector<Real>> > generate_constants(unsig… in generate_constants()
105 auto g = [](Real t)->Real { return exp(half_pi<Real>()*sinh(t)); }; in generate_constants()
106 auto w = [](Real t)->Real { return cosh(t)*half_pi<Real>()*exp(half_pi<Real>()*sinh(t)); }; in generate_constants()
108 std::vector<std::vector<Real>> abscissa, weights; in generate_constants()
110 std::vector<Real> temp; in generate_constants()
112Real tmp = (Real(boost::math::tools::log_min_value<TargetType>()) + log(Real(boost::math::tools::e… in generate_constants()
113 Real t_min = asinh(two_div_pi<Real>()*tmp); in generate_constants()
122 …const Real t_max = log(2 * two_div_pi<Real>()*log(2 * two_div_pi<Real>()*sqrt(Real(boost::math::to… in generate_constants()
124 Real h = 1; in generate_constants()
[all …]
Dtest_trapezoidal.cpp33 typedef typename Complex::value_type Real; in test_complex_bessel() typedef
37 auto bessel_integrand = [&n, &z](Real theta)->Complex in test_complex_bessel()
41 Real t1 = sin(theta); in test_complex_bessel()
42 Real t2 = - n*theta; in test_complex_bessel()
44 return cos(arg)/pi<Real>(); in test_complex_bessel()
49 Real a = 0; in test_complex_bessel()
50 Real b = pi<Real>(); in test_complex_bessel()
51 Complex Jnz = trapezoidal<decltype(bessel_integrand), Real>(bessel_integrand, a, b); in test_complex_bessel()
55Real Jnzx = boost::lexical_cast<Real>("1.257674591970511077630764085052638490387449039392695959943… in test_complex_bessel()
56Real Jnzy = boost::lexical_cast<Real>("2.318771368505683055818032722011594415038779144567369903204… in test_complex_bessel()
[all …]
Dadaptive_gauss_kronrod_quadrature_test.cpp66 template <class Real>
67 Real get_termination_condition() in get_termination_condition()
69 return boost::math::tools::epsilon<Real>() * 1000; in get_termination_condition()
73 template<class Real, unsigned Points>
76 …tegrated properly by gauss_kronrod on type " << boost::typeindex::type_id<Real>().pretty_name() <<… in test_linear()
77 Real tol = boost::math::tools::epsilon<Real>() * 10; in test_linear()
78 Real error; in test_linear()
79 auto f = [](const Real& x) in test_linear()
83 Real L1; in test_linear()
84Real Q = gauss_kronrod<Real, Points>::integrate(f, (Real) 0, (Real) 1, 15, get_termination_conditi… in test_linear()
[all …]
Dgauss_kronrod_quadrature_test.cpp253 template<class Real, unsigned Points>
256 …tegrated properly by gauss_kronrod on type " << boost::typeindex::type_id<Real>().pretty_name() <<… in test_linear()
257 Real tol = boost::math::tools::epsilon<Real>() * 10; in test_linear()
258 Real error; in test_linear()
259 auto f = [](const Real& x)->Real in test_linear()
263 Real L1; in test_linear()
264 Real Q = gauss_kronrod<Real, Points>::integrate(f, (Real) 0, (Real) 1, 0, 0, &error, &L1); in test_linear()
268 Q = gauss_kronrod<Real, Points>::integrate(f, (Real) 1, (Real) 0, 0, 0, &error, &L1); in test_linear()
272 Q = gauss_kronrod<Real, Points>::integrate(f, (Real) 0, (Real) 0, 0, 0, &error, &L1); in test_linear()
273 BOOST_CHECK_CLOSE(Q, Real(0), tol); in test_linear()
[all …]
Dooura_fourier_integral_test.cpp30 template<class Real>
32 if constexpr (std::is_same_v<Real, float>) { in get_sin_integrator()
35 if constexpr (std::is_same_v<Real, double>) { in get_sin_integrator()
38 if constexpr (std::is_same_v<Real, long double>) { in get_sin_integrator()
47 template<class Real>
49 if constexpr (std::is_same_v<Real, float>) { in get_cos_integrator()
52 if constexpr (std::is_same_v<Real, double>) { in get_cos_integrator()
55 if constexpr (std::is_same_v<Real, long double>) { in get_cos_integrator()
61 template<class Real>
65 …std::cout << "Testing eta function on type " << boost::typeindex::type_id<Real>().pretty_name() <… in test_ooura_eta()
[all …]
Dgauss_quadrature_test.cpp249 template<class Real, unsigned Points>
252 …s are integrated properly by gauss on type " << boost::typeindex::type_id<Real>().pretty_name() <<… in test_linear()
253 Real tol = boost::math::tools::epsilon<Real>() * 10; in test_linear()
254 auto f = [](const Real& x) in test_linear()
258 Real L1; in test_linear()
259 Real Q = gauss<Real, Points>::integrate(f, (Real) 0, (Real) 1, &L1); in test_linear()
262 Q = gauss<Real, Points>::integrate(f, (Real) 0, (Real) 0, &L1); in test_linear()
264 Q = gauss<Real, Points>::integrate(f, (Real) 1, (Real) 0, &L1); in test_linear()
268 template<class Real, unsigned Points>
271 …ed properly by Gaussian quadrature on type " << boost::typeindex::type_id<Real>().pretty_name() <<… in test_quadratic()
[all …]
Dcardinal_quintic_b_spline_test.cpp18 template<class Real>
21 Real c = 7.5; in test_constant()
22 Real t0 = 0; in test_constant()
23 Real h = Real(1)/Real(16); in test_constant()
25 std::vector<Real> v(n, c); in test_constant()
26 std::pair<Real, Real> left_endpoint_derivatives{0, 0}; in test_constant()
27 std::pair<Real, Real> right_endpoint_derivatives{0, 0}; in test_constant()
28 …auto qbs = cardinal_quintic_b_spline<Real>(v.data(), v.size(), t0, h, left_endpoint_derivatives, r… in test_constant()
32 Real t = t0 + i*h; in test_constant()
34 CHECK_MOLLIFIED_CLOSE(Real(0), qbs.prime(t), 400*std::numeric_limits<Real>::epsilon()); in test_constant()
[all …]
Dlegendre_stieltjes_test.cpp21 template<class Real>
24 std::cout << std::setprecision(std::numeric_limits<Real>::digits10); in test_legendre_stieltjes()
30 Real tol = std::numeric_limits<Real>::epsilon(); in test_legendre_stieltjes()
31 legendre_stieltjes<Real> ls1(1); in test_legendre_stieltjes()
32 legendre_stieltjes<Real> ls2(2); in test_legendre_stieltjes()
33 legendre_stieltjes<Real> ls3(3); in test_legendre_stieltjes()
34 legendre_stieltjes<Real> ls4(4); in test_legendre_stieltjes()
35 legendre_stieltjes<Real> ls5(5); in test_legendre_stieltjes()
36 legendre_stieltjes<Real> ls8(8); in test_legendre_stieltjes()
37 Real x = -1; in test_legendre_stieltjes()
[all …]
Dcardinal_cubic_b_spline_test.cpp23 template<class Real>
26 …aluation of spline basis functions on type " << boost::typeindex::type_id<Real>().pretty_name() <<… in test_b3_spline()
28 Real eps = std::numeric_limits<Real>::epsilon(); in test_b3_spline()
29 BOOST_CHECK_SMALL(boost::math::interpolators::detail::b3_spline<Real>(2.5), (Real) 0); in test_b3_spline()
30 BOOST_CHECK_SMALL(boost::math::interpolators::detail::b3_spline<Real>(-2.5), (Real) 0); in test_b3_spline()
31 BOOST_CHECK_SMALL(boost::math::interpolators::detail::b3_spline_prime<Real>(2.5), (Real) 0); in test_b3_spline()
32 BOOST_CHECK_SMALL(boost::math::interpolators::detail::b3_spline_prime<Real>(-2.5), (Real) 0); in test_b3_spline()
33 …BOOST_CHECK_SMALL(boost::math::interpolators::detail::b3_spline_double_prime<Real>(2.5), (Real) 0); in test_b3_spline()
34 …BOOST_CHECK_SMALL(boost::math::interpolators::detail::b3_spline_double_prime<Real>(-2.5), (Real) 0… in test_b3_spline()
38 BOOST_CHECK_SMALL(boost::math::interpolators::detail::b3_spline<Real>(2), (Real) 0); in test_b3_spline()
[all …]
Dcubic_hermite_test.cpp28 template<typename Real>
31 Real x0 = 0; in test_constant()
32 std::vector<Real> x{x0,1,2,3, 9, 22, 81}; in test_constant()
33 std::vector<Real> y(x.size()); in test_constant()
39 std::vector<Real> dydx(x.size(), Real(0)); in test_constant()
46 Real tlo = x.front(); in test_constant()
47 Real thi = x.back(); in test_constant()
52 CHECK_ULP_CLOSE(Real(7), hermite_spline(tlo), 2); in test_constant()
53 CHECK_ULP_CLOSE(Real(7), hermite_spline(thi), 2); in test_constant()
54 CHECK_ULP_CLOSE(Real(0), hermite_spline.prime(tlo), 2); in test_constant()
[all …]
Dlanczos_smoothing_test.cpp34 template<class Real>
37 … std::cout << "Testing Discrete Legendre Polynomial norms on type " << typeid(Real).name() << "\n"; in test_dlp_norms()
38 Real tol = std::numeric_limits<Real>::epsilon(); in test_dlp_norms()
39 auto dlp = discrete_legendre<Real>(1, Real(0)); in test_dlp_norms()
42 dlp = discrete_legendre<Real>(2, Real(0)); in test_dlp_norms()
43 BOOST_CHECK_CLOSE_FRACTION(dlp.norm_sq(0), Real(5)/Real(2), tol); in test_dlp_norms()
44 BOOST_CHECK_CLOSE_FRACTION(dlp.norm_sq(1), Real(5)/Real(4), tol); in test_dlp_norms()
45 BOOST_CHECK_CLOSE_FRACTION(dlp.norm_sq(2), Real(3*3*7)/Real(pow(2,6)), 2*tol); in test_dlp_norms()
46 dlp = discrete_legendre<Real>(200, Real(0)); in test_dlp_norms()
49 Real calc = dlp.norm_sq(r); in test_dlp_norms()
[all …]
/third_party/boost/boost/math/special_functions/
Dcardinal_b_spline.hpp18 template<class Real>
19 inline Real B1(Real x) in B1()
25 if (x < Real(1)) in B1()
29 return Real(0); in B1()
33 template<unsigned n, typename Real>
34 Real cardinal_b_spline(Real x) { in cardinal_b_spline()
35 static_assert(!std::is_integral<Real>::value, "Does not work with integral types."); in cardinal_b_spline()
39 return cardinal_b_spline<n, Real>(-x); in cardinal_b_spline()
44 if (x < Real(1)/Real(2)) { in cardinal_b_spline()
45 return Real(1); in cardinal_b_spline()
[all …]
/third_party/boost/boost/math/interpolators/detail/
Dseptic_hermite_detail.hpp19 using Real = typename RandomAccessContainer::value_type; typedef in boost::math::interpolators::detail::septic_hermite_detail
44 Real x0 = x_[0];
47 Real x1 = x_[i];
56 void push_back(Real x, Real y, Real dydx, Real d2ydx2, Real d3ydx3) in push_back()
70 Real operator()(Real x) const in operator ()()
75 oss.precision(std::numeric_limits<Real>::digits10+3); in operator ()()
88 Real x0 = *(it-1); in operator ()()
89 Real x1 = *it; in operator ()()
90 Real dx = (x1-x0); in operator ()()
91 Real t = (x-x0)/dx; in operator ()()
[all …]
Dcardinal_quadratic_b_spline_detail.hpp15 template <class Real>
16 Real b2_spline(Real x) { in b2_spline()
18 Real absx = abs(x); in b2_spline()
19 if (absx < 1/Real(2)) in b2_spline()
21 Real y = absx - 1/Real(2); in b2_spline()
22 Real z = absx + 1/Real(2); in b2_spline()
25 if (absx < Real(3)/Real(2)) in b2_spline()
27 Real y = absx - Real(3)/Real(2); in b2_spline()
30 return (Real) 0; in b2_spline()
33 template <class Real>
[all …]
Dcubic_b_spline_detail.hpp20 template <class Real>
27 cubic_b_spline_imp(BidiIterator f, BidiIterator end_p, Real left_endpoint, Real step_size,
28 Real left_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN(),
29 Real right_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN());
31 Real operator()(Real x) const;
33 Real prime(Real x) const;
35 Real double_prime(Real x) const;
38 std::vector<Real> m_beta;
39 Real m_h_inv;
40 Real m_a;
[all …]
Dcardinal_cubic_b_spline_detail.hpp20 template <class Real>
27 …cardinal_cubic_b_spline_imp(BidiIterator f, BidiIterator end_p, Real left_endpoint, Real step_size,
28 Real left_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN(),
29 Real right_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN());
31 Real operator()(Real x) const;
33 Real prime(Real x) const;
35 Real double_prime(Real x) const;
38 std::vector<Real> m_beta;
39 Real m_h_inv;
40 Real m_a;
[all …]
/third_party/boost/boost/math/differentiation/
Dfinite_difference.hpp53 template<class Real>
54 Real make_xph_representable(Real x, Real h) in make_xph_representable()
59 Real temp = x + h; in make_xph_representable()
64 h = boost::math::nextafter(x, (numeric_limits<Real>::max)()) - x; in make_xph_representable()
70 template<class F, class Real>
71 Real complex_step_derivative(const F f, Real x) in complex_step_derivative()
79 constexpr const Real step = (numeric_limits<Real>::epsilon)(); in complex_step_derivative()
80 constexpr const Real inv_step = 1/(numeric_limits<Real>::epsilon)(); in complex_step_derivative()
81 return f(complex<Real>(x, step)).imag()*inv_step; in complex_step_derivative()
89 template<class F, class Real>
[all …]
/third_party/boost/boost/math/interpolators/
Dcubic_b_spline.hpp32 template <class Real>
39 cubic_b_spline(const BidiIterator f, BidiIterator end_p, Real left_endpoint, Real step_size,
40 Real left_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN(),
41 Real right_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN());
42 cubic_b_spline(const Real* const f, size_t length, Real left_endpoint, Real step_size,
43 Real left_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN(),
44 Real right_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN());
47 Real operator()(Real x) const;
49 Real prime(Real x) const;
51 Real double_prime(Real x) const;
[all …]
Dcardinal_cubic_b_spline.hpp29 template <class Real>
36 …cardinal_cubic_b_spline(const BidiIterator f, BidiIterator end_p, Real left_endpoint, Real step_si…
37 Real left_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN(),
38 Real right_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN());
39 cardinal_cubic_b_spline(const Real* const f, size_t length, Real left_endpoint, Real step_size,
40 Real left_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN(),
41 Real right_endpoint_derivative = std::numeric_limits<Real>::quiet_NaN());
44 Real operator()(Real x) const;
46 Real prime(Real x) const;
48 Real double_prime(Real x) const;
[all …]
/third_party/boost/boost/math/quadrature/
Dtanh_sinh.hpp39 template<class Real, class Policy = policies::policy<> >
43 … tanh_sinh(size_t max_refinements = 15, const Real& min_complement = tools::min_value<Real>() * 4) in tanh_sinh()
44 …: m_imp(std::make_shared<detail::tanh_sinh_detail<Real, Policy>>(max_refinements, min_complement))… in tanh_sinh()
47Real a, Real b, Real tolerance = tools::root_epsilon<Real>(), Real* error = nullptr, Real* L1 = nu…
49Real a, Real b, Real tolerance = tools::root_epsilon<Real>(), Real* error = nullptr, Real* L1 = nu…
52Real tolerance = tools::root_epsilon<Real>(), Real* error = nullptr, Real* L1 = nullptr, std::size…
54Real tolerance = tools::root_epsilon<Real>(), Real* error = nullptr, Real* L1 = nullptr, std::size…
57 std::shared_ptr<detail::tanh_sinh_detail<Real, Policy>> m_imp;
60 template<class Real, class Policy>
62Real, Policy>::integrate(const F f, Real a, Real b, Real tolerance, Real* error, Real* L1, std::si… in integrate()
[all …]
/third_party/boost/boost/math/quadrature/detail/
Dooura_fourier_integrals_detail.hpp22 template<class Real>
23 std::pair<Real, Real> ooura_eta(Real x, Real alpha) { in ooura_eta()
27 Real expx = exp(x); in ooura_eta()
28 Real eta_prime = 2 + alpha/expx + expx/4; in ooura_eta()
29 Real eta; in ooura_eta()
42 template<class Real>
43 Real calculate_ooura_alpha(Real h) in calculate_ooura_alpha()
48 Real x = sqrt(16 + 4*log1p(pi<Real>()/h)/h); in calculate_ooura_alpha()
52 template<class Real>
53 std::pair<Real, Real> ooura_sin_node_and_weight(long n, Real h, Real alpha) in ooura_sin_node_and_weight()
[all …]

12345678910>>...23