40template <base::concepts::real_scalar Scalar>
48template <base::concepts::real_scalar Scalar>
58template <
typename Variable>
66template <base::concepts::real_scalar_dense_vector Variable>
95 : variable_(variable), error_(error) {}
99 return (error_.array().abs() <=
106 return (error_.array().abs() <=
114 return (error_.array().abs() <=
122 return (error_.array().abs() <=
133 evaluator eval{variable, error};
149 : variable_(variable), error_(error) {}
154 return sqrt((error_.array() /
177 return sqrt((error_.array() /
202 evaluator eval{variable, error};
214 "Tolerance of relative error must be a non-negative value.");
227 (val.array() >=
static_cast<scalar_type>(0)).all(),
228 "Tolerance of relative error must be non-negative values.");
241 "Tolerance of absolute error must be a non-negative value.");
254 (val.array() >=
static_cast<scalar_type>(0)).all(),
255 "Tolerance of absolute error must be non-negative values.");
276template <base::concepts::real_scalar Variable>
327 "Tolerance of relative error must be a non-negative value.");
340 "Tolerance of absolute error must be a non-negative value.");
variant_type tol_abs_error_
Tolerance of absolute error.
auto tol_abs_error(const variable_type &val) -> error_tolerances &
Set the tolerance of absolute error.
variant_type tol_rel_error_
Tolerance of relative error.
auto check(const variable_type &variable, const variable_type &error) const -> bool
Check whether the given error satisfies tolerances.
std::variant< scalar_type, variable_type > variant_type
Type of variant used for tolerances.
error_tolerances()
Constructor.
auto calc_norm(const variable_type &variable, const variable_type &error) const -> scalar_type
Calculate the norm of the error determined by tolerances.
auto tol_rel_error(const scalar_type &val) -> error_tolerances &
Set the tolerance of relative error.
auto tol_abs_error(const scalar_type &val) -> error_tolerances &
Set the tolerance of absolute error.
typename variable_type::Scalar scalar_type
Type of scalars.
auto tol_rel_error(const variable_type &val) -> error_tolerances &
Set the tolerance of relative error.
Variable variable_type
Type of variables.
Class of error tolerances hairer1993.
Definition of exceptions.
Definition of macros for logging.
Namespace of internal implementations.
constexpr Scalar default_tol_rel_error
Default tolerance of relative errors.
constexpr Scalar default_tol_abs_error
Default tolerance of absolute errors.
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 real_scalar concept.
Definition of real_scalar_dense_vector concept.