30#include "common/Interval.h"
33#include <boost/math/tools/roots.hpp>
43 template<
class F,
typename DomainType,
typename Tol>
45 const auto function = [&f](
Real s ) ->
Real{
46 const auto result = f( DomainType{s} );
47 return result.Units();
50 const std::pair<Real,Real> bracket = boost::math::tools::bracket_and_solve_root(
58 return { DomainType{bracket.first}, DomainType{bracket.second} };
61 template<
class F,
typename DomainType>
63 const auto function = [&f](
Real s ) -> std::pair<Real,Real>{
64 const auto result = f( DomainType{s} );
65 return { result.first.Units(), result.second.Units() };
68 return DomainType{ boost::math::tools::newton_raphson_iterate(
71 limits.
Near().Units(),
Namespace of common utility classes and methods.
Definition Helpers.h:43
Value< Dimension< 0, 0, 0 > > One
Dimensionless value.
Definition DimensionedValues.h:319
float Real
Underlying floating point type to be used with the dim library.
Definition DimensionedValues.h:190
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
An interval describes the area between two numbers. It is understood to contain the near one and exlu...
Definition Interval.h:42
constexpr Valtype Near() const noexcept
Definition Interval.h:381
constexpr Valtype Far() const noexcept
Definition Interval.h:386