Scippy

SoPlex

Sequential object-oriented simPlex

soplex_interface.h
Go to the documentation of this file.
1
2#ifdef __cplusplus
3extern "C" {
4#endif
5
6/** creates new SoPlex struct **/
7void* SoPlex_create();
8
9/** frees SoPlex struct **/
10void SoPlex_free(void* soplex);
11
12/** reads LP file in LP or MPS format according to READMODE parameter; returns true on success **/
13int SoPlex_readInstanceFile(void* soplex, const char* filename);
14
15/** reads basis information from filename and returns true on success **/
16int SoPlex_readBasisFile(void* soplex, const char* filename);
17
18/** reads settings from filename and returns true on success **/
19int SoPlex_readSettingsFile(void* soplex, const char* filename);
20
21/** clears the (floating point) LP **/
22void SoPlex_clearLPReal(void* soplex);
23
24/** returns number of rows **/
25int SoPlex_numRows(void* soplex);
26
27/** returns number of columns **/
28int SoPlex_numCols(void* soplex);
29
30/** enables rational solving mode **/
31void SoPlex_setRational(void* soplex);
32
33/** sets boolean parameter value **/
34void SoPlex_setBoolParam(void* soplex, int paramcode, int paramvalue);
35
36/** sets integer parameter value **/
37void SoPlex_setIntParam(void* soplex, int paramcode, int paramvalue);
38
39/** sets real parameter value **/
40void SoPlex_setRealParam(void* soplex, int paramcode, double paramvalue);
41
42/** returns value of integer parameter **/
43int SoPlex_getIntParam(void* soplex, int paramcode);
44
45/** adds a single (floating point) column **/
46void SoPlex_addColReal(void* soplex, double* colentries, int colsize, int nnonzeros, double objval,
47 double lb, double ub);
48
49/** removes a single (floating point) column **/
50void SoPlex_removeColReal(void* soplex, int colidx);
51
52/** adds a single rational column **/
53void SoPlex_addColRational(void* soplex, long* colnums, long* coldenoms, int colsize, int nnonzeros,
54 long objvalnum, long objvaldenom, long lbnum, long lbdenom, long ubnum, long ubdenom);
55
56/** adds a single (floating point) row **/
57void SoPlex_addRowReal(void* soplex, double* rowentries, int rowsize, int nnonzeros, double lb,
58 double ub);
59
60/** removes a single (floating point) row **/
61void SoPlex_removeRowReal(void* soplex, int rowidx);
62
63/** adds a single rational row **/
64void SoPlex_addRowRational(void* soplex, long* rownums, long* rowdenoms, int rowsize, int nnonzeros,
65 long lbnum, long lbdenom, long ubnum, long ubdenom);
66
67/** gets primal solution **/
68void SoPlex_getPrimalReal(void* soplex, double* primal, int dim);
69
70/** Returns rational primal solution in a char pointer.
71* The caller needs to ensure the char array is freed.
72**/
73char* SoPlex_getPrimalRationalString(void* soplex, int dim);
74
75/** gets dual solution **/
76void SoPlex_getDualReal(void* soplex, double* dual, int dim);
77
78/** gets reduced cost vector **/
79void SoPlex_getRedCostReal(void* soplex, double* rc, int dim);
80
81/** optimizes the given LP and returns solver status **/
82int SoPlex_optimize(void* soplex);
83
84/** returns the current solver status **/
85int SoPlex_getStatus(void* soplex);
86
87/** returns the time spent in last call to solve **/
88double SoPlex_getSolvingTime(void* soplex);
89
90/** returns the number of iteration in last call to solve **/
92
93/** changes objective function vector to obj **/
94void SoPlex_changeObjReal(void* soplex, double* obj, int dim);
95
96/** changes rational objective function vector to obj **/
97void SoPlex_changeObjRational(void* soplex, long* objnums, long* objdenoms, int dim);
98
99/** changes left-hand side vector for constraints to lhs **/
100void SoPlex_changeLhsReal(void* soplex, double* lhs, int dim);
101
102/** changes left-hand side of a row to lhs **/
103void SoPlex_changeRowLhsReal(void* soplex, int rowidx, double lhs);
104
105/** changes rational left-hand side vector for constraints to lhs **/
106void SoPlex_changeLhsRational(void* soplex, long* lhsnums, long* lhsdenoms, int dim);
107
108/** changes right-hand side vector for constraints to rhs **/
109void SoPlex_changeRhsReal(void* soplex, double* rhs, int dim);
110
111/** changes right-hand side of a row to rhs **/
112void SoPlex_changeRowRhsReal(void* soplex, int rowidx, double rhs);
113
114/** changes rational right-hand side vector for constraints to rhs **/
115void SoPlex_changeRhsRational(void* soplex, long* rhsnums, long* rhsdenoms, int dim);
116
117/** changes both sides for constraints to given lhs and rhs **/
118void SoPlex_changeRangeReal(void* soplex, double* lhs, double* rhs, int dim);
119
120/** changes both sides of a row to given lhs and rhs **/
121void SoPlex_changeRowRangeReal(void* soplex, int rowidx, double lhs, double rhs);
122
123/** write LP to file; LP or MPS format is chosen from the extension in filename **/
124void SoPlex_writeFileReal(void* soplex, char* filename);
125
126/** returns the objective value if a primal solution is available **/
127double SoPlex_objValueReal(void* soplex);
128
129/** Returns the rational objective value (as a string) if a primal solution is available.
130* The caller needs to ensure the char array is freed.
131**/
133
134/** changes vectors of column bounds to lb and ub **/
135void SoPlex_changeBoundsReal(void* soplex, double* lb, double* ub, int dim);
136
137/** changes bounds of a column to lb and ub **/
138void SoPlex_changeVarBoundsReal(void* soplex, int colidx, double lb, double ub);
139
140/** changes rational bounds of a column to lbnum/lbdenom and ubnum/ubdenom **/
141void SoPlex_changeVarBoundsRational(void* soplex, int colidx, long lbnum, long lbdenom, long ubnum,
142 long ubdenom);
143
144/** changes vector of lower bounds to lb **/
145void SoPlex_changeLowerReal(void* soplex, double* lb, int dim);
146
147/** changes lower bound of column to lb **/
148void SoPlex_changeVarLowerReal(void* soplex, int colidx, double lb);
149
150/** gets lower bound vector of columns into lb **/
151void SoPlex_getLowerReal(void* soplex, double* lb, int dim);
152
153/** gets objective vector into obj **/
154void SoPlex_getObjReal(void* soplex, double* obj, int dim);
155
156/** changes vector of upper bounds to ub **/
157void SoPlex_changeUpperReal(void* soplex, double* ub, int dim);
158
159/** changes upper bound of column to ub **/
160void SoPlex_changeVarUpperReal(void* soplex, int colidx, double ub);
161
162/** gets upper bound vector of columns into ub **/
163void SoPlex_getUpperReal(void* soplex, double* ub, int dim);
164
165/** returns status of row
166 * 0 -> row is set to its upper bound
167 * 1 -> row is set to its lower bound
168 * 2 -> row is fixed to its identical bounds
169 * 4 -> row is basic
170 * 5 -> nothing known about basis status
171 **/
172int SoPlex_basisRowStatus(void* soplex, int rowidx);
173
174/** returns status of column
175 * 0 -> column is set to its upper bound
176 * 1 -> column is set to its lower bound
177 * 2 -> column is fixed to its identical bounds
178 * 3 -> column is free and fixed to zero
179 * 4 -> column is basic
180 * 5 -> nothing known about basis status
181 **/
182int SoPlex_basisColStatus(void* soplex, int colidx);
183
184/** get non-zero entries and indices of row i **/
185void SoPlex_getRowVectorReal(void* soplex, int i, int* nnonzeros, long* indices, double* coefs);
186
187/** get non-zero entries and indices of rational row i **/
188void SoPlex_getRowVectorRational(void* soplex, int i, int* nnonzeros, long* indices, long* coefsnum,
189 long* coefsdenom);
190
191/** get lower and upper bounds of row i **/
192void SoPlex_getRowBoundsReal(void* soplex, int i, double* lb, double* ub);
193
194/** get rational lower and upper bounds of row i **/
195void SoPlex_getRowBoundsRational(void* soplex, int i, long* lbnum, long* lbdenom, long* ubnum,
196 long* ubdenom);
197
198#ifdef __cplusplus
199}
200#endif
Everything should be within this namespace.
void SoPlex_getPrimalReal(void *soplex, double *primal, int dim)
void SoPlex_changeRowRhsReal(void *soplex, int rowidx, double rhs)
int SoPlex_optimize(void *soplex)
int SoPlex_readSettingsFile(void *soplex, const char *filename)
void SoPlex_addRowRational(void *soplex, long *rownums, long *rowdenoms, int rowsize, int nnonzeros, long lbnum, long lbdenom, long ubnum, long ubdenom)
void SoPlex_addColReal(void *soplex, double *colentries, int colsize, int nnonzeros, double objval, double lb, double ub)
void SoPlex_clearLPReal(void *soplex)
void SoPlex_getRowVectorRational(void *soplex, int i, int *nnonzeros, long *indices, long *coefsnum, long *coefsdenom)
int SoPlex_getStatus(void *soplex)
void SoPlex_changeVarLowerReal(void *soplex, int colidx, double lb)
void SoPlex_changeLhsRational(void *soplex, long *lhsnums, long *lhsdenoms, int dim)
void SoPlex_getRowBoundsRational(void *soplex, int i, long *lbnum, long *lbdenom, long *ubnum, long *ubdenom)
void SoPlex_getRowVectorReal(void *soplex, int i, int *nnonzeros, long *indices, double *coefs)
char * SoPlex_getPrimalRationalString(void *soplex, int dim)
void SoPlex_changeRowLhsReal(void *soplex, int rowidx, double lhs)
void SoPlex_addRowReal(void *soplex, double *rowentries, int rowsize, int nnonzeros, double lb, double ub)
void SoPlex_changeRhsRational(void *soplex, long *rhsnums, long *rhsdenoms, int dim)
char * SoPlex_objValueRationalString(void *soplex)
void SoPlex_changeRangeReal(void *soplex, double *lhs, double *rhs, int dim)
void SoPlex_setRealParam(void *soplex, int paramcode, double paramvalue)
double SoPlex_objValueReal(void *soplex)
void SoPlex_removeColReal(void *soplex, int colidx)
int SoPlex_numRows(void *soplex)
int SoPlex_basisColStatus(void *soplex, int colidx)
void SoPlex_changeVarBoundsReal(void *soplex, int colidx, double lb, double ub)
void SoPlex_getLowerReal(void *soplex, double *lb, int dim)
void SoPlex_setIntParam(void *soplex, int paramcode, int paramvalue)
void SoPlex_removeRowReal(void *soplex, int rowidx)
int SoPlex_numCols(void *soplex)
int SoPlex_getIntParam(void *soplex, int paramcode)
void SoPlex_changeVarUpperReal(void *soplex, int colidx, double ub)
void SoPlex_addColRational(void *soplex, long *colnums, long *coldenoms, int colsize, int nnonzeros, long objvalnum, long objvaldenom, long lbnum, long lbdenom, long ubnum, long ubdenom)
void SoPlex_changeObjReal(void *soplex, double *obj, int dim)
void SoPlex_free(void *soplex)
void SoPlex_getRedCostReal(void *soplex, double *rc, int dim)
void SoPlex_getDualReal(void *soplex, double *dual, int dim)
void SoPlex_changeLhsReal(void *soplex, double *lhs, int dim)
void SoPlex_changeRhsReal(void *soplex, double *rhs, int dim)
void SoPlex_changeObjRational(void *soplex, long *objnums, long *objdenoms, int dim)
void SoPlex_changeRowRangeReal(void *soplex, int rowidx, double lhs, double rhs)
void * SoPlex_create()
void SoPlex_changeUpperReal(void *soplex, double *ub, int dim)
void SoPlex_writeFileReal(void *soplex, char *filename)
void SoPlex_changeBoundsReal(void *soplex, double *lb, double *ub, int dim)
int SoPlex_getNumIterations(void *soplex)
void SoPlex_setRational(void *soplex)
void SoPlex_getRowBoundsReal(void *soplex, int i, double *lb, double *ub)
void SoPlex_setBoolParam(void *soplex, int paramcode, int paramvalue)
void SoPlex_getUpperReal(void *soplex, double *ub, int dim)
int SoPlex_readBasisFile(void *soplex, const char *filename)
int SoPlex_basisRowStatus(void *soplex, int rowidx)
void SoPlex_changeLowerReal(void *soplex, double *lb, int dim)
void SoPlex_getObjReal(void *soplex, double *obj, int dim)
int SoPlex_readInstanceFile(void *soplex, const char *filename)
void SoPlex_changeVarBoundsRational(void *soplex, int colidx, long lbnum, long lbdenom, long ubnum, long ubdenom)
double SoPlex_getSolvingTime(void *soplex)