Finalize the definition of a set or list.
procedure finalize(s:set)
procedure finalize(l:list)
Dynamic set
Dynamic list
In the following, an indexing set is defined, on which depends a dynamic array of decision variables. The set is subsequently defined to have three elements and is finalized. A static array is then defined:
 Set1: set of string
 x: array(Set1) of mpvar  ! Declare a dynamic array of variables 
                          ! (entries need to be created
                          !  subsequently)
Set1:= {"first", "second", "fifth"}
finalize(Set1)            ! Finalize the set definition

 y: array(Set1) of mpvar  ! Declare a static array of variables 
                          ! (entries are created immediately)
Further information
This procedure finalizes the definition of a set (or list), that is, it turns a dynamic set into a constant set consisting of the elements that are currently in the set. All subsequently declared arrays that are indexed by this set will be created as static (= fixed size). Any arrays indexed by this set that have been declared prior to finalizing the set retain the status dynamic but their set of elements cannot be modified any more.

If you have any comments or suggestions about these pages, please send mail to

© Copyright 2001-2013 Fair Isaac Corporation. All rights reserved.