OR-Tools  8.1
fp_utils.h File Reference

Go to the source code of this file.

Classes

class  ScopedFloatingPointEnv
 

Namespaces

 operations_research
 The vehicle routing library lets one model and solve generic vehicle routing problems ranging from the Traveling Salesman Problem to more complex problems such as the Capacitated Vehicle Routing Problem with Time Windows.
 

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 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 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 ComputeGcdOfRoundedDoubles (const std::vector< double > &x, double scaling_factor)
 
template<typename FloatType >
FloatType Interpolate (FloatType x, FloatType y, FloatType alpha)
 

Macro Definition Documentation

◆ EXPECT_COMPARABLE

#define EXPECT_COMPARABLE (   expected,
  obtained,
  epsilon 
)
Value:
expected, obtained, epsilon, epsilon)) \
<< obtained << " != expected value " << expected \
<< " within epsilon = " << epsilon;

Definition at line 170 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;

Definition at line 176 of file fp_utils.h.

operations_research::AreWithinAbsoluteOrRelativeTolerances
bool AreWithinAbsoluteOrRelativeTolerances(FloatType x, FloatType y, FloatType relative_tolerance, FloatType absolute_tolerance)
Definition: fp_utils.h:120