Generated on Thu Mar 22 10:39:57 2012 for Gecode by doxygen 1.6.3

Gecode::Int::Limits Namespace Reference [Integer variables]

Numerical limits for integer variables. More...

Functions

bool valid (int n)
Return whether integer n is in range.
bool valid (double n)
Return whether double n is in range.
void check (int n, const char *l)
Check whether integer n is in range, otherwise throw out of limits with information l.
void check (double n, const char *l)
Check whether double n is in integer range, otherwise throw out of limits exception with information l.
void positive (int n, const char *l)
Check whether integer n is in range and strictly positive, otherwise throw out of limits with information l.
void positive (double n, const char *l)
Check whether double n is in integer range and strictly postive, otherwise throw out of limits exception with information l.
void nonnegative (int n, const char *l)
Check whether integer n is in range and nonnegative, otherwise throw out of limits with information l.
void nonnegative (double n, const char *l)
Check whether double n is in integer range and nonnegative, otherwise throw out of limits exception with information l.
void double_check (double n, const char *l)
Check whether double n is in exactly representable range, otherwise throw out of limits with information l.

Variables

const int max = INT_MAX - 1
Largest allowed integer value.
const int min = -max
Smallest allowed integer value.
const int infinity = max + 1
Infinity.
const double double_max = 9007199254740991.0
Largest double that can exactly be represented.
const double double_min = -9007199254740991.0
Smallest double that can exactly be represented.
const double double_infinity = DBL_MAX
Infinity value for doubles.

Detailed Description

Numerical limits for integer variables.

The integer limits are chosen such changing the sign is always possible without overflow.

Function Documentation

 bool Gecode::Int::Limits::valid ( int n ) ` [inline]`

Return whether integer n is in range.

Definition at line 41 of file limits.hpp.

 bool Gecode::Int::Limits::valid ( double n ) ` [inline]`

Return whether double n is in range.

Definition at line 46 of file limits.hpp.

 void Gecode::Int::Limits::check ( int n, const char * l ) ` [inline]`

Check whether integer n is in range, otherwise throw out of limits with information l.

Definition at line 51 of file limits.hpp.

 void Gecode::Int::Limits::check ( double n, const char * l ) ` [inline]`

Check whether double n is in integer range, otherwise throw out of limits exception with information l.

Definition at line 57 of file limits.hpp.

 void Gecode::Int::Limits::positive ( int n, const char * l ) ` [inline]`

Check whether integer n is in range and strictly positive, otherwise throw out of limits with information l.

Definition at line 63 of file limits.hpp.

 void Gecode::Int::Limits::positive ( double n, const char * l ) ` [inline]`

Check whether double n is in integer range and strictly postive, otherwise throw out of limits exception with information l.

Definition at line 69 of file limits.hpp.

 void Gecode::Int::Limits::nonnegative ( int n, const char * l ) ` [inline]`

Check whether integer n is in range and nonnegative, otherwise throw out of limits with information l.

Definition at line 75 of file limits.hpp.

 void Gecode::Int::Limits::nonnegative ( double n, const char * l ) ` [inline]`

Check whether double n is in integer range and nonnegative, otherwise throw out of limits exception with information l.

Definition at line 81 of file limits.hpp.

 void Gecode::Int::Limits::double_check ( double n, const char * l ) ` [inline]`

Check whether double n is in exactly representable range, otherwise throw out of limits with information l.

Definition at line 87 of file limits.hpp.

Variable Documentation

 const int Gecode::Int::Limits::max = INT_MAX - 1

Largest allowed integer value.

Definition at line 111 of file int.hh.

 const int Gecode::Int::Limits::min = -max

Smallest allowed integer value.

Definition at line 113 of file int.hh.

 const int Gecode::Int::Limits::infinity = max + 1

Infinity.

Definition at line 115 of file int.hh.

 const double Gecode::Int::Limits::double_max = 9007199254740991.0

Largest double that can exactly be represented.

Definition at line 133 of file int.hh.

 const double Gecode::Int::Limits::double_min = -9007199254740991.0

Smallest double that can exactly be represented.

Definition at line 135 of file int.hh.

 const double Gecode::Int::Limits::double_infinity = DBL_MAX

Infinity value for doubles.

Definition at line 139 of file int.hh.