indicator
Purpose
Synopsis
function indicator(type:integer,y:mpvar,ctr:linctr|nlctr):logctr
Arguments
|
type
|
The indicator type:
|
||||
|
y
|
The variable associated to the constraint
|
||||
|
ctr
|
A linear or nonlinear constraint
|
Return value
Example
This example shows how to define two indicator constraints. The second constraint labeled L is stated with the help of an auxiliary linear constraint definition. This temporary constraint C needs to be deleted from the problem after having been used in the definition of the indicator constraint. The notation b(1)=1 -> ... should be read as 'if b(1) takes the value 1 then ... must hold'
declarations R=1..2, S=1..3 C: linctr ! Linear constraint L: logctr ! Logical (indicator) constraint x: array(S) of mpvar ! Decision variables b: array(R) of mpvar ! Indicator variables end-declarations forall(i in R) b(i) is_binary ! Indicator variables must be binaries C:= x(2)+x(3)<=5 ! Constraint to transform into indicator ctr. ! Define 2 indicator constraints indicator(1, b(1), x(1)+x(2)>=12) ! b(1)=1 -> x(1)+x(2)>=12 L:= indicator(-1, b(2), C) ! b(2)=0 -> x(2)+x(3)<=5 C:=0 ! Delete the auxiliary constraint definition
Related topics
Module
© 2001-2026 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.
