C++ Reference: class IntVar

Note: This documentation is automatically generated.

The class IntVar is a subset of IntExpr. In addition to the IntExpr protocol, it offers persistence, removing values from the domains, and a finer model for events.
Method
Accept

Return type: void

Arguments: ModelVisitor* const visitor

Accepts the given visitor.

Contains

Return type: virtual bool

Arguments: int64_t v

This method returns whether the value 'v' is in the domain of the variable.

index

Return type: int

Returns the index of the variable.

IntVar

Return type: explicit

Arguments: Solver* const s

IntVar

Arguments: Solver* const s, const std::string& name

~IntVar

IsDifferent

Return type: virtual IntVar*

Arguments: int64_t constant

IsEqual

Return type: virtual IntVar*

Arguments: int64_t constant

IsEqual

IsGreaterOrEqual

Return type: virtual IntVar*

Arguments: int64_t constant

IsLessOrEqual

Return type: virtual IntVar*

Arguments: int64_t constant

IsVar

Return type: bool

MakeDomainIterator

Return type: virtual IntVarIterator*

Arguments: bool reversible

Creates a domain iterator. When 'reversible' is false, the returned object is created on the normal C++ heap and the solver does NOT take ownership of the object.

MakeHoleIterator

Return type: virtual IntVarIterator*

Arguments: bool reversible

Creates a hole iterator. When 'reversible' is false, the returned object is created on the normal C++ heap and the solver does NOT take ownership of the object.

OldMax

Return type: virtual int64_t

Returns the previous max.

OldMin

Return type: virtual int64_t

Returns the previous min.

RemoveInterval

Return type: virtual void

Arguments: int64_t l, int64_t u

This method removes the interval 'l' .. 'u' from the domain of the variable. It assumes that 'l' <= 'u'.

RemoveValue

Return type: virtual void

Arguments: int64_t v

This method removes the value 'v' from the domain of the variable.

RemoveValues

Return type: virtual void

Arguments: const std::vector<int64_t>& values

This method remove the values from the domain of the variable.

SetValues

Return type: virtual void

Arguments: const std::vector<int64_t>& values

This method intersects the current domain with the values in the array.

Size

Return type: virtual uint64_t

This method returns the number of values in the domain of the variable.

Value

Return type: virtual int64_t

This method returns the value of the variable. This method checks before that the variable is bound.

Var

Return type: IntVar*

VarType

Return type: virtual int

WhenBound

Return type: virtual void

Arguments: Demon* d

This method attaches a demon that will be awakened when the variable is bound.

WhenBound

Return type: void

Arguments: Solver::Closure closure

This method attaches a closure that will be awakened when the variable is bound.

WhenBound

Return type: void

Arguments: Solver::Action action

This method attaches an action that will be awakened when the variable is bound.

WhenDomain

Return type: virtual void

Arguments: Demon* d

This method attaches a demon that will watch any domain modification of the domain of the variable.

WhenDomain

Return type: void

Arguments: Solver::Closure closure

This method attaches a closure that will watch any domain modification of the domain of the variable.

WhenDomain

Return type: void

Arguments: Solver::Action action

This method attaches an action that will watch any domain modification of the domain of the variable.