Generated on Sat Feb 7 2015 02:01:40 for Gecode by doxygen 1.8.9.1

Integer variables. More...

#include <int.hh>

Related Functions

(Note that these are not member functions.)

template<class Char , class Traits >
std::basic_ostream< Char, Traits > & operator<< (std::basic_ostream< Char, Traits > &os, const IntVar &x)
 Print integer variable x. More...
 

Constructors and initialization

 IntVar (void)
 Default constructor. More...
 
 IntVar (const IntVar &y)
 Initialize from integer variable y. More...
 
 IntVar (const Int::IntView &y)
 Initialize from integer view y. More...
 
 IntVar (Space &home, int min, int max)
 Initialize variable with range domain. More...
 
 IntVar (Space &home, const IntSet &d)
 Initialize variable with arbitrary domain. More...
 

Value access

int min (void) const
 Return minimum of domain. More...
 
int max (void) const
 Return maximum of domain. More...
 
int med (void) const
 Return median of domain (greatest element not greater than the median) More...
 
int val (void) const
 Return assigned value. More...
 
unsigned int size (void) const
 Return size (cardinality) of domain. More...
 
unsigned int width (void) const
 Return width of domain (distance between maximum and minimum) More...
 
unsigned int regret_min (void) const
 Return regret of domain minimum (distance to next larger value) More...
 
unsigned int regret_max (void) const
 Return regret of domain maximum (distance to next smaller value) More...
 

Domain tests

bool range (void) const
 Test whether domain is a range. More...
 
bool in (int n) const
 Test whether n is contained in domain. More...
 

Additional Inherited Members

- Public Types inherited from Gecode::VarImpVar< Int::IntVarImp >
typedef Int::IntVarImp VarImpType
 The variable implementation type corresponding to the variable. More...
 
- Public Member Functions inherited from Gecode::VarImpVar< Int::IntVarImp >
Int::IntVarImpvarimp (void) const
 Return variable implementation of variable. More...
 
unsigned int degree (void) const
 Return degree (number of subscribed propagators and advisors) More...
 
double afc (const Space &home) const
 Return accumulated failure count. More...
 
bool assigned (void) const
 Test whether view is assigned. More...
 
void update (Space &home, bool share, VarImpVar< Int::IntVarImp > &y)
 Update this variable to be a clone of variable y. More...
 
bool same (const VarImpVar< Int::IntVarImp > &y) const
 Test whether variable is the same as y. More...
 
bool before (const VarImpVar< Int::IntVarImp > &y) const
 Test whether variable comes before y (arbitrary order) More...
 
- Protected Member Functions inherited from Gecode::VarImpVar< Int::IntVarImp >
 VarImpVar (void)
 Default constructor. More...
 
 VarImpVar (Int::IntVarImp *y)
 Initialize with variable implementation y. More...
 
- Protected Attributes inherited from Gecode::VarImpVar< Int::IntVarImp >
Int::IntVarImpx
 Pointer to variable implementation. More...
 

Detailed Description

Integer variables.

Definition at line 350 of file int.hh.

Constructor & Destructor Documentation

Gecode::IntVar::IntVar ( void  )
inline

Default constructor.

Definition at line 51 of file int.hpp.

Gecode::IntVar::IntVar ( const IntVar y)
inline

Initialize from integer variable y.

Definition at line 53 of file int.hpp.

Gecode::IntVar::IntVar ( const Int::IntView y)
inline

Initialize from integer view y.

Definition at line 56 of file int.hpp.

Gecode::IntVar::IntVar ( Space home,
int  min,
int  max 
)

Initialize variable with range domain.

The variable is created with a domain ranging from min to max. The following exceptions might be thrown:

Definition at line 42 of file int.cpp.

Gecode::IntVar::IntVar ( Space home,
const IntSet d 
)

Initialize variable with arbitrary domain.

The variable is created with a domain described by d. The following exceptions might be thrown:

Definition at line 50 of file int.cpp.

Member Function Documentation

int Gecode::IntVar::min ( void  ) const
inline

Return minimum of domain.

Definition at line 66 of file int.hpp.

int Gecode::IntVar::max ( void  ) const
inline

Return maximum of domain.

Definition at line 74 of file int.hpp.

int Gecode::IntVar::med ( void  ) const
inline

Return median of domain (greatest element not greater than the median)

Definition at line 70 of file int.hpp.

int Gecode::IntVar::val ( void  ) const
inline

Return assigned value.

Throws an exception of type Int::ValOfUnassignedVar if variable is not yet assigned.

Definition at line 60 of file int.hpp.

unsigned int Gecode::IntVar::size ( void  ) const
inline

Return size (cardinality) of domain.

Definition at line 84 of file int.hpp.

unsigned int Gecode::IntVar::width ( void  ) const
inline

Return width of domain (distance between maximum and minimum)

Definition at line 80 of file int.hpp.

unsigned int Gecode::IntVar::regret_min ( void  ) const
inline

Return regret of domain minimum (distance to next larger value)

Definition at line 88 of file int.hpp.

unsigned int Gecode::IntVar::regret_max ( void  ) const
inline

Return regret of domain maximum (distance to next smaller value)

Definition at line 92 of file int.hpp.

bool Gecode::IntVar::range ( void  ) const
inline

Test whether domain is a range.

Definition at line 97 of file int.hpp.

bool Gecode::IntVar::in ( int  n) const
inline

Test whether n is contained in domain.

Definition at line 101 of file int.hpp.

Friends And Related Function Documentation

template<class Char , class Traits >
std::basic_ostream< Char, Traits > & operator<< ( std::basic_ostream< Char, Traits > &  os,
const IntVar x 
)
related

Print integer variable x.

Definition at line 42 of file print.hpp.


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