View Javadoc
1   /* ----------------------------------------------------------------------------
2    * This file was automatically generated by SWIG (http://www.swig.org).
3    * Version 3.0.8
4    *
5    * Do not make changes to this file unless you know what you are doing--modify
6    * the SWIG interface file instead.
7    * ----------------------------------------------------------------------------- */
8   
9   package org.gnu.glpk;
10  
11  
12  /**
13   * Wrapper class generated by SWIG.
14   * <p>Please, refer to doc/glpk-java.pdf of the GLPK for Java distribution
15   * and to doc/glpk.pdf of the GLPK source distribution
16   * for details. You can download the source distribution from
17   * <a href="ftp://ftp.gnu.org/gnu/glpk">ftp://ftp.gnu.org/gnu/glpk</a>.
18   *
19   * <p>For handling arrays of int and double the following methods are
20   * provided:
21   * @see #new_doubleArray(int)
22   * @see #delete_doubleArray(SWIGTYPE_p_double)
23   * @see #doubleArray_getitem(SWIGTYPE_p_double, int)
24   * @see #doubleArray_setitem(SWIGTYPE_p_double, int, double)
25   * @see #new_intArray(int)
26   * @see #delete_intArray(SWIGTYPE_p_int)
27   * @see #intArray_getitem(SWIGTYPE_p_int, int)
28   * @see #intArray_setitem(SWIGTYPE_p_int, int, int)
29   */
30  public class GLPK implements GLPKConstants {
31    
32  /**
33   * Creates a new array of int.
34   * <p>The memory is allocated with calloc(). To free the memory you will have
35   * to call delete&#95;intArray.
36   *
37   * An OutOfMemoryError error indicates that the C-runtime heap of the process
38   * (not the Java object heap) is full.
39   *
40   * @param nelements number of elements
41   * @return array
42   */
43  public static SWIGTYPE_p_int new_intArray(int nelements) {
44      long cPtr = GLPKJNI.new_intArray(nelements);
45      return (cPtr == 0) ? null : new SWIGTYPE_p_int(cPtr, false);
46    }
47  
48    
49  /**
50   * Deletes an array of int.
51   * <p>The memory is deallocated with free().
52   *
53   * @param ary array
54   */
55  public static void delete_intArray(SWIGTYPE_p_int ary) {
56      GLPKJNI.delete_intArray(SWIGTYPE_p_int.getCPtr(ary));
57    }
58  
59    
60  /**
61   * Retrieves an element of an array of int.
62   * <p>BEWARE: The validity of the index is not checked.
63   *
64   * @param ary array
65   * @param index index of the element
66   * @return array element
67   */
68  public static int intArray_getitem(SWIGTYPE_p_int ary, int index) {
69      return GLPKJNI.intArray_getitem(SWIGTYPE_p_int.getCPtr(ary), index);
70    }
71  
72    
73  /**
74   * Sets the value of an element of an array of int.
75   * <p>BEWARE: The validity of the index is not checked.
76   *
77   * @param ary array
78   * @param index index of the element
79   * @param value new value
80   */
81  public static void intArray_setitem(SWIGTYPE_p_int ary, int index, int value) {
82      GLPKJNI.intArray_setitem(SWIGTYPE_p_int.getCPtr(ary), index, value);
83    }
84  
85    
86  /**
87   * Creates a new array of double.
88   * <p>The memory is allocated with calloc(). To free the memory you will have
89   * to call delete&#95;doubleArray.
90   *
91   * An OutOfMemoryError error indicates that the C-runtime heap of the process
92   * (not the Java object heap) is full.
93   *
94   * @param nelements number of elements
95   * @return array
96   */
97  public static SWIGTYPE_p_double new_doubleArray(int nelements) {
98      long cPtr = GLPKJNI.new_doubleArray(nelements);
99      return (cPtr == 0) ? null : new SWIGTYPE_p_double(cPtr, false);
100   }
101 
102   
103 /**
104  * Deletes an array of double.
105  * <p>The memory is deallocated with free().
106  *
107  * @param ary array
108  */
109 public static void delete_doubleArray(SWIGTYPE_p_double ary) {
110     GLPKJNI.delete_doubleArray(SWIGTYPE_p_double.getCPtr(ary));
111   }
112 
113   
114 /**
115  * Retrieves an element of an array of double.
116  * <p>BEWARE: The validity of the index is not checked.
117  *
118  * @param ary array
119  * @param index index of the element
120  * @return array element
121  */
122 public static double doubleArray_getitem(SWIGTYPE_p_double ary, int index) {
123     return GLPKJNI.doubleArray_getitem(SWIGTYPE_p_double.getCPtr(ary), index);
124   }
125 
126   
127 /**
128  * Sets the value of an element of an array of double.
129  * <p>BEWARE: The validity of the index is not checked.
130  *
131  * @param ary array
132  * @param index index of the element
133  * @param value new value
134  */
135 public static void doubleArray_setitem(SWIGTYPE_p_double ary, int index, double value) {
136     GLPKJNI.doubleArray_setitem(SWIGTYPE_p_double.getCPtr(ary), index, value);
137   }
138 
139   
140 /**
141  * Abort GLPK library with error message. This method can be used to stop the
142  * solver using a GlpkTerminalListener.
143  *
144  * @param message message
145  */
146 public static void glp_java_error(String message) {
147     GLPKJNI.glp_java_error(message);
148   }
149 
150   
151 /**
152  * Sets the message level. This method enables and disables debug output of
153  * GLPK for Java.
154  *
155  * @param msg_lvl message level
156  *
157  * @see GLPKConstants#GLP_JAVA_MSG_LVL_OFF
158  * @see GLPKConstants#GLP_JAVA_MSG_LVL_ALL
159  */
160 public static void glp_java_set_msg_lvl(int msg_lvl) {
161     GLPKJNI.glp_java_set_msg_lvl(msg_lvl);
162   }
163 
164   public static void glp_java_set_numeric_locale(String locale) {
165     GLPKJNI.glp_java_set_numeric_locale(locale);
166   }
167 
168   
169 /**
170  * Get arc data.
171  *
172  * @param arc arc
173  * @return data
174  */
175 public static glp_java_arc_data glp_java_arc_get_data(glp_arc arc) {
176     long cPtr = GLPKJNI.glp_java_arc_get_data(glp_arc.getCPtr(arc), arc);
177     return (cPtr == 0) ? null : new glp_java_arc_data(cPtr, false);
178   }
179 
180   
181 /**
182  * Get vertex data.
183  *
184  * @param G graph
185  * @param i index to vertex
186  * @return data
187  */
188 public static glp_java_vertex_data glp_java_vertex_data_get(glp_graph G, int i) {
189     long cPtr = GLPKJNI.glp_java_vertex_data_get(glp_graph.getCPtr(G), G, i);
190     return (cPtr == 0) ? null : new glp_java_vertex_data(cPtr, false);
191   }
192 
193   
194 /**
195  * Get vertex data.
196  *
197  * @param v vertex
198  * @return data
199  */
200 public static glp_java_vertex_data glp_java_vertex_get_data(glp_vertex v) {
201     long cPtr = GLPKJNI.glp_java_vertex_get_data(glp_vertex.getCPtr(v), v);
202     return (cPtr == 0) ? null : new glp_java_vertex_data(cPtr, false);
203   }
204 
205   
206 /**
207  * Get vertex.
208  *
209  * @param G graph
210  * @param i index
211  * @return vertex
212  */
213 public static glp_vertex glp_java_vertex_get(glp_graph G, int i) {
214     long cPtr = GLPKJNI.glp_java_vertex_get(glp_graph.getCPtr(G), G, i);
215     return (cPtr == 0) ? null : new glp_vertex(cPtr, false);
216   }
217 
218   
219 /**
220  */
221 public static glp_prob glp_create_prob() {
222     long cPtr = GLPKJNI.glp_create_prob();
223     return (cPtr == 0) ? null : new glp_prob(cPtr, false);
224   }
225 
226   
227 /**
228  * glp_set_prob_name - assign (change) problem name .
229  * <p>SYNOPSIS</p>
230  * <p>void glp_set_prob_name(glp_prob *lp, const char *name);</p>
231  * <p>DESCRIPTION</p>
232  * <p>The routine glp_set_prob_name assigns a given symbolic name (1 up to 255 characters) to the specified problem object.</p>
233  * <p>If the parameter name is NULL or empty string, the routine erases an existing symbolic name of the problem object. </p>
234  */
235 public static void glp_set_prob_name(glp_prob P, String name) {
236     GLPKJNI.glp_set_prob_name(glp_prob.getCPtr(P), P, name);
237   }
238 
239   
240 /**
241  * glp_set_obj_name - assign (change) objective function name .
242  * <p>SYNOPSIS</p>
243  * <p>void glp_set_obj_name(glp_prob *lp, const char *name);</p>
244  * <p>DESCRIPTION</p>
245  * <p>The routine glp_set_obj_name assigns a given symbolic name (1 up to 255 characters) to the objective function of the specified problem object.</p>
246  * <p>If the parameter name is NULL or empty string, the routine erases an existing name of the objective function. </p>
247  */
248 public static void glp_set_obj_name(glp_prob P, String name) {
249     GLPKJNI.glp_set_obj_name(glp_prob.getCPtr(P), P, name);
250   }
251 
252   
253 /**
254  * glp_set_obj_dir - set (change) optimization direction flag .
255  * <p>SYNOPSIS</p>
256  * <p>void glp_set_obj_dir(glp_prob *lp, int dir);</p>
257  * <p>DESCRIPTION</p>
258  * <p>The routine glp_set_obj_dir sets (changes) optimization direction flag (i.e. "sense" of the objective function) as specified by the parameter dir:</p>
259  * <p>GLP_MIN - minimization; GLP_MAX - maximization. </p>
260  */
261 public static void glp_set_obj_dir(glp_prob P, int dir) {
262     GLPKJNI.glp_set_obj_dir(glp_prob.getCPtr(P), P, dir);
263   }
264 
265   
266 /**
267  * glp_add_rows - add new rows to problem object .
268  * <p>SYNOPSIS</p>
269  * <p>int glp_add_rows(glp_prob *lp, int nrs);</p>
270  * <p>DESCRIPTION</p>
271  * <p>The routine glp_add_rows adds nrs rows (constraints) to the specified problem object. New rows are always added to the end of the row list, so the ordinal numbers of existing rows remain unchanged.</p>
272  * <p>Being added each new row is initially free (unbounded) and has empty list of the constraint coefficients.</p>
273  * <p>RETURNS</p>
274  * <p>The routine glp_add_rows returns the ordinal number of the first new row added to the problem object. </p>
275  */
276 public static int glp_add_rows(glp_prob P, int nrs) {
277     return GLPKJNI.glp_add_rows(glp_prob.getCPtr(P), P, nrs);
278   }
279 
280   
281 /**
282  * glp_add_cols - add new columns to problem object .
283  * <p>SYNOPSIS</p>
284  * <p>int glp_add_cols(glp_prob *lp, int ncs);</p>
285  * <p>DESCRIPTION</p>
286  * <p>The routine glp_add_cols adds ncs columns (structural variables) to the specified problem object. New columns are always added to the end of the column list, so the ordinal numbers of existing columns remain unchanged.</p>
287  * <p>Being added each new column is initially fixed at zero and has empty list of the constraint coefficients.</p>
288  * <p>RETURNS</p>
289  * <p>The routine glp_add_cols returns the ordinal number of the first new column added to the problem object. </p>
290  */
291 public static int glp_add_cols(glp_prob P, int ncs) {
292     return GLPKJNI.glp_add_cols(glp_prob.getCPtr(P), P, ncs);
293   }
294 
295   
296 /**
297  * glp_set_row_name - assign (change) row name .
298  * <p>SYNOPSIS</p>
299  * <p>void glp_set_row_name(glp_prob *lp, int i, const char *name);</p>
300  * <p>DESCRIPTION</p>
301  * <p>The routine glp_set_row_name assigns a given symbolic name (1 up to 255 characters) to i-th row (auxiliary variable) of the specified problem object.</p>
302  * <p>If the parameter name is NULL or empty string, the routine erases an existing name of i-th row. </p>
303  */
304 public static void glp_set_row_name(glp_prob P, int i, String name) {
305     GLPKJNI.glp_set_row_name(glp_prob.getCPtr(P), P, i, name);
306   }
307 
308   
309 /**
310  * glp_set_col_name - assign (change) column name .
311  * <p>SYNOPSIS</p>
312  * <p>void glp_set_col_name(glp_prob *lp, int j, const char *name);</p>
313  * <p>DESCRIPTION</p>
314  * <p>The routine glp_set_col_name assigns a given symbolic name (1 up to 255 characters) to j-th column (structural variable) of the specified problem object.</p>
315  * <p>If the parameter name is NULL or empty string, the routine erases an existing name of j-th column. </p>
316  */
317 public static void glp_set_col_name(glp_prob P, int j, String name) {
318     GLPKJNI.glp_set_col_name(glp_prob.getCPtr(P), P, j, name);
319   }
320 
321   
322 /**
323  * glp_set_row_bnds - set (change) row bounds .
324  * <p>SYNOPSIS</p>
325  * <p>void glp_set_row_bnds(glp_prob *lp, int i, int type, double lb, double ub);</p>
326  * <p>DESCRIPTION</p>
327  * <p>The routine glp_set_row_bnds sets (changes) the type and bounds of i-th row (auxiliary variable) of the specified problem object.</p>
328  * <p>Parameters type, lb, and ub specify the type, lower bound, and upper bound, respectively, as follows:</p>
329  * <p>Type Bounds Comments 
330 </p>
331  * <p>GLP_FR -inf &lt; x &lt; +inf Free variable GLP_LO lb &lt;= x &lt; +inf Variable with lower bound GLP_UP -inf &lt; x &lt;= ub Variable with upper bound GLP_DB lb &lt;= x &lt;= ub Double-bounded variable GLP_FX x = lb Fixed variable</p>
332  * <p>where x is the auxiliary variable associated with i-th row.</p>
333  * <p>If the row has no lower bound, the parameter lb is ignored. If the row has no upper bound, the parameter ub is ignored. If the row is an equality constraint (i.e. the corresponding auxiliary variable is of fixed type), only the parameter lb is used while the parameter ub is ignored. </p>
334  */
335 public static void glp_set_row_bnds(glp_prob P, int i, int type, double lb, double ub) {
336     GLPKJNI.glp_set_row_bnds(glp_prob.getCPtr(P), P, i, type, lb, ub);
337   }
338 
339   
340 /**
341  * glp_set_col_bnds - set (change) column bounds .
342  * <p>SYNOPSIS</p>
343  * <p>void glp_set_col_bnds(glp_prob *lp, int j, int type, double lb, double ub);</p>
344  * <p>DESCRIPTION</p>
345  * <p>The routine glp_set_col_bnds sets (changes) the type and bounds of j-th column (structural variable) of the specified problem object.</p>
346  * <p>Parameters type, lb, and ub specify the type, lower bound, and upper bound, respectively, as follows:</p>
347  * <p>Type Bounds Comments 
348 </p>
349  * <p>GLP_FR -inf &lt; x &lt; +inf Free variable GLP_LO lb &lt;= x &lt; +inf Variable with lower bound GLP_UP -inf &lt; x &lt;= ub Variable with upper bound GLP_DB lb &lt;= x &lt;= ub Double-bounded variable GLP_FX x = lb Fixed variable</p>
350  * <p>where x is the structural variable associated with j-th column.</p>
351  * <p>If the column has no lower bound, the parameter lb is ignored. If the column has no upper bound, the parameter ub is ignored. If the column is of fixed type, only the parameter lb is used while the parameter ub is ignored. </p>
352  */
353 public static void glp_set_col_bnds(glp_prob P, int j, int type, double lb, double ub) {
354     GLPKJNI.glp_set_col_bnds(glp_prob.getCPtr(P), P, j, type, lb, ub);
355   }
356 
357   
358 /**
359  * glp_set_obj_coef - set (change) obj. .
360  * <p>coefficient or constant term</p>
361  * <p>SYNOPSIS</p>
362  * <p>void glp_set_obj_coef(glp_prob *lp, int j, double coef);</p>
363  * <p>DESCRIPTION</p>
364  * <p>The routine glp_set_obj_coef sets (changes) objective coefficient at j-th column (structural variable) of the specified problem object.</p>
365  * <p>If the parameter j is 0, the routine sets (changes) the constant term ("shift") of the objective function. </p>
366  */
367 public static void glp_set_obj_coef(glp_prob P, int j, double coef) {
368     GLPKJNI.glp_set_obj_coef(glp_prob.getCPtr(P), P, j, coef);
369   }
370 
371   
372 /**
373  * glp_set_mat_row - set (replace) row of the constraint matrix .
374  * <p>SYNOPSIS</p>
375  * <p>void glp_set_mat_row(glp_prob *lp, int i, int len, const int ind[], const double val[]);</p>
376  * <p>DESCRIPTION</p>
377  * <p>The routine glp_set_mat_row stores (replaces) the contents of i-th row of the constraint matrix of the specified problem object.</p>
378  * <p>Column indices and numeric values of new row elements must be placed in locations ind[1], ..., ind[len] and val[1], ..., val[len], where 0 &lt;= len &lt;= n is the new length of i-th row, n is the current number of columns in the problem object. Elements with identical column indices are not allowed. Zero elements are allowed, but they are not stored in the constraint matrix.</p>
379  * <p>If the parameter len is zero, the parameters ind and/or val can be specified as NULL. </p>
380  */
381 public static void glp_set_mat_row(glp_prob P, int i, int len, SWIGTYPE_p_int ind, SWIGTYPE_p_double val) {
382     GLPKJNI.glp_set_mat_row(glp_prob.getCPtr(P), P, i, len, SWIGTYPE_p_int.getCPtr(ind), SWIGTYPE_p_double.getCPtr(val));
383   }
384 
385   
386 /**
387  * glp_set_mat_col - set (replace) column of the constraint matrix .
388  * <p>SYNOPSIS</p>
389  * <p>void glp_set_mat_col(glp_prob *lp, int j, int len, const int ind[], const double val[]);</p>
390  * <p>DESCRIPTION</p>
391  * <p>The routine glp_set_mat_col stores (replaces) the contents of j-th column of the constraint matrix of the specified problem object.</p>
392  * <p>Row indices and numeric values of new column elements must be placed in locations ind[1], ..., ind[len] and val[1], ..., val[len], where 0 &lt;= len &lt;= m is the new length of j-th column, m is the current number of rows in the problem object. Elements with identical column indices are not allowed. Zero elements are allowed, but they are not stored in the constraint matrix.</p>
393  * <p>If the parameter len is zero, the parameters ind and/or val can be specified as NULL. </p>
394  */
395 public static void glp_set_mat_col(glp_prob P, int j, int len, SWIGTYPE_p_int ind, SWIGTYPE_p_double val) {
396     GLPKJNI.glp_set_mat_col(glp_prob.getCPtr(P), P, j, len, SWIGTYPE_p_int.getCPtr(ind), SWIGTYPE_p_double.getCPtr(val));
397   }
398 
399   
400 /**
401  * glp_load_matrix - load (replace) the whole constraint matrix .
402  * <p>SYNOPSIS</p>
403  * <p>void glp_load_matrix(glp_prob *lp, int ne, const int ia[], const int ja[], const double ar[]);</p>
404  * <p>DESCRIPTION</p>
405  * <p>The routine glp_load_matrix loads the constraint matrix passed in the arrays ia, ja, and ar into the specified problem object. Before loading the current contents of the constraint matrix is destroyed.</p>
406  * <p>Constraint coefficients (elements of the constraint matrix) must be specified as triplets (ia[k], ja[k], ar[k]) for k = 1, ..., ne, where ia[k] is the row index, ja[k] is the column index, ar[k] is a numeric value of corresponding constraint coefficient. The parameter ne specifies the total number of (non-zero) elements in the matrix to be loaded. Coefficients with identical indices are not allowed. Zero coefficients are allowed, however, they are not stored in the constraint matrix.</p>
407  * <p>If the parameter ne is zero, the parameters ia, ja, and ar can be specified as NULL. </p>
408  */
409 public static void glp_load_matrix(glp_prob P, int ne, SWIGTYPE_p_int ia, SWIGTYPE_p_int ja, SWIGTYPE_p_double ar) {
410     GLPKJNI.glp_load_matrix(glp_prob.getCPtr(P), P, ne, SWIGTYPE_p_int.getCPtr(ia), SWIGTYPE_p_int.getCPtr(ja), SWIGTYPE_p_double.getCPtr(ar));
411   }
412 
413   
414 /**
415  * glp_check_dup - check for duplicate elements in sparse matrix .
416  * <p>SYNOPSIS</p>
417  * <p>int glp_check_dup(int m, int n, int ne, const int ia[], const int ja[]);</p>
418  * <p>DESCRIPTION</p>
419  * <p>The routine glp_check_dup checks for duplicate elements (that is, elements with identical indices) in a sparse matrix specified in the coordinate format.</p>
420  * <p>The parameters m and n specifies, respectively, the number of rows and columns in the matrix, m &gt;= 0, n &gt;= 0.</p>
421  * <p>The parameter ne specifies the number of (structurally) non-zero elements in the matrix, ne &gt;= 0.</p>
422  * <p>Elements of the matrix are specified as doublets (ia[k],ja[k]) for k = 1,...,ne, where ia[k] is a row index, ja[k] is a column index.</p>
423  * <p>The routine glp_check_dup can be used prior to a call to the routine glp_load_matrix to check that the constraint matrix to be loaded has no duplicate elements.</p>
424  * <p>RETURNS</p>
425  * <p>The routine glp_check_dup returns one of the following values:</p>
426  * <p>0 - the matrix has no duplicate elements;</p>
427  * <p>-k - indices ia[k] or/and ja[k] are out of range;</p>
428  * <p>+k - element (ia[k],ja[k]) is duplicate. </p>
429  */
430 public static int glp_check_dup(int m, int n, int ne, SWIGTYPE_p_int ia, SWIGTYPE_p_int ja) {
431     return GLPKJNI.glp_check_dup(m, n, ne, SWIGTYPE_p_int.getCPtr(ia), SWIGTYPE_p_int.getCPtr(ja));
432   }
433 
434   
435 /**
436  * glp_sort_matrix - sort elements of the constraint matrix .
437  * <p>SYNOPSIS</p>
438  * <p>void glp_sort_matrix(glp_prob *P);</p>
439  * <p>DESCRIPTION</p>
440  * <p>The routine glp_sort_matrix sorts elements of the constraint matrix rebuilding its row and column linked lists. On exit from the routine the constraint matrix is not changed, however, elements in the row linked lists become ordered by ascending column indices, and the elements in the column linked lists become ordered by ascending row indices. </p>
441  */
442 public static void glp_sort_matrix(glp_prob P) {
443     GLPKJNI.glp_sort_matrix(glp_prob.getCPtr(P), P);
444   }
445 
446   
447 /**
448  * glp_del_rows - delete rows from problem object .
449  * <p>SYNOPSIS</p>
450  * <p>void glp_del_rows(glp_prob *lp, int nrs, const int num[]);</p>
451  * <p>DESCRIPTION</p>
452  * <p>The routine glp_del_rows deletes rows from the specified problem object. Ordinal numbers of rows to be deleted should be placed in locations num[1], ..., num[nrs], where nrs &gt; 0.</p>
453  * <p>Note that deleting rows involves changing ordinal numbers of other rows remaining in the problem object. New ordinal numbers of the remaining rows are assigned under the assumption that the original order of rows is not changed. </p>
454  */
455 public static void glp_del_rows(glp_prob P, int nrs, SWIGTYPE_p_int num) {
456     GLPKJNI.glp_del_rows(glp_prob.getCPtr(P), P, nrs, SWIGTYPE_p_int.getCPtr(num));
457   }
458 
459   
460 /**
461  * glp_del_cols - delete columns from problem object .
462  * <p>SYNOPSIS</p>
463  * <p>void glp_del_cols(glp_prob *lp, int ncs, const int num[]);</p>
464  * <p>DESCRIPTION</p>
465  * <p>The routine glp_del_cols deletes columns from the specified problem object. Ordinal numbers of columns to be deleted should be placed in locations num[1], ..., num[ncs], where ncs &gt; 0.</p>
466  * <p>Note that deleting columns involves changing ordinal numbers of other columns remaining in the problem object. New ordinal numbers of the remaining columns are assigned under the assumption that the original order of columns is not changed. </p>
467  */
468 public static void glp_del_cols(glp_prob P, int ncs, SWIGTYPE_p_int num) {
469     GLPKJNI.glp_del_cols(glp_prob.getCPtr(P), P, ncs, SWIGTYPE_p_int.getCPtr(num));
470   }
471 
472   
473 /**
474  * glp_copy_prob - copy problem object content .
475  * <p>SYNOPSIS</p>
476  * <p>void glp_copy_prob(glp_prob *dest, glp_prob *prob, int names);</p>
477  * <p>DESCRIPTION</p>
478  * <p>The routine glp_copy_prob copies the content of the problem object prob to the problem object dest.</p>
479  * <p>The parameter names is a flag. If it is non-zero, the routine also copies all symbolic names; otherwise, if it is zero, symbolic names are not copied. </p>
480  */
481 public static void glp_copy_prob(glp_prob dest, glp_prob prob, int names) {
482     GLPKJNI.glp_copy_prob(glp_prob.getCPtr(dest), dest, glp_prob.getCPtr(prob), prob, names);
483   }
484 
485   
486 /**
487  */
488 public static void glp_erase_prob(glp_prob P) {
489     GLPKJNI.glp_erase_prob(glp_prob.getCPtr(P), P);
490   }
491 
492   
493 /**
494  */
495 public static void glp_delete_prob(glp_prob P) {
496     GLPKJNI.glp_delete_prob(glp_prob.getCPtr(P), P);
497   }
498 
499   
500 /**
501  * glp_get_prob_name - retrieve problem name .
502  * <p>SYNOPSIS</p>
503  * <p>const char *glp_get_prob_name(glp_prob *lp);</p>
504  * <p>RETURNS</p>
505  * <p>The routine glp_get_prob_name returns a pointer to an internal buffer, which contains symbolic name of the problem. However, if the problem has no assigned name, the routine returns NULL. </p>
506  */
507 public static String glp_get_prob_name(glp_prob P) {
508     return GLPKJNI.glp_get_prob_name(glp_prob.getCPtr(P), P);
509   }
510 
511   
512 /**
513  * glp_get_obj_name - retrieve objective function name .
514  * <p>SYNOPSIS</p>
515  * <p>const char *glp_get_obj_name(glp_prob *lp);</p>
516  * <p>RETURNS</p>
517  * <p>The routine glp_get_obj_name returns a pointer to an internal buffer, which contains a symbolic name of the objective function. However, if the objective function has no assigned name, the routine returns NULL. </p>
518  */
519 public static String glp_get_obj_name(glp_prob P) {
520     return GLPKJNI.glp_get_obj_name(glp_prob.getCPtr(P), P);
521   }
522 
523   
524 /**
525  * glp_get_obj_dir - retrieve optimization direction flag .
526  * <p>SYNOPSIS</p>
527  * <p>int glp_get_obj_dir(glp_prob *lp);</p>
528  * <p>RETURNS</p>
529  * <p>The routine glp_get_obj_dir returns the optimization direction flag (i.e. "sense" of the objective function):</p>
530  * <p>GLP_MIN - minimization; GLP_MAX - maximization. </p>
531  */
532 public static int glp_get_obj_dir(glp_prob P) {
533     return GLPKJNI.glp_get_obj_dir(glp_prob.getCPtr(P), P);
534   }
535 
536   
537 /**
538  * glp_get_num_rows - retrieve number of rows .
539  * <p>SYNOPSIS</p>
540  * <p>int glp_get_num_rows(glp_prob *lp);</p>
541  * <p>RETURNS</p>
542  * <p>The routine glp_get_num_rows returns the current number of rows in the specified problem object. </p>
543  */
544 public static int glp_get_num_rows(glp_prob P) {
545     return GLPKJNI.glp_get_num_rows(glp_prob.getCPtr(P), P);
546   }
547 
548   
549 /**
550  * glp_get_num_cols - retrieve number of columns .
551  * <p>SYNOPSIS</p>
552  * <p>int glp_get_num_cols(glp_prob *lp);</p>
553  * <p>RETURNS</p>
554  * <p>The routine glp_get_num_cols returns the current number of columns in the specified problem object. </p>
555  */
556 public static int glp_get_num_cols(glp_prob P) {
557     return GLPKJNI.glp_get_num_cols(glp_prob.getCPtr(P), P);
558   }
559 
560   
561 /**
562  * glp_get_row_name - retrieve row name .
563  * <p>SYNOPSIS</p>
564  * <p>const char *glp_get_row_name(glp_prob *lp, int i);</p>
565  * <p>RETURNS</p>
566  * <p>The routine glp_get_row_name returns a pointer to an internal buffer, which contains symbolic name of i-th row. However, if i-th row has no assigned name, the routine returns NULL. </p>
567  */
568 public static String glp_get_row_name(glp_prob P, int i) {
569     return GLPKJNI.glp_get_row_name(glp_prob.getCPtr(P), P, i);
570   }
571 
572   
573 /**
574  * glp_get_col_name - retrieve column name .
575  * <p>SYNOPSIS</p>
576  * <p>const char *glp_get_col_name(glp_prob *lp, int j);</p>
577  * <p>RETURNS</p>
578  * <p>The routine glp_get_col_name returns a pointer to an internal buffer, which contains symbolic name of j-th column. However, if j-th column has no assigned name, the routine returns NULL. </p>
579  */
580 public static String glp_get_col_name(glp_prob P, int j) {
581     return GLPKJNI.glp_get_col_name(glp_prob.getCPtr(P), P, j);
582   }
583 
584   
585 /**
586  * glp_get_row_type - retrieve row type .
587  * <p>SYNOPSIS</p>
588  * <p>int glp_get_row_type(glp_prob *lp, int i);</p>
589  * <p>RETURNS</p>
590  * <p>The routine glp_get_row_type returns the type of i-th row, i.e. the type of corresponding auxiliary variable, as follows:</p>
591  * <p>GLP_FR - free (unbounded) variable; GLP_LO - variable with lower bound; GLP_UP - variable with upper bound; GLP_DB - double-bounded variable; GLP_FX - fixed variable. </p>
592  */
593 public static int glp_get_row_type(glp_prob P, int i) {
594     return GLPKJNI.glp_get_row_type(glp_prob.getCPtr(P), P, i);
595   }
596 
597   
598 /**
599  * glp_get_row_lb - retrieve row lower bound .
600  * <p>SYNOPSIS</p>
601  * <p>double glp_get_row_lb(glp_prob *lp, int i);</p>
602  * <p>RETURNS</p>
603  * <p>The routine glp_get_row_lb returns the lower bound of i-th row, i.e. the lower bound of corresponding auxiliary variable. However, if the row has no lower bound, the routine returns -DBL_MAX. </p>
604  */
605 public static double glp_get_row_lb(glp_prob P, int i) {
606     return GLPKJNI.glp_get_row_lb(glp_prob.getCPtr(P), P, i);
607   }
608 
609   
610 /**
611  * glp_get_row_ub - retrieve row upper bound .
612  * <p>SYNOPSIS</p>
613  * <p>double glp_get_row_ub(glp_prob *lp, int i);</p>
614  * <p>RETURNS</p>
615  * <p>The routine glp_get_row_ub returns the upper bound of i-th row, i.e. the upper bound of corresponding auxiliary variable. However, if the row has no upper bound, the routine returns +DBL_MAX. </p>
616  */
617 public static double glp_get_row_ub(glp_prob P, int i) {
618     return GLPKJNI.glp_get_row_ub(glp_prob.getCPtr(P), P, i);
619   }
620 
621   
622 /**
623  * glp_get_col_type - retrieve column type .
624  * <p>SYNOPSIS</p>
625  * <p>int glp_get_col_type(glp_prob *lp, int j);</p>
626  * <p>RETURNS</p>
627  * <p>The routine glp_get_col_type returns the type of j-th column, i.e. the type of corresponding structural variable, as follows:</p>
628  * <p>GLP_FR - free (unbounded) variable; GLP_LO - variable with lower bound; GLP_UP - variable with upper bound; GLP_DB - double-bounded variable; GLP_FX - fixed variable. </p>
629  */
630 public static int glp_get_col_type(glp_prob P, int j) {
631     return GLPKJNI.glp_get_col_type(glp_prob.getCPtr(P), P, j);
632   }
633 
634   
635 /**
636  * glp_get_col_lb - retrieve column lower bound .
637  * <p>SYNOPSIS</p>
638  * <p>double glp_get_col_lb(glp_prob *lp, int j);</p>
639  * <p>RETURNS</p>
640  * <p>The routine glp_get_col_lb returns the lower bound of j-th column, i.e. the lower bound of corresponding structural variable. However, if the column has no lower bound, the routine returns -DBL_MAX. </p>
641  */
642 public static double glp_get_col_lb(glp_prob P, int j) {
643     return GLPKJNI.glp_get_col_lb(glp_prob.getCPtr(P), P, j);
644   }
645 
646   
647 /**
648  * glp_get_col_ub - retrieve column upper bound .
649  * <p>SYNOPSIS</p>
650  * <p>double glp_get_col_ub(glp_prob *lp, int j);</p>
651  * <p>RETURNS</p>
652  * <p>The routine glp_get_col_ub returns the upper bound of j-th column, i.e. the upper bound of corresponding structural variable. However, if the column has no upper bound, the routine returns +DBL_MAX. </p>
653  */
654 public static double glp_get_col_ub(glp_prob P, int j) {
655     return GLPKJNI.glp_get_col_ub(glp_prob.getCPtr(P), P, j);
656   }
657 
658   
659 /**
660  * glp_get_obj_coef - retrieve obj. .
661  * <p>coefficient or constant term</p>
662  * <p>SYNOPSIS</p>
663  * <p>double glp_get_obj_coef(glp_prob *lp, int j);</p>
664  * <p>RETURNS</p>
665  * <p>The routine glp_get_obj_coef returns the objective coefficient at j-th structural variable (column) of the specified problem object.</p>
666  * <p>If the parameter j is zero, the routine returns the constant term ("shift") of the objective function. </p>
667  */
668 public static double glp_get_obj_coef(glp_prob P, int j) {
669     return GLPKJNI.glp_get_obj_coef(glp_prob.getCPtr(P), P, j);
670   }
671 
672   
673 /**
674  * glp_get_num_nz - retrieve number of constraint coefficients .
675  * <p>SYNOPSIS</p>
676  * <p>int glp_get_num_nz(glp_prob *lp);</p>
677  * <p>RETURNS</p>
678  * <p>The routine glp_get_num_nz returns the number of (non-zero) elements in the constraint matrix of the specified problem object. </p>
679  */
680 public static int glp_get_num_nz(glp_prob P) {
681     return GLPKJNI.glp_get_num_nz(glp_prob.getCPtr(P), P);
682   }
683 
684   
685 /**
686  * glp_get_mat_row - retrieve row of the constraint matrix .
687  * <p>SYNOPSIS</p>
688  * <p>int glp_get_mat_row(glp_prob *lp, int i, int ind[], double val[]);</p>
689  * <p>DESCRIPTION</p>
690  * <p>The routine glp_get_mat_row scans (non-zero) elements of i-th row of the constraint matrix of the specified problem object and stores their column indices and numeric values to locations ind[1], ..., ind[len] and val[1], ..., val[len], respectively, where 0 &lt;= len &lt;= n is the number of elements in i-th row, n is the number of columns.</p>
691  * <p>The parameter ind and/or val can be specified as NULL, in which case corresponding information is not stored.</p>
692  * <p>RETURNS</p>
693  * <p>The routine glp_get_mat_row returns the length len, i.e. the number of (non-zero) elements in i-th row. </p>
694  */
695 public static int glp_get_mat_row(glp_prob P, int i, SWIGTYPE_p_int ind, SWIGTYPE_p_double val) {
696     return GLPKJNI.glp_get_mat_row(glp_prob.getCPtr(P), P, i, SWIGTYPE_p_int.getCPtr(ind), SWIGTYPE_p_double.getCPtr(val));
697   }
698 
699   
700 /**
701  * glp_get_mat_col - retrieve column of the constraint matrix .
702  * <p>SYNOPSIS</p>
703  * <p>int glp_get_mat_col(glp_prob *lp, int j, int ind[], double val[]);</p>
704  * <p>DESCRIPTION</p>
705  * <p>The routine glp_get_mat_col scans (non-zero) elements of j-th column of the constraint matrix of the specified problem object and stores their row indices and numeric values to locations ind[1], ..., ind[len] and val[1], ..., val[len], respectively, where 0 &lt;= len &lt;= m is the number of elements in j-th column, m is the number of rows.</p>
706  * <p>The parameter ind or/and val can be specified as NULL, in which case corresponding information is not stored.</p>
707  * <p>RETURNS</p>
708  * <p>The routine glp_get_mat_col returns the length len, i.e. the number of (non-zero) elements in j-th column. </p>
709  */
710 public static int glp_get_mat_col(glp_prob P, int j, SWIGTYPE_p_int ind, SWIGTYPE_p_double val) {
711     return GLPKJNI.glp_get_mat_col(glp_prob.getCPtr(P), P, j, SWIGTYPE_p_int.getCPtr(ind), SWIGTYPE_p_double.getCPtr(val));
712   }
713 
714   
715 /**
716  * glp_create_index - create the name index .
717  * <p>SYNOPSIS</p>
718  * <p>void glp_create_index(glp_prob *lp);</p>
719  * <p>DESCRIPTION</p>
720  * <p>The routine glp_create_index creates the name index for the specified problem object. The name index is an auxiliary data structure, which is intended to quickly (i.e. for logarithmic time) find rows and columns by their names.</p>
721  * <p>This routine can be called at any time. If the name index already exists, the routine does nothing. </p>
722  */
723 public static void glp_create_index(glp_prob P) {
724     GLPKJNI.glp_create_index(glp_prob.getCPtr(P), P);
725   }
726 
727   
728 /**
729  * glp_find_row - find row by its name .
730  * <p>SYNOPSIS</p>
731  * <p>int glp_find_row(glp_prob *lp, const char *name);</p>
732  * <p>RETURNS</p>
733  * <p>The routine glp_find_row returns the ordinal number of a row, which is assigned (by the routine glp_set_row_name) the specified symbolic name. If no such row exists, the routine returns 0. </p>
734  */
735 public static int glp_find_row(glp_prob P, String name) {
736     return GLPKJNI.glp_find_row(glp_prob.getCPtr(P), P, name);
737   }
738 
739   
740 /**
741  * glp_find_col - find column by its name .
742  * <p>SYNOPSIS</p>
743  * <p>int glp_find_col(glp_prob *lp, const char *name);</p>
744  * <p>RETURNS</p>
745  * <p>The routine glp_find_col returns the ordinal number of a column, which is assigned (by the routine glp_set_col_name) the specified symbolic name. If no such column exists, the routine returns 0. </p>
746  */
747 public static int glp_find_col(glp_prob P, String name) {
748     return GLPKJNI.glp_find_col(glp_prob.getCPtr(P), P, name);
749   }
750 
751   
752 /**
753  * glp_delete_index - delete the name index .
754  * <p>SYNOPSIS</p>
755  * <p>void glp_delete_index(glp_prob *lp);</p>
756  * <p>DESCRIPTION</p>
757  * <p>The routine glp_delete_index deletes the name index previously created by the routine glp_create_index and frees the memory allocated to this auxiliary data structure.</p>
758  * <p>This routine can be called at any time. If the name index does not exist, the routine does nothing. </p>
759  */
760 public static void glp_delete_index(glp_prob P) {
761     GLPKJNI.glp_delete_index(glp_prob.getCPtr(P), P);
762   }
763 
764   
765 /**
766  * glp_set_rii - set (change) row scale factor .
767  * <p>SYNOPSIS</p>
768  * <p>void glp_set_rii(glp_prob *lp, int i, double rii);</p>
769  * <p>DESCRIPTION</p>
770  * <p>The routine glp_set_rii sets (changes) the scale factor r[i,i] for i-th row of the specified problem object. </p>
771  */
772 public static void glp_set_rii(glp_prob P, int i, double rii) {
773     GLPKJNI.glp_set_rii(glp_prob.getCPtr(P), P, i, rii);
774   }
775 
776   
777 /**
778  * glp_set sjj - set (change) column scale factor .
779  * <p>SYNOPSIS</p>
780  * <p>void glp_set_sjj(glp_prob *lp, int j, double sjj);</p>
781  * <p>DESCRIPTION</p>
782  * <p>The routine glp_set_sjj sets (changes) the scale factor s[j,j] for j-th column of the specified problem object. </p>
783  */
784 public static void glp_set_sjj(glp_prob P, int j, double sjj) {
785     GLPKJNI.glp_set_sjj(glp_prob.getCPtr(P), P, j, sjj);
786   }
787 
788   
789 /**
790  * glp_get_rii - retrieve row scale factor .
791  * <p>SYNOPSIS</p>
792  * <p>double glp_get_rii(glp_prob *lp, int i);</p>
793  * <p>RETURNS</p>
794  * <p>The routine glp_get_rii returns current scale factor r[i,i] for i-th row of the specified problem object. </p>
795  */
796 public static double glp_get_rii(glp_prob P, int i) {
797     return GLPKJNI.glp_get_rii(glp_prob.getCPtr(P), P, i);
798   }
799 
800   
801 /**
802  * glp_get_sjj - retrieve column scale factor .
803  * <p>SYNOPSIS</p>
804  * <p>double glp_get_sjj(glp_prob *lp, int j);</p>
805  * <p>RETURNS</p>
806  * <p>The routine glp_get_sjj returns current scale factor s[j,j] for j-th column of the specified problem object. </p>
807  */
808 public static double glp_get_sjj(glp_prob P, int j) {
809     return GLPKJNI.glp_get_sjj(glp_prob.getCPtr(P), P, j);
810   }
811 
812   
813 /**
814  * glp_scale_prob - scale problem data .
815  * <p>SYNOPSIS</p>
816  * <p>void glp_scale_prob(glp_prob *lp, int flags);</p>
817  * <p>DESCRIPTION</p>
818  * <p>The routine glp_scale_prob performs automatic scaling of problem data for the specified problem object.</p>
819  * <p>The parameter flags specifies scaling options used by the routine. Options can be combined with the bitwise OR operator and may be the following:</p>
820  * <p>GLP_SF_GM perform geometric mean scaling; GLP_SF_EQ perform equilibration scaling; GLP_SF_2N round scale factors to nearest power of two; GLP_SF_SKIP skip scaling, if the problem is well scaled.</p>
821  * <p>The parameter flags may be specified as GLP_SF_AUTO, in which case the routine chooses scaling options automatically. </p>
822  */
823 public static void glp_scale_prob(glp_prob P, int flags) {
824     GLPKJNI.glp_scale_prob(glp_prob.getCPtr(P), P, flags);
825   }
826 
827   
828 /**
829  * glp_unscale_prob - unscale problem data .
830  * <p>SYNOPSIS</p>
831  * <p>void glp_unscale_prob(glp_prob *lp);</p>
832  * <p>DESCRIPTION</p>
833  * <p>The routine glp_unscale_prob performs unscaling of problem data for the specified problem object.</p>
834  * <p>"Unscaling" means replacing the current scaling matrices R and S by unity matrices that cancels the scaling effect. </p>
835  */
836 public static void glp_unscale_prob(glp_prob P) {
837     GLPKJNI.glp_unscale_prob(glp_prob.getCPtr(P), P);
838   }
839 
840   
841 /**
842  * glp_set_row_stat - set (change) row status .
843  * <p>SYNOPSIS</p>
844  * <p>void glp_set_row_stat(glp_prob *lp, int i, int stat);</p>
845  * <p>DESCRIPTION</p>
846  * <p>The routine glp_set_row_stat sets (changes) status of the auxiliary variable associated with i-th row.</p>
847  * <p>The new status of the auxiliary variable should be specified by the parameter stat as follows:</p>
848  * <p>GLP_BS - basic variable; GLP_NL - non-basic variable; GLP_NU - non-basic variable on its upper bound; if the variable is not double-bounded, this means the same as GLP_NL (only in case of this routine); GLP_NF - the same as GLP_NL (only in case of this routine); GLP_NS - the same as GLP_NL (only in case of this routine). </p>
849  */
850 public static void glp_set_row_stat(glp_prob P, int i, int stat) {
851     GLPKJNI.glp_set_row_stat(glp_prob.getCPtr(P), P, i, stat);
852   }
853 
854   
855 /**
856  * glp_set_col_stat - set (change) column status .
857  * <p>SYNOPSIS</p>
858  * <p>void glp_set_col_stat(glp_prob *lp, int j, int stat);</p>
859  * <p>DESCRIPTION</p>
860  * <p>The routine glp_set_col_stat sets (changes) status of the structural variable associated with j-th column.</p>
861  * <p>The new status of the structural variable should be specified by the parameter stat as follows:</p>
862  * <p>GLP_BS - basic variable; GLP_NL - non-basic variable; GLP_NU - non-basic variable on its upper bound; if the variable is not double-bounded, this means the same as GLP_NL (only in case of this routine); GLP_NF - the same as GLP_NL (only in case of this routine); GLP_NS - the same as GLP_NL (only in case of this routine). </p>
863  */
864 public static void glp_set_col_stat(glp_prob P, int j, int stat) {
865     GLPKJNI.glp_set_col_stat(glp_prob.getCPtr(P), P, j, stat);
866   }
867 
868   
869 /**
870  * glp_std_basis - construct standard initial LP basis .
871  * <p>SYNOPSIS</p>
872  * <p>void glp_std_basis(glp_prob *lp);</p>
873  * <p>DESCRIPTION</p>
874  * <p>The routine glp_std_basis builds the "standard" (trivial) initial basis for the specified problem object.</p>
875  * <p>In the "standard" basis all auxiliary variables are basic, and all structural variables are non-basic. </p>
876  */
877 public static void glp_std_basis(glp_prob P) {
878     GLPKJNI.glp_std_basis(glp_prob.getCPtr(P), P);
879   }
880 
881   
882 /**
883  */
884 public static void glp_adv_basis(glp_prob P, int flags) {
885     GLPKJNI.glp_adv_basis(glp_prob.getCPtr(P), P, flags);
886   }
887 
888   
889 /**
890  * glp_cpx_basis - construct Bixby's initial LP basis .
891  * <p>SYNOPSIS</p>
892  * <p>void glp_cpx_basis(glp_prob *lp);</p>
893  * <p>DESCRIPTION</p>
894  * <p>The routine glp_cpx_basis constructs an advanced initial basis for the specified problem object.</p>
895  * <p>The routine is based on Bixby's algorithm described in the paper:</p>
896  * <p>Robert E. Bixby. Implementing the Simplex Method: The Initial Basis. ORSA Journal on Computing, Vol. 4, No. 3, 1992, pp. 267-84. </p>
897  */
898 public static void glp_cpx_basis(glp_prob P) {
899     GLPKJNI.glp_cpx_basis(glp_prob.getCPtr(P), P);
900   }
901 
902   
903 /**
904  */
905 public static int glp_simplex(glp_prob P, glp_smcp parm) {
906     return GLPKJNI.glp_simplex(glp_prob.getCPtr(P), P, glp_smcp.getCPtr(parm), parm);
907   }
908 
909   
910 /**
911  */
912 public static int glp_exact(glp_prob P, glp_smcp parm) {
913     return GLPKJNI.glp_exact(glp_prob.getCPtr(P), P, glp_smcp.getCPtr(parm), parm);
914   }
915 
916   
917 /**
918  * glp_init_smcp - initialize simplex method control parameters .
919  * <p>SYNOPSIS</p>
920  * <p>void glp_init_smcp(glp_smcp *parm);</p>
921  * <p>DESCRIPTION</p>
922  * <p>The routine glp_init_smcp initializes control parameters, which are used by the simplex solver, with default values.</p>
923  * <p>Default values of the control parameters are stored in a glp_smcp structure, which the parameter parm points to. </p>
924  */
925 public static void glp_init_smcp(glp_smcp parm) {
926     GLPKJNI.glp_init_smcp(glp_smcp.getCPtr(parm), parm);
927   }
928 
929   
930 /**
931  * glp_get_status - retrieve generic status of basic solution .
932  * <p>SYNOPSIS</p>
933  * <p>int glp_get_status(glp_prob *lp);</p>
934  * <p>RETURNS</p>
935  * <p>The routine glp_get_status reports the generic status of the basic solution for the specified problem object as follows:</p>
936  * <p>GLP_OPT - solution is optimal; GLP_FEAS - solution is feasible; GLP_INFEAS - solution is infeasible; GLP_NOFEAS - problem has no feasible solution; GLP_UNBND - problem has unbounded solution; GLP_UNDEF - solution is undefined. </p>
937  */
938 public static int glp_get_status(glp_prob P) {
939     return GLPKJNI.glp_get_status(glp_prob.getCPtr(P), P);
940   }
941 
942   
943 /**
944  * glp_get_prim_stat - retrieve status of primal basic solution .
945  * <p>SYNOPSIS</p>
946  * <p>int glp_get_prim_stat(glp_prob *lp);</p>
947  * <p>RETURNS</p>
948  * <p>The routine glp_get_prim_stat reports the status of the primal basic solution for the specified problem object as follows:</p>
949  * <p>GLP_UNDEF - primal solution is undefined; GLP_FEAS - primal solution is feasible; GLP_INFEAS - primal solution is infeasible; GLP_NOFEAS - no primal feasible solution exists. </p>
950  */
951 public static int glp_get_prim_stat(glp_prob P) {
952     return GLPKJNI.glp_get_prim_stat(glp_prob.getCPtr(P), P);
953   }
954 
955   
956 /**
957  * glp_get_dual_stat - retrieve status of dual basic solution .
958  * <p>SYNOPSIS</p>
959  * <p>int glp_get_dual_stat(glp_prob *lp);</p>
960  * <p>RETURNS</p>
961  * <p>The routine glp_get_dual_stat reports the status of the dual basic solution for the specified problem object as follows:</p>
962  * <p>GLP_UNDEF - dual solution is undefined; GLP_FEAS - dual solution is feasible; GLP_INFEAS - dual solution is infeasible; GLP_NOFEAS - no dual feasible solution exists. </p>
963  */
964 public static int glp_get_dual_stat(glp_prob P) {
965     return GLPKJNI.glp_get_dual_stat(glp_prob.getCPtr(P), P);
966   }
967 
968   
969 /**
970  * glp_get_obj_val - retrieve objective value (basic solution) .
971  * <p>SYNOPSIS</p>
972  * <p>double glp_get_obj_val(glp_prob *lp);</p>
973  * <p>RETURNS</p>
974  * <p>The routine glp_get_obj_val returns value of the objective function for basic solution. </p>
975  */
976 public static double glp_get_obj_val(glp_prob P) {
977     return GLPKJNI.glp_get_obj_val(glp_prob.getCPtr(P), P);
978   }
979 
980   
981 /**
982  * glp_get_row_stat - retrieve row status .
983  * <p>SYNOPSIS</p>
984  * <p>int glp_get_row_stat(glp_prob *lp, int i);</p>
985  * <p>RETURNS</p>
986  * <p>The routine glp_get_row_stat returns current status assigned to the auxiliary variable associated with i-th row as follows:</p>
987  * <p>GLP_BS - basic variable; GLP_NL - non-basic variable on its lower bound; GLP_NU - non-basic variable on its upper bound; GLP_NF - non-basic free (unbounded) variable; GLP_NS - non-basic fixed variable. </p>
988  */
989 public static int glp_get_row_stat(glp_prob P, int i) {
990     return GLPKJNI.glp_get_row_stat(glp_prob.getCPtr(P), P, i);
991   }
992 
993   
994 /**
995  * glp_get_row_prim - retrieve row primal value (basic solution) .
996  * <p>SYNOPSIS</p>
997  * <p>double glp_get_row_prim(glp_prob *lp, int i);</p>
998  * <p>RETURNS</p>
999  * <p>The routine glp_get_row_prim returns primal value of the auxiliary variable associated with i-th row. </p>
1000  */
1001 public static double glp_get_row_prim(glp_prob P, int i) {
1002     return GLPKJNI.glp_get_row_prim(glp_prob.getCPtr(P), P, i);
1003   }
1004 
1005   
1006 /**
1007  * glp_get_row_dual - retrieve row dual value (basic solution) .
1008  * <p>SYNOPSIS</p>
1009  * <p>double glp_get_row_dual(glp_prob *lp, int i);</p>
1010  * <p>RETURNS</p>
1011  * <p>The routine glp_get_row_dual returns dual value (i.e. reduced cost) of the auxiliary variable associated with i-th row. </p>
1012  */
1013 public static double glp_get_row_dual(glp_prob P, int i) {
1014     return GLPKJNI.glp_get_row_dual(glp_prob.getCPtr(P), P, i);
1015   }
1016 
1017   
1018 /**
1019  * glp_get_col_stat - retrieve column status .
1020  * <p>SYNOPSIS</p>
1021  * <p>int glp_get_col_stat(glp_prob *lp, int j);</p>
1022  * <p>RETURNS</p>
1023  * <p>The routine glp_get_col_stat returns current status assigned to the structural variable associated with j-th column as follows:</p>
1024  * <p>GLP_BS - basic variable; GLP_NL - non-basic variable on its lower bound; GLP_NU - non-basic variable on its upper bound; GLP_NF - non-basic free (unbounded) variable; GLP_NS - non-basic fixed variable. </p>
1025  */
1026 public static int glp_get_col_stat(glp_prob P, int j) {
1027     return GLPKJNI.glp_get_col_stat(glp_prob.getCPtr(P), P, j);
1028   }
1029 
1030   
1031 /**
1032  * glp_get_col_prim - retrieve column primal value (basic solution) .
1033  * <p>SYNOPSIS</p>
1034  * <p>double glp_get_col_prim(glp_prob *lp, int j);</p>
1035  * <p>RETURNS</p>
1036  * <p>The routine glp_get_col_prim returns primal value of the structural variable associated with j-th column. </p>
1037  */
1038 public static double glp_get_col_prim(glp_prob P, int j) {
1039     return GLPKJNI.glp_get_col_prim(glp_prob.getCPtr(P), P, j);
1040   }
1041 
1042   
1043 /**
1044  * glp_get_col_dual - retrieve column dual value (basic solution) .
1045  * <p>SYNOPSIS</p>
1046  * <p>double glp_get_col_dual(glp_prob *lp, int j);</p>
1047  * <p>RETURNS</p>
1048  * <p>The routine glp_get_col_dual returns dual value (i.e. reduced cost) of the structural variable associated with j-th column. </p>
1049  */
1050 public static double glp_get_col_dual(glp_prob P, int j) {
1051     return GLPKJNI.glp_get_col_dual(glp_prob.getCPtr(P), P, j);
1052   }
1053 
1054   
1055 /**
1056  * glp_get_unbnd_ray - determine variable causing unboundedness .
1057  * <p>SYNOPSIS</p>
1058  * <p>int glp_get_unbnd_ray(glp_prob *lp);</p>
1059  * <p>RETURNS</p>
1060  * <p>The routine glp_get_unbnd_ray returns the number k of a variable, which causes primal or dual unboundedness. If 1 &lt;= k &lt;= m, it is k-th auxiliary variable, and if m+1 &lt;= k &lt;= m+n, it is (k-m)-th structural variable, where m is the number of rows, n is the number of columns in the problem object. If such variable is not defined, the routine returns 0.</p>
1061  * <p>COMMENTS</p>
1062  * <p>If it is not exactly known which version of the simplex solver detected unboundedness, i.e. whether the unboundedness is primal or dual, it is sufficient to check the status of the variable reported with the routine glp_get_row_stat or glp_get_col_stat. If the variable is non-basic, the unboundedness is primal, otherwise, if the variable is basic, the unboundedness is dual (the latter case means that the problem has no primal feasible dolution). </p>
1063  */
1064 public static int glp_get_unbnd_ray(glp_prob P) {
1065     return GLPKJNI.glp_get_unbnd_ray(glp_prob.getCPtr(P), P);
1066   }
1067 
1068   
1069 /**
1070  */
1071 public static int glp_get_it_cnt(glp_prob P) {
1072     return GLPKJNI.glp_get_it_cnt(glp_prob.getCPtr(P), P);
1073   }
1074 
1075   
1076 /**
1077  */
1078 public static void glp_set_it_cnt(glp_prob P, int it_cnt) {
1079     GLPKJNI.glp_set_it_cnt(glp_prob.getCPtr(P), P, it_cnt);
1080   }
1081 
1082   
1083 /**
1084  */
1085 public static int glp_interior(glp_prob P, glp_iptcp parm) {
1086     return GLPKJNI.glp_interior(glp_prob.getCPtr(P), P, glp_iptcp.getCPtr(parm), parm);
1087   }
1088 
1089   
1090 /**
1091  * glp_init_iptcp - initialize interior-point solver control parameters .
1092  * <p>SYNOPSIS</p>
1093  * <p>void glp_init_iptcp(glp_iptcp *parm);</p>
1094  * <p>DESCRIPTION</p>
1095  * <p>The routine glp_init_iptcp initializes control parameters, which are used by the interior-point solver, with default values.</p>
1096  * <p>Default values of the control parameters are stored in the glp_iptcp structure, which the parameter parm points to. </p>
1097  */
1098 public static void glp_init_iptcp(glp_iptcp parm) {
1099     GLPKJNI.glp_init_iptcp(glp_iptcp.getCPtr(parm), parm);
1100   }
1101 
1102   
1103 /**
1104  * glp_ipt_status - retrieve status of interior-point solution .
1105  * <p>SYNOPSIS</p>
1106  * <p>int glp_ipt_status(glp_prob *lp);</p>
1107  * <p>RETURNS</p>
1108  * <p>The routine glp_ipt_status reports the status of solution found by the interior-point solver as follows:</p>
1109  * <p>GLP_UNDEF - interior-point solution is undefined; GLP_OPT - interior-point solution is optimal; GLP_INFEAS - interior-point solution is infeasible; GLP_NOFEAS - no feasible solution exists. </p>
1110  */
1111 public static int glp_ipt_status(glp_prob P) {
1112     return GLPKJNI.glp_ipt_status(glp_prob.getCPtr(P), P);
1113   }
1114 
1115   
1116 /**
1117  * glp_ipt_obj_val - retrieve objective value (interior point) .
1118  * <p>SYNOPSIS</p>
1119  * <p>double glp_ipt_obj_val(glp_prob *lp);</p>
1120  * <p>RETURNS</p>
1121  * <p>The routine glp_ipt_obj_val returns value of the objective function for interior-point solution. </p>
1122  */
1123 public static double glp_ipt_obj_val(glp_prob P) {
1124     return GLPKJNI.glp_ipt_obj_val(glp_prob.getCPtr(P), P);
1125   }
1126 
1127   
1128 /**
1129  * glp_ipt_row_prim - retrieve row primal value (interior point) .
1130  * <p>SYNOPSIS</p>
1131  * <p>double glp_ipt_row_prim(glp_prob *lp, int i);</p>
1132  * <p>RETURNS</p>
1133  * <p>The routine glp_ipt_row_prim returns primal value of the auxiliary variable associated with i-th row. </p>
1134  */
1135 public static double glp_ipt_row_prim(glp_prob P, int i) {
1136     return GLPKJNI.glp_ipt_row_prim(glp_prob.getCPtr(P), P, i);
1137   }
1138 
1139   
1140 /**
1141  * glp_ipt_row_dual - retrieve row dual value (interior point) .
1142  * <p>SYNOPSIS</p>
1143  * <p>double glp_ipt_row_dual(glp_prob *lp, int i);</p>
1144  * <p>RETURNS</p>
1145  * <p>The routine glp_ipt_row_dual returns dual value (i.e. reduced cost) of the auxiliary variable associated with i-th row. </p>
1146  */
1147 public static double glp_ipt_row_dual(glp_prob P, int i) {
1148     return GLPKJNI.glp_ipt_row_dual(glp_prob.getCPtr(P), P, i);
1149   }
1150 
1151   
1152 /**
1153  * glp_ipt_col_prim - retrieve column primal value (interior point) .
1154  * <p>SYNOPSIS</p>
1155  * <p>double glp_ipt_col_prim(glp_prob *lp, int j);</p>
1156  * <p>RETURNS</p>
1157  * <p>The routine glp_ipt_col_prim returns primal value of the structural variable associated with j-th column. </p>
1158  */
1159 public static double glp_ipt_col_prim(glp_prob P, int j) {
1160     return GLPKJNI.glp_ipt_col_prim(glp_prob.getCPtr(P), P, j);
1161   }
1162 
1163   
1164 /**
1165  * glp_ipt_col_dual - retrieve column dual value (interior point) .
1166  * <p>SYNOPSIS</p>
1167  * <p>double glp_ipt_col_dual(glp_prob *lp, int j);</p>
1168  * <p>RETURNS</p>
1169  * <p>The routine glp_ipt_col_dual returns dual value (i.e. reduced cost) of the structural variable associated with j-th column. </p>
1170  */
1171 public static double glp_ipt_col_dual(glp_prob P, int j) {
1172     return GLPKJNI.glp_ipt_col_dual(glp_prob.getCPtr(P), P, j);
1173   }
1174 
1175   
1176 /**
1177  * glp_set_col_kind - set (change) column kind .
1178  * <p>SYNOPSIS</p>
1179  * <p>void glp_set_col_kind(glp_prob *mip, int j, int kind);</p>
1180  * <p>DESCRIPTION</p>
1181  * <p>The routine glp_set_col_kind sets (changes) the kind of j-th column (structural variable) as specified by the parameter kind:</p>
1182  * <p>GLP_CV - continuous variable; GLP_IV - integer variable; GLP_BV - binary variable. </p>
1183  */
1184 public static void glp_set_col_kind(glp_prob P, int j, int kind) {
1185     GLPKJNI.glp_set_col_kind(glp_prob.getCPtr(P), P, j, kind);
1186   }
1187 
1188   
1189 /**
1190  * glp_get_col_kind - retrieve column kind .
1191  * <p>SYNOPSIS</p>
1192  * <p>int glp_get_col_kind(glp_prob *mip, int j);</p>
1193  * <p>RETURNS</p>
1194  * <p>The routine glp_get_col_kind returns the kind of j-th column, i.e. the kind of corresponding structural variable, as follows:</p>
1195  * <p>GLP_CV - continuous variable; GLP_IV - integer variable; GLP_BV - binary variable </p>
1196  */
1197 public static int glp_get_col_kind(glp_prob P, int j) {
1198     return GLPKJNI.glp_get_col_kind(glp_prob.getCPtr(P), P, j);
1199   }
1200 
1201   
1202 /**
1203  * glp_get_num_int - retrieve number of integer columns .
1204  * <p>SYNOPSIS</p>
1205  * <p>int glp_get_num_int(glp_prob *mip);</p>
1206  * <p>RETURNS</p>
1207  * <p>The routine glp_get_num_int returns the current number of columns, which are marked as integer. </p>
1208  */
1209 public static int glp_get_num_int(glp_prob P) {
1210     return GLPKJNI.glp_get_num_int(glp_prob.getCPtr(P), P);
1211   }
1212 
1213   
1214 /**
1215  * glp_get_num_bin - retrieve number of binary columns .
1216  * <p>SYNOPSIS</p>
1217  * <p>int glp_get_num_bin(glp_prob *mip);</p>
1218  * <p>RETURNS</p>
1219  * <p>The routine glp_get_num_bin returns the current number of columns, which are marked as binary. </p>
1220  */
1221 public static int glp_get_num_bin(glp_prob P) {
1222     return GLPKJNI.glp_get_num_bin(glp_prob.getCPtr(P), P);
1223   }
1224 
1225   
1226 /**
1227  */
1228 public static int glp_intopt(glp_prob P, glp_iocp parm) {
1229     return GLPKJNI.glp_intopt(glp_prob.getCPtr(P), P, glp_iocp.getCPtr(parm), parm);
1230   }
1231 
1232   
1233 /**
1234  * glp_init_iocp - initialize integer optimizer control parameters .
1235  * <p>SYNOPSIS</p>
1236  * <p>void glp_init_iocp(glp_iocp *parm);</p>
1237  * <p>DESCRIPTION</p>
1238  * <p>The routine glp_init_iocp initializes control parameters, which are used by the integer optimizer, with default values.</p>
1239  * <p>Default values of the control parameters are stored in a glp_iocp structure, which the parameter parm points to. </p>
1240  */
1241 public static void glp_init_iocp(glp_iocp parm) {
1242     GLPKJNI.glp_init_iocp(glp_iocp.getCPtr(parm), parm);
1243   }
1244 
1245   
1246 /**
1247  * glp_mip_status - retrieve status of MIP solution .
1248  * <p>SYNOPSIS</p>
1249  * <p>int glp_mip_status(glp_prob *mip);</p>
1250  * <p>RETURNS</p>
1251  * <p>The routine lpx_mip_status reports the status of MIP solution found by the branch-and-bound solver as follows:</p>
1252  * <p>GLP_UNDEF - MIP solution is undefined; GLP_OPT - MIP solution is integer optimal; GLP_FEAS - MIP solution is integer feasible but its optimality (or non-optimality) has not been proven, perhaps due to premature termination of the search; GLP_NOFEAS - problem has no integer feasible solution (proven by the solver). </p>
1253  */
1254 public static int glp_mip_status(glp_prob P) {
1255     return GLPKJNI.glp_mip_status(glp_prob.getCPtr(P), P);
1256   }
1257 
1258   
1259 /**
1260  * glp_mip_obj_val - retrieve objective value (MIP solution) .
1261  * <p>SYNOPSIS</p>
1262  * <p>double glp_mip_obj_val(glp_prob *mip);</p>
1263  * <p>RETURNS</p>
1264  * <p>The routine glp_mip_obj_val returns value of the objective function for MIP solution. </p>
1265  */
1266 public static double glp_mip_obj_val(glp_prob P) {
1267     return GLPKJNI.glp_mip_obj_val(glp_prob.getCPtr(P), P);
1268   }
1269 
1270   
1271 /**
1272  * glp_mip_row_val - retrieve row value (MIP solution) .
1273  * <p>SYNOPSIS</p>
1274  * <p>double glp_mip_row_val(glp_prob *mip, int i);</p>
1275  * <p>RETURNS</p>
1276  * <p>The routine glp_mip_row_val returns value of the auxiliary variable associated with i-th row. </p>
1277  */
1278 public static double glp_mip_row_val(glp_prob P, int i) {
1279     return GLPKJNI.glp_mip_row_val(glp_prob.getCPtr(P), P, i);
1280   }
1281 
1282   
1283 /**
1284  * glp_mip_col_val - retrieve column value (MIP solution) .
1285  * <p>SYNOPSIS</p>
1286  * <p>double glp_mip_col_val(glp_prob *mip, int j);</p>
1287  * <p>RETURNS</p>
1288  * <p>The routine glp_mip_col_val returns value of the structural variable associated with j-th column. </p>
1289  */
1290 public static double glp_mip_col_val(glp_prob P, int j) {
1291     return GLPKJNI.glp_mip_col_val(glp_prob.getCPtr(P), P, j);
1292   }
1293 
1294   
1295 /**
1296  */
1297 public static void glp_check_kkt(glp_prob P, int sol, int cond, SWIGTYPE_p_double ae_max, SWIGTYPE_p_int ae_ind, SWIGTYPE_p_double re_max, SWIGTYPE_p_int re_ind) {
1298     GLPKJNI.glp_check_kkt(glp_prob.getCPtr(P), P, sol, cond, SWIGTYPE_p_double.getCPtr(ae_max), SWIGTYPE_p_int.getCPtr(ae_ind), SWIGTYPE_p_double.getCPtr(re_max), SWIGTYPE_p_int.getCPtr(re_ind));
1299   }
1300 
1301   
1302 /**
1303  */
1304 public static int glp_print_sol(glp_prob P, String fname) {
1305     return GLPKJNI.glp_print_sol(glp_prob.getCPtr(P), P, fname);
1306   }
1307 
1308   
1309 /**
1310  * glp_read_sol - read basic solution from text file .
1311  * <p>SYNOPSIS</p>
1312  * <p>int glp_read_sol(glp_prob *lp, const char *fname);</p>
1313  * <p>DESCRIPTION</p>
1314  * <p>The routine glp_read_sol reads basic solution from a text file whose name is specified by the parameter fname into the problem object.</p>
1315  * <p>For the file format see description of the routine glp_write_sol.</p>
1316  * <p>RETURNS</p>
1317  * <p>On success the routine returns zero, otherwise non-zero. </p>
1318  */
1319 public static int glp_read_sol(glp_prob P, String fname) {
1320     return GLPKJNI.glp_read_sol(glp_prob.getCPtr(P), P, fname);
1321   }
1322 
1323   
1324 /**
1325  * glp_write_sol - write basic solution to text file .
1326  * <p>SYNOPSIS</p>
1327  * <p>int glp_write_sol(glp_prob *lp, const char *fname);</p>
1328  * <p>DESCRIPTION</p>
1329  * <p>The routine glp_write_sol writes the current basic solution to a text file whose name is specified by the parameter fname. This file can be read back with the routine glp_read_sol.</p>
1330  * <p>RETURNS</p>
1331  * <p>On success the routine returns zero, otherwise non-zero.</p>
1332  * <p>FILE FORMAT</p>
1333  * <p>The file created by the routine glp_write_sol is a plain text file, which contains the following information:</p>
1334  * <p>m n p_stat d_stat obj_val r_stat[1] r_prim[1] r_dual[1] . . . r_stat[m] r_prim[m] r_dual[m] c_stat[1] c_prim[1] c_dual[1] . . . c_stat[n] c_prim[n] c_dual[n]</p>
1335  * <p>where: m is the number of rows (auxiliary variables); n is the number of columns (structural variables); p_stat is the primal status of the basic solution (GLP_UNDEF = 1, GLP_FEAS = 2, GLP_INFEAS = 3, or GLP_NOFEAS = 4); d_stat is the dual status of the basic solution (GLP_UNDEF = 1, GLP_FEAS = 2, GLP_INFEAS = 3, or GLP_NOFEAS = 4); obj_val is the objective value; r_stat[i], i = 1,...,m, is the status of i-th row (GLP_BS = 1, GLP_NL = 2, GLP_NU = 3, GLP_NF = 4, or GLP_NS = 5); r_prim[i], i = 1,...,m, is the primal value of i-th row; r_dual[i], i = 1,...,m, is the dual value of i-th row; c_stat[j], j = 1,...,n, is the status of j-th column (GLP_BS = 1, GLP_NL = 2, GLP_NU = 3, GLP_NF = 4, or GLP_NS = 5); c_prim[j], j = 1,...,n, is the primal value of j-th column; c_dual[j], j = 1,...,n, is the dual value of j-th column. </p>
1336  */
1337 public static int glp_write_sol(glp_prob P, String fname) {
1338     return GLPKJNI.glp_write_sol(glp_prob.getCPtr(P), P, fname);
1339   }
1340 
1341   
1342 /**
1343  */
1344 public static int glp_print_ranges(glp_prob P, int len, SWIGTYPE_p_int list, int flags, String fname) {
1345     return GLPKJNI.glp_print_ranges(glp_prob.getCPtr(P), P, len, SWIGTYPE_p_int.getCPtr(list), flags, fname);
1346   }
1347 
1348   
1349 /**
1350  */
1351 public static int glp_print_ipt(glp_prob P, String fname) {
1352     return GLPKJNI.glp_print_ipt(glp_prob.getCPtr(P), P, fname);
1353   }
1354 
1355   
1356 /**
1357  * glp_read_ipt - read interior-point solution from text file .
1358  * <p>SYNOPSIS</p>
1359  * <p>int glp_read_ipt(glp_prob *lp, const char *fname);</p>
1360  * <p>DESCRIPTION</p>
1361  * <p>The routine glp_read_ipt reads interior-point solution from a text file whose name is specified by the parameter fname into the problem object.</p>
1362  * <p>For the file format see description of the routine glp_write_ipt.</p>
1363  * <p>RETURNS</p>
1364  * <p>On success the routine returns zero, otherwise non-zero. </p>
1365  */
1366 public static int glp_read_ipt(glp_prob P, String fname) {
1367     return GLPKJNI.glp_read_ipt(glp_prob.getCPtr(P), P, fname);
1368   }
1369 
1370   
1371 /**
1372  * glp_write_ipt - write interior-point solution to text file .
1373  * <p>SYNOPSIS</p>
1374  * <p>int glp_write_ipt(glp_prob *lp, const char *fname);</p>
1375  * <p>DESCRIPTION</p>
1376  * <p>The routine glp_write_ipt writes the current interior-point solution to a text file whose name is specified by the parameter fname. This file can be read back with the routine glp_read_ipt.</p>
1377  * <p>RETURNS</p>
1378  * <p>On success the routine returns zero, otherwise non-zero.</p>
1379  * <p>FILE FORMAT</p>
1380  * <p>The file created by the routine glp_write_ipt is a plain text file, which contains the following information:</p>
1381  * <p>m n stat obj_val r_prim[1] r_dual[1] . . . r_prim[m] r_dual[m] c_prim[1] c_dual[1] . . . c_prim[n] c_dual[n]</p>
1382  * <p>where: m is the number of rows (auxiliary variables); n is the number of columns (structural variables); stat is the solution status (GLP_UNDEF = 1 or GLP_OPT = 5); obj_val is the objective value; r_prim[i], i = 1,...,m, is the primal value of i-th row; r_dual[i], i = 1,...,m, is the dual value of i-th row; c_prim[j], j = 1,...,n, is the primal value of j-th column; c_dual[j], j = 1,...,n, is the dual value of j-th column. </p>
1383  */
1384 public static int glp_write_ipt(glp_prob P, String fname) {
1385     return GLPKJNI.glp_write_ipt(glp_prob.getCPtr(P), P, fname);
1386   }
1387 
1388   
1389 /**
1390  */
1391 public static int glp_print_mip(glp_prob P, String fname) {
1392     return GLPKJNI.glp_print_mip(glp_prob.getCPtr(P), P, fname);
1393   }
1394 
1395   
1396 /**
1397  * glp_read_mip - read MIP solution from text file .
1398  * <p>SYNOPSIS</p>
1399  * <p>int glp_read_mip(glp_prob *mip, const char *fname);</p>
1400  * <p>DESCRIPTION</p>
1401  * <p>The routine glp_read_mip reads MIP solution from a text file whose name is specified by the parameter fname into the problem object.</p>
1402  * <p>For the file format see description of the routine glp_write_mip.</p>
1403  * <p>RETURNS</p>
1404  * <p>On success the routine returns zero, otherwise non-zero. </p>
1405  */
1406 public static int glp_read_mip(glp_prob P, String fname) {
1407     return GLPKJNI.glp_read_mip(glp_prob.getCPtr(P), P, fname);
1408   }
1409 
1410   
1411 /**
1412  * glp_write_mip - write MIP solution to text file .
1413  * <p>SYNOPSIS</p>
1414  * <p>int glp_write_mip(glp_prob *mip, const char *fname);</p>
1415  * <p>DESCRIPTION</p>
1416  * <p>The routine glp_write_mip writes the current MIP solution to a text file whose name is specified by the parameter fname. This file can be read back with the routine glp_read_mip.</p>
1417  * <p>RETURNS</p>
1418  * <p>On success the routine returns zero, otherwise non-zero.</p>
1419  * <p>FILE FORMAT</p>
1420  * <p>The file created by the routine glp_write_sol is a plain text file, which contains the following information:</p>
1421  * <p>m n stat obj_val r_val[1] . . . r_val[m] c_val[1] . . . c_val[n]</p>
1422  * <p>where: m is the number of rows (auxiliary variables); n is the number of columns (structural variables); stat is the solution status (GLP_UNDEF = 1, GLP_FEAS = 2, GLP_NOFEAS = 4, or GLP_OPT = 5); obj_val is the objective value; r_val[i], i = 1,...,m, is the value of i-th row; c_val[j], j = 1,...,n, is the value of j-th column. </p>
1423  */
1424 public static int glp_write_mip(glp_prob P, String fname) {
1425     return GLPKJNI.glp_write_mip(glp_prob.getCPtr(P), P, fname);
1426   }
1427 
1428   
1429 /**
1430  * glp_bf_exists - check if the basis factorization exists .
1431  * <p>SYNOPSIS</p>
1432  * <p>int glp_bf_exists(glp_prob *lp);</p>
1433  * <p>RETURNS</p>
1434  * <p>If the basis factorization for the current basis associated with the specified problem object exists and therefore is available for computations, the routine glp_bf_exists returns non-zero. Otherwise the routine returns zero. </p>
1435  */
1436 public static int glp_bf_exists(glp_prob P) {
1437     return GLPKJNI.glp_bf_exists(glp_prob.getCPtr(P), P);
1438   }
1439 
1440   
1441 /**
1442  */
1443 public static int glp_factorize(glp_prob P) {
1444     return GLPKJNI.glp_factorize(glp_prob.getCPtr(P), P);
1445   }
1446 
1447   
1448 /**
1449  * glp_bf_updated - check if the basis factorization has been updated .
1450  * <p>SYNOPSIS</p>
1451  * <p>int glp_bf_updated(glp_prob *lp);</p>
1452  * <p>RETURNS</p>
1453  * <p>If the basis factorization has been just computed from scratch, the routine glp_bf_updated returns zero. Otherwise, if the factorization has been updated one or more times, the routine returns non-zero. </p>
1454  */
1455 public static int glp_bf_updated(glp_prob P) {
1456     return GLPKJNI.glp_bf_updated(glp_prob.getCPtr(P), P);
1457   }
1458 
1459   
1460 /**
1461  * glp_get_bfcp - retrieve basis factorization control parameters .
1462  * <p>SYNOPSIS</p>
1463  * <p>void glp_get_bfcp(glp_prob *lp, glp_bfcp *parm);</p>
1464  * <p>DESCRIPTION</p>
1465  * <p>The routine glp_get_bfcp retrieves control parameters, which are used on computing and updating the basis factorization associated with the specified problem object.</p>
1466  * <p>Current values of control parameters are stored by the routine in a glp_bfcp structure, which the parameter parm points to. </p>
1467  */
1468 public static void glp_get_bfcp(glp_prob P, glp_bfcp parm) {
1469     GLPKJNI.glp_get_bfcp(glp_prob.getCPtr(P), P, glp_bfcp.getCPtr(parm), parm);
1470   }
1471 
1472   
1473 /**
1474  * glp_set_bfcp - change basis factorization control parameters .
1475  * <p>SYNOPSIS</p>
1476  * <p>void glp_set_bfcp(glp_prob *lp, const glp_bfcp *parm);</p>
1477  * <p>DESCRIPTION</p>
1478  * <p>The routine glp_set_bfcp changes control parameters, which are used by internal GLPK routines in computing and updating the basis factorization associated with the specified problem object.</p>
1479  * <p>New values of the control parameters should be passed in a structure glp_bfcp, which the parameter parm points to.</p>
1480  * <p>The parameter parm can be specified as NULL, in which case all control parameters are reset to their default values. </p>
1481  */
1482 public static void glp_set_bfcp(glp_prob P, glp_bfcp parm) {
1483     GLPKJNI.glp_set_bfcp(glp_prob.getCPtr(P), P, glp_bfcp.getCPtr(parm), parm);
1484   }
1485 
1486   
1487 /**
1488  * glp_get_bhead - retrieve the basis header information .
1489  * <p>SYNOPSIS</p>
1490  * <p>int glp_get_bhead(glp_prob *lp, int k);</p>
1491  * <p>DESCRIPTION</p>
1492  * <p>The routine glp_get_bhead returns the basis header information for the current basis associated with the specified problem object.</p>
1493  * <p>RETURNS</p>
1494  * <p>If xB[k], 1 &lt;= k &lt;= m, is i-th auxiliary variable (1 &lt;= i &lt;= m), the routine returns i. Otherwise, if xB[k] is j-th structural variable (1 &lt;= j &lt;= n), the routine returns m+j. Here m is the number of rows and n is the number of columns in the problem object. </p>
1495  */
1496 public static int glp_get_bhead(glp_prob P, int k) {
1497     return GLPKJNI.glp_get_bhead(glp_prob.getCPtr(P), P, k);
1498   }
1499 
1500   
1501 /**
1502  * glp_get_row_bind - retrieve row index in the basis header .
1503  * <p>SYNOPSIS</p>
1504  * <p>int glp_get_row_bind(glp_prob *lp, int i);</p>
1505  * <p>RETURNS</p>
1506  * <p>The routine glp_get_row_bind returns the index k of basic variable xB[k], 1 &lt;= k &lt;= m, which is i-th auxiliary variable, 1 &lt;= i &lt;= m, in the current basis associated with the specified problem object, where m is the number of rows. However, if i-th auxiliary variable is non-basic, the routine returns zero. </p>
1507  */
1508 public static int glp_get_row_bind(glp_prob P, int i) {
1509     return GLPKJNI.glp_get_row_bind(glp_prob.getCPtr(P), P, i);
1510   }
1511 
1512   
1513 /**
1514  * glp_get_col_bind - retrieve column index in the basis header .
1515  * <p>SYNOPSIS</p>
1516  * <p>int glp_get_col_bind(glp_prob *lp, int j);</p>
1517  * <p>RETURNS</p>
1518  * <p>The routine glp_get_col_bind returns the index k of basic variable xB[k], 1 &lt;= k &lt;= m, which is j-th structural variable, 1 &lt;= j &lt;= n, in the current basis associated with the specified problem object, where m is the number of rows, n is the number of columns. However, if j-th structural variable is non-basic, the routine returns zero. </p>
1519  */
1520 public static int glp_get_col_bind(glp_prob P, int j) {
1521     return GLPKJNI.glp_get_col_bind(glp_prob.getCPtr(P), P, j);
1522   }
1523 
1524   
1525 /**
1526  * glp_ftran - perform forward transformation (solve system B*x = b) .
1527  * <p>SYNOPSIS</p>
1528  * <p>void glp_ftran(glp_prob *lp, double x[]);</p>
1529  * <p>DESCRIPTION</p>
1530  * <p>The routine glp_ftran performs forward transformation, i.e. solves the system B*x = b, where B is the basis matrix corresponding to the current basis for the specified problem object, x is the vector of unknowns to be computed, b is the vector of right-hand sides.</p>
1531  * <p>On entry elements of the vector b should be stored in dense format in locations x[1], ..., x[m], where m is the number of rows. On exit the routine stores elements of the vector x in the same locations.</p>
1532  * <p>SCALING/UNSCALING</p>
1533  * <p>Let A~ = (I | -A) is the augmented constraint matrix of the original (unscaled) problem. In the scaled LP problem instead the matrix A the scaled matrix A" = R*A*S is actually used, so</p>
1534  * <p>A~" = (I | A") = (I | R*A*S) = (R*I*inv(R) | R*A*S) = (1) = R*(I | A)*S~ = R*A~*S~,</p>
1535  * <p>is the scaled augmented constraint matrix, where R and S are diagonal scaling matrices used to scale rows and columns of the matrix A, and</p>
1536  * <p>S~ = diag(inv(R) | S) (2)</p>
1537  * <p>is an augmented diagonal scaling matrix.</p>
1538  * <p>By definition:</p>
1539  * <p>A~ = (B | N), (3)</p>
1540  * <p>where B is the basic matrix, which consists of basic columns of the augmented constraint matrix A~, and N is a matrix, which consists of non-basic columns of A~. From (1) it follows that:</p>
1541  * <p>A~" = (B" | N") = (R*B*SB | R*N*SN), (4)</p>
1542  * <p>where SB and SN are parts of the augmented scaling matrix S~, which correspond to basic and non-basic variables, respectively. Therefore</p>
1543  * <p>B" = R*B*SB, (5)</p>
1544  * <p>which is the scaled basis matrix. </p>
1545  */
1546 public static void glp_ftran(glp_prob P, SWIGTYPE_p_double x) {
1547     GLPKJNI.glp_ftran(glp_prob.getCPtr(P), P, SWIGTYPE_p_double.getCPtr(x));
1548   }
1549 
1550   
1551 /**
1552  * glp_btran - perform backward transformation (solve system B'*x = b) .
1553  * <p>SYNOPSIS</p>
1554  * <p>void glp_btran(glp_prob *lp, double x[]);</p>
1555  * <p>DESCRIPTION</p>
1556  * <p>The routine glp_btran performs backward transformation, i.e. solves the system B'*x = b, where B' is a matrix transposed to the basis matrix corresponding to the current basis for the specified problem problem object, x is the vector of unknowns to be computed, b is the vector of right-hand sides.</p>
1557  * <p>On entry elements of the vector b should be stored in dense format in locations x[1], ..., x[m], where m is the number of rows. On exit the routine stores elements of the vector x in the same locations.</p>
1558  * <p>SCALING/UNSCALING</p>
1559  * <p>See comments to the routine glp_ftran. </p>
1560  */
1561 public static void glp_btran(glp_prob P, SWIGTYPE_p_double x) {
1562     GLPKJNI.glp_btran(glp_prob.getCPtr(P), P, SWIGTYPE_p_double.getCPtr(x));
1563   }
1564 
1565   
1566 /**
1567  * glp_warm_up - "warm up" LP basis .
1568  * <p>SYNOPSIS</p>
1569  * <p>int glp_warm_up(glp_prob *P);</p>
1570  * <p>DESCRIPTION</p>
1571  * <p>The routine glp_warm_up "warms up" the LP basis for the specified problem object using current statuses assigned to rows and columns (that is, to auxiliary and structural variables).</p>
1572  * <p>This operation includes computing factorization of the basis matrix (if it does not exist), computing primal and dual components of basic solution, and determining the solution status.</p>
1573  * <p>RETURNS</p>
1574  * <p>0 The operation has been successfully performed.</p>
1575  * <p>GLP_EBADB The basis matrix is invalid, i.e. the number of basic (auxiliary and structural) variables differs from the number of rows in the problem object.</p>
1576  * <p>GLP_ESING The basis matrix is singular within the working precision.</p>
1577  * <p>GLP_ECOND The basis matrix is ill-conditioned. </p>
1578  */
1579 public static int glp_warm_up(glp_prob P) {
1580     return GLPKJNI.glp_warm_up(glp_prob.getCPtr(P), P);
1581   }
1582 
1583   
1584 /**
1585  * glp_eval_tab_row - compute row of the simplex tableau .
1586  * <p>SYNOPSIS</p>
1587  * <p>int glp_eval_tab_row(glp_prob *lp, int k, int ind[], double val[]);</p>
1588  * <p>DESCRIPTION</p>
1589  * <p>The routine glp_eval_tab_row computes a row of the current simplex tableau for the basic variable, which is specified by the number k: if 1 &lt;= k &lt;= m, x[k] is k-th auxiliary variable; if m+1 &lt;= k &lt;= m+n, x[k] is (k-m)-th structural variable, where m is number of rows, and n is number of columns. The current basis must be available.</p>
1590  * <p>The routine stores column indices and numerical values of non-zero elements of the computed row using sparse format to the locations ind[1], ..., ind[len] and val[1], ..., val[len], respectively, where 0 &lt;= len &lt;= n is number of non-zeros returned on exit.</p>
1591  * <p>Element indices stored in the array ind have the same sense as the index k, i.e. indices 1 to m denote auxiliary variables and indices m+1 to m+n denote structural ones (all these variables are obviously non-basic by definition).</p>
1592  * <p>The computed row shows how the specified basic variable x[k] = xB[i] depends on non-basic variables:</p>
1593  * <p>xB[i] = alfa[i,1]*xN[1] + alfa[i,2]*xN[2] + ... + alfa[i,n]*xN[n],</p>
1594  * <p>where alfa[i,j] are elements of the simplex table row, xN[j] are non-basic (auxiliary and structural) variables.</p>
1595  * <p>RETURNS</p>
1596  * <p>The routine returns number of non-zero elements in the simplex table row stored in the arrays ind and val.</p>
1597  * <p>BACKGROUND</p>
1598  * <p>The system of equality constraints of the LP problem is:</p>
1599  * <p>xR = A * xS, (1)</p>
1600  * <p>where xR is the vector of auxliary variables, xS is the vector of structural variables, A is the matrix of constraint coefficients.</p>
1601  * <p>The system (1) can be written in homogenous form as follows:</p>
1602  * <p>A~ * x = 0, (2)</p>
1603  * <p>where A~ = (I | -A) is the augmented constraint matrix (has m rows and m+n columns), x = (xR | xS) is the vector of all (auxiliary and structural) variables.</p>
1604  * <p>By definition for the current basis we have:</p>
1605  * <p>A~ = (B | N), (3)</p>
1606  * <p>where B is the basis matrix. Thus, the system (2) can be written as:</p>
1607  * <p>B * xB + N * xN = 0. (4)</p>
1608  * <p>From (4) it follows that:</p>
1609  * <p>xB = A^ * xN, (5)</p>
1610  * <p>where the matrix</p>
1611  * <p>A^ = - inv(B) * N (6)</p>
1612  * <p>is called the simplex table.</p>
1613  * <p>It is understood that i-th row of the simplex table is:</p>
1614  * <p>e * A^ = - e * inv(B) * N, (7)</p>
1615  * <p>where e is a unity vector with e[i] = 1.</p>
1616  * <p>To compute i-th row of the simplex table the routine first computes i-th row of the inverse:</p>
1617  * <p>rho = inv(B') * e, (8)</p>
1618  * <p>where B' is a matrix transposed to B, and then computes elements of i-th row of the simplex table as scalar products:</p>
1619  * <p>alfa[i,j] = - rho * N[j] for all j, (9)</p>
1620  * <p>where N[j] is a column of the augmented constraint matrix A~, which corresponds to some non-basic auxiliary or structural variable. </p>
1621  */
1622 public static int glp_eval_tab_row(glp_prob P, int k, SWIGTYPE_p_int ind, SWIGTYPE_p_double val) {
1623     return GLPKJNI.glp_eval_tab_row(glp_prob.getCPtr(P), P, k, SWIGTYPE_p_int.getCPtr(ind), SWIGTYPE_p_double.getCPtr(val));
1624   }
1625 
1626   
1627 /**
1628  * glp_eval_tab_col - compute column of the simplex tableau .
1629  * <p>SYNOPSIS</p>
1630  * <p>int glp_eval_tab_col(glp_prob *lp, int k, int ind[], double val[]);</p>
1631  * <p>DESCRIPTION</p>
1632  * <p>The routine glp_eval_tab_col computes a column of the current simplex table for the non-basic variable, which is specified by the number k: if 1 &lt;= k &lt;= m, x[k] is k-th auxiliary variable; if m+1 &lt;= k &lt;= m+n, x[k] is (k-m)-th structural variable, where m is number of rows, and n is number of columns. The current basis must be available.</p>
1633  * <p>The routine stores row indices and numerical values of non-zero elements of the computed column using sparse format to the locations ind[1], ..., ind[len] and val[1], ..., val[len] respectively, where 0 &lt;= len &lt;= m is number of non-zeros returned on exit.</p>
1634  * <p>Element indices stored in the array ind have the same sense as the index k, i.e. indices 1 to m denote auxiliary variables and indices m+1 to m+n denote structural ones (all these variables are obviously basic by the definition).</p>
1635  * <p>The computed column shows how basic variables depend on the specified non-basic variable x[k] = xN[j]:</p>
1636  * <p>xB[1] = ... + alfa[1,j]*xN[j] + ... xB[2] = ... + alfa[2,j]*xN[j] + ... . . . . . . xB[m] = ... + alfa[m,j]*xN[j] + ...</p>
1637  * <p>where alfa[i,j] are elements of the simplex table column, xB[i] are basic (auxiliary and structural) variables.</p>
1638  * <p>RETURNS</p>
1639  * <p>The routine returns number of non-zero elements in the simplex table column stored in the arrays ind and val.</p>
1640  * <p>BACKGROUND</p>
1641  * <p>As it was explained in comments to the routine glp_eval_tab_row (see above) the simplex table is the following matrix:</p>
1642  * <p>A^ = - inv(B) * N. (1)</p>
1643  * <p>Therefore j-th column of the simplex table is:</p>
1644  * <p>A^ * e = - inv(B) * N * e = - inv(B) * N[j], (2)</p>
1645  * <p>where e is a unity vector with e[j] = 1, B is the basis matrix, N[j] is a column of the augmented constraint matrix A~, which corresponds to the given non-basic auxiliary or structural variable. </p>
1646  */
1647 public static int glp_eval_tab_col(glp_prob P, int k, SWIGTYPE_p_int ind, SWIGTYPE_p_double val) {
1648     return GLPKJNI.glp_eval_tab_col(glp_prob.getCPtr(P), P, k, SWIGTYPE_p_int.getCPtr(ind), SWIGTYPE_p_double.getCPtr(val));
1649   }
1650 
1651   
1652 /**
1653  * glp_transform_row - transform explicitly specified row .
1654  * <p>SYNOPSIS</p>
1655  * <p>int glp_transform_row(glp_prob *P, int len, int ind[], double val[]);</p>
1656  * <p>DESCRIPTION</p>
1657  * <p>The routine glp_transform_row performs the same operation as the routine glp_eval_tab_row with exception that the row to be transformed is specified explicitly as a sparse vector.</p>
1658  * <p>The explicitly specified row may be thought as a linear form:</p>
1659  * <p>x = a[1]*x[m+1] + a[2]*x[m+2] + ... + a[n]*x[m+n], (1)</p>
1660  * <p>where x is an auxiliary variable for this row, a[j] are coefficients of the linear form, x[m+j] are structural variables.</p>
1661  * <p>On entry column indices and numerical values of non-zero elements of the row should be stored in locations ind[1], ..., ind[len] and val[1], ..., val[len], where len is the number of non-zero elements.</p>
1662  * <p>This routine uses the system of equality constraints and the current basis in order to express the auxiliary variable x in (1) through the current non-basic variables (as if the transformed row were added to the problem object and its auxiliary variable were basic), i.e. the resultant row has the form:</p>
1663  * <p>x = alfa[1]*xN[1] + alfa[2]*xN[2] + ... + alfa[n]*xN[n], (2)</p>
1664  * <p>where xN[j] are non-basic (auxiliary or structural) variables, n is the number of columns in the LP problem object.</p>
1665  * <p>On exit the routine stores indices and numerical values of non-zero elements of the resultant row (2) in locations ind[1], ..., ind[len'] and val[1], ..., val[len'], where 0 &lt;= len' &lt;= n is the number of non-zero elements in the resultant row returned by the routine. Note that indices (numbers) of non-basic variables stored in the array ind correspond to original ordinal numbers of variables: indices 1 to m mean auxiliary variables and indices m+1 to m+n mean structural ones.</p>
1666  * <p>RETURNS</p>
1667  * <p>The routine returns len', which is the number of non-zero elements in the resultant row stored in the arrays ind and val.</p>
1668  * <p>BACKGROUND</p>
1669  * <p>The explicitly specified row (1) is transformed in the same way as it were the objective function row.</p>
1670  * <p>From (1) it follows that:</p>
1671  * <p>x = aB * xB + aN * xN, (3)</p>
1672  * <p>where xB is the vector of basic variables, xN is the vector of non-basic variables.</p>
1673  * <p>The simplex table, which corresponds to the current basis, is:</p>
1674  * <p>xB = [-inv(B) * N] * xN. (4)</p>
1675  * <p>Therefore substituting xB from (4) to (3) we have:</p>
1676  * <p>x = aB * [-inv(B) * N] * xN + aN * xN = (5) = rho * (-N) * xN + aN * xN = alfa * xN,</p>
1677  * <p>where:</p>
1678  * <p>rho = inv(B') * aB, (6)</p>
1679  * <p>and</p>
1680  * <p>alfa = aN + rho * (-N) (7)</p>
1681  * <p>is the resultant row computed by the routine. </p>
1682  */
1683 public static int glp_transform_row(glp_prob P, int len, SWIGTYPE_p_int ind, SWIGTYPE_p_double val) {
1684     return GLPKJNI.glp_transform_row(glp_prob.getCPtr(P), P, len, SWIGTYPE_p_int.getCPtr(ind), SWIGTYPE_p_double.getCPtr(val));
1685   }
1686 
1687   
1688 /**
1689  * glp_transform_col - transform explicitly specified column .
1690  * <p>SYNOPSIS</p>
1691  * <p>int glp_transform_col(glp_prob *P, int len, int ind[], double val[]);</p>
1692  * <p>DESCRIPTION</p>
1693  * <p>The routine glp_transform_col performs the same operation as the routine glp_eval_tab_col with exception that the column to be transformed is specified explicitly as a sparse vector.</p>
1694  * <p>The explicitly specified column may be thought as if it were added to the original system of equality constraints:</p>
1695  * <p>x[1] = a[1,1]*x[m+1] + ... + a[1,n]*x[m+n] + a[1]*x x[2] = a[2,1]*x[m+1] + ... + a[2,n]*x[m+n] + a[2]*x (1) . . . . . . . . . . . . . . . x[m] = a[m,1]*x[m+1] + ... + a[m,n]*x[m+n] + a[m]*x</p>
1696  * <p>where x[i] are auxiliary variables, x[m+j] are structural variables, x is a structural variable for the explicitly specified column, a[i] are constraint coefficients for x.</p>
1697  * <p>On entry row indices and numerical values of non-zero elements of the column should be stored in locations ind[1], ..., ind[len] and val[1], ..., val[len], where len is the number of non-zero elements.</p>
1698  * <p>This routine uses the system of equality constraints and the current basis in order to express the current basic variables through the structural variable x in (1) (as if the transformed column were added to the problem object and the variable x were non-basic), i.e. the resultant column has the form:</p>
1699  * <p>xB[1] = ... + alfa[1]*x xB[2] = ... + alfa[2]*x (2) . . . . . . xB[m] = ... + alfa[m]*x</p>
1700  * <p>where xB are basic (auxiliary and structural) variables, m is the number of rows in the problem object.</p>
1701  * <p>On exit the routine stores indices and numerical values of non-zero elements of the resultant column (2) in locations ind[1], ..., ind[len'] and val[1], ..., val[len'], where 0 &lt;= len' &lt;= m is the number of non-zero element in the resultant column returned by the routine. Note that indices (numbers) of basic variables stored in the array ind correspond to original ordinal numbers of variables: indices 1 to m mean auxiliary variables and indices m+1 to m+n mean structural ones.</p>
1702  * <p>RETURNS</p>
1703  * <p>The routine returns len', which is the number of non-zero elements in the resultant column stored in the arrays ind and val.</p>
1704  * <p>BACKGROUND</p>
1705  * <p>The explicitly specified column (1) is transformed in the same way as any other column of the constraint matrix using the formula:</p>
1706  * <p>alfa = inv(B) * a, (3)</p>
1707  * <p>where alfa is the resultant column computed by the routine. </p>
1708  */
1709 public static int glp_transform_col(glp_prob P, int len, SWIGTYPE_p_int ind, SWIGTYPE_p_double val) {
1710     return GLPKJNI.glp_transform_col(glp_prob.getCPtr(P), P, len, SWIGTYPE_p_int.getCPtr(ind), SWIGTYPE_p_double.getCPtr(val));
1711   }
1712 
1713   
1714 /**
1715  * glp_prim_rtest - perform primal ratio test .
1716  * <p>SYNOPSIS</p>
1717  * <p>int glp_prim_rtest(glp_prob *P, int len, const int ind[], const double val[], int dir, double eps);</p>
1718  * <p>DESCRIPTION</p>
1719  * <p>The routine glp_prim_rtest performs the primal ratio test using an explicitly specified column of the simplex table.</p>
1720  * <p>The current basic solution associated with the LP problem object must be primal feasible.</p>
1721  * <p>The explicitly specified column of the simplex table shows how the basic variables xB depend on some non-basic variable x (which is not necessarily presented in the problem object):</p>
1722  * <p>xB[1] = ... + alfa[1] * x + ... xB[2] = ... + alfa[2] * x + ... (*) . . . . . . . . xB[m] = ... + alfa[m] * x + ...</p>
1723  * <p>The column (*) is specifed on entry to the routine using the sparse format. Ordinal numbers of basic variables xB[i] should be placed in locations ind[1], ..., ind[len], where ordinal number 1 to m denote auxiliary variables, and ordinal numbers m+1 to m+n denote structural variables. The corresponding non-zero coefficients alfa[i] should be placed in locations val[1], ..., val[len]. The arrays ind and val are not changed on exit.</p>
1724  * <p>The parameter dir specifies direction in which the variable x changes on entering the basis: +1 means increasing, -1 means decreasing.</p>
1725  * <p>The parameter eps is an absolute tolerance (small positive number) used by the routine to skip small alfa[j] of the row (*).</p>
1726  * <p>The routine determines which basic variable (among specified in ind[1], ..., ind[len]) should leave the basis in order to keep primal feasibility.</p>
1727  * <p>RETURNS</p>
1728  * <p>The routine glp_prim_rtest returns the index piv in the arrays ind and val corresponding to the pivot element chosen, 1 &lt;= piv &lt;= len. If the adjacent basic solution is primal unbounded and therefore the choice cannot be made, the routine returns zero.</p>
1729  * <p>COMMENTS</p>
1730  * <p>If the non-basic variable x is presented in the LP problem object, the column (*) can be computed with the routine glp_eval_tab_col; otherwise it can be computed with the routine glp_transform_col. </p>
1731  */
1732 public static int glp_prim_rtest(glp_prob P, int len, SWIGTYPE_p_int ind, SWIGTYPE_p_double val, int dir, double eps) {
1733     return GLPKJNI.glp_prim_rtest(glp_prob.getCPtr(P), P, len, SWIGTYPE_p_int.getCPtr(ind), SWIGTYPE_p_double.getCPtr(val), dir, eps);
1734   }
1735 
1736   
1737 /**
1738  * glp_dual_rtest - perform dual ratio test .
1739  * <p>SYNOPSIS</p>
1740  * <p>int glp_dual_rtest(glp_prob *P, int len, const int ind[], const double val[], int dir, double eps);</p>
1741  * <p>DESCRIPTION</p>
1742  * <p>The routine glp_dual_rtest performs the dual ratio test using an explicitly specified row of the simplex table.</p>
1743  * <p>The current basic solution associated with the LP problem object must be dual feasible.</p>
1744  * <p>The explicitly specified row of the simplex table is a linear form that shows how some basic variable x (which is not necessarily presented in the problem object) depends on non-basic variables xN:</p>
1745  * <p>x = alfa[1] * xN[1] + alfa[2] * xN[2] + ... + alfa[n] * xN[n]. (*)</p>
1746  * <p>The row (*) is specified on entry to the routine using the sparse format. Ordinal numbers of non-basic variables xN[j] should be placed in locations ind[1], ..., ind[len], where ordinal numbers 1 to m denote auxiliary variables, and ordinal numbers m+1 to m+n denote structural variables. The corresponding non-zero coefficients alfa[j] should be placed in locations val[1], ..., val[len]. The arrays ind and val are not changed on exit.</p>
1747  * <p>The parameter dir specifies direction in which the variable x changes on leaving the basis: +1 means that x goes to its lower bound, and -1 means that x goes to its upper bound.</p>
1748  * <p>The parameter eps is an absolute tolerance (small positive number) used by the routine to skip small alfa[j] of the row (*).</p>
1749  * <p>The routine determines which non-basic variable (among specified in ind[1], ..., ind[len]) should enter the basis in order to keep dual feasibility.</p>
1750  * <p>RETURNS</p>
1751  * <p>The routine glp_dual_rtest returns the index piv in the arrays ind and val corresponding to the pivot element chosen, 1 &lt;= piv &lt;= len. If the adjacent basic solution is dual unbounded and therefore the choice cannot be made, the routine returns zero.</p>
1752  * <p>COMMENTS</p>
1753  * <p>If the basic variable x is presented in the LP problem object, the row (*) can be computed with the routine glp_eval_tab_row; otherwise it can be computed with the routine glp_transform_row. </p>
1754  */
1755 public static int glp_dual_rtest(glp_prob P, int len, SWIGTYPE_p_int ind, SWIGTYPE_p_double val, int dir, double eps) {
1756     return GLPKJNI.glp_dual_rtest(glp_prob.getCPtr(P), P, len, SWIGTYPE_p_int.getCPtr(ind), SWIGTYPE_p_double.getCPtr(val), dir, eps);
1757   }
1758 
1759   
1760 /**
1761  * glp_analyze_bound - analyze active bound of non-basic variable .
1762  * <p>SYNOPSIS</p>
1763  * <p>void glp_analyze_bound(glp_prob *P, int k, double *limit1, int *var1, double *limit2, int *var2);</p>
1764  * <p>DESCRIPTION</p>
1765  * <p>The routine glp_analyze_bound analyzes the effect of varying the active bound of specified non-basic variable.</p>
1766  * <p>The non-basic variable is specified by the parameter k, where 1 &lt;= k &lt;= m means auxiliary variable of corresponding row while m+1 &lt;= k &lt;= m+n means structural variable (column).</p>
1767  * <p>Note that the current basic solution must be optimal, and the basis factorization must exist.</p>
1768  * <p>Results of the analysis have the following meaning.</p>
1769  * <p>value1 is the minimal value of the active bound, at which the basis still remains primal feasible and thus optimal. -DBL_MAX means that the active bound has no lower limit.</p>
1770  * <p>var1 is the ordinal number of an auxiliary (1 to m) or structural (m+1 to n) basic variable, which reaches its bound first and thereby limits further decreasing the active bound being analyzed. if value1 = -DBL_MAX, var1 is set to 0.</p>
1771  * <p>value2 is the maximal value of the active bound, at which the basis still remains primal feasible and thus optimal. +DBL_MAX means that the active bound has no upper limit.</p>
1772  * <p>var2 is the ordinal number of an auxiliary (1 to m) or structural (m+1 to n) basic variable, which reaches its bound first and thereby limits further increasing the active bound being analyzed. if value2 = +DBL_MAX, var2 is set to 0. </p>
1773  */
1774 public static void glp_analyze_bound(glp_prob P, int k, SWIGTYPE_p_double value1, SWIGTYPE_p_int var1, SWIGTYPE_p_double value2, SWIGTYPE_p_int var2) {
1775     GLPKJNI.glp_analyze_bound(glp_prob.getCPtr(P), P, k, SWIGTYPE_p_double.getCPtr(value1), SWIGTYPE_p_int.getCPtr(var1), SWIGTYPE_p_double.getCPtr(value2), SWIGTYPE_p_int.getCPtr(var2));
1776   }
1777 
1778   
1779 /**
1780  * glp_analyze_coef - analyze objective coefficient at basic variable .
1781  * <p>SYNOPSIS</p>
1782  * <p>void glp_analyze_coef(glp_prob *P, int k, double *coef1, int *var1, double *value1, double *coef2, int *var2, double *value2);</p>
1783  * <p>DESCRIPTION</p>
1784  * <p>The routine glp_analyze_coef analyzes the effect of varying the objective coefficient at specified basic variable.</p>
1785  * <p>The basic variable is specified by the parameter k, where 1 &lt;= k &lt;= m means auxiliary variable of corresponding row while m+1 &lt;= k &lt;= m+n means structural variable (column).</p>
1786  * <p>Note that the current basic solution must be optimal, and the basis factorization must exist.</p>
1787  * <p>Results of the analysis have the following meaning.</p>
1788  * <p>coef1 is the minimal value of the objective coefficient, at which the basis still remains dual feasible and thus optimal. -DBL_MAX means that the objective coefficient has no lower limit.</p>
1789  * <p>var1 is the ordinal number of an auxiliary (1 to m) or structural (m+1 to n) non-basic variable, whose reduced cost reaches its zero bound first and thereby limits further decreasing the objective coefficient being analyzed. If coef1 = -DBL_MAX, var1 is set to 0.</p>
1790  * <p>value1 is value of the basic variable being analyzed in an adjacent basis, which is defined as follows. Let the objective coefficient reaches its minimal value (coef1) and continues decreasing. Then the reduced cost of the limiting non-basic variable (var1) becomes dual infeasible and the current basis becomes non-optimal that forces the limiting non-basic variable to enter the basis replacing there some basic variable that leaves the basis to keep primal feasibility. Should note that on determining the adjacent basis current bounds of the basic variable being analyzed are ignored as if it were free (unbounded) variable, so it cannot leave the basis. It may happen that no dual feasible adjacent basis exists, in which case value1 is set to -DBL_MAX or +DBL_MAX.</p>
1791  * <p>coef2 is the maximal value of the objective coefficient, at which the basis still remains dual feasible and thus optimal. +DBL_MAX means that the objective coefficient has no upper limit.</p>
1792  * <p>var2 is the ordinal number of an auxiliary (1 to m) or structural (m+1 to n) non-basic variable, whose reduced cost reaches its zero bound first and thereby limits further increasing the objective coefficient being analyzed. If coef2 = +DBL_MAX, var2 is set to 0.</p>
1793  * <p>value2 is value of the basic variable being analyzed in an adjacent basis, which is defined exactly in the same way as value1 above with exception that now the objective coefficient is increasing. </p>
1794  */
1795 public static void glp_analyze_coef(glp_prob P, int k, SWIGTYPE_p_double coef1, SWIGTYPE_p_int var1, SWIGTYPE_p_double value1, SWIGTYPE_p_double coef2, SWIGTYPE_p_int var2, SWIGTYPE_p_double value2) {
1796     GLPKJNI.glp_analyze_coef(glp_prob.getCPtr(P), P, k, SWIGTYPE_p_double.getCPtr(coef1), SWIGTYPE_p_int.getCPtr(var1), SWIGTYPE_p_double.getCPtr(value1), SWIGTYPE_p_double.getCPtr(coef2), SWIGTYPE_p_int.getCPtr(var2), SWIGTYPE_p_double.getCPtr(value2));
1797   }
1798 
1799   public static SWIGTYPE_p_glp_prep glp_npp_alloc_wksp() {
1800     long cPtr = GLPKJNI.glp_npp_alloc_wksp();
1801     return (cPtr == 0) ? null : new SWIGTYPE_p_glp_prep(cPtr, false);
1802   }
1803 
1804   public static void glp_npp_load_prob(SWIGTYPE_p_glp_prep prep, glp_prob P, int sol, int names) {
1805     GLPKJNI.glp_npp_load_prob(SWIGTYPE_p_glp_prep.getCPtr(prep), glp_prob.getCPtr(P), P, sol, names);
1806   }
1807 
1808   public static int glp_npp_preprocess1(SWIGTYPE_p_glp_prep prep, int hard) {
1809     return GLPKJNI.glp_npp_preprocess1(SWIGTYPE_p_glp_prep.getCPtr(prep), hard);
1810   }
1811 
1812   public static void glp_npp_build_prob(SWIGTYPE_p_glp_prep prep, glp_prob Q) {
1813     GLPKJNI.glp_npp_build_prob(SWIGTYPE_p_glp_prep.getCPtr(prep), glp_prob.getCPtr(Q), Q);
1814   }
1815 
1816   public static void glp_npp_postprocess(SWIGTYPE_p_glp_prep prep, glp_prob Q) {
1817     GLPKJNI.glp_npp_postprocess(SWIGTYPE_p_glp_prep.getCPtr(prep), glp_prob.getCPtr(Q), Q);
1818   }
1819 
1820   public static void glp_npp_obtain_sol(SWIGTYPE_p_glp_prep prep, glp_prob P) {
1821     GLPKJNI.glp_npp_obtain_sol(SWIGTYPE_p_glp_prep.getCPtr(prep), glp_prob.getCPtr(P), P);
1822   }
1823 
1824   public static void glp_npp_free_wksp(SWIGTYPE_p_glp_prep prep) {
1825     GLPKJNI.glp_npp_free_wksp(SWIGTYPE_p_glp_prep.getCPtr(prep));
1826   }
1827 
1828   
1829 /**
1830  * glp_ios_reason - determine reason for calling the callback routine .
1831  * <p>SYNOPSIS</p>
1832  * <p>glp_ios_reason(glp_tree *tree);</p>
1833  * <p>RETURNS</p>
1834  * <p>The routine glp_ios_reason returns a code, which indicates why the user-defined callback routine is being called. </p>
1835  */
1836 public static int glp_ios_reason(glp_tree T) {
1837     return GLPKJNI.glp_ios_reason(glp_tree.getCPtr(T), T);
1838   }
1839 
1840   
1841 /**
1842  * glp_ios_get_prob - access the problem object .
1843  * <p>SYNOPSIS</p>
1844  * <p>glp_prob *glp_ios_get_prob(glp_tree *tree);</p>
1845  * <p>DESCRIPTION</p>
1846  * <p>The routine glp_ios_get_prob can be called from the user-defined callback routine to access the problem object, which is used by the MIP solver. It is the original problem object passed to the routine glp_intopt if the MIP presolver is not used; otherwise it is an internal problem object built by the presolver. If the current subproblem exists, LP segment of the problem object corresponds to its LP relaxation.</p>
1847  * <p>RETURNS</p>
1848  * <p>The routine glp_ios_get_prob returns a pointer to the problem object used by the MIP solver. </p>
1849  */
1850 public static glp_prob glp_ios_get_prob(glp_tree T) {
1851     long cPtr = GLPKJNI.glp_ios_get_prob(glp_tree.getCPtr(T), T);
1852     return (cPtr == 0) ? null : new glp_prob(cPtr, false);
1853   }
1854 
1855   
1856 /**
1857  * glp_ios_tree_size - determine size of the branch-and-bound tree .
1858  * <p>SYNOPSIS</p>
1859  * <p>void glp_ios_tree_size(glp_tree *tree, int *a_cnt, int *n_cnt, int *t_cnt);</p>
1860  * <p>DESCRIPTION</p>
1861  * <p>The routine glp_ios_tree_size stores the following three counts which characterize the current size of the branch-and-bound tree:</p>
1862  * <p>a_cnt is the current number of active nodes, i.e. the current size of the active list;</p>
1863  * <p>n_cnt is the current number of all (active and inactive) nodes;</p>
1864  * <p>t_cnt is the total number of nodes including those which have been already removed from the tree. This count is increased whenever a new node appears in the tree and never decreased.</p>
1865  * <p>If some of the parameters a_cnt, n_cnt, t_cnt is a null pointer, the corresponding count is not stored. </p>
1866  */
1867 public static void glp_ios_tree_size(glp_tree T, SWIGTYPE_p_int a_cnt, SWIGTYPE_p_int n_cnt, SWIGTYPE_p_int t_cnt) {
1868     GLPKJNI.glp_ios_tree_size(glp_tree.getCPtr(T), T, SWIGTYPE_p_int.getCPtr(a_cnt), SWIGTYPE_p_int.getCPtr(n_cnt), SWIGTYPE_p_int.getCPtr(t_cnt));
1869   }
1870 
1871   
1872 /**
1873  * glp_ios_curr_node - determine current active subproblem .
1874  * <p>SYNOPSIS</p>
1875  * <p>int glp_ios_curr_node(glp_tree *tree);</p>
1876  * <p>RETURNS</p>
1877  * <p>The routine glp_ios_curr_node returns the reference number of the current active subproblem. However, if the current subproblem does not exist, the routine returns zero. </p>
1878  */
1879 public static int glp_ios_curr_node(glp_tree T) {
1880     return GLPKJNI.glp_ios_curr_node(glp_tree.getCPtr(T), T);
1881   }
1882 
1883   
1884 /**
1885  * glp_ios_next_node - determine next active subproblem .
1886  * <p>SYNOPSIS</p>
1887  * <p>int glp_ios_next_node(glp_tree *tree, int p);</p>
1888  * <p>RETURNS</p>
1889  * <p>If the parameter p is zero, the routine glp_ios_next_node returns the reference number of the first active subproblem. However, if the tree is empty, zero is returned.</p>
1890  * <p>If the parameter p is not zero, it must specify the reference number of some active subproblem, in which case the routine returns the reference number of the next active subproblem. However, if there is no next active subproblem in the list, zero is returned.</p>
1891  * <p>All subproblems in the active list are ordered chronologically, i.e. subproblem A precedes subproblem B if A was created before B. </p>
1892  */
1893 public static int glp_ios_next_node(glp_tree T, int p) {
1894     return GLPKJNI.glp_ios_next_node(glp_tree.getCPtr(T), T, p);
1895   }
1896 
1897   
1898 /**
1899  * glp_ios_prev_node - determine previous active subproblem .
1900  * <p>SYNOPSIS</p>
1901  * <p>int glp_ios_prev_node(glp_tree *tree, int p);</p>
1902  * <p>RETURNS</p>
1903  * <p>If the parameter p is zero, the routine glp_ios_prev_node returns the reference number of the last active subproblem. However, if the tree is empty, zero is returned.</p>
1904  * <p>If the parameter p is not zero, it must specify the reference number of some active subproblem, in which case the routine returns the reference number of the previous active subproblem. However, if there is no previous active subproblem in the list, zero is returned.</p>
1905  * <p>All subproblems in the active list are ordered chronologically, i.e. subproblem A precedes subproblem B if A was created before B. </p>
1906  */
1907 public static int glp_ios_prev_node(glp_tree T, int p) {
1908     return GLPKJNI.glp_ios_prev_node(glp_tree.getCPtr(T), T, p);
1909   }
1910 
1911   
1912 /**
1913  * glp_ios_up_node - determine parent subproblem .
1914  * <p>SYNOPSIS</p>
1915  * <p>int glp_ios_up_node(glp_tree *tree, int p);</p>
1916  * <p>RETURNS</p>
1917  * <p>The parameter p must specify the reference number of some (active or inactive) subproblem, in which case the routine iet_get_up_node returns the reference number of its parent subproblem. However, if the specified subproblem is the root of the tree and, therefore, has no parent, the routine returns zero. </p>
1918  */
1919 public static int glp_ios_up_node(glp_tree T, int p) {
1920     return GLPKJNI.glp_ios_up_node(glp_tree.getCPtr(T), T, p);
1921   }
1922 
1923   
1924 /**
1925  * glp_ios_node_level - determine subproblem level .
1926  * <p>SYNOPSIS</p>
1927  * <p>int glp_ios_node_level(glp_tree *tree, int p);</p>
1928  * <p>RETURNS</p>
1929  * <p>The routine glp_ios_node_level returns the level of the subproblem, whose reference number is p, in the branch-and-bound tree. (The root subproblem has level 0, and the level of any other subproblem is the level of its parent plus one.) </p>
1930  */
1931 public static int glp_ios_node_level(glp_tree T, int p) {
1932     return GLPKJNI.glp_ios_node_level(glp_tree.getCPtr(T), T, p);
1933   }
1934 
1935   
1936 /**
1937  * glp_ios_node_bound - determine subproblem local bound .
1938  * <p>SYNOPSIS</p>
1939  * <p>double glp_ios_node_bound(glp_tree *tree, int p);</p>
1940  * <p>RETURNS</p>
1941  * <p>The routine glp_ios_node_bound returns the local bound for (active or inactive) subproblem, whose reference number is p.</p>
1942  * <p>COMMENTS</p>
1943  * <p>The local bound for subproblem p is an lower (minimization) or upper (maximization) bound for integer optimal solution to this subproblem (not to the original problem). This bound is local in the sense that only subproblems in the subtree rooted at node p cannot have better integer feasible solutions.</p>
1944  * <p>On creating a subproblem (due to the branching step) its local bound is inherited from its parent and then may get only stronger (never weaker). For the root subproblem its local bound is initially set to -DBL_MAX (minimization) or +DBL_MAX (maximization) and then improved as the root LP relaxation has been solved.</p>
1945  * <p>Note that the local bound is not necessarily the optimal objective value to corresponding LP relaxation; it may be stronger. </p>
1946  */
1947 public static double glp_ios_node_bound(glp_tree T, int p) {
1948     return GLPKJNI.glp_ios_node_bound(glp_tree.getCPtr(T), T, p);
1949   }
1950 
1951   
1952 /**
1953  * glp_ios_best_node - find active subproblem with best local bound .
1954  * <p>SYNOPSIS</p>
1955  * <p>int glp_ios_best_node(glp_tree *tree);</p>
1956  * <p>RETURNS</p>
1957  * <p>The routine glp_ios_best_node returns the reference number of the active subproblem, whose local bound is best (i.e. smallest in case of minimization or largest in case of maximization). However, if the tree is empty, the routine returns zero.</p>
1958  * <p>COMMENTS</p>
1959  * <p>The best local bound is an lower (minimization) or upper (maximization) bound for integer optimal solution to the original MIP problem. </p>
1960  */
1961 public static int glp_ios_best_node(glp_tree T) {
1962     return GLPKJNI.glp_ios_best_node(glp_tree.getCPtr(T), T);
1963   }
1964 
1965   
1966 /**
1967  * glp_ios_mip_gap - compute relative MIP gap .
1968  * <p>SYNOPSIS</p>
1969  * <p>double glp_ios_mip_gap(glp_tree *tree);</p>
1970  * <p>DESCRIPTION</p>
1971  * <p>The routine glp_ios_mip_gap computes the relative MIP gap with the following formula:</p>
1972  * <p>gap = |best_mip - best_bnd| / (|best_mip| + DBL_EPSILON),</p>
1973  * <p>where best_mip is the best integer feasible solution found so far, best_bnd is the best (global) bound. If no integer feasible solution has been found yet, gap is set to DBL_MAX.</p>
1974  * <p>RETURNS</p>
1975  * <p>The routine glp_ios_mip_gap returns the relative MIP gap. </p>
1976  */
1977 public static double glp_ios_mip_gap(glp_tree T) {
1978     return GLPKJNI.glp_ios_mip_gap(glp_tree.getCPtr(T), T);
1979   }
1980 
1981   
1982 /**
1983  * glp_ios_node_data - access subproblem application-specific data .
1984  * <p>SYNOPSIS</p>
1985  * <p>void *glp_ios_node_data(glp_tree *tree, int p);</p>
1986  * <p>DESCRIPTION</p>
1987  * <p>The routine glp_ios_node_data allows the application accessing a memory block allocated for the subproblem (which may be active or inactive), whose reference number is p.</p>
1988  * <p>The size of the block is defined by the control parameter cb_size passed to the routine glp_intopt. The block is initialized by binary zeros on creating corresponding subproblem, and its contents is kept until the subproblem will be removed from the tree.</p>
1989  * <p>The application may use these memory blocks to store specific data for each subproblem.</p>
1990  * <p>RETURNS</p>
1991  * <p>The routine glp_ios_node_data returns a pointer to the memory block for the specified subproblem. Note that if cb_size = 0, the routine returns a null pointer. </p>
1992  */
1993 public static SWIGTYPE_p_void glp_ios_node_data(glp_tree T, int p) {
1994     long cPtr = GLPKJNI.glp_ios_node_data(glp_tree.getCPtr(T), T, p);
1995     return (cPtr == 0) ? null : new SWIGTYPE_p_void(cPtr, false);
1996   }
1997 
1998   
1999 /**
2000  * glp_ios_row_attr - retrieve additional row attributes .
2001  * <p>SYNOPSIS</p>
2002  * <p>void glp_ios_row_attr(glp_tree *tree, int i, glp_attr *attr);</p>
2003  * <p>DESCRIPTION</p>
2004  * <p>The routine glp_ios_row_attr retrieves additional attributes of row i and stores them in the structure glp_attr. </p>
2005  */
2006 public static void glp_ios_row_attr(glp_tree T, int i, glp_attr attr) {
2007     GLPKJNI.glp_ios_row_attr(glp_tree.getCPtr(T), T, i, glp_attr.getCPtr(attr), attr);
2008   }
2009 
2010   
2011 /**
2012  */
2013 public static int glp_ios_pool_size(glp_tree T) {
2014     return GLPKJNI.glp_ios_pool_size(glp_tree.getCPtr(T), T);
2015   }
2016 
2017   
2018 /**
2019  */
2020 public static int glp_ios_add_row(glp_tree T, String name, int klass, int flags, int len, SWIGTYPE_p_int ind, SWIGTYPE_p_double val, int type, double rhs) {
2021     return GLPKJNI.glp_ios_add_row(glp_tree.getCPtr(T), T, name, klass, flags, len, SWIGTYPE_p_int.getCPtr(ind), SWIGTYPE_p_double.getCPtr(val), type, rhs);
2022   }
2023 
2024   
2025 /**
2026  */
2027 public static void glp_ios_del_row(glp_tree T, int i) {
2028     GLPKJNI.glp_ios_del_row(glp_tree.getCPtr(T), T, i);
2029   }
2030 
2031   
2032 /**
2033  */
2034 public static void glp_ios_clear_pool(glp_tree T) {
2035     GLPKJNI.glp_ios_clear_pool(glp_tree.getCPtr(T), T);
2036   }
2037 
2038   
2039 /**
2040  * glp_ios_can_branch - check if can branch upon specified variable .
2041  * <p>SYNOPSIS</p>
2042  * <p>int glp_ios_can_branch(glp_tree *tree, int j);</p>
2043  * <p>RETURNS</p>
2044  * <p>If j-th variable (column) can be used to branch upon, the routine glp_ios_can_branch returns non-zero, otherwise zero. </p>
2045  */
2046 public static int glp_ios_can_branch(glp_tree T, int j) {
2047     return GLPKJNI.glp_ios_can_branch(glp_tree.getCPtr(T), T, j);
2048   }
2049 
2050   
2051 /**
2052  * glp_ios_branch_upon - choose variable to branch upon .
2053  * <p>SYNOPSIS</p>
2054  * <p>void glp_ios_branch_upon(glp_tree *tree, int j, int sel);</p>
2055  * <p>DESCRIPTION</p>
2056  * <p>The routine glp_ios_branch_upon can be called from the user-defined callback routine in response to the reason GLP_IBRANCH to choose a branching variable, whose ordinal number is j. Should note that only variables, for which the routine glp_ios_can_branch returns non-zero, can be used to branch upon.</p>
2057  * <p>The parameter sel is a flag that indicates which branch (subproblem) should be selected next to continue the search:</p>
2058  * <p>GLP_DN_BRNCH - select down-branch; GLP_UP_BRNCH - select up-branch; GLP_NO_BRNCH - use general selection technique. </p>
2059  */
2060 public static void glp_ios_branch_upon(glp_tree T, int j, int sel) {
2061     GLPKJNI.glp_ios_branch_upon(glp_tree.getCPtr(T), T, j, sel);
2062   }
2063 
2064   
2065 /**
2066  * glp_ios_select_node - select subproblem to continue the search .
2067  * <p>SYNOPSIS</p>
2068  * <p>void glp_ios_select_node(glp_tree *tree, int p);</p>
2069  * <p>DESCRIPTION</p>
2070  * <p>The routine glp_ios_select_node can be called from the user-defined callback routine in response to the reason GLP_ISELECT to select an active subproblem, whose reference number is p. The search will be continued from the subproblem selected. </p>
2071  */
2072 public static void glp_ios_select_node(glp_tree T, int p) {
2073     GLPKJNI.glp_ios_select_node(glp_tree.getCPtr(T), T, p);
2074   }
2075 
2076   
2077 /**
2078  * glp_ios_heur_sol - provide solution found by heuristic .
2079  * <p>SYNOPSIS</p>
2080  * <p>int glp_ios_heur_sol(glp_tree *tree, const double x[]);</p>
2081  * <p>DESCRIPTION</p>
2082  * <p>The routine glp_ios_heur_sol can be called from the user-defined callback routine in response to the reason GLP_IHEUR to provide an integer feasible solution found by a primal heuristic.</p>
2083  * <p>Primal values of all variables (columns) found by the heuristic should be placed in locations x[1], ..., x[n], where n is the number of columns in the original problem object. Note that the routine glp_ios_heur_sol does not check primal feasibility of the solution provided.</p>
2084  * <p>Using the solution passed in the array x the routine computes value of the objective function. If the objective value is better than the best known integer feasible solution, the routine computes values of auxiliary variables (rows) and stores all solution components in the problem object.</p>
2085  * <p>RETURNS</p>
2086  * <p>If the provided solution is accepted, the routine glp_ios_heur_sol returns zero. Otherwise, if the provided solution is rejected, the routine returns non-zero. </p>
2087  */
2088 public static int glp_ios_heur_sol(glp_tree T, SWIGTYPE_p_double x) {
2089     return GLPKJNI.glp_ios_heur_sol(glp_tree.getCPtr(T), T, SWIGTYPE_p_double.getCPtr(x));
2090   }
2091 
2092   
2093 /**
2094  * glp_ios_terminate - terminate the solution process. .
2095  * <p>SYNOPSIS</p>
2096  * <p>void glp_ios_terminate(glp_tree *tree);</p>
2097  * <p>DESCRIPTION</p>
2098  * <p>The routine glp_ios_terminate sets a flag indicating that the MIP solver should prematurely terminate the search. </p>
2099  */
2100 public static void glp_ios_terminate(glp_tree T) {
2101     GLPKJNI.glp_ios_terminate(glp_tree.getCPtr(T), T);
2102   }
2103 
2104   
2105 /**
2106  * glp_init_mpscp - initialize MPS format control parameters .
2107  * <p>SYNOPSIS</p>
2108  * <p>void glp_init_mpscp(glp_mpscp *parm);</p>
2109  * <p>DESCRIPTION</p>
2110  * <p>The routine glp_init_mpscp initializes control parameters, which are used by the MPS input/output routines glp_read_mps and glp_write_mps, with default values.</p>
2111  * <p>Default values of the control parameters are stored in the glp_mpscp structure, which the parameter parm points to. </p>
2112  */
2113 public static void glp_init_mpscp(glp_mpscp parm) {
2114     GLPKJNI.glp_init_mpscp(glp_mpscp.getCPtr(parm), parm);
2115   }
2116 
2117   
2118 /**
2119  */
2120 public static int glp_read_mps(glp_prob P, int fmt, glp_mpscp parm, String fname) {
2121     return GLPKJNI.glp_read_mps(glp_prob.getCPtr(P), P, fmt, glp_mpscp.getCPtr(parm), parm, fname);
2122   }
2123 
2124   
2125 /**
2126  */
2127 public static int glp_write_mps(glp_prob P, int fmt, glp_mpscp parm, String fname) {
2128     return GLPKJNI.glp_write_mps(glp_prob.getCPtr(P), P, fmt, glp_mpscp.getCPtr(parm), parm, fname);
2129   }
2130 
2131   
2132 /**
2133  * glp_init_cpxcp - initialize CPLEX LP format control parameters .
2134  * <p>SYNOPSIS</p>
2135  * <p>void glp_init_cpxcp(glp_cpxcp *parm):</p>
2136  * <p>The routine glp_init_cpxcp initializes control parameters used by the CPLEX LP input/output routines glp_read_lp and glp_write_lp with default values.</p>
2137  * <p>Default values of the control parameters are stored in the glp_cpxcp structure, which the parameter parm points to. </p>
2138  */
2139 public static void glp_init_cpxcp(glp_cpxcp parm) {
2140     GLPKJNI.glp_init_cpxcp(glp_cpxcp.getCPtr(parm), parm);
2141   }
2142 
2143   
2144 /**
2145  */
2146 public static int glp_read_lp(glp_prob P, glp_cpxcp parm, String fname) {
2147     return GLPKJNI.glp_read_lp(glp_prob.getCPtr(P), P, glp_cpxcp.getCPtr(parm), parm, fname);
2148   }
2149 
2150   
2151 /**
2152  */
2153 public static int glp_write_lp(glp_prob P, glp_cpxcp parm, String fname) {
2154     return GLPKJNI.glp_write_lp(glp_prob.getCPtr(P), P, glp_cpxcp.getCPtr(parm), parm, fname);
2155   }
2156 
2157   
2158 /**
2159  * glp_read_prob - read problem data in GLPK format .
2160  * <p>SYNOPSIS</p>
2161  * <p>int glp_read_prob(glp_prob *P, int flags, const char *fname);</p>
2162  * <p>The routine glp_read_prob reads problem data in GLPK LP/MIP format from a text file.</p>
2163  * <p>RETURNS</p>
2164  * <p>If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero. </p>
2165  */
2166 public static int glp_read_prob(glp_prob P, int flags, String fname) {
2167     return GLPKJNI.glp_read_prob(glp_prob.getCPtr(P), P, flags, fname);
2168   }
2169 
2170   
2171 /**
2172  * glp_write_prob - write problem data in GLPK format .
2173  * <p>SYNOPSIS</p>
2174  * <p>int glp_write_prob(glp_prob *P, int flags, const char *fname);</p>
2175  * <p>The routine glp_write_prob writes problem data in GLPK LP/MIP format to a text file.</p>
2176  * <p>RETURNS</p>
2177  * <p>If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero. </p>
2178  */
2179 public static int glp_write_prob(glp_prob P, int flags, String fname) {
2180     return GLPKJNI.glp_write_prob(glp_prob.getCPtr(P), P, flags, fname);
2181   }
2182 
2183   
2184 /**
2185  */
2186 public static glp_tran glp_mpl_alloc_wksp() {
2187     long cPtr = GLPKJNI.glp_mpl_alloc_wksp();
2188     return (cPtr == 0) ? null : new glp_tran(cPtr, false);
2189   }
2190 
2191   public static void glp_mpl_init_rand(glp_tran tran, int seed) {
2192     GLPKJNI.glp_mpl_init_rand(glp_tran.getCPtr(tran), tran, seed);
2193   }
2194 
2195   
2196 /**
2197  */
2198 public static int glp_mpl_read_model(glp_tran tran, String fname, int skip) {
2199     return GLPKJNI.glp_mpl_read_model(glp_tran.getCPtr(tran), tran, fname, skip);
2200   }
2201 
2202   
2203 /**
2204  */
2205 public static int glp_mpl_read_data(glp_tran tran, String fname) {
2206     return GLPKJNI.glp_mpl_read_data(glp_tran.getCPtr(tran), tran, fname);
2207   }
2208 
2209   
2210 /**
2211  */
2212 public static int glp_mpl_generate(glp_tran tran, String fname) {
2213     return GLPKJNI.glp_mpl_generate(glp_tran.getCPtr(tran), tran, fname);
2214   }
2215 
2216   
2217 /**
2218  */
2219 public static void glp_mpl_build_prob(glp_tran tran, glp_prob prob) {
2220     GLPKJNI.glp_mpl_build_prob(glp_tran.getCPtr(tran), tran, glp_prob.getCPtr(prob), prob);
2221   }
2222 
2223   
2224 /**
2225  */
2226 public static int glp_mpl_postsolve(glp_tran tran, glp_prob prob, int sol) {
2227     return GLPKJNI.glp_mpl_postsolve(glp_tran.getCPtr(tran), tran, glp_prob.getCPtr(prob), prob, sol);
2228   }
2229 
2230   
2231 /**
2232  */
2233 public static void glp_mpl_free_wksp(glp_tran tran) {
2234     GLPKJNI.glp_mpl_free_wksp(glp_tran.getCPtr(tran), tran);
2235   }
2236 
2237   
2238 /**
2239  */
2240 public static int glp_read_cnfsat(glp_prob P, String fname) {
2241     return GLPKJNI.glp_read_cnfsat(glp_prob.getCPtr(P), P, fname);
2242   }
2243 
2244   
2245 /**
2246  */
2247 public static int glp_check_cnfsat(glp_prob P) {
2248     return GLPKJNI.glp_check_cnfsat(glp_prob.getCPtr(P), P);
2249   }
2250 
2251   
2252 /**
2253  */
2254 public static int glp_write_cnfsat(glp_prob P, String fname) {
2255     return GLPKJNI.glp_write_cnfsat(glp_prob.getCPtr(P), P, fname);
2256   }
2257 
2258   
2259 /**
2260  */
2261 public static int glp_minisat1(glp_prob P) {
2262     return GLPKJNI.glp_minisat1(glp_prob.getCPtr(P), P);
2263   }
2264 
2265   
2266 /**
2267  */
2268 public static int glp_intfeas1(glp_prob P, int use_bound, int obj_bound) {
2269     return GLPKJNI.glp_intfeas1(glp_prob.getCPtr(P), P, use_bound, obj_bound);
2270   }
2271 
2272   
2273 /**
2274  * glp_init_env - initialize GLPK environment .
2275  * <p>SYNOPSIS</p>
2276  * <p>int glp_init_env(void);</p>
2277  * <p>DESCRIPTION</p>
2278  * <p>The routine glp_init_env initializes the GLPK environment. Normally the application program does not need to call this routine, because it is called automatically on the first call to any API routine.</p>
2279  * <p>RETURNS</p>
2280  * <p>The routine glp_init_env returns one of the following codes:</p>
2281  * <p>0 - initialization successful; 1 - environment has been already initialized; 2 - initialization failed (insufficient memory); 3 - initialization failed (unsupported programming model). </p>
2282  */
2283 public static int glp_init_env() {
2284     return GLPKJNI.glp_init_env();
2285   }
2286 
2287   
2288 /**
2289  * glp_version - determine library version .
2290  * <p>SYNOPSIS</p>
2291  * <p>const char *glp_version(void);</p>
2292  * <p>RETURNS</p>
2293  * <p>The routine glp_version returns a pointer to a null-terminated character string, which specifies the version of the GLPK library in the form "X.Y", where X is the major version number, and Y is the minor version number, for example, "4.16". </p>
2294  */
2295 public static String glp_version() {
2296     return GLPKJNI.glp_version();
2297   }
2298 
2299   public static String glp_config(String option) {
2300     return GLPKJNI.glp_config(option);
2301   }
2302 
2303   
2304 /**
2305  * glp_free_env - free GLPK environment .
2306  * <p>SYNOPSIS</p>
2307  * <p>int glp_free_env(void);</p>
2308  * <p>DESCRIPTION</p>
2309  * <p>The routine glp_free_env frees all resources used by GLPK routines (memory blocks, etc.) which are currently still in use.</p>
2310  * <p>Normally the application program does not need to call this routine, because GLPK routines always free all unused resources. However, if the application program even has deleted all problem objects, there will be several memory blocks still allocated for the library needs. For some reasons the application program may want GLPK to free this memory, in which case it should call glp_free_env.</p>
2311  * <p>Note that a call to glp_free_env invalidates all problem objects as if no GLPK routine were called.</p>
2312  * <p>RETURNS</p>
2313  * <p>0 - termination successful; 1 - environment is inactive (was not initialized). </p>
2314  */
2315 public static int glp_free_env() {
2316     return GLPKJNI.glp_free_env();
2317   }
2318 
2319   
2320 /**
2321  * glp_puts - write string on terminal .
2322  * <p>SYNOPSIS</p>
2323  * <p>void glp_puts(const char *s);</p>
2324  * <p>The routine glp_puts writes the string s on the terminal. </p>
2325  */
2326 public static void glp_puts(String s) {
2327     GLPKJNI.glp_puts(s);
2328   }
2329 
2330   
2331 /**
2332  * glp_printf - write formatted output on terminal .
2333  * <p>SYNOPSIS</p>
2334  * <p>void glp_printf(const char *fmt, ...);</p>
2335  * <p>DESCRIPTION</p>
2336  * <p>The routine glp_printf uses the format control string fmt to format its parameters and writes the formatted output on the terminal. </p>
2337  */
2338 public static void glp_printf(String fmt) {
2339     GLPKJNI.glp_printf(fmt);
2340   }
2341 
2342   
2343 /**
2344  * glp_vprintf - write formatted output on terminal .
2345  * <p>SYNOPSIS</p>
2346  * <p>void glp_vprintf(const char *fmt, va_list arg);</p>
2347  * <p>DESCRIPTION</p>
2348  * <p>The routine glp_vprintf uses the format control string fmt to format its parameters specified by the list arg and writes the formatted output on the terminal. </p>
2349  */
2350 public static void glp_vprintf(String fmt, SWIGTYPE_p_va_list arg) {
2351     GLPKJNI.glp_vprintf(fmt, SWIGTYPE_p_va_list.getCPtr(arg));
2352   }
2353 
2354   
2355 /**
2356  * glp_term_out - enable/disable terminal output .
2357  * <p>SYNOPSIS</p>
2358  * <p>int glp_term_out(int flag);</p>
2359  * <p>DESCRIPTION</p>
2360  * <p>Depending on the parameter flag the routine glp_term_out enables or disables terminal output performed by glpk routines:</p>
2361  * <p>GLP_ON - enable terminal output; GLP_OFF - disable terminal output.</p>
2362  * <p>RETURNS</p>
2363  * <p>The routine glp_term_out returns the previous value of the terminal output flag. </p>
2364  */
2365 public static int glp_term_out(int flag) {
2366     return GLPKJNI.glp_term_out(flag);
2367   }
2368 
2369   
2370 /**
2371  * glp_term_hook - install hook to intercept terminal output .
2372  * <p>SYNOPSIS</p>
2373  * <p>void glp_term_hook(int (*func)(void *info, const char *s), void *info);</p>
2374  * <p>DESCRIPTION</p>
2375  * <p>The routine glp_term_hook installs a user-defined hook routine to intercept all terminal output performed by glpk routines.</p>
2376  * <p>This feature can be used to redirect the terminal output to other destination, for example to a file or a text window.</p>
2377  * <p>The parameter func specifies the user-defined hook routine. It is called from an internal printing routine, which passes to it two parameters: info and s. The parameter info is a transit pointer, specified in the corresponding call to the routine glp_term_hook; it may be used to pass some information to the hook routine. The parameter s is a pointer to the null terminated character string, which is intended to be written to the terminal. If the hook routine returns zero, the printing routine writes the string s to the terminal in a usual way; otherwise, if the hook routine returns non-zero, no terminal output is performed.</p>
2378  * <p>To uninstall the hook routine the parameters func and info should be specified as NULL. </p>
2379  */
2380 public static void glp_term_hook(SWIGTYPE_p_f_p_void_p_q_const__char__int func, SWIGTYPE_p_void info) {
2381     GLPKJNI.glp_term_hook(SWIGTYPE_p_f_p_void_p_q_const__char__int.getCPtr(func), SWIGTYPE_p_void.getCPtr(info));
2382   }
2383 
2384   
2385 /**
2386  * glp_open_tee - start copying terminal output to text file .
2387  * <p>SYNOPSIS</p>
2388  * <p>int glp_open_tee(const char *name);</p>
2389  * <p>DESCRIPTION</p>
2390  * <p>The routine glp_open_tee starts copying all the terminal output to an output text file, whose name is specified by the character string name.</p>
2391  * <p>RETURNS</p>
2392  * <p>0 - operation successful 1 - copying terminal output is already active 2 - unable to create output file </p>
2393  */
2394 public static int glp_open_tee(String name) {
2395     return GLPKJNI.glp_open_tee(name);
2396   }
2397 
2398   
2399 /**
2400  * glp_close_tee - stop copying terminal output to text file .
2401  * <p>SYNOPSIS</p>
2402  * <p>int glp_close_tee(void);</p>
2403  * <p>DESCRIPTION</p>
2404  * <p>The routine glp_close_tee stops copying the terminal output to the output text file previously open by the routine glp_open_tee closing that file.</p>
2405  * <p>RETURNS</p>
2406  * <p>0 - operation successful 1 - copying terminal output was not started </p>
2407  */
2408 public static int glp_close_tee() {
2409     return GLPKJNI.glp_close_tee();
2410   }
2411 
2412   
2413 /**
2414  */
2415 public static SWIGTYPE_p_f_p_q_const__char_v_______void glp_error_(String file, int line) {
2416     long cPtr = GLPKJNI.glp_error_(file, line);
2417     return (cPtr == 0) ? null : new SWIGTYPE_p_f_p_q_const__char_v_______void(cPtr, false);
2418   }
2419 
2420   
2421 /**
2422  * glp_at_error - check for error state .
2423  * <p>SYNOPSIS</p>
2424  * <p>int glp_at_error(void);</p>
2425  * <p>DESCRIPTION</p>
2426  * <p>The routine glp_at_error checks if the GLPK environment is at error state, i.e. if the call to the routine is (indirectly) made from the glp_error routine via an user-defined hook routine.</p>
2427  * <p>RETURNS</p>
2428  * <p>If the GLPK environment is at error state, the routine glp_at_error returns non-zero, otherwise zero. </p>
2429  */
2430 public static int glp_at_error() {
2431     return GLPKJNI.glp_at_error();
2432   }
2433 
2434   
2435 /**
2436  * glp_assert - check for logical condition .
2437  * <p>SYNOPSIS</p>
2438  * <p>void glp_assert(int expr);</p>
2439  * <p>DESCRIPTION</p>
2440  * <p>The routine glp_assert (implemented as a macro) checks for a logical condition specified by the parameter expr. If the condition is false (i.e. the value of expr is zero), the routine writes a message on the terminal and abnormally terminates the program. </p>
2441  */
2442 public static void glp_assert_(String expr, String file, int line) {
2443     GLPKJNI.glp_assert_(expr, file, line);
2444   }
2445 
2446   
2447 /**
2448  * glp_error_hook - install hook to intercept abnormal termination .
2449  * <p>SYNOPSIS</p>
2450  * <p>void glp_error_hook(void (*func)(void *info), void *info);</p>
2451  * <p>DESCRIPTION</p>
2452  * <p>The routine glp_error_hook installs a user-defined hook routine to intercept abnormal termination.</p>
2453  * <p>The parameter func specifies the user-defined hook routine. It is called from the routine glp_error before the latter calls the abort function to abnormally terminate the application program because of fatal error. The parameter info is a transit pointer, specified in the corresponding call to the routine glp_error_hook; it may be used to pass some information to the hook routine.</p>
2454  * <p>To uninstall the hook routine the parameters func and info should be both specified as NULL. </p>
2455  */
2456 public static void glp_error_hook(SWIGTYPE_p_f_p_void__void func, SWIGTYPE_p_void info) {
2457     GLPKJNI.glp_error_hook(SWIGTYPE_p_f_p_void__void.getCPtr(func), SWIGTYPE_p_void.getCPtr(info));
2458   }
2459 
2460   
2461 /**
2462  * glp_alloc - allocate memory block .
2463  * <p>SYNOPSIS</p>
2464  * <p>void *glp_alloc(int n, int size);</p>
2465  * <p>DESCRIPTION</p>
2466  * <p>The routine glp_alloc allocates a memory block of n * size bytes long.</p>
2467  * <p>Note that being allocated the memory block contains arbitrary data (not binary zeros!).</p>
2468  * <p>RETURNS</p>
2469  * <p>The routine glp_alloc returns a pointer to the block allocated. To free this block the routine glp_free (not free!) must be used. </p>
2470  */
2471 public static SWIGTYPE_p_void glp_alloc(int n, int size) {
2472     long cPtr = GLPKJNI.glp_alloc(n, size);
2473     return (cPtr == 0) ? null : new SWIGTYPE_p_void(cPtr, false);
2474   }
2475 
2476   
2477 /**
2478  */
2479 public static SWIGTYPE_p_void glp_realloc(SWIGTYPE_p_void ptr, int n, int size) {
2480     long cPtr = GLPKJNI.glp_realloc(SWIGTYPE_p_void.getCPtr(ptr), n, size);
2481     return (cPtr == 0) ? null : new SWIGTYPE_p_void(cPtr, false);
2482   }
2483 
2484   
2485 /**
2486  * glp_free - free (deallocate) memory block .
2487  * <p>SYNOPSIS</p>
2488  * <p>void glp_free(void *ptr);</p>
2489  * <p>DESCRIPTION</p>
2490  * <p>The routine glp_free frees (deallocates) a memory block pointed to by ptr, which was previuosly allocated by the routine glp_alloc or reallocated by the routine glp_realloc. </p>
2491  */
2492 public static void glp_free(SWIGTYPE_p_void ptr) {
2493     GLPKJNI.glp_free(SWIGTYPE_p_void.getCPtr(ptr));
2494   }
2495 
2496   
2497 /**
2498  * glp_mem_limit - set memory usage limit .
2499  * <p>SYNOPSIS</p>
2500  * <p>void glp_mem_limit(int limit);</p>
2501  * <p>DESCRIPTION</p>
2502  * <p>The routine glp_mem_limit limits the amount of memory available for dynamic allocation (in GLPK routines) to limit megabytes. </p>
2503  */
2504 public static void glp_mem_limit(int limit) {
2505     GLPKJNI.glp_mem_limit(limit);
2506   }
2507 
2508   
2509 /**
2510  * glp_mem_usage - get memory usage information .
2511  * <p>SYNOPSIS</p>
2512  * <p>void glp_mem_usage(int *count, int *cpeak, size_t *total, size_t *tpeak);</p>
2513  * <p>DESCRIPTION</p>
2514  * <p>The routine glp_mem_usage reports some information about utilization of the memory by GLPK routines. Information is stored to locations specified by corresponding parameters (see below). Any parameter can be specified as NULL, in which case its value is not stored.</p>
2515  * <p>*count is the number of the memory blocks currently allocated by the routines glp_malloc and glp_calloc (one call to glp_malloc or glp_calloc results in allocating one memory block).</p>
2516  * <p>*cpeak is the peak value of *count reached since the initialization of the GLPK library environment.</p>
2517  * <p>*total is the total amount, in bytes, of the memory blocks currently allocated by the routines glp_malloc and glp_calloc.</p>
2518  * <p>*tpeak is the peak value of *total reached since the initialization of the GLPK library envirionment. </p>
2519  */
2520 public static void glp_mem_usage(SWIGTYPE_p_int count, SWIGTYPE_p_int cpeak, SWIGTYPE_p_size_t total, SWIGTYPE_p_size_t tpeak) {
2521     GLPKJNI.glp_mem_usage(SWIGTYPE_p_int.getCPtr(count), SWIGTYPE_p_int.getCPtr(cpeak), SWIGTYPE_p_size_t.getCPtr(total), SWIGTYPE_p_size_t.getCPtr(tpeak));
2522   }
2523 
2524   
2525 /**
2526  */
2527 public static double glp_time() {
2528     return GLPKJNI.glp_time();
2529   }
2530 
2531   
2532 /**
2533  * glp_difftime - compute difference between two time values .
2534  * <p>SYNOPSIS</p>
2535  * <p>double glp_difftime(double t1, double t0);</p>
2536  * <p>RETURNS</p>
2537  * <p>The routine glp_difftime returns the difference between two time values t1 and t0, expressed in seconds. </p>
2538  */
2539 public static double glp_difftime(double t1, double t0) {
2540     return GLPKJNI.glp_difftime(t1, t0);
2541   }
2542 
2543   
2544 /**
2545  */
2546 public static glp_graph glp_create_graph(int v_size, int a_size) {
2547     long cPtr = GLPKJNI.glp_create_graph(v_size, a_size);
2548     return (cPtr == 0) ? null : new glp_graph(cPtr, false);
2549   }
2550 
2551   
2552 /**
2553  * glp_set_graph_name - assign (change) graph name .
2554  * <p>SYNOPSIS</p>
2555  * <p>void glp_set_graph_name(glp_graph *G, const char *name);</p>
2556  * <p>DESCRIPTION</p>
2557  * <p>The routine glp_set_graph_name assigns a symbolic name specified by the character string name (1 to 255 chars) to the graph.</p>
2558  * <p>If the parameter name is NULL or an empty string, the routine erases the existing symbolic name of the graph. </p>
2559  */
2560 public static void glp_set_graph_name(glp_graph G, String name) {
2561     GLPKJNI.glp_set_graph_name(glp_graph.getCPtr(G), G, name);
2562   }
2563 
2564   
2565 /**
2566  * glp_add_vertices - add new vertices to graph .
2567  * <p>SYNOPSIS</p>
2568  * <p>int glp_add_vertices(glp_graph *G, int nadd);</p>
2569  * <p>DESCRIPTION</p>
2570  * <p>The routine glp_add_vertices adds nadd vertices to the specified graph. New vertices are always added to the end of the vertex list, so ordinal numbers of existing vertices remain unchanged.</p>
2571  * <p>Being added each new vertex is isolated (has no incident arcs).</p>
2572  * <p>RETURNS</p>
2573  * <p>The routine glp_add_vertices returns an ordinal number of the first new vertex added to the graph. </p>
2574  */
2575 public static int glp_add_vertices(glp_graph G, int nadd) {
2576     return GLPKJNI.glp_add_vertices(glp_graph.getCPtr(G), G, nadd);
2577   }
2578 
2579   
2580 /**
2581  */
2582 public static void glp_set_vertex_name(glp_graph G, int i, String name) {
2583     GLPKJNI.glp_set_vertex_name(glp_graph.getCPtr(G), G, i, name);
2584   }
2585 
2586   
2587 /**
2588  * glp_add_arc - add new arc to graph .
2589  * <p>SYNOPSIS</p>
2590  * <p>glp_arc *glp_add_arc(glp_graph *G, int i, int j);</p>
2591  * <p>DESCRIPTION</p>
2592  * <p>The routine glp_add_arc adds a new arc to the specified graph.</p>
2593  * <p>The parameters i and j specify the ordinal numbers of, resp., tail and head vertices of the arc. Note that self-loops and multiple arcs are allowed.</p>
2594  * <p>RETURNS</p>
2595  * <p>The routine glp_add_arc returns a pointer to the arc added. </p>
2596  */
2597 public static glp_arc glp_add_arc(glp_graph G, int i, int j) {
2598     long cPtr = GLPKJNI.glp_add_arc(glp_graph.getCPtr(G), G, i, j);
2599     return (cPtr == 0) ? null : new glp_arc(cPtr, false);
2600   }
2601 
2602   
2603 /**
2604  * glp_del_vertices - delete vertices from graph .
2605  * <p>SYNOPSIS</p>
2606  * <p>void glp_del_vertices(glp_graph *G, int ndel, const int num[]);</p>
2607  * <p>DESCRIPTION</p>
2608  * <p>The routine glp_del_vertices deletes vertices along with all incident arcs from the specified graph. Ordinal numbers of vertices to be deleted should be placed in locations num[1], ..., num[ndel], ndel &gt; 0.</p>
2609  * <p>Note that deleting vertices involves changing ordinal numbers of other vertices remaining in the graph. New ordinal numbers of the remaining vertices are assigned under the assumption that the original order of vertices is not changed. </p>
2610  */
2611 public static void glp_del_vertices(glp_graph G, int ndel, SWIGTYPE_p_int num) {
2612     GLPKJNI.glp_del_vertices(glp_graph.getCPtr(G), G, ndel, SWIGTYPE_p_int.getCPtr(num));
2613   }
2614 
2615   
2616 /**
2617  * glp_del_arc - delete arc from graph .
2618  * <p>SYNOPSIS</p>
2619  * <p>void glp_del_arc(glp_graph *G, glp_arc *a);</p>
2620  * <p>DESCRIPTION</p>
2621  * <p>The routine glp_del_arc deletes an arc from the specified graph. The arc to be deleted must exist. </p>
2622  */
2623 public static void glp_del_arc(glp_graph G, glp_arc a) {
2624     GLPKJNI.glp_del_arc(glp_graph.getCPtr(G), G, glp_arc.getCPtr(a), a);
2625   }
2626 
2627   
2628 /**
2629  */
2630 public static void glp_erase_graph(glp_graph G, int v_size, int a_size) {
2631     GLPKJNI.glp_erase_graph(glp_graph.getCPtr(G), G, v_size, a_size);
2632   }
2633 
2634   
2635 /**
2636  * glp_delete_graph - delete graph .
2637  * <p>SYNOPSIS</p>
2638  * <p>void glp_delete_graph(glp_graph *G);</p>
2639  * <p>DESCRIPTION</p>
2640  * <p>The routine glp_delete_graph deletes the specified graph and frees all the memory allocated to this program object. </p>
2641  */
2642 public static void glp_delete_graph(glp_graph G) {
2643     GLPKJNI.glp_delete_graph(glp_graph.getCPtr(G), G);
2644   }
2645 
2646   
2647 /**
2648  */
2649 public static void glp_create_v_index(glp_graph G) {
2650     GLPKJNI.glp_create_v_index(glp_graph.getCPtr(G), G);
2651   }
2652 
2653   
2654 /**
2655  */
2656 public static int glp_find_vertex(glp_graph G, String name) {
2657     return GLPKJNI.glp_find_vertex(glp_graph.getCPtr(G), G, name);
2658   }
2659 
2660   
2661 /**
2662  */
2663 public static void glp_delete_v_index(glp_graph G) {
2664     GLPKJNI.glp_delete_v_index(glp_graph.getCPtr(G), G);
2665   }
2666 
2667   
2668 /**
2669  * glp_read_graph - read graph from plain text file .
2670  * <p>SYNOPSIS</p>
2671  * <p>int glp_read_graph(glp_graph *G, const char *fname);</p>
2672  * <p>DESCRIPTION</p>
2673  * <p>The routine glp_read_graph reads a graph from a plain text file.</p>
2674  * <p>RETURNS</p>
2675  * <p>If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero. </p>
2676  */
2677 public static int glp_read_graph(glp_graph G, String fname) {
2678     return GLPKJNI.glp_read_graph(glp_graph.getCPtr(G), G, fname);
2679   }
2680 
2681   
2682 /**
2683  * glp_write_graph - write graph to plain text file .
2684  * <p>SYNOPSIS</p>
2685  * <p>int glp_write_graph(glp_graph *G, const char *fname).</p>
2686  * <p>DESCRIPTION</p>
2687  * <p>The routine glp_write_graph writes the specified graph to a plain text file.</p>
2688  * <p>RETURNS</p>
2689  * <p>If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero. </p>
2690  */
2691 public static int glp_write_graph(glp_graph G, String fname) {
2692     return GLPKJNI.glp_write_graph(glp_graph.getCPtr(G), G, fname);
2693   }
2694 
2695   
2696 /**
2697  * glp_mincost_lp - convert minimum cost flow problem to LP .
2698  * <p>SYNOPSIS</p>
2699  * <p>void glp_mincost_lp(glp_prob *lp, glp_graph *G, int names, int v_rhs, int a_low, int a_cap, int a_cost);</p>
2700  * <p>DESCRIPTION</p>
2701  * <p>The routine glp_mincost_lp builds an LP problem, which corresponds to the minimum cost flow problem on the specified network G. </p>
2702  */
2703 public static void glp_mincost_lp(glp_prob P, glp_graph G, int names, int v_rhs, int a_low, int a_cap, int a_cost) {
2704     GLPKJNI.glp_mincost_lp(glp_prob.getCPtr(P), P, glp_graph.getCPtr(G), G, names, v_rhs, a_low, a_cap, a_cost);
2705   }
2706 
2707   
2708 /**
2709  */
2710 public static int glp_mincost_okalg(glp_graph G, int v_rhs, int a_low, int a_cap, int a_cost, SWIGTYPE_p_double sol, int a_x, int v_pi) {
2711     return GLPKJNI.glp_mincost_okalg(glp_graph.getCPtr(G), G, v_rhs, a_low, a_cap, a_cost, SWIGTYPE_p_double.getCPtr(sol), a_x, v_pi);
2712   }
2713 
2714   
2715 /**
2716  */
2717 public static int glp_mincost_relax4(glp_graph G, int v_rhs, int a_low, int a_cap, int a_cost, int crash, SWIGTYPE_p_double sol, int a_x, int a_rc) {
2718     return GLPKJNI.glp_mincost_relax4(glp_graph.getCPtr(G), G, v_rhs, a_low, a_cap, a_cost, crash, SWIGTYPE_p_double.getCPtr(sol), a_x, a_rc);
2719   }
2720 
2721   
2722 /**
2723  * glp_maxflow_lp - convert maximum flow problem to LP .
2724  * <p>SYNOPSIS</p>
2725  * <p>void glp_maxflow_lp(glp_prob *lp, glp_graph *G, int names, int s, int t, int a_cap);</p>
2726  * <p>DESCRIPTION</p>
2727  * <p>The routine glp_maxflow_lp builds an LP problem, which corresponds to the maximum flow problem on the specified network G. </p>
2728  */
2729 public static void glp_maxflow_lp(glp_prob P, glp_graph G, int names, int s, int t, int a_cap) {
2730     GLPKJNI.glp_maxflow_lp(glp_prob.getCPtr(P), P, glp_graph.getCPtr(G), G, names, s, t, a_cap);
2731   }
2732 
2733   
2734 /**
2735  */
2736 public static int glp_maxflow_ffalg(glp_graph G, int s, int t, int a_cap, SWIGTYPE_p_double sol, int a_x, int v_cut) {
2737     return GLPKJNI.glp_maxflow_ffalg(glp_graph.getCPtr(G), G, s, t, a_cap, SWIGTYPE_p_double.getCPtr(sol), a_x, v_cut);
2738   }
2739 
2740   
2741 /**
2742  * glp_check_asnprob - check correctness of assignment problem data .
2743  * <p>SYNOPSIS</p>
2744  * <p>int glp_check_asnprob(glp_graph *G, int v_set);</p>
2745  * <p>RETURNS</p>
2746  * <p>If the specified assignment problem data are correct, the routine glp_check_asnprob returns zero, otherwise, non-zero. </p>
2747  */
2748 public static int glp_check_asnprob(glp_graph G, int v_set) {
2749     return GLPKJNI.glp_check_asnprob(glp_graph.getCPtr(G), G, v_set);
2750   }
2751 
2752   
2753 /**
2754  * glp_asnprob_lp - convert assignment problem to LP .
2755  * <p>SYNOPSIS</p>
2756  * <p>int glp_asnprob_lp(glp_prob *P, int form, glp_graph *G, int names, int v_set, int a_cost);</p>
2757  * <p>DESCRIPTION</p>
2758  * <p>The routine glp_asnprob_lp builds an LP problem, which corresponds to the assignment problem on the specified graph G.</p>
2759  * <p>RETURNS</p>
2760  * <p>If the LP problem has been successfully built, the routine returns zero, otherwise, non-zero. </p>
2761  */
2762 public static int glp_asnprob_lp(glp_prob P, int form, glp_graph G, int names, int v_set, int a_cost) {
2763     return GLPKJNI.glp_asnprob_lp(glp_prob.getCPtr(P), P, form, glp_graph.getCPtr(G), G, names, v_set, a_cost);
2764   }
2765 
2766   
2767 /**
2768  */
2769 public static int glp_asnprob_okalg(int form, glp_graph G, int v_set, int a_cost, SWIGTYPE_p_double sol, int a_x) {
2770     return GLPKJNI.glp_asnprob_okalg(form, glp_graph.getCPtr(G), G, v_set, a_cost, SWIGTYPE_p_double.getCPtr(sol), a_x);
2771   }
2772 
2773   
2774 /**
2775  * glp_asnprob_hall - find bipartite matching of maximum cardinality .
2776  * <p>SYNOPSIS</p>
2777  * <p>int glp_asnprob_hall(glp_graph *G, int v_set, int a_x);</p>
2778  * <p>DESCRIPTION</p>
2779  * <p>The routine glp_asnprob_hall finds a matching of maximal cardinality in the specified bipartite graph G. It uses a version of the Fortran routine MC21A developed by I.S.Duff [1], which implements Hall's algorithm [2].</p>
2780  * <p>RETURNS</p>
2781  * <p>The routine glp_asnprob_hall returns the cardinality of the matching found. However, if the specified graph is incorrect (as detected by the routine glp_check_asnprob), the routine returns negative value.</p>
2782  * <p>REFERENCES</p>
2783  * <p>
2784 I.S.Duff, Algorithm 575: Permutations for zero-free diagonal, ACM Trans. on Math. Softw. 7 (1981), 387-390.M.Hall, "An Algorithm for distinct representatives," Amer. Math. Monthly 63 (1956), 716-717. 
2785 </p>
2786  */
2787 public static int glp_asnprob_hall(glp_graph G, int v_set, int a_x) {
2788     return GLPKJNI.glp_asnprob_hall(glp_graph.getCPtr(G), G, v_set, a_x);
2789   }
2790 
2791   
2792 /**
2793  */
2794 public static double glp_cpp(glp_graph G, int v_t, int v_es, int v_ls) {
2795     return GLPKJNI.glp_cpp(glp_graph.getCPtr(G), G, v_t, v_es, v_ls);
2796   }
2797 
2798   
2799 /**
2800  * glp_read_mincost - read min-cost flow problem data in DIMACS format .
2801  * <p>SYNOPSIS</p>
2802  * <p>int glp_read_mincost(glp_graph *G, int v_rhs, int a_low, int a_cap, int a_cost, const char *fname);</p>
2803  * <p>DESCRIPTION</p>
2804  * <p>The routine glp_read_mincost reads minimum cost flow problem data in DIMACS format from a text file.</p>
2805  * <p>RETURNS</p>
2806  * <p>If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero. </p>
2807  */
2808 public static int glp_read_mincost(glp_graph G, int v_rhs, int a_low, int a_cap, int a_cost, String fname) {
2809     return GLPKJNI.glp_read_mincost(glp_graph.getCPtr(G), G, v_rhs, a_low, a_cap, a_cost, fname);
2810   }
2811 
2812   
2813 /**
2814  * glp_write_mincost - write min-cost flow problem data in DIMACS format .
2815  * <p>SYNOPSIS</p>
2816  * <p>int glp_write_mincost(glp_graph *G, int v_rhs, int a_low, int a_cap, int a_cost, const char *fname);</p>
2817  * <p>DESCRIPTION</p>
2818  * <p>The routine glp_write_mincost writes minimum cost flow problem data in DIMACS format to a text file.</p>
2819  * <p>RETURNS</p>
2820  * <p>If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero. </p>
2821  */
2822 public static int glp_write_mincost(glp_graph G, int v_rhs, int a_low, int a_cap, int a_cost, String fname) {
2823     return GLPKJNI.glp_write_mincost(glp_graph.getCPtr(G), G, v_rhs, a_low, a_cap, a_cost, fname);
2824   }
2825 
2826   
2827 /**
2828  * glp_read_maxflow - read maximum flow problem data in DIMACS format .
2829  * <p>SYNOPSIS</p>
2830  * <p>int glp_read_maxflow(glp_graph *G, int *s, int *t, int a_cap, const char *fname);</p>
2831  * <p>DESCRIPTION</p>
2832  * <p>The routine glp_read_maxflow reads maximum flow problem data in DIMACS format from a text file.</p>
2833  * <p>RETURNS</p>
2834  * <p>If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero. </p>
2835  */
2836 public static int glp_read_maxflow(glp_graph G, SWIGTYPE_p_int s, SWIGTYPE_p_int t, int a_cap, String fname) {
2837     return GLPKJNI.glp_read_maxflow(glp_graph.getCPtr(G), G, SWIGTYPE_p_int.getCPtr(s), SWIGTYPE_p_int.getCPtr(t), a_cap, fname);
2838   }
2839 
2840   
2841 /**
2842  * glp_write_maxflow - write maximum flow problem data in DIMACS format .
2843  * <p>SYNOPSIS</p>
2844  * <p>int glp_write_maxflow(glp_graph *G, int s, int t, int a_cap, const char *fname);</p>
2845  * <p>DESCRIPTION</p>
2846  * <p>The routine glp_write_maxflow writes maximum flow problem data in DIMACS format to a text file.</p>
2847  * <p>RETURNS</p>
2848  * <p>If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero. </p>
2849  */
2850 public static int glp_write_maxflow(glp_graph G, int s, int t, int a_cap, String fname) {
2851     return GLPKJNI.glp_write_maxflow(glp_graph.getCPtr(G), G, s, t, a_cap, fname);
2852   }
2853 
2854   
2855 /**
2856  * glp_read_asnprob - read assignment problem data in DIMACS format .
2857  * <p>SYNOPSIS</p>
2858  * <p>int glp_read_asnprob(glp_graph *G, int v_set, int a_cost, const char *fname);</p>
2859  * <p>DESCRIPTION</p>
2860  * <p>The routine glp_read_asnprob reads assignment problem data in DIMACS format from a text file.</p>
2861  * <p>RETURNS</p>
2862  * <p>If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero. </p>
2863  */
2864 public static int glp_read_asnprob(glp_graph G, int v_set, int a_cost, String fname) {
2865     return GLPKJNI.glp_read_asnprob(glp_graph.getCPtr(G), G, v_set, a_cost, fname);
2866   }
2867 
2868   
2869 /**
2870  * glp_write_asnprob - write assignment problem data in DIMACS format .
2871  * <p>SYNOPSIS</p>
2872  * <p>int glp_write_asnprob(glp_graph *G, int v_set, int a_cost, const char *fname);</p>
2873  * <p>DESCRIPTION</p>
2874  * <p>The routine glp_write_asnprob writes assignment problem data in DIMACS format to a text file.</p>
2875  * <p>RETURNS</p>
2876  * <p>If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero. </p>
2877  */
2878 public static int glp_write_asnprob(glp_graph G, int v_set, int a_cost, String fname) {
2879     return GLPKJNI.glp_write_asnprob(glp_graph.getCPtr(G), G, v_set, a_cost, fname);
2880   }
2881 
2882   
2883 /**
2884  * glp_read_ccdata - read graph in DIMACS clique/coloring format .
2885  * <p>SYNOPSIS</p>
2886  * <p>int glp_read_ccdata(glp_graph *G, int v_wgt, const char *fname);</p>
2887  * <p>DESCRIPTION</p>
2888  * <p>The routine glp_read_ccdata reads an (undirected) graph in DIMACS clique/coloring format from a text file.</p>
2889  * <p>RETURNS</p>
2890  * <p>If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero. </p>
2891  */
2892 public static int glp_read_ccdata(glp_graph G, int v_wgt, String fname) {
2893     return GLPKJNI.glp_read_ccdata(glp_graph.getCPtr(G), G, v_wgt, fname);
2894   }
2895 
2896   
2897 /**
2898  * glp_write_ccdata - write graph in DIMACS clique/coloring format .
2899  * <p>SYNOPSIS</p>
2900  * <p>int glp_write_ccdata(glp_graph *G, int v_wgt, const char *fname);</p>
2901  * <p>DESCRIPTION</p>
2902  * <p>The routine glp_write_ccdata writes the specified graph in DIMACS clique/coloring format to a text file.</p>
2903  * <p>RETURNS</p>
2904  * <p>If the operation was successful, the routine returns zero. Otherwise it prints an error message and returns non-zero. </p>
2905  */
2906 public static int glp_write_ccdata(glp_graph G, int v_wgt, String fname) {
2907     return GLPKJNI.glp_write_ccdata(glp_graph.getCPtr(G), G, v_wgt, fname);
2908   }
2909 
2910   
2911 /**
2912  */
2913 public static int glp_netgen(glp_graph G, int v_rhs, int a_cap, int a_cost, SWIGTYPE_p_int parm) {
2914     return GLPKJNI.glp_netgen(glp_graph.getCPtr(G), G, v_rhs, a_cap, a_cost, SWIGTYPE_p_int.getCPtr(parm));
2915   }
2916 
2917   
2918 /**
2919  */
2920 public static void glp_netgen_prob(int nprob, SWIGTYPE_p_int parm) {
2921     GLPKJNI.glp_netgen_prob(nprob, SWIGTYPE_p_int.getCPtr(parm));
2922   }
2923 
2924   
2925 /**
2926  */
2927 public static int glp_gridgen(glp_graph G, int v_rhs, int a_cap, int a_cost, SWIGTYPE_p_int parm) {
2928     return GLPKJNI.glp_gridgen(glp_graph.getCPtr(G), G, v_rhs, a_cap, a_cost, SWIGTYPE_p_int.getCPtr(parm));
2929   }
2930 
2931   
2932 /**
2933  */
2934 public static int glp_rmfgen(glp_graph G, SWIGTYPE_p_int s, SWIGTYPE_p_int t, int a_cap, SWIGTYPE_p_int parm) {
2935     return GLPKJNI.glp_rmfgen(glp_graph.getCPtr(G), G, SWIGTYPE_p_int.getCPtr(s), SWIGTYPE_p_int.getCPtr(t), a_cap, SWIGTYPE_p_int.getCPtr(parm));
2936   }
2937 
2938   
2939 /**
2940  * glp_weak_comp - find all weakly connected components of graph .
2941  * <p>SYNOPSIS</p>
2942  * <p>int glp_weak_comp(glp_graph *G, int v_num);</p>
2943  * <p>DESCRIPTION</p>
2944  * <p>The routine glp_weak_comp finds all weakly connected components of the specified graph.</p>
2945  * <p>The parameter v_num specifies an offset of the field of type int in the vertex data block, to which the routine stores the number of a (weakly) connected component containing that vertex. If v_num &lt; 0, no component numbers are stored.</p>
2946  * <p>The components are numbered in arbitrary order from 1 to nc, where nc is the total number of components found, 0 &lt;= nc &lt;= |V|.</p>
2947  * <p>RETURNS</p>
2948  * <p>The routine returns nc, the total number of components found. </p>
2949  */
2950 public static int glp_weak_comp(glp_graph G, int v_num) {
2951     return GLPKJNI.glp_weak_comp(glp_graph.getCPtr(G), G, v_num);
2952   }
2953 
2954   
2955 /**
2956  * glp_strong_comp - find all strongly connected components of graph .
2957  * <p>SYNOPSIS</p>
2958  * <p>int glp_strong_comp(glp_graph *G, int v_num);</p>
2959  * <p>DESCRIPTION</p>
2960  * <p>The routine glp_strong_comp finds all strongly connected components of the specified graph.</p>
2961  * <p>The parameter v_num specifies an offset of the field of type int in the vertex data block, to which the routine stores the number of a strongly connected component containing that vertex. If v_num &lt; 0, no component numbers are stored.</p>
2962  * <p>The components are numbered in arbitrary order from 1 to nc, where nc is the total number of components found, 0 &lt;= nc &lt;= |V|. However, the component numbering has the property that for every arc (i-&gt;j) in the graph the condition num(i) &gt;= num(j) holds.</p>
2963  * <p>RETURNS</p>
2964  * <p>The routine returns nc, the total number of components found. </p>
2965  */
2966 public static int glp_strong_comp(glp_graph G, int v_num) {
2967     return GLPKJNI.glp_strong_comp(glp_graph.getCPtr(G), G, v_num);
2968   }
2969 
2970   
2971 /**
2972  */
2973 public static int glp_top_sort(glp_graph G, int v_num) {
2974     return GLPKJNI.glp_top_sort(glp_graph.getCPtr(G), G, v_num);
2975   }
2976 
2977   
2978 /**
2979  */
2980 public static int glp_wclique_exact(glp_graph G, int v_wgt, SWIGTYPE_p_double sol, int v_set) {
2981     return GLPKJNI.glp_wclique_exact(glp_graph.getCPtr(G), G, v_wgt, SWIGTYPE_p_double.getCPtr(sol), v_set);
2982   }
2983 
2984 }