39template <
typename Derived, concepts::formula Formula>
103 "Rate to reduce step sizes when error is large must be a positive "
123 [[nodiscard]]
auto derived() noexcept -> Derived& {
124 return *
static_cast<Derived*
>(
this);
132 [[nodiscard]]
auto derived() const noexcept -> const Derived& {
133 return *
static_cast<const Derived*
>(
this);
147 const bool tolerance_satisfied =
tolerances().check(variable, error);
148 if (!tolerance_satisfied) {
151 "Error tolerance not satisfied with step size {}.",
158 "Error tolerance not satisfied even with the lowest step size "
160 step_size,
tolerances().calc_norm(variable, error));
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.
Class of error tolerances hairer1993.
Base class of classes to control step sizes.
typename formula_type::problem_type problem_type
Type of problem.
scalar_type reduction_rate_
Rate to reduce step sizes when error is large.
static constexpr auto default_reduction_rate
Default rate to reduce step sizes when error is large.
step_size_limits< scalar_type > limits_
Limits of step sizes.
auto limits(const step_size_limits< scalar_type > &val) -> Derived &
Set the limits of step sizes.
auto reduce_if_needed(scalar_type &step_size, const variable_type &variable, const variable_type &error) -> bool
Reduce step size if needed.
error_tolerances< variable_type > tolerances_
Error tolerances.
auto limits() const -> const step_size_limits< scalar_type > &
Get the limits of step sizes.
auto derived() noexcept -> Derived &
Access derived object.
auto reduction_rate(const scalar_type &val) -> Derived &
Set the rate to reduce step sizes when error is large.
auto tolerances() const -> const error_tolerances< variable_type > &
Get the error tolerances.
Formula formula_type
Type of formula.
auto tolerances(const error_tolerances< variable_type > &val) -> Derived &
Set the error tolerances.
auto derived() const noexcept -> const Derived &
Access derived object.
typename problem_type::scalar_type scalar_type
Type of scalars.
typename problem_type::variable_type variable_type
Type of variables.
step_size_controller_base(logging::log_tag_view tag)
Constructor.
Class of limits of step sizes.
auto apply(scalar_type val) const -> scalar_type
Apply the limit of this object.
auto lower_limit() const -> const scalar_type &
Get the lower limit.
Definition of error_tolerances class.
Definition of exceptions.
Definition of log_tag_view class.
Definition of macros for logging.
#define NUM_COLLECT_LOG_TRACE(LOGGER,...)
Write a trace log.
#define NUM_COLLECT_LOG_WARNING(LOGGER,...)
Write a warning log.
Definition of logging_mixin class.
Namespace of solvers of ordinary differential equations (ODE).
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 step_size_limits class.