Gecode::Int::Limits Namespace Reference
[Integer variables]
Numerical limits for integer variables. More...
Functions | |
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. | |
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. |
Detailed Description
Numerical limits for integer variables.
The integer limits are chosen such changing the sign is always possible without overflow.
Function Documentation
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 41 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 47 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 53 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 59 of file limits.hpp.
Variable Documentation
const int Gecode::Int::Limits::max = INT_MAX - 1 |
const int Gecode::Int::Limits::min = -max |
const int Gecode::Int::Limits::infinity = max + 1 |