DSDP
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
src
solver
dsdp.h
Go to the documentation of this file.
1
#ifndef __DSDP_H
2
#define __DSDP_H
3
4
#include "
dsdpbasictypes.h
"
5
#include "
dsdpvec.h
"
6
#include "
dsdpschurmat.h
"
7
#include "
dsdpcone.h
"
8
#include "
dsdpconverge.h
"
18
typedef
struct
LUBounds_C*
YBoundCone
;
19
24
typedef
struct
RDCone*
RRCone
;
25
26
27
#define MAX_DSDP_MONITORS 5
28
#define MAX_XMAKERS 4
29
30
typedef
struct
{
31
DSDPVec
y;
32
DSDPVec
dy;
33
double
mu;
34
double
pstep;
35
DSDPVec
rhs;
36
} XMaker;
37
38
typedef
struct
{
/* This information is needed to compute the step Direction */
39
DSDPVec
y;
40
double
zbar;
41
double
mutarget;
42
double
logdet;
43
} DSDPState;
44
45
typedef
struct
{
46
int (*f)(
void
*);
47
void
* ptr;
48
}DRoutine;
49
50
typedef
struct
{
51
int (*monitor)(
struct
DSDP_C
*,
void
*);
52
void
*monitorctx;
53
} DMonitor;
54
55
typedef
struct
{
56
DSDPCone
cone;
57
int
coneid;
58
} DCone;
59
65
struct
DSDP_C
{
66
67
DSDPCG *sles;
68
int
slestype;
69
70
double
schurmu;
71
DSDPSchurMat
M;
72
double
Mshift;
73
double
maxschurshift;
74
75
int
ncones,maxcones;
76
DCone* K;
77
78
int
keyid;
79
80
int
solvetime,cgtime,ptime,dtime,ctime;
81
int
reuseM;
82
DSDPTruth
goty0;
83
DSDPTruth
setupcalled;
84
85
int
m;
/* number of constraints */
86
double
np;
/* Dimension of full variable matrix */
87
88
int
itnow;
/* current iterate */
89
int
maxiter;
/* Maximum number of iterates */
90
double
pobj;
/* current primal objective value - use duality gap */
91
double
ppobj;
/* current primal objetive value - evaluate P */
92
double
dobj,ddobj;
/* the current dual objective value */
93
double
pstep,dstep;
/* current primal and dual step lengths */
94
double
dualitygap;
95
double
mutarget;
96
double
mu,muold,mu0;
/* The current mu */
97
double
rho,potential,logdet,rhon;
98
double
pnorm;
/* the current value of ||P|| */
99
double
maxtrustradius;
100
double
cnorm,anorm,bnorm;
101
double
tracex,tracexs;
102
double
rgap;
103
double
pstepold;
104
105
DSDPVec
y;
/* dual variables */
106
DSDPVec
y0;
/* initial dual variables */
107
DSDPVec
ytemp;
/* temporary dual variables */
108
DSDPVec
dy1;
/* search direction 1 affine direction */
109
DSDPVec
dy2;
/* search direction 2 centering direction */
110
DSDPVec
dy;
/* total search direction = constant*dy1-dy2 */
111
DSDPVec
rhs1;
/* objective vector b to determine step direction */
112
DSDPVec
rhs2;
/* barrier vector A(S^{-1}) to determine step direction */
113
DSDPVec
rhs;
/* right-hand side of linear system */
114
DSDPVec
rhstemp;
/* temporary rhs vector */
115
DSDPVec
b;
/* dual objective vector */
116
117
/* Multiple of identity matrix added to dual */
118
double
r;
119
int
rflag;
120
DSDPPenalty UsePenalty;
121
RRCone
rcone;
122
123
DSDPTruth
usefixedrho;
/* True if fixed rho used. */
124
125
XMaker xmaker[MAX_XMAKERS];
/* step direction used to create X */
126
DSDPVec
xmakerrhs;
127
128
YBoundCone
ybcone;
129
double
pinfeas;
/* Infeasible in P indirectly -- neglect numerical errors */
130
double
perror;
/* Infeasible in P computed directly */
131
132
DSDPSolutionType
pdfeasible;
133
double
dinfeastol;
/* Parameter: Classify (D) as feasible */
134
double
pinfeastol;
/* Parameter: Classify (P) as feasible */
135
136
ConvergenceMonitor conv;
137
DSDPTerminationReason
reason;
138
139
DMonitor dmonitor[MAX_DSDP_MONITORS];
140
int
nmonitors;
141
142
DRoutine droutine[10];
143
int
ndroutines;
144
};
145
146
typedef
struct
DSDP_C
PD_DSDP
;
147
148
#define DSDPKEY 5432
149
150
#define DSDPValid(a) {if (!(a)||((a)->keyid!=DSDPKEY)){ DSDPSETERR(101,"DSDPERROR: Invalid DSDP object\n");}}
151
152
#include "
dsdpbasictypes.h
"
153
154
155
extern
int
DSDPCreateLUBoundsCone
(
DSDP
,
YBoundCone
*);
156
extern
int
BoundYConeSetBounds
(
YBoundCone
,
double
,
double
);
157
extern
int
BoundYConeGetBounds
(
YBoundCone
,
double
*,
double
*);
158
extern
int
BoundYConeAddX(
YBoundCone
,
double
,
DSDPVec
,
DSDPVec
,
DSDPVec
,
double
*);
159
extern
int
BoundYConeAddS(
YBoundCone
,
DSDPVec
,
DSDPVec
);
160
161
#ifdef __cplusplus
162
extern
"C"
{
163
#endif
164
165
extern
int
DSDPComputeObjective
(
DSDP
,
DSDPVec
,
double
*);
166
extern
int
DSDPComputeDY
(
DSDP
,
double
,
DSDPVec
,
double
*);
167
extern
int
DSDPComputeNewY
(
DSDP
,
double
,
DSDPVec
);
168
extern
int
DSDPComputeRHS
(
DSDP
,
double
,
DSDPVec
);
169
extern
int
DSDPComputePDY1
(
DSDP
,
double
,
DSDPVec
);
170
extern
int
DSDPComputePDY
(
DSDP
,
double
,
DSDPVec
,
double
*);
171
extern
int
DSDPComputePY
(
DSDP
,
double
,
DSDPVec
);
172
extern
int
DSDPComputeG
(
DSDP
,
DSDPVec
,
DSDPVec
,
DSDPVec
);
173
extern
int
DSDPComputePNorm
(
DSDP
,
double
,
DSDPVec
,
double
*);
174
extern
int
DSDPComputeDualityGap
(
DSDP
,
double
,
double
*);
175
extern
int
DSDPSaveYForX
(
DSDP
,
double
,
double
);
176
extern
int
DSDPSetY
(
DSDP
,
double
,
double
,
DSDPVec
);
177
extern
int
DSDPComputePotential
(
DSDP
,
DSDPVec
,
double
,
double
*);
178
extern
int
DSDPComputePotential2
(
DSDP
,
DSDPVec
,
double
,
double
,
double
*);
179
extern
int
DSDPSetRR
(
DSDP
,
double
);
180
extern
int
DSDPGetRR
(
DSDP
,
double
*);
181
extern
int
DSDPGetMaxYElement
(
DSDP
,
double
*);
182
183
extern
int
DSDPSolveDynamicRho
(
DSDP
);
184
extern
int
DSDPRefineStepDirection(
DSDP
,
DSDPVec
,
DSDPVec
);
185
186
/* Cone operations */
187
extern
int
DSDPSetUpCones
(
DSDP
);
188
extern
int
DSDPSetUpCones2
(
DSDP
,
DSDPVec
,
DSDPSchurMat
);
189
extern
int
DSDPSchurSparsity
(
DSDP
,
int
,
int
[],
int
);
190
extern
int
DSDPComputeSS
(
DSDP
,
DSDPVec
,
DSDPDualFactorMatrix
,
DSDPTruth
*);
191
extern
int
DSDPInvertS
(
DSDP
);
192
extern
int
DSDPComputeHessian
(
DSDP
,
DSDPSchurMat
,
DSDPVec
,
DSDPVec
);
193
extern
int
DSDPHessianMultiplyAdd
(
DSDP
,
DSDPVec
,
DSDPVec
);
194
extern
int
DSDPComputeMaxStepLength
(
DSDP
,
DSDPVec
,
DSDPDualFactorMatrix
,
double
*);
195
extern
int
DSDPComputeLogSDeterminant
(
DSDP
,
double
*);
196
extern
int
DSDPComputeANorm2
(
DSDP
,
DSDPVec
);
197
extern
int
DSDPViewCones
(
DSDP
);
198
extern
int
DSDPMonitorCones
(
DSDP
,
int
);
199
extern
int
DSDPDestroyCones
(
DSDP
);
200
extern
int
DSDPPassXVectors
(
DSDP
,
double
,
DSDPVec
,
DSDPVec
);
201
extern
int
DSDPComputeXVariables
(
DSDP
,
double
,
DSDPVec
,
DSDPVec
,
DSDPVec
,
double
*);
202
extern
int
DSDPGetConicDimension
(
DSDP
,
double
*);
203
extern
int
DSDPSchurSparsity
(
DSDP
,
int
,
int
[],
int
);
204
205
extern
int
DSDPCGSolve
(
DSDP
,
DSDPSchurMat
,
DSDPVec
,
DSDPVec
,
double
,
DSDPTruth
*);
206
extern
int
DSDPComputeDualStepDirection(
DSDP
,
double
,
DSDPVec
);
207
extern
int
DSDPComputeDualStepDirections
(
DSDP
);
208
209
extern
int
DSDPSetCone
(
DSDP
,
DSDPCone
);
210
211
extern
int
DSDPScaleData
(
DSDP
);
212
extern
int
DSDPComputeDataNorms
(
DSDP
);
213
214
extern
int
DSDPTakeDown
(
DSDP
);
215
extern
int
DSDPSetDefaultStatistics
(
DSDP
);
216
extern
int
DSDPSetDefaultParameters
(
DSDP
);
217
extern
int
DSDPSetDefaultMonitors
(
DSDP
);
218
219
/* DSDP subroutines */
220
extern
int
DSDPInitializeVariables
(
DSDP
);
221
extern
int
DSDPObjectiveGH
(
DSDP
,
DSDPSchurMat
,
DSDPVec
);
222
extern
int
DSDPCheckForUnboundedObjective(
DSDP
,
DSDPTruth
*);
223
224
extern
int
DSDPCheckConvergence
(
DSDP
,
DSDPTerminationReason
*);
225
extern
int
DSDPMonitor(
DSDP
);
226
extern
int
DSDPPrintStats
(
DSDP
,
void
*);
227
extern
int
DSDPPrintStatsFile(
DSDP
,
void
*);
228
229
extern
int
DSDPGetSchurMatrix(
DSDP
,
DSDPSchurMat
*);
230
231
232
#ifdef __cplusplus
233
}
234
#endif
235
236
extern
int
DSDPAddRCone
(
DSDP
,
RRCone
*);
237
extern
int
RConeSetType(
RRCone
, DSDPPenalty);
238
extern
int
RConeGetRX(
RRCone
,
double
*);
239
240
extern
int
DSDPGetConvergenceMonitor
(
DSDP
, ConvergenceMonitor**);
241
extern
int
DSDPDefaultConvergence
(
DSDP
,
void
*);
242
243
extern
int
DSDPSetDefaultSchurMatrixStructure(
DSDP
);
244
extern
int
DSDPFixedVariablesNorm(
DSDPSchurMat
,
DSDPVec
);
245
extern
int
DSDPComputeFixedYX(
DSDPSchurMat
,
DSDPVec
);
246
247
extern
int
DSDPAddBCone(
DSDP
,
DSDPVec
,
double
);
248
249
#endif
Generated by
1.8.1.1