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
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
126 this->
logger(),
"Maximum point must be a positive value.");
139 "Number of points must be a positive integer.");
static constexpr index_type default_points
Default number of points.
index_type points_
Number of points.
static constexpr auto default_max_point
Default maximum point in changed variable.
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.
variable_type max_point_
Maximum point in changed variable.
static constexpr variable_type half_pi
Half value of pi.
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.
logging_mixin(log_tag_view tag)
Constructor.
auto logger() const noexcept -> const num_collect::logging::logger &
Access to the logger.
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.