1 #ifndef _GLUCAT_SCALAR_IMP_H 2 #define _GLUCAT_SCALAR_IMP_H 37 #include <boost/numeric/ublas/traits.hpp> 49 template<
typename Other_Scalar_T >
58 template<
typename Other_Scalar_T >
65 #if defined(_GLUCAT_USE_QD) 73 {
return static_cast<long double>(val.x[0]) + static_cast<long double>(val.x[1]); }
82 {
return static_cast<long double>(val.x[0]) + static_cast<long double>(val.x[1]); }
91 {
return {double(val),double(val - static_cast<long double>(
double(val)))}; }
100 {
return {val.x[0],val.x[1]}; }
109 {
return {double(val),double(val - static_cast<long double>(
double(val))),0.0,0.0}; }
118 {
return {val.x[0],val.x[1],0.0,0.0}; }
122 template<
typename Scalar_T >
132 template<
typename Scalar_T >
142 #endif // _GLUCAT_SCALAR_IMP_H
auto to_promote(const Scalar_T &val) -> typename numeric_traits< Scalar_T >::promoted::type
Cast to promote.
static auto to_double(const Scalar_T &val) -> double
Cast to double.
static auto to_scalar_t(const Other_Scalar_T &val) -> Scalar_T
Cast to Scalar_T.
auto to_demote(const Scalar_T &val) -> typename numeric_traits< Scalar_T >::demoted::type
Cast to demote.