16 #ifndef _SOPLEX_STABLE_SUM_H_ 17 #define _SOPLEX_STABLE_SUM_H_ 21 #include <type_traits> 29 typename std::remove_const<T>::type
sum;
45 operator typename std::remove_const<T>::type()
const 56 #ifdef CHECK_STABLESUM 66 #if defined(_MSC_VER) || defined(__INTEL_COMPILER) 67 #pragma float_control( precise, on ) 69 #ifdef CHECK_STABLESUM 72 double t = sum + input;
74 double y = (sum - (t - z)) + (input - z);
85 operator double()
const 87 #ifdef CHECK_STABLESUM 88 if(
spxAbs(checksum - (sum + c)) >= 1e-6)
89 printf(
"stablesum viol: %g, rel: %g, checksum: %g\n",
spxAbs(checksum - (sum + c)),
91 assert(
spxAbs(checksum - (sum + c)) < 1e-6);
Rational spxAbs(const Rational &r)
Absolute.
void operator+=(double input)
void operator-=(double input)
void operator+=(const T &input)
Everything should be within this namespace.
std::remove_const< T >::type sum
void operator-=(const T &input)