25 #ifndef _SOPLEX_STABLE_SUM_H_ 26 #define _SOPLEX_STABLE_SUM_H_ 27 #include <type_traits> 65 #ifdef SOPLEX_CHECK_STABLESUM 75 #if defined(_MSC_VER) || defined(__INTEL_COMPILER) 76 #pragma float_control( precise, on ) 78 #ifdef SOPLEX_CHECK_STABLESUM 81 double t = sum + input;
83 double y = (sum - (t - z)) + (input - z);
94 operator double()
const 96 #ifdef SOPLEX_CHECK_STABLESUM 98 if(
spxAbs(checksum - (sum + c)) >= 1e-6)
99 printf(
"stablesum viol: %g, rel: %g, checksum: %g\n",
spxAbs(checksum - (sum + c)),
103 assert(
spxAbs(checksum - (sum + c)) < 1e-6);
111 std::ostream& operator<<(std::ostream& s, const StableSum<T>&
sum)
113 s << static_cast<T>(
sum);
void operator+=(double input)
void operator-=(double input)
void operator+=(const T &input)
int printf(const S &format_str, const Args &... args)
Everything should be within this namespace.
std::remove_const< T >::type sum
void operator-=(const T &input)