Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::MathUtil Class Reference

Detailed Description

Definition at line 29 of file mathutil.h.

#include <mathutil.h>

Static Public Member Functions

template<typename IntegralType>
static IntegralType CeilOfRatio (IntegralType numerator, IntegralType denominator)
template<typename IntegralType>
static IntegralType FloorOfRatio (IntegralType numerator, IntegralType denominator)
static unsigned int GCD (unsigned int x, unsigned int y)
static unsigned int LeastCommonMultiple (unsigned int a, unsigned int b)
template<typename T>
static T Abs (const T x)
template<typename T>
static T Square (const T x)
static int64_t GCD64 (int64_t x, int64_t y)
template<typename T>
static T IPow (T base, int exp)
template<class IntOut, class FloatIn>
static IntOut Round (FloatIn x)
template<typename IntType>
static IntType RoundUpTo (IntType input_value, IntType rounding_value)
template<class IntOut, class FloatIn>
static IntOut SafeCast (FloatIn x)
template<class IntOut, class FloatIn>
static IntOut SafeRound (FloatIn x)
static int64_t FastInt64Round (double x)
static double Stirling (double n)
static double LogCombinations (int n, int k)
template<typename T>
static bool AlmostEquals (const T x, const T y)

Member Function Documentation

◆ Abs()

template<typename T>
T operations_research::MathUtil::Abs ( const T x)
inlinestatic

Definition at line 95 of file mathutil.h.

◆ AlmostEquals()

template<typename T>
bool operations_research::MathUtil::AlmostEquals ( const T x,
const T y )
inlinestatic

Definition at line 314 of file mathutil.h.

◆ CeilOfRatio()

template<typename IntegralType>
IntegralType operations_research::MathUtil::CeilOfRatio ( IntegralType numerator,
IntegralType denominator )
inlinestatic

Definition at line 39 of file mathutil.h.

◆ FastInt64Round()

int64_t operations_research::MathUtil::FastInt64Round ( double x)
inlinestatic

Definition at line 260 of file mathutil.h.

◆ FloorOfRatio()

template<typename IntegralType>
IntegralType operations_research::MathUtil::FloorOfRatio ( IntegralType numerator,
IntegralType denominator )
inlinestatic

Definition at line 53 of file mathutil.h.

◆ GCD()

unsigned int operations_research::MathUtil::GCD ( unsigned int x,
unsigned int y )
inlinestatic

Definition at line 68 of file mathutil.h.

◆ GCD64()

int64_t operations_research::MathUtil::GCD64 ( int64_t x,
int64_t y )
inlinestatic

Definition at line 107 of file mathutil.h.

◆ IPow()

template<typename T>
T operations_research::MathUtil::IPow ( T base,
int exp )
inlinestatic

Definition at line 119 of file mathutil.h.

◆ LeastCommonMultiple()

unsigned int operations_research::MathUtil::LeastCommonMultiple ( unsigned int a,
unsigned int b )
inlinestatic

Definition at line 79 of file mathutil.h.

◆ LogCombinations()

double operations_research::MathUtil::LogCombinations ( int n,
int k )
static

Definition at line 33 of file mathutil.cc.

◆ Round()

template<class IntOut, class FloatIn>
IntOut operations_research::MathUtil::Round ( FloatIn x)
inlinestatic

Definition at line 124 of file mathutil.h.

◆ RoundUpTo()

template<typename IntType>
IntType operations_research::MathUtil::RoundUpTo ( IntType input_value,
IntType rounding_value )
inlinestatic

Definition at line 143 of file mathutil.h.

◆ SafeCast()

template<class IntOut, class FloatIn>
IntOut operations_research::MathUtil::SafeCast ( FloatIn x)
inlinestatic

Definition at line 174 of file mathutil.h.

◆ SafeRound()

template<class IntOut, class FloatIn>
IntOut operations_research::MathUtil::SafeRound ( FloatIn x)
inlinestatic

Definition at line 227 of file mathutil.h.

◆ Square()

template<typename T>
T operations_research::MathUtil::Square ( const T x)
inlinestatic

Definition at line 101 of file mathutil.h.

◆ Stirling()

double operations_research::MathUtil::Stirling ( double n)
static

Definition at line 26 of file mathutil.cc.


The documentation for this class was generated from the following files: