FRAMES NO FRAMES

Class IlcBoolVar

Definition file: ilsolver/numi.h
Include file: <ilsolver/ilosolver.h>

Constrained Boolean variables are variables whose possible values are IlcTrue and IlcFalse. These variables are instances of the class IlcBoolVar, which is a subclass of the class IlcConstraint. This class inherits the member functions, isTrue and isFalse, as well as the operators defined for IlcConstraint, of course.

A constrained Boolean expression can be transformed into a constrained Boolean variable by means of the class constructor or the assignment operator. The effect of either of those is to associate a domain with the constrained Boolean expression.

See Also:

Constructor Summary
public IlcBoolVar(IloSolver solver, const char * name=0)
public IlcBoolVar(const IlcConstraint exp)
public IlcBoolVar()
Method Summary
public IlcBoolisBound()
public voidoperator=(const IlcBoolVar & exp)
public voidoperator=(const IlcConstraint & exp)
Inherited Methods from IlcConstraint
getImpl, getName, getObject, getParentDemon, getSolver, isFalse, isTrue, setName, setObject
Inherited Methods from IlcDemon
getConstraint, getImpl, getSolver, operator=
Constructor Detail

IlcBoolVar

public IlcBoolVar(IloSolver solver, const char * name=0)

This constructor creates a constrained Boolean variable with a domain containing IlcTrue and IlcFalse. The optional argument name, if provided, becomes the name of the constrained Boolean variable.


IlcBoolVar

public IlcBoolVar(const IlcConstraint exp)

This constructor associates a domain with the constrained Boolean expression, exp. That expression thus becomes a constrained Boolean variable. Moreover, the newly created constrained Boolean variable points to the same implementation object as exp.


IlcBoolVar

public IlcBoolVar()

This constructor creates a constrained Boolean variable which is empty, that is, whose handle pointer is null. This object must then be assigned before it can be used, exactly as when you declare a pointer.


Method Detail

isBound

public IlcBool isBound()

This member function indicates whether or not its invoking object is bound to a value in its domain.


operator=

public void operator=(const IlcBoolVar & exp)

This operator assigns an address to the handle pointer of the invoking object. That address is the location of the implementation object of the argument exp. After the execution of this operator, the invoking object and exp both point to the same implementation object. This assignment operator has no effect on its argument.


operator=

public void operator=(const IlcConstraint & exp)

This operator assigns an address to the handle pointer of the invoking object. That address is the location of the implementation object of the argument exp. After the execution of this operator, the invoking object and the exp object both point to the same implementation object. Moreover, this assignment operator associates a domain with the constrained Boolean expression exp, which is thus transformed into a constrained Boolean variable.