Initializing help system before first use

setrange

Purpose
Set the domain range of a constraint.
Synopsis
procedure setrange(c:linctr, lb:real, ub:real)
Arguments
A linear constraint expression
lb 
Lower bound
ub 
Upper bound
Example
The following sets the domain of the x variable and defines c as a range constraint.
declarations
 x,y,z: mpvar
 c: linctr
end-declarations

c:= 2*y+4*z+5
setrange(x,3,10)   ! 3<=x<=10
setrange(c,1,30)   ! -4<=2*y+4*z<=25
Further information
1. If the parameter c is a linear expression a new anonymous range constraint is added to the problem. Otherwise, the provided constraint is turned into a range constraint (and added to the problem if required).
2. This procedure changes the type of the provided constraint to CT_RNG, stores the provided lower bound as an external information and records the upper bound as the constant term of the constraint. As a consequence defining the range of a constraint modifies its constant term, this has to be taken into account if a range constraint is converted to another type or used as part of a linear expression.

© 2001-2024 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.