49template <
typename Signature>
59template <
typename Result, base::concepts::real_scalar Variable>
81 template <base::concepts::invocable_as<result_type(variable_type)> Function>
82 [[nodiscard]]
auto integrate(
const Function& function)
const
94 const variable_type half_pi_sinh = half_pi * std::sinh(changed_var);
97 half_pi * std::cosh(half_pi_sinh) * std::cosh(changed_var);
98 sum += function(var) * diff_coeff;
99 sum += function(-var) * diff_coeff;
102 return sum * interval;
112 template <base::concepts::invocable_as<result_type(variable_type)> Function>
113 [[nodiscard]]
auto operator()(
const Function& function)
const
115 return integrate(function);
126 this->logger(),
"Maximum point must be a positive value.");
139 "Number of points must be a positive integer.");
auto operator()(const Function &function) const -> result_type
Integrate a function.
std::decay_t< Variable > variable_type
Type of variables.
std::decay_t< Result > result_type
Type of results.
auto max_point(variable_type val) -> de_infinite_integrator &
Set maximum point in changed variable.
de_infinite_integrator()
Constructor.
auto integrate(const Function &function) const -> result_type
Integrate a function.
auto points(index_type val) -> de_infinite_integrator &
Set number of points.
Class to perform numerical integration on infinite range using double exponential rule.
Class of tags of logs without memory management.
Class to incorporate logging in algorithms.
Definition of exceptions.
Definition of index_type type.
Definition of invocable_as concept.
Definition of macros for logging.
Definition of logging_mixin class.
std::ptrdiff_t index_type
Type of indices in this library.
constexpr T pi
Value of pi, .
constexpr T half
Value 0.5.
Namespace of numerical integration.
constexpr auto de_infinite_integrator_tag
Tag of de_infinite_integrator.
Definition of NUM_COLLECT_PRECONDITION macro.
#define NUM_COLLECT_PRECONDITION(CONDITION,...)
Check whether a precondition is satisfied and throw an exception if not.
Definition of real_scalar concept.