41 "num_collect::integration::de_semi_infinite_integrator");
51template <
typename Variable>
61 static constexpr float default_max_point = 3.0F;
71 static constexpr double default_max_point = 4.0;
82template <
typename Signature>
92template <
typename Result, base::concepts::real_scalar Variable>
115 template <base::concepts::invocable_as<result_type(variable_type)> Function>
116 [[nodiscard]]
auto integrate(
const Function& function)
const
133 const variable_type diff_coeff_plus = diff_coeff(changed_var);
134 sum += function(var_plus) * diff_coeff_plus;
138 const variable_type diff_coeff_minus = diff_coeff(-changed_var);
139 sum += function(var_minus) * diff_coeff_minus;
142 return sum * interval;
152 template <base::concepts::invocable_as<result_type(variable_type)> Function>
153 [[nodiscard]]
auto operator()(
const Function& function)
const
155 return integrate(function);
166 this->logger(),
"Maximum point must be a positive value.");
179 "Number of points must be a positive integer.");
197 std::cosh(changed_var);
201 static constexpr auto default_max_point =
std::decay_t< Variable > variable_type
Type of variables.
auto operator()(const Function &function) const -> result_type
Integrate a function.
auto max_point(variable_type val) -> de_semi_infinite_integrator &
Set maximum point in changed variable.
de_semi_infinite_integrator()
Constructor.
auto integrate(const Function &function) const -> result_type
Integrate a function.
static auto diff_coeff(variable_type changed_var) -> variable_type
Calculate differential coefficient for change of variable.
auto points(index_type val) -> de_semi_infinite_integrator &
Set number of points.
std::decay_t< Result > result_type
Type of results.
Class to perform numerical integration on semi-infinite range using double exponential rule.
Class of tags of logs without memory management.
Class to incorporate logging in algorithms.
Definition of index_type type.
Definition of invocable_as concept.
Definition of log_tag_view class.
Definition of logging_mixin class.
std::ptrdiff_t index_type
Type of indices in this library.
constexpr T pi
Value of pi, .
Namespace of numerical integration.
constexpr auto de_semi_infinite_integrator_tag
Tag of de_semi_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.
Helper class of constants for use in de_semi_infinite_integrator class.