OR-Tools  9.2
fp_utils.h File Reference

Go to the source code of this file.

Classes

class  ScopedFloatingPointEnv
 

Namespaces

 operations_research
 Collection of objects used to extend the Constraint Solver library.
 

Macros

#define EXPECT_COMPARABLE(expected, obtained, epsilon)
 
#define EXPECT_NOTCOMPARABLE(expected, obtained, epsilon)
 

Functions

template<typename FloatType >
bool IsPositiveOrNegativeInfinity (FloatType x)
 
template<typename FloatType >
bool AreWithinAbsoluteOrRelativeTolerances (FloatType x, FloatType y, FloatType relative_tolerance, FloatType absolute_tolerance)
 
template<typename FloatType >
bool AreWithinAbsoluteTolerance (FloatType x, FloatType y, FloatType absolute_tolerance)
 
template<typename FloatType >
bool IsSmallerWithinTolerance (FloatType x, FloatType y, FloatType tolerance)
 
template<typename FloatType >
bool IsIntegerWithinTolerance (FloatType x, FloatType tolerance)
 
void GetBestScalingOfDoublesToInt64 (const std::vector< double > &input, int64_t max_absolute_sum, double *scaling_factor, double *max_relative_coeff_error)
 
double GetBestScalingOfDoublesToInt64 (const std::vector< double > &input, const std::vector< double > &lb, const std::vector< double > &ub, int64_t max_absolute_sum)
 
void ComputeScalingErrors (const std::vector< double > &input, const std::vector< double > &lb, const std::vector< double > &ub, double scaling_factor, double *max_relative_coeff_error, double *max_scaled_sum_error)
 
int64_t ComputeGcdOfRoundedDoubles (const std::vector< double > &x, double scaling_factor)
 
template<typename FloatType >
FloatType Interpolate (FloatType x, FloatType y, FloatType alpha)
 
int fast_ilogb (double value)
 
double fast_scalbn (double value, int exponent)
 
void fast_scalbn_inplace (double &mutable_value, int exponent)
 

Macro Definition Documentation

◆ EXPECT_COMPARABLE

#define EXPECT_COMPARABLE (   expected,
  obtained,
  epsilon 
)
Value:
expected, obtained, epsilon, epsilon)) \
<< obtained << " != expected value " << expected \
<< " within epsilon = " << epsilon;
bool AreWithinAbsoluteOrRelativeTolerances(FloatType x, FloatType y, FloatType relative_tolerance, FloatType absolute_tolerance)
Definition: fp_utils.h:124

Definition at line 174 of file fp_utils.h.

◆ EXPECT_NOTCOMPARABLE

#define EXPECT_NOTCOMPARABLE (   expected,
  obtained,
  epsilon 
)
Value:
expected, obtained, epsilon, epsilon)) \
<< obtained << " == expected value " << expected \
<< " within epsilon = " << epsilon;
bool AreWithinAbsoluteOrRelativeTolerances(FloatType x, FloatType y, FloatType relative_tolerance, FloatType absolute_tolerance)
Definition: fp_utils.h:124

Definition at line 180 of file fp_utils.h.