Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:39:58

0001 // Copyright Nick Thompson, 2017
0002 // Use, modification and distribution are subject to the
0003 // Boost Software License, Version 1.0.
0004 // (See accompanying file LICENSE_1_0.txt
0005 // or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 /*
0008  * This class performs sinh-sinh quadrature over the entire real line.
0009  *
0010  * References:
0011  *
0012  * 1) Tanaka, Ken'ichiro, et al. "Function classes for double exponential integration formulas." Numerische Mathematik 111.4 (2009): 631-655.
0013  */
0014 
0015 #ifndef BOOST_MATH_QUADRATURE_SINH_SINH_HPP
0016 #define BOOST_MATH_QUADRATURE_SINH_SINH_HPP
0017 
0018 #include <cmath>
0019 #include <limits>
0020 #include <memory>
0021 #include <boost/math/quadrature/detail/sinh_sinh_detail.hpp>
0022 
0023 namespace boost{ namespace math{ namespace quadrature {
0024 
0025 template<class Real, class Policy = boost::math::policies::policy<> >
0026 class sinh_sinh
0027 {
0028 public:
0029     sinh_sinh(size_t max_refinements = 9)
0030         : m_imp(std::make_shared<detail::sinh_sinh_detail<Real, Policy> >(max_refinements)) {}
0031 
0032     template<class F>
0033     auto integrate(const F f, Real tol = boost::math::tools::root_epsilon<Real>(), Real* error = nullptr, Real* L1 = nullptr, std::size_t* levels = nullptr) const ->decltype(std::declval<F>()(std::declval<Real>()))
0034     {
0035         return m_imp->integrate(f, tol, error, L1, levels);
0036     }
0037 
0038 private:
0039     std::shared_ptr<detail::sinh_sinh_detail<Real, Policy>> m_imp;
0040 };
0041 
0042 }}}
0043 #endif