45#ifndef ROL_SCALARTRAITS_HPP
46#define ROL_SCALARTRAITS_HPP
53template<
typename Real>
54struct ScalarTraits_Magnitude {
58template<
typename Real>
59struct ScalarTraits_Magnitude<std::complex<Real>> {
64template<
typename Real>
69 static constexpr Real
zero() noexcept {
return static_cast<Real
>(0.0); }
70 static constexpr Real half() noexcept {
return static_cast<Real
>(0.5); }
71 static constexpr Real one() noexcept {
return static_cast<Real
>(1.0); }
72 static constexpr Real two() noexcept {
return static_cast<Real
>(2.0); }
74 static constexpr Real eps() noexcept {
75 return std::numeric_limits<Real>::epsilon();
78 static constexpr Real rmin() noexcept {
79 return std::numeric_limits<Real>::min();
82 static constexpr Real rmax() noexcept {
83 return std::numeric_limits<Real>::max();
86 static constexpr Real two_pi() noexcept {
87 return static_cast<Real
>( 6.283185307179586476925286766559005768L );
90 static constexpr Real pi() noexcept {
91 return static_cast<Real
>( 3.141592653589793238462643383279502884L );
94 static constexpr Real half_pi() noexcept {
95 return static_cast<Real
>( 1.570796326794896619231321691639751442L );
98 static constexpr Real quarter_pi() noexcept {
99 return static_cast<Real
>( 7.85398163397448309615660845819875721e-1L );
102 static constexpr Real sqrt_two_pi() noexcept {
103 return static_cast<Real
>( 2.506628274631000502415765284811045252L );
106 static constexpr Real sqrt_pi() noexcept {
107 return static_cast<Real
>( 1.772453850905516027298167483341145182L );
110 static constexpr Real sqrt_half_pi() noexcept {
111 return static_cast<Real
>( 1.253314137315500251207882642405522626L );
114 static constexpr Real sqrt_two() noexcept {
115 return static_cast<Real
>( 1.414213562373095048801688724209698078L );
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0 zero)()
typename ScalarTraits_Magnitude< Real >::type magnitudeType