Initializing help system before first use

# setdomain

Purpose
Sets the domain of the variable to the set of integers passed in argument.
Synopsis
`procedure setdomain(x:cpvar, domain:set of integers)`
`procedure setdomain(x:cpvar, lowerBound:integer, upperBound:integer)`
`procedure setdomain(x:cpfloatvar, lowerBound:real, upperBound:real)`
`procedure setdomain(x:cpauxvar, lowerBound:real, upperBound:real)`
Arguments

x | the decision variable
domain | Set of integers representing the target domain.
lowerBound | lower bound of the interval
upperBound | upper bound of the interval

Example
The following example shows how to set the domain of a cpvar x to the set of integers {1,3,5,7,9}

    setdomain(x,{1,3,5,7,9})

Related topics
getlb getub getmiddle getsize getval is_fixed getdegree gettarget getrand getnext getprev
Parent Topic Variables

© 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.