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   	/** clears the (floating point) LP **/
13   	void SoPlex_clearLPReal(void* soplex);
14   	
15   	/** returns number of rows **/
16   	int SoPlex_numRows(void* soplex);
17   	
18   	/** returns number of columns **/
19   	int SoPlex_numCols(void* soplex);
20   	
21   	/** enables rational solving mode  **/
22   	void SoPlex_setRational(void* soplex);
23   	
24   	/** sets integer parameter value **/
25   	void SoPlex_setIntParam(void* soplex, int paramcode, int paramvalue);
26   	
27   	/** returns value of integer parameter **/
28   	int SoPlex_getIntParam(void* soplex, int paramcode);
29   	
30   	/** adds a single (floating point) column **/
31   	void SoPlex_addColReal(
32   	   void* soplex,
33   	   double* colentries,
34   	   int colsize,
35   	   int nnonzeros,
36   	   double objval,
37   	   double lb,
38   	   double ub
39   	);
40   	
41   	/** adds a single rational column **/
42   	void SoPlex_addColRational(
43   	   void* soplex,
44   	   long* colnums,
45   	   long* coldenoms,
46   	   int colsize,
47   	   int nnonzeros,
48   	   long objvalnum,
49   	   long objvaldenom,
50   	   long lbnum,
51   	   long lbdenom,
52   	   long ubnum,
53   	   long ubdenom
54   	);
55   	
56   	/** adds a single (floating point) column **/
57   	void SoPlex_addRowReal(
58   	   void* soplex,
59   	   double* rowentries,
60   	   int rowsize,
61   	   int nnonzeros,
62   	   double lb,
63   	   double ub
64   	);
65   	
66   	/** adds a single rational row **/
67   	void SoPlex_addRowRational(
68   	   void* soplex,
69   	   long* rownums,
70   	   long* rowdenoms,
71   	   int rowsize,
72   	   int nnonzeros,
73   	   long lbnum,
74   	   long lbdenom,
75   	   long ubnum,
76   	   long ubdenom
77   	);
78   	
79   	/** gets primal solution **/
80   	void SoPlex_getPrimalReal(void* soplex, double* primal, int dim);
81   	
82   	/** Returns rational primal solution in a char pointer.
83   	*   The caller needs to ensure the char array is freed.
84   	**/
85   	char* SoPlex_getPrimalRationalString(void* soplex, int dim);
86   	
87   	/** gets dual solution **/
88   	void SoPlex_getDualReal(void* soplex, double* dual, int dim);
89   	
90   	/** optimizes the given LP **/
91   	int SoPlex_optimize(void* soplex);
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 rational left-hand side vector for constraints to lhs **/
103  	void SoPlex_changeLhsRational(void* soplex, long* lhsnums, long* lhsdenoms, int dim);
104  	
105  	/** changes right-hand side vector for constraints to rhs **/
106  	void SoPlex_changeRhsReal(void* soplex, double* rhs, int dim);
107  	
108  	/** changes rational right-hand side vector for constraints to rhs **/
109  	void SoPlex_changeRhsRational(void* soplex, long* rhsnums, long* rhsdenoms, int dim);
110  	
111  	/** write LP to file **/
112  	void SoPlex_writeFileReal(void* soplex, char* filename);
113  	
114  	/** returns the objective value if a primal solution is available **/
115  	double SoPlex_objValueReal(void* soplex);
116  	
117  	/** Returns the rational objective value (as a string) if a primal solution is available.
118  	*   The caller needs to ensure the char array is freed.
119  	**/
120  	char* SoPlex_objValueRationalString(void* soplex);
121  	
122  	/** changes vectors of column bounds to lb and ub **/
123  	void SoPlex_changeBoundsReal(void* soplex, double* lb, double* ub, int dim);
124  	
125  	/** changes bounds of a column to lb and ub **/
126  	void SoPlex_changeVarBoundsReal(void* soplex, int colidx, double lb, double ub);
127  	
128  	/** changes rational bounds of a column to lbnum/lbdenom and ubnum/ubdenom **/
129  	void SoPlex_changeVarBoundsRational(
130  	   void* soplex,
131  	   int colidx,
132  	   long lbnum,
133  	   long lbdenom,
134  	   long ubnum,
135  	   long ubdenom
136  	);
137  	
138  	/** changes upper bound of column to ub **/
139  	void SoPlex_changeVarUpperReal(void* soplex, int colidx, double ub);
140  	
141  	/** changes upper bound vector of columns to ub **/
142  	void SoPlex_getUpperReal(void* soplex, double* ub, int dim);
143  	
144  	/** returns status of row
145  	 *  0 -> row is set to its upper bound
146  	 *  1 -> row is set to its lower bound
147  	 *  2 -> row is fixed to its identical bounds
148  	 *  4 -> row is basic
149  	 *  5 -> nothing known about basis status
150  	 **/
151  	int SoPlex_basisRowStatus(void* soplex, int rowidx);
152  	
153  	/** returns status of column
154  	 *  0 -> column is set to its upper bound
155  	 *  1 -> column is set to its lower bound
156  	 *  2 -> column is fixed to its identical bounds
157  	 *  3 -> column is free and fixed to zero
158  	 *  4 -> column is basic
159  	 *  5 -> nothing known about basis status
160  	 **/
161  	int SoPlex_basisColStatus(void* soplex, int colidx);
162  	
163  	/** get non-zero entries and indices of row i **/
164  	void SoPlex_getRowVectorReal(
165  	   void* soplex,
166  	   int i,
167  	   int* nnonzeros,
168  	   long* indices,
169  	   double* coefs
170  	);
171  	
172  	/** get non-zero entries and indices of rational row i **/
173  	void SoPlex_getRowVectorRational(
174  	   void* soplex,
175  	   int i,
176  	   int* nnonzeros,
177  	   long* indices,
178  	   long* coefsnum,
179  	   long* coefsdenom
180  	);
181  	
182  	/** get lower and upper bounds of row i **/
183  	void SoPlex_getRowBoundsReal(
184  	   void* soplex,
185  	   int i,
186  	   double* lb,
187  	   double* ub
188  	);
189  	
190  	/** get rational lower and upper bounds of row i **/
191  	void SoPlex_getRowBoundsRational(
192  	   void* soplex,
193  	   int i,
194  	   long* lbnum,
195  	   long* lbdenom,
196  	   long* ubnum,
197  	   long* ubdenom
198  	);
199  	
200  	#ifdef __cplusplus
201  	}
202  	#endif
203