Initializing help system before first use

Example

Some users of Mosel are annoyed by the fact that after solving an optimization problem they have to retrieve the solution value for every variable separately using function getsol. We therefore show in this example how to write a module solarray providing a procedure that copies the solution values of an array of variables into an array of reals. The arrays may be static or dynamic and of any number of dimensions (but of course, the solution array must correspond to the array of variables). Our aim is to be able to write a model along the following lines (assuming that the new procedure is also called solarray):

model "test solarray module"
 uses "solarray", "mmxprs"

 declarations
  R1=1..2
  R2={6,7,9}
  x: array(R1,R2) of mpvar
  sol: array(R1,R2) of real
 end-declarations
 ...
 solarray(x,sol)
 writeln(sol)

end-model