SLPDATA("XV")


Purpose
Define an array of xvitems as an XV
Synopsis
procedure SLPDATA(XV:string, XArray:array(XR) of xvitem)
Arguments
XV 
string containing "XV", indicating the SLPDATA type
XArray 
an array of xvitems to be defined as an XV
Example

The following example declares two arrays of xvitem:
rTheta is a 1-dimensional array, which will correspond to a single XV with (in this case) up to 50 items;
XXA is a 2-dimensional array, which will correspond to an array of nBox XVs each with up to (in this case) 10 items.

The first two SLPDATA statements define two user functions. The remaining two SLPDATA statements define rTheta and XXA as XVs.

The XVs are used in the user functions through the general-purpose Func function, which allows an XV to be used in place of an array of values. rTheta can appear directly because it is 1-dimensional. The relevant XV from the array XXA is referenced using the first item in the appropriate part of the array so that XXA(B,1), being the first item in XXA(B), refers to the Bth XV in XXA.


declarations
  rTheta: array (1..50) of xvitem
  XXA: array(1..nBox,1..10) of xvitem
end-declarations
SLPDATA("UF", "Area", "DOUBLE,INTEGER",
        "", "DLL", "myProgLib")
SLPDATA("UF", "ValueCalc", "DOUBLE,INTEGER",
        "", "DLL", "myProgLib")
SLPDATA("XV", rTheta)
SLPDATA("XV",XXA)

...
Obj = Func("Area",rTheta)
forall (B in 1..nBox) Value(B) = Func("ValueCalc",XXA(B,1))

Further information

An array of xvitems must be declared as an XV before it can be used in a statement where an XV is required — for example, in a Func reference.

An array of XVs is declared as an array of xvitem objects with one extra dimension (since each XV is itself an array of xvitem objects). Thus, a 1-dimensional array of XVs with dimension 1..nBox is described as a 2-dimensional array of xvitem objects, with its first dimension 1..nBox and the second dimension large enough for the largest of the XVs in the array. When an XV in an array of XVs is used, it is referred to by using its first xvitem object. So, in the example above, to refer to XXA number B, use XXA(B,1).




If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.