To specify an application with a cone of linear scalar inequalities, the subroutine
DSDPCreateLPCone( DSDP dsdp, LPCone *newlpcone)can be used to create a new object that describes a cone with
DSDP
solver and the second
argument is the address of an
LPCone variable. This subroutine will allocate structures needed to specify the
constraints and point the variable to this structure. Multiple cones for these inequalities
can be created for the same DSDP
solver, but it is usually more efficient to group all inequalities
of this type into the same structure.
All subroutines that pass data to the LP cone use this LPCone variable
in the first argument.
A list of linear inequalities are passed to the object in
sparse column format.
The vector
should be considered an additional column of the data.
(In the formulation (P), the data
and
is represented in sparse row format.)
Pass the data to the LPCone using the subroutine:
LPConeSetData(LPCone lpcone, int n, const int nnzin[], const int row[], const double aval[]);In this case, the integer array nnzin has length
For example, the following problems in the form of (D):
If its more convenient to specify the vector in the last column, consider using the subroutine:
LPConeSetData2(LPCone lpcone,int n, const int ik[],const int cols[],const double vals[]);This input is also sparse column input, but the first column corr In this form the input arrays would be as follows:
The subroutines
LPConeView(LPCone lpcone); LPConeView2(LPCone lpcone);can be used to view the data that has been set and verify the correctness of the data. Multiple
LPCone
structures can be used, but for efficiency purposes, it is often better to include all
linear inequalities in a single cone.
The variables in (D) and
in (P)
can be found using the subroutines
LPConeGetXArray(LPCone lpcone,double *xout[], int *n); LPConeGetSArray(LPCone lpcone,double *sout[], int *n);In these subroutines, the second argument sets a pointer to an an array of doubles containing the variables and the integer in the third argument will be set to the length of this array. These array were allocated by the
LPCone
object and the memory will be freed with the DSDP
solver object is destroyed.
Alternatively, the application can give the LPCone
an array in which to put the solution LPConeSetXVec(LPCone lpcone,double xout[], int n);At completion of the
DSDP
solver, the solution
In some applications it may be useful to fix a variable to a number. Instead of modeling this constraint as a pair of linear inequalities, fixed variables can be passed directly to the solver using the subroutine
DSDPSetFixedVariables(DSDP dsdp, double vars[], double vals[], double x[],int n);In this subroutine, the array of variables in the second argument is set to the values in the array of the third argument. The fourth argument is an optional array in which the solver will put the sensitivities to these fixed variables. The final argument is the length of the arrays. Note, the values in the second argument are integer numbers from