Skip to main content
FRAMES NO FRAMES

IlcMinDistance

public IlcConstraint IlcMinDistance(IlcIntExp x, IlcIntExp y, IlcInt k)
Definition file: ilcp/cpext.h
Include file: <ilcp/cpext.h>
Creates and returns a minimum distance constraint.

The function IlcMinDistance creates and returns a constraint. When that constraint is posted, it ensures that the absolute distance between x and y will be greater than or equal to k (that is, |x - y| >= k).

IlcMinDistance(x,y,k) is more efficient than, although logically equivalent to, the code IlcAbs(x-y) >= k.

IlcAllMinDistance is a similar function operating on all the variables in an array (rather than on two variables).

See Also: