DSDP
Linear Programming

Functions

int DSDPCreateLPCone (DSDP dsdp, LPCone *dspcone)
 Create a new object for linear programs and scalar inequalities.
 
int LPConeCopyS (LPCone lpcone, double s[], int n)
 Copy the variables s into the spedified array.
 
int LPConeGetDimension (LPCone lpcone, int *n)
 Get the dimension is the number of variables x, which equals the number of slack variables s.
 
int LPConeGetXArray (LPCone lpcone, double *x[], int *n)
 Get the array used to store the x variables.
 
int LPConeSetData (LPCone lpcone, int n, const int ik[], const int cols[], const double vals[])
 Set data into the LP cone.
 
int LPConeSetData2 (LPCone lpcone, int n, const int ik[], const int cols[], const double vals[])
 Set data A and into the LP cone.
 
int LPConeView (LPCone lpcone)
 Print the data in the LP cone to the screen.
 
int LPConeView2 (LPCone lpcone)
 Print the data in the LP cone to the screen.
 

Detailed Description

Routines that create the LP cone object for linear inequalites, set the data, and provide access to the solutions.

#include dsdp5.h

In DSDP Standard Form a pure linear program is given by the following pair of problems.

\[ \begin{array}{lllllllll}
\mbox{Maximize} & b^T y & & \mbox{such that} & A^T y & \leq c \\
\mbox{Minimize} & c^T x & & \mbox{such that} & A x  & = b, & x \geq 0 \\
\end{array}
\]

Slack variables $ s:= c - A^Ty $ must be positive. Variables $ x,s \in \Re^n$.

LP data may be used in conjuction with semidefinite data.

Return values
0if successful

Function Documentation

◆ DSDPCreateLPCone()

int DSDPCreateLPCone ( DSDP dsdp,
LPCone * dspcone )

Create a new object for linear programs and scalar inequalities.

Parameters
dsdpthe solver
*dspconenew LP Cone object
Note
LP data can be specified using one or more LPCone objects. Although the use multiple cones is allowed, efficiency is best when all LP data is set in the same cone.
DSDP dsdp;
LPCone lpcone;
DSDPCreate(3,&dsdp);
DSDPCreateLPCone(dsdp,&lpcone);
struct LPCone_C * LPCone
The LPCone object points to blocks of data that specify linear scalar inequality constraints.
Definition dsdp5.h:27
struct DSDP_C * DSDP
An implementation of the dual-scaling algorithm for semidefinite programming.
int DSDPCreate(int m, DSDP *dsdpnew)
Create a DSDP solver. FIRST DSDP routine!
Definition dsdpsetup.c:30
int DSDPCreateLPCone(DSDP dsdp, LPCone *dspcone)
Create a new object for linear programs and scalar inequalities.
Definition dsdplp.c:509
See also
DSDPCreate()

Definition at line 509 of file dsdplp.c.

Referenced by mexFunction(), and ReadSDPAFile().

◆ LPConeCopyS()

int LPConeCopyS ( LPCone lpcone,
double s[],
int n )

Copy the variables s into the spedified array.

Parameters
lpconeLP Cone
sarray
nthe conic dimension and length of the array
See also
DSDPCreateLPCone()
LPConeGetDimension()

Definition at line 595 of file dsdplp.c.

Referenced by DSDPPrintSolution().

◆ LPConeGetDimension()

int LPConeGetDimension ( LPCone lpcone,
int * n )

Get the dimension is the number of variables x, which equals the number of slack variables s.

Parameters
lpconeLP Cone
ndimension

Definition at line 616 of file dsdplp.c.

Referenced by DSDPPrintData().

◆ LPConeGetXArray()

int LPConeGetXArray ( LPCone lpcone,
double * x[],
int * n )

Get the array used to store the x variables.

Parameters
lpconeLP Cone
xarray of variables
nthe dimension of the cone and length of the array
See also
DSDPCreateLPCone()

For example, after calling DSDPComputeX(),

int i,n;
double *x;
LPConeGetXArray(lpcone,&x,&n);
for (i=0;i<n,i++) printf("x[%d] = %16.8f\n",x[i]);
int LPConeGetXArray(LPCone lpcone, double *x[], int *n)
Get the array used to store the x variables.
Definition dsdplp.c:556

Definition at line 556 of file dsdplp.c.

Referenced by DSDPPrintSolution().

◆ LPConeSetData()

int LPConeSetData ( LPCone lpcone,
int n,
const int ik[],
const int cols[],
const double vals[] )

Set data into the LP cone.

Parameters
lpconethe LP cone
nthe number of inequalities
ikthe number of nonzeros in each column of the matrix
colsarray of column numbers
valsarray of LP data
See also
DSDPSetDualObjective()

For example, consider the following problem in the form of (D):

\[ \begin{array}{llllll}
\mbox{Maximize} & & y_1 & + & y_2 \\
\mbox{Subject to}
 & & 4 y_1 & + & 2 y_2 & \leq 6 \\
 & & 3 y_1 & + & 7 y_2 & \leq 10 \\
 & &   &   & -  y_2 & \leq 12 \\
\end{array}
\]

In this example, there three inequalities, so the dimension of the x vector would be 3 and n=3. The input arrays would be as follows:

int ik[]={0,3,5,7};
int row[]={0,1,2,0,1,0,1,2};
double vals[]={6.0,10.0,12.0,4.0,3.0,1.0,7.0,-1.0};
LPConeSetData(lpcone,3,ik,row,vals);
int DSDPSetDualObjective(DSDP dsdp, int i, double bi)
Set the objective vector b in (D).
Definition dsdpsetdata.c:25
int LPConeSetData(LPCone lpcone, int n, const int ik[], const int cols[], const double vals[])
Set data into the LP cone.
Definition dsdplp.c:666

Definition at line 666 of file dsdplp.c.

Referenced by ReadSDPAFile().

◆ LPConeSetData2()

int LPConeSetData2 ( LPCone lpcone,
int n,
const int ik[],
const int cols[],
const double vals[] )

Set data A and into the LP cone.

Parameters
lpconethe LP cone
nthe number of inequalities
ikthe number of nonzeros in each column of the matrix $A^T$
colsarray of column numbers in A
valsarray of nonzeros in A and c
See also
DSDPSetDualObjective()

For example, consider the following problem in the form of (D):

\[ \begin{array}{llllll}
\mbox{Maximize} & & y_1 & + & y_2 \\
\mbox{Subject to}
 & & 4 y_1 & + & 2 y_2 & \leq 6 \\
 & & 3 y_1 & + & 7 y_2 & \leq 10 \\
 & &   &   & -  y_2 & \leq 12 \\
\end{array}
\]

int ik[]={0,2,5,7};
int row[]={0,1,0,1,2,0,1,2};
double vals[]={4.0,3.0,2.0,7.0,-1.0,6.0,10.0,12.0};
LPConeSetData2(lpcone,3,ik,row,vals);
int LPConeSetData2(LPCone lpcone, int n, const int ik[], const int cols[], const double vals[])
Set data A and into the LP cone.
Definition dsdplp.c:717

Definition at line 717 of file dsdplp.c.

Referenced by mexFunction().

◆ LPConeView()

int LPConeView ( LPCone lpcone)

Print the data in the LP cone to the screen.

Parameters
lpconethe LP cone

Definition at line 1078 of file dsdplp.c.

Referenced by ReadSDPAFile().

◆ LPConeView2()

int LPConeView2 ( LPCone lpcone)

Print the data in the LP cone to the screen.

Parameters
lpconethe LP cone

Definition at line 744 of file dsdplp.c.

Referenced by ReadSDPAFile().