Scippy

SoPlex

Sequential object-oriented simPlex

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