FICO
FICO Xpress Optimization Examples Repository
FICO Optimization Community FICO Xpress Optimization Home
Back to examples browserPrevious exampleNext example

Working with unions

Description
  • uniondef.mos: Defining unions, assignment of values, retrieving type information, compatible union types in subroutine arguments
  • unioninit.mos: Initializing unions from a text file (requires uniondata.dat), displaying type names
  • unionops.mos: 'reference to' operator, accessing unions of array type (exists, create, delcell, reset)
Further explanation of this example: 'Mosel User Guide', Section 8.8 Unions


Source Files
By clicking on a file name, a preview is opened at the bottom of this page.
uniondef.mos[download]
unioninit.mos[download]
unionops.mos[download]

Data Files





uniondata.dat

! Data file for 'unioninit.mos'
L: [10 "abc" true 7.5]
S: [10 "abc" true 7.5]
B: [(1) "abc" (3) 5 (4) 5.6 ]

Back to examples browserPrevious exampleNext example