12 | 12 |
* <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>
|
13 | 13 |
* <p>If the parameter d_stat is NULL, the current status of dual basic solution remains unchanged.</p>
|
14 | 14 |
* <p>The parameter obj_val is a pointer to the objective function value. If it is NULL, the current value of the objective function remains unchanged.</p>
|
15 | |
* <p>The array element r_stat[i], 1 <= i <= m (where m is the number of rows in the problem object), specifies the status of i-th auxiliary variable, which should be specified as follows:</p>
|
|
15 |
* <p>The array element r_stat[i], 1 <= i <= m (where m is the number of rows in the problem object), specifies the status of i-th auxiliary variable, which should be specified as follows:</p>
|
16 | 16 |
* <p>GLP_BS - basic variable; GLP_NL - non-basic variable on lower bound; GLP_NU - non-basic variable on upper bound; GLP_NF - non-basic free variable; GLP_NS - non-basic fixed variable.</p>
|
17 | 17 |
* <p>If the parameter r_stat is NULL, the current statuses of auxiliary variables remain unchanged.</p>
|
18 | |
* <p>The array element r_prim[i], 1 <= i <= m (where m is the number of rows in the problem object), specifies a primal value of i-th auxiliary variable. If the parameter r_prim is NULL, the current primal values of auxiliary variables remain unchanged.</p>
|
19 | |
* <p>The array element r_dual[i], 1 <= i <= m (where m is the number of rows in the problem object), specifies a dual value (reduced cost) of i-th auxiliary variable. If the parameter r_dual is NULL, the current dual values of auxiliary variables remain unchanged.</p>
|
20 | |
* <p>The array element c_stat[j], 1 <= j <= n (where n is the number of columns in the problem object), specifies the status of j-th structural variable, which should be specified as follows:</p>
|
|
18 |
* <p>The array element r_prim[i], 1 <= i <= m (where m is the number of rows in the problem object), specifies a primal value of i-th auxiliary variable. If the parameter r_prim is NULL, the current primal values of auxiliary variables remain unchanged.</p>
|
|
19 |
* <p>The array element r_dual[i], 1 <= i <= m (where m is the number of rows in the problem object), specifies a dual value (reduced cost) of i-th auxiliary variable. If the parameter r_dual is NULL, the current dual values of auxiliary variables remain unchanged.</p>
|
|
20 |
* <p>The array element c_stat[j], 1 <= j <= n (where n is the number of columns in the problem object), specifies the status of j-th structural variable, which should be specified as follows:</p>
|
21 | 21 |
* <p>GLP_BS - basic variable; GLP_NL - non-basic variable on lower bound; GLP_NU - non-basic variable on upper bound; GLP_NF - non-basic free variable; GLP_NS - non-basic fixed variable.</p>
|
22 | 22 |
* <p>If the parameter c_stat is NULL, the current statuses of structural variables remain unchanged.</p>
|
23 | |
* <p>The array element c_prim[j], 1 <= j <= n (where n is the number of columns in the problem object), specifies a primal value of j-th structural variable. If the parameter c_prim is NULL, the current primal values of structural variables remain unchanged.</p>
|
24 | |
* <p>The array element c_dual[j], 1 <= j <= n (where n is the number of columns in the problem object), specifies a dual value (reduced cost) of j-th structural variable. If the parameter c_dual is NULL, the current dual values of structural variables remain unchanged. </p>
|
|
23 |
* <p>The array element c_prim[j], 1 <= j <= n (where n is the number of columns in the problem object), specifies a primal value of j-th structural variable. If the parameter c_prim is NULL, the current primal values of structural variables remain unchanged.</p>
|
|
24 |
* <p>The array element c_dual[j], 1 <= j <= n (where n is the number of columns in the problem object), specifies a dual value (reduced cost) of j-th structural variable. If the parameter c_dual is NULL, the current dual values of structural variables remain unchanged. </p>
|
25 | 25 |
*/
|
26 | 26 |
public";
|
27 | 27 |
|
|
43 | 43 |
* <p>where y is an auxiliary variable of the row, alfa[j] is an influence coefficient, xN[j] is a non-basic variable.</p>
|
44 | 44 |
* <p>The row is passed to the routine in sparse format. Ordinal numbers of non-basic variables are stored in locations ind[1], ..., ind[len], where numbers 1 to m denote auxiliary variables while numbers m+1 to m+n denote structural variables. Corresponding non-zero coefficients alfa[j] are stored in locations val[1], ..., val[len]. The arrays ind and val are ot changed on exit.</p>
|
45 | 45 |
* <p>The parameters type and rhs specify the row type and its right-hand side as follows:</p>
|
46 | |
* <p>type = GLP_LO: y = sum alfa[j] * xN[j] >= rhs</p>
|
47 | |
* <p>type = GLP_UP: y = sum alfa[j] * xN[j] <= rhs</p>
|
|
46 |
* <p>type = GLP_LO: y = sum alfa[j] * xN[j] >= rhs</p>
|
|
47 |
* <p>type = GLP_UP: y = sum alfa[j] * xN[j] <= rhs</p>
|
48 | 48 |
* <p>The parameter eps is an absolute tolerance (small positive number) used by the routine to skip small coefficients alfa[j] on performing the dual ratio test.</p>
|
49 | 49 |
* <p>If the operation was successful, the routine stores the following information to corresponding location (if some parameter is NULL, its value is not stored):</p>
|
50 | |
* <p>piv index in the array ind and val, 1 <= piv <= len, determining the non-basic variable, which would enter the adjacent basis;</p>
|
|
50 |
* <p>piv index in the array ind and val, 1 <= piv <= len, determining the non-basic variable, which would enter the adjacent basis;</p>
|
51 | 51 |
* <p>x value of the non-basic variable in the current basis;</p>
|
52 | 52 |
* <p>dx difference between values of the non-basic variable in the adjacent and current bases, dx = x.new - x.old;</p>
|
53 | 53 |
* <p>y value of the row (i.e. of its auxiliary variable) in the current basis;</p>
|
54 | 54 |
* <p>dy difference between values of the row in the adjacent and current bases, dy = y.new - y.old;</p>
|
55 | |
* <p>dz difference between values of the objective function in the adjacent and current bases, dz = z.new - z.old. Note that in case of minimization dz >= 0, and in case of maximization dz <= 0, i.e. in the adjacent basis the objective function always gets worse (degrades). </p>
|
|
55 |
* <p>dz difference between values of the objective function in the adjacent and current bases, dz = z.new - z.old. Note that in case of minimization dz >= 0, and in case of maximization dz <= 0, i.e. in the adjacent basis the objective function always gets worse (degrades). </p>
|
56 | 56 |
*/
|
57 | 57 |
public";
|
58 | 58 |
|
|
177 | 177 |
* <p>DESCRIPTION</p>
|
178 | 178 |
* <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>
|
179 | 179 |
* <p>Parameters type, lb, and ub specify the type, lower bound, and upper bound, respectively, as follows:</p>
|
180 | |
* <p>Type Bounds Comments ------------------------------------------------------ GLP_FR -inf < x < +inf Free variable GLP_LO lb <= x < +inf Variable with lower bound GLP_UP -inf < x <= ub Variable with upper bound GLP_DB lb <= x <= ub Double-bounded variable GLP_FX x = lb Fixed variable</p>
|
|
180 |
* <p>Type Bounds Comments ------------------------------------------------------ GLP_FR -inf < x < +inf Free variable GLP_LO lb <= x < +inf Variable with lower bound GLP_UP -inf < x <= ub Variable with upper bound GLP_DB lb <= x <= ub Double-bounded variable GLP_FX x = lb Fixed variable</p>
|
181 | 181 |
* <p>where x is the auxiliary variable associated with i-th row.</p>
|
182 | 182 |
* <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>
|
183 | 183 |
*/
|
|
191 | 191 |
* <p>DESCRIPTION</p>
|
192 | 192 |
* <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>
|
193 | 193 |
* <p>Parameters type, lb, and ub specify the type, lower bound, and upper bound, respectively, as follows:</p>
|
194 | |
* <p>Type Bounds Comments ------------------------------------------------------ GLP_FR -inf < x < +inf Free variable GLP_LO lb <= x < +inf Variable with lower bound GLP_UP -inf < x <= ub Variable with upper bound GLP_DB lb <= x <= ub Double-bounded variable GLP_FX x = lb Fixed variable</p>
|
|
194 |
* <p>Type Bounds Comments ------------------------------------------------------ GLP_FR -inf < x < +inf Free variable GLP_LO lb <= x < +inf Variable with lower bound GLP_UP -inf < x <= ub Variable with upper bound GLP_DB lb <= x <= ub Double-bounded variable GLP_FX x = lb Fixed variable</p>
|
195 | 195 |
* <p>where x is the structural variable associated with j-th column.</p>
|
196 | 196 |
* <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>
|
197 | 197 |
*/
|
|
216 | 216 |
* <p>void glp_set_mat_row(glp_prob *lp, int i, int len, const int ind[], const double val[]);</p>
|
217 | 217 |
* <p>DESCRIPTION</p>
|
218 | 218 |
* <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>
|
219 | |
* <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 <= len <= 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>
|
|
219 |
* <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 <= len <= 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>
|
220 | 220 |
* <p>If the parameter len is zero, the parameters ind and/or val can be specified as NULL. </p>
|
221 | 221 |
*/
|
222 | 222 |
public";
|
|
228 | 228 |
* <p>void glp_set_mat_col(glp_prob *lp, int j, int len, const int ind[], const double val[]);</p>
|
229 | 229 |
* <p>DESCRIPTION</p>
|
230 | 230 |
* <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>
|
231 | |
* <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 <= len <= 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>
|
|
231 |
* <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 <= len <= 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>
|
232 | 232 |
* <p>If the parameter len is zero, the parameters ind and/or val can be specified as NULL. </p>
|
233 | 233 |
*/
|
234 | 234 |
public";
|
|
252 | 252 |
* <p>int glp_check_dup(int m, int n, int ne, const int ia[], const int ja[]);</p>
|
253 | 253 |
* <p>DESCRIPTION</p>
|
254 | 254 |
* <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>
|
255 | |
* <p>The parameters m and n specifies, respectively, the number of rows and columns in the matrix, m >= 0, n >= 0.</p>
|
256 | |
* <p>The parameter ne specifies the number of (structurally) non-zero elements in the matrix, ne >= 0.</p>
|
|
255 |
* <p>The parameters m and n specifies, respectively, the number of rows and columns in the matrix, m >= 0, n >= 0.</p>
|
|
256 |
* <p>The parameter ne specifies the number of (structurally) non-zero elements in the matrix, ne >= 0.</p>
|
257 | 257 |
* <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>
|
258 | 258 |
* <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>
|
259 | 259 |
* <p>RETURNS</p>
|
|
280 | 280 |
* <p>SYNOPSIS</p>
|
281 | 281 |
* <p>void glp_del_rows(glp_prob *lp, int nrs, const int num[]);</p>
|
282 | 282 |
* <p>DESCRIPTION</p>
|
283 | |
* <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 > 0.</p>
|
|
283 |
* <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 > 0.</p>
|
284 | 284 |
* <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>
|
285 | 285 |
*/
|
286 | 286 |
public";
|
|
291 | 291 |
* <p>SYNOPSIS</p>
|
292 | 292 |
* <p>void glp_del_cols(glp_prob *lp, int ncs, const int num[]);</p>
|
293 | 293 |
* <p>DESCRIPTION</p>
|
294 | |
* <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 > 0.</p>
|
|
294 |
* <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 > 0.</p>
|
295 | 295 |
* <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>
|
296 | 296 |
*/
|
297 | 297 |
public";
|
|
493 | 493 |
* <p>SYNOPSIS</p>
|
494 | 494 |
* <p>int glp_get_mat_row(glp_prob *lp, int i, int ind[], double val[]);</p>
|
495 | 495 |
* <p>DESCRIPTION</p>
|
496 | |
* <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 <= len <= n is the number of elements in i-th row, n is the number of columns.</p>
|
|
496 |
* <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 <= len <= n is the number of elements in i-th row, n is the number of columns.</p>
|
497 | 497 |
* <p>The parameter ind and/or val can be specified as NULL, in which case corresponding information is not stored.</p>
|
498 | 498 |
* <p>RETURNS</p>
|
499 | 499 |
* <p>The routine glp_get_mat_row returns the length len, i.e. the number of (non-zero) elements in i-th row. </p>
|
|
506 | 506 |
* <p>SYNOPSIS</p>
|
507 | 507 |
* <p>int glp_get_mat_col(glp_prob *lp, int j, int ind[], double val[]);</p>
|
508 | 508 |
* <p>DESCRIPTION</p>
|
509 | |
* <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 <= len <= m is the number of elements in j-th column, m is the number of rows.</p>
|
|
509 |
* <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 <= len <= m is the number of elements in j-th column, m is the number of rows.</p>
|
510 | 510 |
* <p>The parameter ind or/and val can be specified as NULL, in which case corresponding information is not stored.</p>
|
511 | 511 |
* <p>RETURNS</p>
|
512 | 512 |
* <p>The routine glp_get_mat_col returns the length len, i.e. the number of (non-zero) elements in j-th column. </p>
|
|
803 | 803 |
* <p>SYNOPSIS</p>
|
804 | 804 |
* <p>int glp_get_unbnd_ray(glp_prob *lp);</p>
|
805 | 805 |
* <p>RETURNS</p>
|
806 | |
* <p>The routine glp_get_unbnd_ray returns the number k of a variable, which causes primal or dual unboundedness. If 1 <= k <= m, it is k-th auxiliary variable, and if m+1 <= k <= 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>
|
|
806 |
* <p>The routine glp_get_unbnd_ray returns the number k of a variable, which causes primal or dual unboundedness. If 1 <= k <= m, it is k-th auxiliary variable, and if m+1 <= k <= 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>
|
807 | 807 |
* <p>COMMENTS</p>
|
808 | 808 |
* <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>
|
809 | 809 |
*/
|
|
1263 | 1263 |
* <p>DESCRIPTION</p>
|
1264 | 1264 |
* <p>The routine glp_get_bhead returns the basis header information for the current basis associated with the specified problem object.</p>
|
1265 | 1265 |
* <p>RETURNS</p>
|
1266 | |
* <p>If xB[k], 1 <= k <= m, is i-th auxiliary variable (1 <= i <= m), the routine returns i. Otherwise, if xB[k] is j-th structural variable (1 <= j <= 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>
|
|
1266 |
* <p>If xB[k], 1 <= k <= m, is i-th auxiliary variable (1 <= i <= m), the routine returns i. Otherwise, if xB[k] is j-th structural variable (1 <= j <= 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>
|
1267 | 1267 |
*/
|
1268 | 1268 |
public";
|
1269 | 1269 |
|
|
1273 | 1273 |
* <p>SYNOPSIS</p>
|
1274 | 1274 |
* <p>int glp_get_row_bind(glp_prob *lp, int i);</p>
|
1275 | 1275 |
* <p>RETURNS</p>
|
1276 | |
* <p>The routine glp_get_row_bind returns the index k of basic variable xB[k], 1 <= k <= m, which is i-th auxiliary variable, 1 <= i <= 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>
|
|
1276 |
* <p>The routine glp_get_row_bind returns the index k of basic variable xB[k], 1 <= k <= m, which is i-th auxiliary variable, 1 <= i <= 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>
|
1277 | 1277 |
*/
|
1278 | 1278 |
public";
|
1279 | 1279 |
|
|
1283 | 1283 |
* <p>SYNOPSIS</p>
|
1284 | 1284 |
* <p>int glp_get_col_bind(glp_prob *lp, int j);</p>
|
1285 | 1285 |
* <p>RETURNS</p>
|
1286 | |
* <p>The routine glp_get_col_bind returns the index k of basic variable xB[k], 1 <= k <= m, which is j-th structural variable, 1 <= j <= 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>
|
|
1286 |
* <p>The routine glp_get_col_bind returns the index k of basic variable xB[k], 1 <= k <= m, which is j-th structural variable, 1 <= j <= 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>
|
1287 | 1287 |
*/
|
1288 | 1288 |
public";
|
1289 | 1289 |
|
|
1346 | 1346 |
* <p>SYNOPSIS</p>
|
1347 | 1347 |
* <p>int glp_eval_tab_row(glp_prob *lp, int k, int ind[], double val[]);</p>
|
1348 | 1348 |
* <p>DESCRIPTION</p>
|
1349 | |
* <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 <= k <= m, x[k] is k-th auxiliary variable; if m+1 <= k <= 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>
|
1350 | |
* <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 <= len <= n is number of non-zeros returned on exit.</p>
|
|
1349 |
* <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 <= k <= m, x[k] is k-th auxiliary variable; if m+1 <= k <= 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>
|
|
1350 |
* <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 <= len <= n is number of non-zeros returned on exit.</p>
|
1351 | 1351 |
* <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>
|
1352 | 1352 |
* <p>The computed row shows how the specified basic variable x[k] = xB[i] depends on non-basic variables:</p>
|
1353 | 1353 |
* <p>xB[i] = alfa[i,1]*xN[1] + alfa[i,2]*xN[2] + ... + alfa[i,n]*xN[n],</p>
|
|
1387 | 1387 |
* <p>SYNOPSIS</p>
|
1388 | 1388 |
* <p>int glp_eval_tab_col(glp_prob *lp, int k, int ind[], double val[]);</p>
|
1389 | 1389 |
* <p>DESCRIPTION</p>
|
1390 | |
* <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 <= k <= m, x[k] is k-th auxiliary variable; if m+1 <= k <= 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>
|
1391 | |
* <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 <= len <= m is number of non-zeros returned on exit.</p>
|
|
1390 |
* <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 <= k <= m, x[k] is k-th auxiliary variable; if m+1 <= k <= 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>
|
|
1391 |
* <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 <= len <= m is number of non-zeros returned on exit.</p>
|
1392 | 1392 |
* <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>
|
1393 | 1393 |
* <p>The computed column shows how basic variables depend on the specified non-basic variable x[k] = xN[j]:</p>
|
1394 | 1394 |
* <p>xB[1] = ... + alfa[1,j]*xN[j] + ... xB[2] = ... + alfa[2,j]*xN[j] + ... . . . . . . xB[m] = ... + alfa[m,j]*xN[j] + ...</p>
|
|
1418 | 1418 |
* <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>
|
1419 | 1419 |
* <p>x = alfa[1]*xN[1] + alfa[2]*xN[2] + ... + alfa[n]*xN[n], (2)</p>
|
1420 | 1420 |
* <p>where xN[j] are non-basic (auxiliary or structural) variables, n is the number of columns in the LP problem object.</p>
|
1421 | |
* <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 <= len' <= 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>
|
|
1421 |
* <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 <= len' <= 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>
|
1422 | 1422 |
* <p>RETURNS</p>
|
1423 | 1423 |
* <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>
|
1424 | 1424 |
* <p>BACKGROUND</p>
|
|
1452 | 1452 |
* <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>
|
1453 | 1453 |
* <p>xB[1] = ... + alfa[1]*x xB[2] = ... + alfa[2]*x (2) . . . . . . xB[m] = ... + alfa[m]*x</p>
|
1454 | 1454 |
* <p>where xB are basic (auxiliary and structural) variables, m is the number of rows in the problem object.</p>
|
1455 | |
* <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 <= len' <= 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>
|
|
1455 |
* <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 <= len' <= 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>
|
1456 | 1456 |
* <p>RETURNS</p>
|
1457 | 1457 |
* <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>
|
1458 | 1458 |
* <p>BACKGROUND</p>
|
|
1477 | 1477 |
* <p>The parameter eps is an absolute tolerance (small positive number) used by the routine to skip small alfa[j] of the row (*).</p>
|
1478 | 1478 |
* <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>
|
1479 | 1479 |
* <p>RETURNS</p>
|
1480 | |
* <p>The routine glp_prim_rtest returns the index piv in the arrays ind and val corresponding to the pivot element chosen, 1 <= piv <= len. If the adjacent basic solution is primal unbounded and therefore the choice cannot be made, the routine returns zero.</p>
|
|
1480 |
* <p>The routine glp_prim_rtest returns the index piv in the arrays ind and val corresponding to the pivot element chosen, 1 <= piv <= len. If the adjacent basic solution is primal unbounded and therefore the choice cannot be made, the routine returns zero.</p>
|
1481 | 1481 |
* <p>COMMENTS</p>
|
1482 | 1482 |
* <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>
|
1483 | 1483 |
*/
|
|
1498 | 1498 |
* <p>The parameter eps is an absolute tolerance (small positive number) used by the routine to skip small alfa[j] of the row (*).</p>
|
1499 | 1499 |
* <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>
|
1500 | 1500 |
* <p>RETURNS</p>
|
1501 | |
* <p>The routine glp_dual_rtest returns the index piv in the arrays ind and val corresponding to the pivot element chosen, 1 <= piv <= len. If the adjacent basic solution is dual unbounded and therefore the choice cannot be made, the routine returns zero.</p>
|
|
1501 |
* <p>The routine glp_dual_rtest returns the index piv in the arrays ind and val corresponding to the pivot element chosen, 1 <= piv <= len. If the adjacent basic solution is dual unbounded and therefore the choice cannot be made, the routine returns zero.</p>
|
1502 | 1502 |
* <p>COMMENTS</p>
|
1503 | 1503 |
* <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>
|
1504 | 1504 |
*/
|
|
1517 | 1517 |
* <p>where y is an auxiliary variable of the row, alfa[j] is an influence coefficient, xN[j] is a non-basic variable.</p>
|
1518 | 1518 |
* <p>The row is passed to the routine in sparse format. Ordinal numbers of non-basic variables are stored in locations ind[1], ..., ind[len], where numbers 1 to m denote auxiliary variables while numbers m+1 to m+n denote structural variables. Corresponding non-zero coefficients alfa[j] are stored in locations val[1], ..., val[len]. The arrays ind and val are ot changed on exit.</p>
|
1519 | 1519 |
* <p>The parameters type and rhs specify the row type and its right-hand side as follows:</p>
|
1520 | |
* <p>type = GLP_LO: y = sum alfa[j] * xN[j] >= rhs</p>
|
1521 | |
* <p>type = GLP_UP: y = sum alfa[j] * xN[j] <= rhs</p>
|
|
1520 |
* <p>type = GLP_LO: y = sum alfa[j] * xN[j] >= rhs</p>
|
|
1521 |
* <p>type = GLP_UP: y = sum alfa[j] * xN[j] <= rhs</p>
|
1522 | 1522 |
* <p>The parameter eps is an absolute tolerance (small positive number) used by the routine to skip small coefficients alfa[j] on performing the dual ratio test.</p>
|
1523 | 1523 |
* <p>If the operation was successful, the routine stores the following information to corresponding location (if some parameter is NULL, its value is not stored):</p>
|
1524 | |
* <p>piv index in the array ind and val, 1 <= piv <= len, determining the non-basic variable, which would enter the adjacent basis;</p>
|
|
1524 |
* <p>piv index in the array ind and val, 1 <= piv <= len, determining the non-basic variable, which would enter the adjacent basis;</p>
|
1525 | 1525 |
* <p>x value of the non-basic variable in the current basis;</p>
|
1526 | 1526 |
* <p>dx difference between values of the non-basic variable in the adjacent and current bases, dx = x.new - x.old;</p>
|
1527 | 1527 |
* <p>y value of the row (i.e. of its auxiliary variable) in the current basis;</p>
|
1528 | 1528 |
* <p>dy difference between values of the row in the adjacent and current bases, dy = y.new - y.old;</p>
|
1529 | |
* <p>dz difference between values of the objective function in the adjacent and current bases, dz = z.new - z.old. Note that in case of minimization dz >= 0, and in case of maximization dz <= 0, i.e. in the adjacent basis the objective function always gets worse (degrades). </p>
|
|
1529 |
* <p>dz difference between values of the objective function in the adjacent and current bases, dz = z.new - z.old. Note that in case of minimization dz >= 0, and in case of maximization dz <= 0, i.e. in the adjacent basis the objective function always gets worse (degrades). </p>
|
1530 | 1530 |
*/
|
1531 | 1531 |
public";
|
1532 | 1532 |
|
|
1537 | 1537 |
* <p>void glp_analyze_bound(glp_prob *P, int k, double *limit1, int *var1, double *limit2, int *var2);</p>
|
1538 | 1538 |
* <p>DESCRIPTION</p>
|
1539 | 1539 |
* <p>The routine glp_analyze_bound analyzes the effect of varying the active bound of specified non-basic variable.</p>
|
1540 | |
* <p>The non-basic variable is specified by the parameter k, where 1 <= k <= m means auxiliary variable of corresponding row while m+1 <= k <= m+n means structural variable (column).</p>
|
|
1540 |
* <p>The non-basic variable is specified by the parameter k, where 1 <= k <= m means auxiliary variable of corresponding row while m+1 <= k <= m+n means structural variable (column).</p>
|
1541 | 1541 |
* <p>Note that the current basic solution must be optimal, and the basis factorization must exist.</p>
|
1542 | 1542 |
* <p>Results of the analysis have the following meaning.</p>
|
1543 | 1543 |
* <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>
|
|
1554 | 1554 |
* <p>void glp_analyze_coef(glp_prob *P, int k, double *coef1, int *var1, double *value1, double *coef2, int *var2, double *value2);</p>
|
1555 | 1555 |
* <p>DESCRIPTION</p>
|
1556 | 1556 |
* <p>The routine glp_analyze_coef analyzes the effect of varying the objective coefficient at specified basic variable.</p>
|
1557 | |
* <p>The basic variable is specified by the parameter k, where 1 <= k <= m means auxiliary variable of corresponding row while m+1 <= k <= m+n means structural variable (column).</p>
|
|
1557 |
* <p>The basic variable is specified by the parameter k, where 1 <= k <= m means auxiliary variable of corresponding row while m+1 <= k <= m+n means structural variable (column).</p>
|
1558 | 1558 |
* <p>Note that the current basic solution must be optimal, and the basis factorization must exist.</p>
|
1559 | 1559 |
* <p>Results of the analysis have the following meaning.</p>
|
1560 | 1560 |
* <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>
|
|
1903 | 1903 |
* <p>SYNOPSIS</p>
|
1904 | 1904 |
* <p>void glp_del_vertices(glp_graph *G, int ndel, const int num[]);</p>
|
1905 | 1905 |
* <p>DESCRIPTION</p>
|
1906 | |
* <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 > 0.</p>
|
|
1906 |
* <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 > 0.</p>
|
1907 | 1907 |
* <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>
|
1908 | 1908 |
*/
|
1909 | 1909 |
public";
|
|
1989 | 1989 |
* <p>int glp_weak_comp(glp_graph *G, int v_num);</p>
|
1990 | 1990 |
* <p>DESCRIPTION</p>
|
1991 | 1991 |
* <p>The routine glp_weak_comp finds all weakly connected components of the specified graph.</p>
|
1992 | |
* <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 < 0, no component numbers are stored.</p>
|
1993 | |
* <p>The components are numbered in arbitrary order from 1 to nc, where nc is the total number of components found, 0 <= nc <= |V|.</p>
|
|
1992 |
* <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 < 0, no component numbers are stored.</p>
|
|
1993 |
* <p>The components are numbered in arbitrary order from 1 to nc, where nc is the total number of components found, 0 <= nc <= |V|.</p>
|
1994 | 1994 |
* <p>RETURNS</p>
|
1995 | 1995 |
* <p>The routine returns nc, the total number of components found. </p>
|
1996 | 1996 |
*/
|
|
2003 | 2003 |
* <p>int glp_strong_comp(glp_graph *G, int v_num);</p>
|
2004 | 2004 |
* <p>DESCRIPTION</p>
|
2005 | 2005 |
* <p>The routine glp_strong_comp finds all strongly connected components of the specified graph.</p>
|
2006 | |
* <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 < 0, no component numbers are stored.</p>
|
2007 | |
* <p>The components are numbered in arbitrary order from 1 to nc, where nc is the total number of components found, 0 <= nc <= |V|. However, the component numbering has the property that for every arc (i->j) in the graph the condition num(i) >= num(j) holds.</p>
|
|
2006 |
* <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 < 0, no component numbers are stored.</p>
|
|
2007 |
* <p>The components are numbered in arbitrary order from 1 to nc, where nc is the total number of components found, 0 <= nc <= |V|. However, the component numbering has the property that for every arc (i->j) in the graph the condition num(i) >= num(j) holds.</p>
|
2008 | 2008 |
* <p>RETURNS</p>
|
2009 | 2009 |
* <p>The routine returns nc, the total number of components found. </p>
|
2010 | 2010 |
*/
|
|
2017 | 2017 |
* <p>int glp_top_sort(glp_graph *G, int v_num);</p>
|
2018 | 2018 |
* <p>DESCRIPTION</p>
|
2019 | 2019 |
* <p>The routine glp_top_sort performs topological sorting of vertices of the specified acyclic digraph.</p>
|
2020 | |
* <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 vertex number assigned. If v_num < 0, vertex numbers are not stored.</p>
|
2021 | |
* <p>The vertices are numbered from 1 to n, where n is the total number of vertices in the graph. The vertex numbering has the property that for every arc (i->j) in the graph the condition num(i) < num(j) holds. Special case num(i) = 0 means that vertex i is not assigned a number, because the graph is *not* acyclic.</p>
|
|
2020 |
* <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 vertex number assigned. If v_num < 0, vertex numbers are not stored.</p>
|
|
2021 |
* <p>The vertices are numbered from 1 to n, where n is the total number of vertices in the graph. The vertex numbering has the property that for every arc (i->j) in the graph the condition num(i) < num(j) holds. Special case num(i) = 0 means that vertex i is not assigned a number, because the graph is *not* acyclic.</p>
|
2022 | 2022 |
* <p>RETURNS</p>
|
2023 | 2023 |
* <p>If the graph is acyclic and therefore all the vertices have been assigned numbers, the routine glp_top_sort returns zero. Otherwise, if the graph is not acyclic, the routine returns the number of vertices which have not been numbered, i.e. for which num(i) = 0. </p>
|
2024 | 2024 |
*/
|
|
2119 | 2119 |
* <p>DESCRIPTION</p>
|
2120 | 2120 |
* <p>The routine glp_cpp solves the critical path problem represented in the form of the project network.</p>
|
2121 | 2121 |
* <p>The parameter G is a pointer to the graph object, which specifies the project network. This graph must be acyclic. Multiple arcs are allowed being considered as single arcs.</p>
|
2122 | |
* <p>The parameter v_t specifies an offset of the field of type double in the vertex data block, which contains time t[i] >= 0 needed to perform corresponding job j. If v_t < 0, it is assumed that t[i] = 1 for all jobs.</p>
|
2123 | |
* <p>The parameter v_es specifies an offset of the field of type double in the vertex data block, to which the routine stores earliest start time for corresponding job. If v_es < 0, this time is not stored.</p>
|
2124 | |
* <p>The parameter v_ls specifies an offset of the field of type double in the vertex data block, to which the routine stores latest start time for corresponding job. If v_ls < 0, this time is not stored.</p>
|
|
2122 |
* <p>The parameter v_t specifies an offset of the field of type double in the vertex data block, which contains time t[i] >= 0 needed to perform corresponding job j. If v_t < 0, it is assumed that t[i] = 1 for all jobs.</p>
|
|
2123 |
* <p>The parameter v_es specifies an offset of the field of type double in the vertex data block, to which the routine stores earliest start time for corresponding job. If v_es < 0, this time is not stored.</p>
|
|
2124 |
* <p>The parameter v_ls specifies an offset of the field of type double in the vertex data block, to which the routine stores latest start time for corresponding job. If v_ls < 0, this time is not stored.</p>
|
2125 | 2125 |
* <p>RETURNS</p>
|
2126 | 2126 |
* <p>The routine glp_cpp returns the minimal project duration, that is, minimal time needed to perform all jobs in the project. </p>
|
2127 | 2127 |
*/
|
|
2307 | 2307 |
* <p>DESCRIPTION</p>
|
2308 | 2308 |
* <p>The routine bfd_factorize computes the factorization of the basis matrix B specified by the routine col.</p>
|
2309 | 2309 |
* <p>The parameter bfd specified the basis factorization data structure created with the routine bfd_create_it.</p>
|
2310 | |
* <p>The parameter m specifies the order of B, m > 0.</p>
|
2311 | |
* <p>The array bh specifies the basis header: bh[j], 1 <= j <= m, is the number of j-th column of B in some original matrix. The array bh is optional and can be specified as NULL.</p>
|
2312 | |
* <p>The formal routine col specifies the matrix B to be factorized. To obtain j-th column of A the routine bfd_factorize calls the routine col with the parameter j (1 <= j <= n). In response the routine col should store row indices and numerical values of non-zero elements of j-th column of B to locations ind[1,...,len] and val[1,...,len], respectively, where len is the number of non-zeros in j-th column returned on exit. Neither zero nor duplicate elements are allowed.</p>
|
|
2310 |
* <p>The parameter m specifies the order of B, m > 0.</p>
|
|
2311 |
* <p>The array bh specifies the basis header: bh[j], 1 <= j <= m, is the number of j-th column of B in some original matrix. The array bh is optional and can be specified as NULL.</p>
|
|
2312 |
* <p>The formal routine col specifies the matrix B to be factorized. To obtain j-th column of A the routine bfd_factorize calls the routine col with the parameter j (1 <= j <= n). In response the routine col should store row indices and numerical values of non-zero elements of j-th column of B to locations ind[1,...,len] and val[1,...,len], respectively, where len is the number of non-zeros in j-th column returned on exit. Neither zero nor duplicate elements are allowed.</p>
|
2313 | 2313 |
* <p>The parameter info is a transit pointer passed to the routine col.</p>
|
2314 | 2314 |
* <p>RETURNS</p>
|
2315 | 2315 |
* <p>0 The factorization has been successfully computed.</p>
|
|
2348 | 2348 |
* <p>#include \"glpbfd.h\" int bfd_update_it(BFD *bfd, int j, int bh, int len, const int ind[], const double val[]);</p>
|
2349 | 2349 |
* <p>DESCRIPTION</p>
|
2350 | 2350 |
* <p>The routine bfd_update_it updates the factorization of the basis matrix B after replacing its j-th column by a new vector.</p>
|
2351 | |
* <p>The parameter j specifies the number of column of B, which has been replaced, 1 <= j <= m, where m is the order of B.</p>
|
|
2351 |
* <p>The parameter j specifies the number of column of B, which has been replaced, 1 <= j <= m, where m is the order of B.</p>
|
2352 | 2352 |
* <p>The parameter bh specifies the basis header entry for the new column of B, which is the number of the new column in some original matrix. This parameter is optional and can be specified as 0.</p>
|
2353 | 2353 |
* <p>Row indices and numerical values of non-zero elements of the new column of B should be placed in locations ind[1], ..., ind[len] and val[1], ..., val[len], resp., where len is the number of non-zeros in the column. Neither zero nor duplicate elements are allowed.</p>
|
2354 | 2354 |
* <p>RETURNS</p>
|
|
2401 | 2401 |
* <p>DESCRIPTION</p>
|
2402 | 2402 |
* <p>The routine bfd_factorize computes the factorization of the basis matrix B specified by the routine col.</p>
|
2403 | 2403 |
* <p>The parameter bfd specified the basis factorization data structure created with the routine bfd_create_it.</p>
|
2404 | |
* <p>The parameter m specifies the order of B, m > 0.</p>
|
2405 | |
* <p>The array bh specifies the basis header: bh[j], 1 <= j <= m, is the number of j-th column of B in some original matrix. The array bh is optional and can be specified as NULL.</p>
|
2406 | |
* <p>The formal routine col specifies the matrix B to be factorized. To obtain j-th column of A the routine bfd_factorize calls the routine col with the parameter j (1 <= j <= n). In response the routine col should store row indices and numerical values of non-zero elements of j-th column of B to locations ind[1,...,len] and val[1,...,len], respectively, where len is the number of non-zeros in j-th column returned on exit. Neither zero nor duplicate elements are allowed.</p>
|
|
2404 |
* <p>The parameter m specifies the order of B, m > 0.</p>
|
|
2405 |
* <p>The array bh specifies the basis header: bh[j], 1 <= j <= m, is the number of j-th column of B in some original matrix. The array bh is optional and can be specified as NULL.</p>
|
|
2406 |
* <p>The formal routine col specifies the matrix B to be factorized. To obtain j-th column of A the routine bfd_factorize calls the routine col with the parameter j (1 <= j <= n). In response the routine col should store row indices and numerical values of non-zero elements of j-th column of B to locations ind[1,...,len] and val[1,...,len], respectively, where len is the number of non-zeros in j-th column returned on exit. Neither zero nor duplicate elements are allowed.</p>
|
2407 | 2407 |
* <p>The parameter info is a transit pointer passed to the routine col.</p>
|
2408 | 2408 |
* <p>RETURNS</p>
|
2409 | 2409 |
* <p>0 The factorization has been successfully computed.</p>
|
|
2442 | 2442 |
* <p>#include \"glpbfd.h\" int bfd_update_it(BFD *bfd, int j, int bh, int len, const int ind[], const double val[]);</p>
|
2443 | 2443 |
* <p>DESCRIPTION</p>
|
2444 | 2444 |
* <p>The routine bfd_update_it updates the factorization of the basis matrix B after replacing its j-th column by a new vector.</p>
|
2445 | |
* <p>The parameter j specifies the number of column of B, which has been replaced, 1 <= j <= m, where m is the order of B.</p>
|
|
2445 |
* <p>The parameter j specifies the number of column of B, which has been replaced, 1 <= j <= m, where m is the order of B.</p>
|
2446 | 2446 |
* <p>The parameter bh specifies the basis header entry for the new column of B, which is the number of the new column in some original matrix. This parameter is optional and can be specified as 0.</p>
|
2447 | 2447 |
* <p>Row indices and numerical values of non-zero elements of the new column of B should be placed in locations ind[1], ..., ind[len] and val[1], ..., val[len], resp., where len is the number of non-zeros in the column. Neither zero nor duplicate elements are allowed.</p>
|
2448 | 2448 |
* <p>RETURNS</p>
|
|
2674 | 2674 |
* <p>#include \"glpdmp.h\" void *dmp_get_atom(DMP *pool, int size);</p>
|
2675 | 2675 |
* <p>DESCRIPTION</p>
|
2676 | 2676 |
* <p>The routine dmp_get_atom obtains a free atom (memory block) from the specified memory pool.</p>
|
2677 | |
* <p>The parameter size is the atom size, in bytes, 1 <= size <= 256.</p>
|
|
2677 |
* <p>The parameter size is the atom size, in bytes, 1 <= size <= 256.</p>
|
2678 | 2678 |
* <p>Note that the free atom contains arbitrary data, not binary zeros.</p>
|
2679 | 2679 |
* <p>RETURNS</p>
|
2680 | 2680 |
* <p>The routine returns a pointer to the free atom obtained. </p>
|
|
2688 | 2688 |
* <p>#include \"glpdmp.h\" void dmp_free_atom(DMP *pool, void *atom, int size);</p>
|
2689 | 2689 |
* <p>DESCRIPTION</p>
|
2690 | 2690 |
* <p>The routine dmp_free_atom returns the specified atom (memory block) to the specified memory pool, making it free.</p>
|
2691 | |
* <p>The parameter size is the atom size, in bytes, 1 <= size <= 256.</p>
|
|
2691 |
* <p>The parameter size is the atom size, in bytes, 1 <= size <= 256.</p>
|
2692 | 2692 |
* <p>Note that the atom can be returned only to the pool, from which it was obtained, and its size must be exactly the same as on obtaining it from the pool. </p>
|
2693 | 2693 |
*/
|
2694 | 2694 |
public";
|
|
2734 | 2734 |
* <p>#include \"glpdmp.h\" void *dmp_get_atom(DMP *pool, int size);</p>
|
2735 | 2735 |
* <p>DESCRIPTION</p>
|
2736 | 2736 |
* <p>The routine dmp_get_atom obtains a free atom (memory block) from the specified memory pool.</p>
|
2737 | |
* <p>The parameter size is the atom size, in bytes, 1 <= size <= 256.</p>
|
|
2737 |
* <p>The parameter size is the atom size, in bytes, 1 <= size <= 256.</p>
|
2738 | 2738 |
* <p>Note that the free atom contains arbitrary data, not binary zeros.</p>
|
2739 | 2739 |
* <p>RETURNS</p>
|
2740 | 2740 |
* <p>The routine returns a pointer to the free atom obtained. </p>
|
|
2748 | 2748 |
* <p>#include \"glpdmp.h\" void dmp_free_atom(DMP *pool, void *atom, int size);</p>
|
2749 | 2749 |
* <p>DESCRIPTION</p>
|
2750 | 2750 |
* <p>The routine dmp_free_atom returns the specified atom (memory block) to the specified memory pool, making it free.</p>
|
2751 | |
* <p>The parameter size is the atom size, in bytes, 1 <= size <= 256.</p>
|
|
2751 |
* <p>The parameter size is the atom size, in bytes, 1 <= size <= 256.</p>
|
2752 | 2752 |
* <p>Note that the atom can be returned only to the pool, from which it was obtained, and its size must be exactly the same as on obtaining it from the pool. </p>
|
2753 | 2753 |
*/
|
2754 | 2754 |
public";
|
|
3626 | 3626 |
* <p>DESCRIPTION</p>
|
3627 | 3627 |
* <p>The routine fhv_factorize computes the factorization of the basis matrix B specified by the routine col.</p>
|
3628 | 3628 |
* <p>The parameter fhv specified the basis factorization data structure created by the routine fhv_create_it.</p>
|
3629 | |
* <p>The parameter m specifies the order of B, m > 0.</p>
|
3630 | |
* <p>The formal routine col specifies the matrix B to be factorized. To obtain j-th column of A the routine fhv_factorize calls the routine col with the parameter j (1 <= j <= n). In response the routine col should store row indices and numerical values of non-zero elements of j-th column of B to locations ind[1,...,len] and val[1,...,len], respectively, where len is the number of non-zeros in j-th column returned on exit. Neither zero nor duplicate elements are allowed.</p>
|
|
3629 |
* <p>The parameter m specifies the order of B, m > 0.</p>
|
|
3630 |
* <p>The formal routine col specifies the matrix B to be factorized. To obtain j-th column of A the routine fhv_factorize calls the routine col with the parameter j (1 <= j <= n). In response the routine col should store row indices and numerical values of non-zero elements of j-th column of B to locations ind[1,...,len] and val[1,...,len], respectively, where len is the number of non-zeros in j-th column returned on exit. Neither zero nor duplicate elements are allowed.</p>
|
3631 | 3631 |
* <p>The parameter info is a transit pointer passed to the routine col.</p>
|
3632 | 3632 |
* <p>RETURNS</p>
|
3633 | 3633 |
* <p>0 The factorization has been successfully computed.</p>
|
|
3688 | 3688 |
* <p>#include \"glpfhv.h\" int fhv_update_it(FHV *fhv, int j, int len, const int ind[], const double val[]);</p>
|
3689 | 3689 |
* <p>DESCRIPTION</p>
|
3690 | 3690 |
* <p>The routine fhv_update_it updates the factorization of the basis matrix B after replacing its j-th column by a new vector.</p>
|
3691 | |
* <p>The parameter j specifies the number of column of B, which has been replaced, 1 <= j <= m, where m is the order of B.</p>
|
|
3691 |
* <p>The parameter j specifies the number of column of B, which has been replaced, 1 <= j <= m, where m is the order of B.</p>
|
3692 | 3692 |
* <p>Row indices and numerical values of non-zero elements of the new column of B should be placed in locations ind[1], ..., ind[len] and val[1], ..., val[len], resp., where len is the number of non-zeros in the column. Neither zero nor duplicate elements are allowed.</p>
|
3693 | 3693 |
* <p>RETURNS</p>
|
3694 | 3694 |
* <p>0 The factorization has been successfully updated.</p>
|
3695 | |
* <p>FHV_ESING The adjacent basis matrix is structurally singular, since after changing j-th column of matrix V by the new column (see algorithm below) the case k1 > k2 occured.</p>
|
|
3695 |
* <p>FHV_ESING The adjacent basis matrix is structurally singular, since after changing j-th column of matrix V by the new column (see algorithm below) the case k1 > k2 occured.</p>
|
3696 | 3696 |
* <p>FHV_ECHECK The factorization is inaccurate, since after transforming k2-th row of matrix U = P*V*Q, its diagonal element u[k2,k2] is zero or close to zero,</p>
|
3697 | 3697 |
* <p>FHV_ELIMIT Maximal number of H factors has been reached.</p>
|
3698 | 3698 |
* <p>FHV_EROOM Overflow of the sparse vector area.</p>
|
|
3740 | 3740 |
* <p>DESCRIPTION</p>
|
3741 | 3741 |
* <p>The routine fhv_factorize computes the factorization of the basis matrix B specified by the routine col.</p>
|
3742 | 3742 |
* <p>The parameter fhv specified the basis factorization data structure created by the routine fhv_create_it.</p>
|
3743 | |
* <p>The parameter m specifies the order of B, m > 0.</p>
|
3744 | |
* <p>The formal routine col specifies the matrix B to be factorized. To obtain j-th column of A the routine fhv_factorize calls the routine col with the parameter j (1 <= j <= n). In response the routine col should store row indices and numerical values of non-zero elements of j-th column of B to locations ind[1,...,len] and val[1,...,len], respectively, where len is the number of non-zeros in j-th column returned on exit. Neither zero nor duplicate elements are allowed.</p>
|
|
3743 |
* <p>The parameter m specifies the order of B, m > 0.</p>
|
|
3744 |
* <p>The formal routine col specifies the matrix B to be factorized. To obtain j-th column of A the routine fhv_factorize calls the routine col with the parameter j (1 <= j <= n). In response the routine col should store row indices and numerical values of non-zero elements of j-th column of B to locations ind[1,...,len] and val[1,...,len], respectively, where len is the number of non-zeros in j-th column returned on exit. Neither zero nor duplicate elements are allowed.</p>
|
3745 | 3745 |
* <p>The parameter info is a transit pointer passed to the routine col.</p>
|
3746 | 3746 |
* <p>RETURNS</p>
|
3747 | 3747 |
* <p>0 The factorization has been successfully computed.</p>
|
|
3802 | 3802 |
* <p>#include \"glpfhv.h\" int fhv_update_it(FHV *fhv, int j, int len, const int ind[], const double val[]);</p>
|
3803 | 3803 |
* <p>DESCRIPTION</p>
|
3804 | 3804 |
* <p>The routine fhv_update_it updates the factorization of the basis matrix B after replacing its j-th column by a new vector.</p>
|
3805 | |
* <p>The parameter j specifies the number of column of B, which has been replaced, 1 <= j <= m, where m is the order of B.</p>
|
|
3805 |
* <p>The parameter j specifies the number of column of B, which has been replaced, 1 <= j <= m, where m is the order of B.</p>
|
3806 | 3806 |
* <p>Row indices and numerical values of non-zero elements of the new column of B should be placed in locations ind[1], ..., ind[len] and val[1], ..., val[len], resp., where len is the number of non-zeros in the column. Neither zero nor duplicate elements are allowed.</p>
|
3807 | 3807 |
* <p>RETURNS</p>
|
3808 | 3808 |
* <p>0 The factorization has been successfully updated.</p>
|
3809 | |
* <p>FHV_ESING The adjacent basis matrix is structurally singular, since after changing j-th column of matrix V by the new column (see algorithm below) the case k1 > k2 occured.</p>
|
|
3809 |
* <p>FHV_ESING The adjacent basis matrix is structurally singular, since after changing j-th column of matrix V by the new column (see algorithm below) the case k1 > k2 occured.</p>
|
3810 | 3810 |
* <p>FHV_ECHECK The factorization is inaccurate, since after transforming k2-th row of matrix U = P*V*Q, its diagonal element u[k2,k2] is zero or close to zero,</p>
|
3811 | 3811 |
* <p>FHV_ELIMIT Maximal number of H factors has been reached.</p>
|
3812 | 3812 |
* <p>FHV_EROOM Overflow of the sparse vector area.</p>
|
|
4399 | 4399 |
* <p>For the given local bound for any integer feasible solution to the current subproblem the routine ios_round_bound returns an improved local bound for the same integer feasible solution.</p>
|
4400 | 4400 |
* <p>BACKGROUND</p>
|
4401 | 4401 |
* <p>Let the current subproblem has the following objective function:</p>
|
4402 | |
* <p>z = sum c[j] * x[j] + s >= b, (1) j in J</p>
|
|
4402 |
* <p>z = sum c[j] * x[j] + s >= b, (1) j in J</p>
|
4403 | 4403 |
* <p>where J = {j: c[j] is non-zero and integer, x[j] is integer}, s is the sum of terms corresponding to fixed variables, b is an initial local bound (minimization).</p>
|
4404 | 4404 |
* <p>From (1) it follows that:</p>
|
4405 | |
* <p>d * sum (c[j] / d) * x[j] + s >= b, (2) j in J</p>
|
|
4405 |
* <p>d * sum (c[j] / d) * x[j] + s >= b, (2) j in J</p>
|
4406 | 4406 |
* <p>or, equivalently,</p>
|
4407 | |
* <p>sum (c[j] / d) * x[j] >= (b - s) / d = h, (3) j in J</p>
|
|
4407 |
* <p>sum (c[j] / d) * x[j] >= (b - s) / d = h, (3) j in J</p>
|
4408 | 4408 |
* <p>where d = gcd(c[j]). Since the left-hand side of (3) is integer, h = (b - s) / d can be rounded up to the nearest integer:</p>
|
4409 | 4409 |
* <p>h' = ceil(h) = (b' - s) / d, (4)</p>
|
4410 | 4410 |
* <p>that gives an rounded, improved local bound:</p>
|
4411 | 4411 |
* <p>b' = d * h' + s. (5)</p>
|
4412 | |
* <p>In case of maximization '>=' in (1) should be replaced by '<=' that leads to the following formula:</p>
|
|
4412 |
* <p>In case of maximization '>=' in (1) should be replaced by '<=' that leads to the following formula:</p>
|
4413 | 4413 |
* <p>h' = floor(h) = (b' - s) / d, (6)</p>
|
4414 | 4414 |
* <p>which should used in the same way as (4).</p>
|
4415 | 4415 |
* <p>NOTE: If b is a valid local bound for a child of the current subproblem, b' is also valid for that child subproblem. </p>
|
|
4813 | 4813 |
* <p>For the given local bound for any integer feasible solution to the current subproblem the routine ios_round_bound returns an improved local bound for the same integer feasible solution.</p>
|
4814 | 4814 |
* <p>BACKGROUND</p>
|
4815 | 4815 |
* <p>Let the current subproblem has the following objective function:</p>
|
4816 | |
* <p>z = sum c[j] * x[j] + s >= b, (1) j in J</p>
|
|
4816 |
* <p>z = sum c[j] * x[j] + s >= b, (1) j in J</p>
|
4817 | 4817 |
* <p>where J = {j: c[j] is non-zero and integer, x[j] is integer}, s is the sum of terms corresponding to fixed variables, b is an initial local bound (minimization).</p>
|
4818 | 4818 |
* <p>From (1) it follows that:</p>
|
4819 | |
* <p>d * sum (c[j] / d) * x[j] + s >= b, (2) j in J</p>
|
|
4819 |
* <p>d * sum (c[j] / d) * x[j] + s >= b, (2) j in J</p>
|
4820 | 4820 |
* <p>or, equivalently,</p>
|
4821 | |
* <p>sum (c[j] / d) * x[j] >= (b - s) / d = h, (3) j in J</p>
|
|
4821 |
* <p>sum (c[j] / d) * x[j] >= (b - s) / d = h, (3) j in J</p>
|
4822 | 4822 |
* <p>where d = gcd(c[j]). Since the left-hand side of (3) is integer, h = (b - s) / d can be rounded up to the nearest integer:</p>
|
4823 | 4823 |
* <p>h' = ceil(h) = (b' - s) / d, (4)</p>
|
4824 | 4824 |
* <p>that gives an rounded, improved local bound:</p>
|
4825 | 4825 |
* <p>b' = d * h' + s. (5)</p>
|
4826 | |
* <p>In case of maximization '>=' in (1) should be replaced by '<=' that leads to the following formula:</p>
|
|
4826 |
* <p>In case of maximization '>=' in (1) should be replaced by '<=' that leads to the following formula:</p>
|
4827 | 4827 |
* <p>h' = floor(h) = (b' - s) / d, (6)</p>
|
4828 | 4828 |
* <p>which should used in the same way as (4).</p>
|
4829 | 4829 |
* <p>NOTE: If b is a valid local bound for a child of the current subproblem, b' is also valid for that child subproblem. </p>
|
|
5576 | 5576 |
* <p>. . . . . .</p>
|
5577 | 5577 |
* <p>a[m,1]*x[1] + a[m,2]*x[2] + ... + a[m,n]*x[n] = b[m]</p>
|
5578 | 5578 |
* <p>and non-negative variables</p>
|
5579 | |
* <p>x[1] >= 0, x[2] >= 0, ..., x[n] >= 0</p>
|
|
5579 |
* <p>x[1] >= 0, x[2] >= 0, ..., x[n] >= 0</p>
|
5580 | 5580 |
* <p>where: F is the objective function; x[1], ..., x[n] are (structural) variables; c[0] is a constant term of the objective function; c[1], ..., c[n] are objective coefficients; a[1,1], ..., a[m,n] are constraint coefficients; b[1], ..., b[n] are right-hand sides.</p>
|
5581 | 5581 |
* <p>The solution is three vectors x, y, and z, which are stored by the routine in the arrays x, y, and z, respectively. These vectors correspond to the best primal-dual point found during optimization. They are approximate solution of the following system (which is the Karush-Kuhn-Tucker optimality conditions):</p>
|
5582 | 5582 |
* <p>A*x = b (primal feasibility condition)</p>
|
5583 | 5583 |
* <p>A'*y + z = c (dual feasibility condition)</p>
|
5584 | 5584 |
* <p>x'*z = 0 (primal-dual complementarity condition)</p>
|
5585 | |
* <p>x >= 0, z >= 0 (non-negativity condition)</p>
|
|
5585 |
* <p>x >= 0, z >= 0 (non-negativity condition)</p>
|
5586 | 5586 |
* <p>where: x[1], ..., x[n] are primal (structural) variables; y[1], ..., y[m] are dual variables (Lagrange multipliers) for equality constraints; z[1], ..., z[n] are dual variables (Lagrange multipliers) for non-negativity constraints.</p>
|
5587 | 5587 |
* <p>RETURNS</p>
|
5588 | 5588 |
* <p>0 LP has been successfully solved.</p>
|
|
5609 | 5609 |
* <p>. . . . . .</p>
|
5610 | 5610 |
* <p>a[m,1]*x[1] + a[m,2]*x[2] + ... + a[m,n]*x[n] = b[m]</p>
|
5611 | 5611 |
* <p>and non-negative variables</p>
|
5612 | |
* <p>x[1] >= 0, x[2] >= 0, ..., x[n] >= 0</p>
|
|
5612 |
* <p>x[1] >= 0, x[2] >= 0, ..., x[n] >= 0</p>
|
5613 | 5613 |
* <p>where: F is the objective function; x[1], ..., x[n] are (structural) variables; c[0] is a constant term of the objective function; c[1], ..., c[n] are objective coefficients; a[1,1], ..., a[m,n] are constraint coefficients; b[1], ..., b[n] are right-hand sides.</p>
|
5614 | 5614 |
* <p>The solution is three vectors x, y, and z, which are stored by the routine in the arrays x, y, and z, respectively. These vectors correspond to the best primal-dual point found during optimization. They are approximate solution of the following system (which is the Karush-Kuhn-Tucker optimality conditions):</p>
|
5615 | 5615 |
* <p>A*x = b (primal feasibility condition)</p>
|
5616 | 5616 |
* <p>A'*y + z = c (dual feasibility condition)</p>
|
5617 | 5617 |
* <p>x'*z = 0 (primal-dual complementarity condition)</p>
|
5618 | |
* <p>x >= 0, z >= 0 (non-negativity condition)</p>
|
|
5618 |
* <p>x >= 0, z >= 0 (non-negativity condition)</p>
|
5619 | 5619 |
* <p>where: x[1], ..., x[n] are primal (structural) variables; y[1], ..., y[m] are dual variables (Lagrange multipliers) for equality constraints; z[1], ..., z[n] are dual variables (Lagrange multipliers) for non-negativity constraints.</p>
|
5620 | 5620 |
* <p>RETURNS</p>
|
5621 | 5621 |
* <p>0 LP has been successfully solved.</p>
|
|
5720 | 5720 |
* <p>DESCRIPTION</p>
|
5721 | 5721 |
* <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>
|
5722 | 5722 |
* <p>Parameters type, lb, and ub specify the type, lower bound, and upper bound, respectively, as follows:</p>
|
5723 | |
* <p>Type Bounds Comments ------------------------------------------------------ GLP_FR -inf < x < +inf Free variable GLP_LO lb <= x < +inf Variable with lower bound GLP_UP -inf < x <= ub Variable with upper bound GLP_DB lb <= x <= ub Double-bounded variable GLP_FX x = lb Fixed variable</p>
|
|
5723 |
* <p>Type Bounds Comments ------------------------------------------------------ GLP_FR -inf < x < +inf Free variable GLP_LO lb <= x < +inf Variable with lower bound GLP_UP -inf < x <= ub Variable with upper bound GLP_DB lb <= x <= ub Double-bounded variable GLP_FX x = lb Fixed variable</p>
|
5724 | 5724 |
* <p>where x is the auxiliary variable associated with i-th row.</p>
|
5725 | 5725 |
* <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>
|
5726 | 5726 |
*/
|
|
5734 | 5734 |
* <p>DESCRIPTION</p>
|
5735 | 5735 |
* <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>
|
5736 | 5736 |
* <p>Parameters type, lb, and ub specify the type, lower bound, and upper bound, respectively, as follows:</p>
|
5737 | |
* <p>Type Bounds Comments ------------------------------------------------------ GLP_FR -inf < x < +inf Free variable GLP_LO lb <= x < +inf Variable with lower bound GLP_UP -inf < x <= ub Variable with upper bound GLP_DB lb <= x <= ub Double-bounded variable GLP_FX x = lb Fixed variable</p>
|
|
5737 |
* <p>Type Bounds Comments ------------------------------------------------------ GLP_FR -inf < x < +inf Free variable GLP_LO lb <= x < +inf Variable with lower bound GLP_UP -inf < x <= ub Variable with upper bound GLP_DB lb <= x <= ub Double-bounded variable GLP_FX x = lb Fixed variable</p>
|
5738 | 5738 |
* <p>where x is the structural variable associated with j-th column.</p>
|
5739 | 5739 |
* <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>
|
5740 | 5740 |
*/
|
|
5759 | 5759 |
* <p>void glp_set_mat_row(glp_prob *lp, int i, int len, const int ind[], const double val[]);</p>
|
5760 | 5760 |
* <p>DESCRIPTION</p>
|
5761 | 5761 |
* <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>
|
5762 | |
* <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 <= len <= 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>
|
|
5762 |
* <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 <= len <= 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>
|
5763 | 5763 |
* <p>If the parameter len is zero, the parameters ind and/or val can be specified as NULL. </p>
|
5764 | 5764 |
*/
|
5765 | 5765 |
public";
|
|
5771 | 5771 |
* <p>void glp_set_mat_col(glp_prob *lp, int j, int len, const int ind[], const double val[]);</p>
|
5772 | 5772 |
* <p>DESCRIPTION</p>
|
5773 | 5773 |
* <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>
|
5774 | |
* <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 <= len <= 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>
|
|
5774 |
* <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 <= len <= 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>
|
5775 | 5775 |
* <p>If the parameter len is zero, the parameters ind and/or val can be specified as NULL. </p>
|
5776 | 5776 |
*/
|
5777 | 5777 |
public";
|
|
5795 | 5795 |
* <p>int glp_check_dup(int m, int n, int ne, const int ia[], const int ja[]);</p>
|
5796 | 5796 |
* <p>DESCRIPTION</p>
|
5797 | 5797 |
* <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>
|
5798 | |
* <p>The parameters m and n specifies, respectively, the number of rows and columns in the matrix, m >= 0, n >= 0.</p>
|
5799 | |
* <p>The parameter ne specifies the number of (structurally) non-zero elements in the matrix, ne >= 0.</p>
|
|
5798 |
* <p>The parameters m and n specifies, respectively, the number of rows and columns in the matrix, m >= 0, n >= 0.</p>
|
|
5799 |
* <p>The parameter ne specifies the number of (structurally) non-zero elements in the matrix, ne >= 0.</p>
|
5800 | 5800 |
* <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>
|
5801 | 5801 |
* <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>
|
5802 | 5802 |
* <p>RETURNS</p>
|
|
5823 | 5823 |
* <p>SYNOPSIS</p>
|
5824 | 5824 |
* <p>void glp_del_rows(glp_prob *lp, int nrs, const int num[]);</p>
|
5825 | 5825 |
* <p>DESCRIPTION</p>
|
5826 | |
* <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 > 0.</p>
|
|
5826 |
* <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 > 0.</p>
|
5827 | 5827 |
* <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>
|
5828 | 5828 |
*/
|
5829 | 5829 |
public";
|
|
5834 | 5834 |
* <p>SYNOPSIS</p>
|
5835 | 5835 |
* <p>void glp_del_cols(glp_prob *lp, int ncs, const int num[]);</p>
|
5836 | 5836 |
* <p>DESCRIPTION</p>
|
5837 | |
* <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 > 0.</p>
|
|
5837 |
* <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 > 0.</p>
|
5838 | 5838 |
* <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>
|
5839 | 5839 |
*/
|
5840 | 5840 |
public";
|
|
6021 | 6021 |
* <p>SYNOPSIS</p>
|
6022 | 6022 |
* <p>int glp_get_mat_row(glp_prob *lp, int i, int ind[], double val[]);</p>
|
6023 | 6023 |
* <p>DESCRIPTION</p>
|
6024 | |
* <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 <= len <= n is the number of elements in i-th row, n is the number of columns.</p>
|
|
6024 |
* <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 <= len <= n is the number of elements in i-th row, n is the number of columns.</p>
|
6025 | 6025 |
* <p>The parameter ind and/or val can be specified as NULL, in which case corresponding information is not stored.</p>
|
6026 | 6026 |
* <p>RETURNS</p>
|
6027 | 6027 |
* <p>The routine glp_get_mat_row returns the length len, i.e. the number of (non-zero) elements in i-th row. </p>
|
|
6034 | 6034 |
* <p>SYNOPSIS</p>
|
6035 | 6035 |
* <p>int glp_get_mat_col(glp_prob *lp, int j, int ind[], double val[]);</p>
|
6036 | 6036 |
* <p>DESCRIPTION</p>
|
6037 | |
* <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 <= len <= m is the number of elements in j-th column, m is the number of rows.</p>
|
|
6037 |
* <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 <= len <= m is the number of elements in j-th column, m is the number of rows.</p>
|
6038 | 6038 |
* <p>The parameter ind or/and val can be specified as NULL, in which case corresponding information is not stored.</p>
|
6039 | 6039 |
* <p>RETURNS</p>
|
6040 | 6040 |
* <p>The routine glp_get_mat_col returns the length len, i.e. the number of (non-zero) elements in j-th column. </p>
|
|
6337 | 6337 |
* <p>SYNOPSIS</p>
|
6338 | 6338 |
* <p>int glp_get_unbnd_ray(glp_prob *lp);</p>
|
6339 | 6339 |
* <p>RETURNS</p>
|
6340 | |
* <p>The routine glp_get_unbnd_ray returns the number k of a variable, which causes primal or dual unboundedness. If 1 <= k <= m, it is k-th auxiliary variable, and if m+1 <= k <= 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>
|
|
6340 |
* <p>The routine glp_get_unbnd_ray returns the number k of a variable, which causes primal or dual unboundedness. If 1 <= k <= m, it is k-th auxiliary variable, and if m+1 <= k <= 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>
|
6341 | 6341 |
* <p>COMMENTS</p>
|
6342 | 6342 |
* <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>
|
6343 | 6343 |
*/
|
|
6680 | 6680 |
* <p>DESCRIPTION</p>
|
6681 | 6681 |
* <p>The routine glp_get_bhead returns the basis header information for the current basis associated with the specified problem object.</p>
|
6682 | 6682 |
* <p>RETURNS</p>
|
6683 | |
* <p>If xB[k], 1 <= k <= m, is i-th auxiliary variable (1 <= i <= m), the routine returns i. Otherwise, if xB[k] is j-th structural variable (1 <= j <= 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>
|
|
6683 |
* <p>If xB[k], 1 <= k <= m, is i-th auxiliary variable (1 <= i <= m), the routine returns i. Otherwise, if xB[k] is j-th structural variable (1 <= j <= 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>
|
6684 | 6684 |
*/
|
6685 | 6685 |
public";
|
6686 | 6686 |
|
|
6690 | 6690 |
* <p>SYNOPSIS</p>
|
6691 | 6691 |
* <p>int glp_get_row_bind(glp_prob *lp, int i);</p>
|
6692 | 6692 |
* <p>RETURNS</p>
|
6693 | |
* <p>The routine glp_get_row_bind returns the index k of basic variable xB[k], 1 <= k <= m, which is i-th auxiliary variable, 1 <= i <= 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>
|
|
6693 |
* <p>The routine glp_get_row_bind returns the index k of basic variable xB[k], 1 <= k <= m, which is i-th auxiliary variable, 1 <= i <= 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>
|
6694 | 6694 |
*/
|
6695 | 6695 |
public";
|
6696 | 6696 |
|
|
6700 | 6700 |
* <p>SYNOPSIS</p>
|
6701 | 6701 |
* <p>int glp_get_col_bind(glp_prob *lp, int j);</p>
|
6702 | 6702 |
* <p>RETURNS</p>
|
6703 | |
* <p>The routine glp_get_col_bind returns the index k of basic variable xB[k], 1 <= k <= m, which is j-th structural variable, 1 <= j <= 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>
|
|
6703 |
* <p>The routine glp_get_col_bind returns the index k of basic variable xB[k], 1 <= k <= m, which is j-th structural variable, 1 <= j <= 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>
|
6704 | 6704 |
*/
|
6705 | 6705 |
public";
|
6706 | 6706 |
|
|
6763 | 6763 |
* <p>SYNOPSIS</p>
|
6764 | 6764 |
* <p>int glp_eval_tab_row(glp_prob *lp, int k, int ind[], double val[]);</p>
|
6765 | 6765 |
* <p>DESCRIPTION</p>
|
6766 | |
* <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 <= k <= m, x[k] is k-th auxiliary variable; if m+1 <= k <= 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>
|
6767 | |
* <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 <= len <= n is number of non-zeros returned on exit.</p>
|
|
6766 |
* <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 <= k <= m, x[k] is k-th auxiliary variable; if m+1 <= k <= 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>
|
|
6767 |
* <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 <= len <= n is number of non-zeros returned on exit.</p>
|
6768 | 6768 |
* <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>
|
6769 | 6769 |
* <p>The computed row shows how the specified basic variable x[k] = xB[i] depends on non-basic variables:</p>
|
6770 | 6770 |
* <p>xB[i] = alfa[i,1]*xN[1] + alfa[i,2]*xN[2] + ... + alfa[i,n]*xN[n],</p>
|
|
6804 | 6804 |
* <p>SYNOPSIS</p>
|
6805 | 6805 |
* <p>int glp_eval_tab_col(glp_prob *lp, int k, int ind[], double val[]);</p>
|
6806 | 6806 |
* <p>DESCRIPTION</p>
|
6807 | |
* <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 <= k <= m, x[k] is k-th auxiliary variable; if m+1 <= k <= 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>
|
6808 | |
* <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 <= len <= m is number of non-zeros returned on exit.</p>
|
|
6807 |
* <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 <= k <= m, x[k] is k-th auxiliary variable; if m+1 <= k <= 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>
|
|
6808 |
* <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 <= len <= m is number of non-zeros returned on exit.</p>
|
6809 | 6809 |
* <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>
|
6810 | 6810 |
* <p>The computed column shows how basic variables depend on the specified non-basic variable x[k] = xN[j]:</p>
|
6811 | 6811 |
* <p>xB[1] = ... + alfa[1,j]*xN[j] + ... xB[2] = ... + alfa[2,j]*xN[j] + ... . . . . . . xB[m] = ... + alfa[m,j]*xN[j] + ...</p>
|
|
6835 | 6835 |
* <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>
|
6836 | 6836 |
* <p>x = alfa[1]*xN[1] + alfa[2]*xN[2] + ... + alfa[n]*xN[n], (2)</p>
|
6837 | 6837 |
* <p>where xN[j] are non-basic (auxiliary or structural) variables, n is the number of columns in the LP problem object.</p>
|
6838 | |
* <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 <= len' <= 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>
|
|
6838 |
* <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 <= len' <= 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>
|
6839 | 6839 |
* <p>RETURNS</p>
|
6840 | 6840 |
* <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>
|
6841 | 6841 |
* <p>BACKGROUND</p>
|
|
6869 | 6869 |
* <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>
|
6870 | 6870 |
* <p>xB[1] = ... + alfa[1]*x xB[2] = ... + alfa[2]*x (2) . . . . . . xB[m] = ... + alfa[m]*x</p>
|
6871 | 6871 |
* <p>where xB are basic (auxiliary and structural) variables, m is the number of rows in the problem object.</p>
|
6872 | |
* <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 <= len' <= 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>
|
|
6872 |
* <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 <= len' <= 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>
|
6873 | 6873 |
* <p>RETURNS</p>
|
6874 | 6874 |
* <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>
|
6875 | 6875 |
* <p>BACKGROUND</p>
|
|
6894 | 6894 |
* <p>The parameter eps is an absolute tolerance (small positive number) used by the routine to skip small alfa[j] of the row (*).</p>
|
6895 | 6895 |
* <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>
|
6896 | 6896 |
* <p>RETURNS</p>
|
6897 | |
* <p>The routine glp_prim_rtest returns the index piv in the arrays ind and val corresponding to the pivot element chosen, 1 <= piv <= len. If the adjacent basic solution is primal unbounded and therefore the choice cannot be made, the routine returns zero.</p>
|
|
6897 |
* <p>The routine glp_prim_rtest returns the index piv in the arrays ind and val corresponding to the pivot element chosen, 1 <= piv <= len. If the adjacent basic solution is primal unbounded and therefore the choice cannot be made, the routine returns zero.</p>
|
6898 | 6898 |
* <p>COMMENTS</p>
|
6899 | 6899 |
* <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>
|
6900 | 6900 |
*/
|
|
6915 | 6915 |
* <p>The parameter eps is an absolute tolerance (small positive number) used by the routine to skip small alfa[j] of the row (*).</p>
|
6916 | 6916 |
* <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>
|
6917 | 6917 |
* <p>RETURNS</p>
|
6918 | |
* <p>The routine glp_dual_rtest returns the index piv in the arrays ind and val corresponding to the pivot element chosen, 1 <= piv <= len. If the adjacent basic solution is dual unbounded and therefore the choice cannot be made, the routine returns zero.</p>
|
|
6918 |
* <p>The routine glp_dual_rtest returns the index piv in the arrays ind and val corresponding to the pivot element chosen, 1 <= piv <= len. If the adjacent basic solution is dual unbounded and therefore the choice cannot be made, the routine returns zero.</p>
|
6919 | 6919 |
* <p>COMMENTS</p>
|
6920 | 6920 |
* <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>
|
6921 | 6921 |
*/
|
|
6928 | 6928 |
* <p>void glp_analyze_bound(glp_prob *P, int k, double *limit1, int *var1, double *limit2, int *var2);</p>
|
6929 | 6929 |
* <p>DESCRIPTION</p>
|
6930 | 6930 |
* <p>The routine glp_analyze_bound analyzes the effect of varying the active bound of specified non-basic variable.</p>
|
6931 | |
* <p>The non-basic variable is specified by the parameter k, where 1 <= k <= m means auxiliary variable of corresponding row while m+1 <= k <= m+n means structural variable (column).</p>
|
|
6931 |
* <p>The non-basic variable is specified by the parameter k, where 1 <= k <= m means auxiliary variable of corresponding row while m+1 <= k <= m+n means structural variable (column).</p>
|
6932 | 6932 |
* <p>Note that the current basic solution must be optimal, and the basis factorization must exist.</p>
|
6933 | 6933 |
* <p>Results of the analysis have the following meaning.</p>
|
6934 | 6934 |
* <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>
|
|
6945 | 6945 |
* <p>void glp_analyze_coef(glp_prob *P, int k, double *coef1, int *var1, double *value1, double *coef2, int *var2, double *value2);</p>
|
6946 | 6946 |
* <p>DESCRIPTION</p>
|
6947 | 6947 |
* <p>The routine glp_analyze_coef analyzes the effect of varying the objective coefficient at specified basic variable.</p>
|
6948 | |
* <p>The basic variable is specified by the parameter k, where 1 <= k <= m means auxiliary variable of corresponding row while m+1 <= k <= m+n means structural variable (column).</p>
|
|
6948 |
* <p>The basic variable is specified by the parameter k, where 1 <= k <= m means auxiliary variable of corresponding row while m+1 <= k <= m+n means structural variable (column).</p>
|
6949 | 6949 |
* <p>Note that the current basic solution must be optimal, and the basis factorization must exist.</p>
|
6950 | 6950 |
* <p>Results of the analysis have the following meaning.</p>
|
6951 | 6951 |
* <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>
|
|
7562 | 7562 |
* <p>SYNOPSIS</p>
|
7563 | 7563 |
* <p>void glp_del_vertices(glp_graph *G, int ndel, const int num[]);</p>
|
7564 | 7564 |
* <p>DESCRIPTION</p>
|
7565 | |
* <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 > 0.</p>
|
|
7565 |
* <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 > 0.</p>
|
7566 | 7566 |
* <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>
|
7567 | 7567 |
*/
|
7568 | 7568 |
public";
|
|
7836 | 7836 |
* <p>int glp_weak_comp(glp_graph *G, int v_num);</p>
|
7837 | 7837 |
* <p>DESCRIPTION</p>
|
7838 | 7838 |
* <p>The routine glp_weak_comp finds all weakly connected components of the specified graph.</p>
|
7839 | |
* <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 < 0, no component numbers are stored.</p>
|
7840 | |
* <p>The components are numbered in arbitrary order from 1 to nc, where nc is the total number of components found, 0 <= nc <= |V|.</p>
|
|
7839 |
* <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 < 0, no component numbers are stored.</p>
|
|
7840 |
* <p>The components are numbered in arbitrary order from 1 to nc, where nc is the total number of components found, 0 <= nc <= |V|.</p>
|
7841 | 7841 |
* <p>RETURNS</p>
|
7842 | 7842 |
* <p>The routine returns nc, the total number of components found. </p>
|
7843 | 7843 |
*/
|
|
7850 | 7850 |
* <p>int glp_strong_comp(glp_graph *G, int v_num);</p>
|
7851 | 7851 |
* <p>DESCRIPTION</p>
|
7852 | 7852 |
* <p>The routine glp_strong_comp finds all strongly connected components of the specified graph.</p>
|
7853 | |
* <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 < 0, no component numbers are stored.</p>
|
7854 | |
* <p>The components are numbered in arbitrary order from 1 to nc, where nc is the total number of components found, 0 <= nc <= |V|. However, the component numbering has the property that for every arc (i->j) in the graph the condition num(i) >= num(j) holds.</p>
|
|
7853 |
* <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 < 0, no component numbers are stored.</p>
|
|
7854 |
* <p>The components are numbered in arbitrary order from 1 to nc, where nc is the total number of components found, 0 <= nc <= |V|. However, the component numbering has the property that for every arc (i->j) in the graph the condition num(i) >= num(j) holds.</p>
|
7855 | 7855 |
* <p>RETURNS</p>
|
7856 | 7856 |
* <p>The routine returns nc, the total number of components found. </p>
|
7857 | 7857 |
*/
|
|
7874 | 7874 |
* <p>#include \"glplib.h\" void bigmul(int n, int m, unsigned short x[], unsigned short y[]);</p>
|
7875 | 7875 |
* <p>DESCRIPTION</p>
|
7876 | 7876 |
* <p>The routine bigmul multiplies unsigned integer numbers of arbitrary precision.</p>
|
7877 | |
* <p>n is the number of digits of multiplicand, n >= 1;</p>
|
7878 | |
* <p>m is the number of digits of multiplier, m >= 1;</p>
|
|
7877 |
* <p>n is the number of digits of multiplicand, n >= 1;</p>
|
|
7878 |
* <p>m is the number of digits of multiplier, m >= 1;</p>
|
7879 | 7879 |
* <p>x is an array containing digits of the multiplicand in elements x[m], x[m+1], ..., x[n+m-1]. Contents of x[0], x[1], ..., x[m-1] are ignored on entry.</p>
|
7880 | 7880 |
* <p>y is an array containing digits of the multiplier in elements y[0], y[1], ..., y[m-1].</p>
|
7881 | 7881 |
* <p>On exit digits of the product are stored in elements x[0], x[1], ..., x[n+m-1]. The array y is not changed. </p>
|
|
7889 | 7889 |
* <p>#include \"glplib.h\" void bigdiv(int n, int m, unsigned short x[], unsigned short y[]);</p>
|
7890 | 7890 |
* <p>DESCRIPTION</p>
|
7891 | 7891 |
* <p>The routine bigdiv divides one unsigned integer number of arbitrary precision by another with the algorithm described in [1].</p>
|
7892 | |
* <p>n is the difference between the number of digits of dividend and the number of digits of divisor, n >= 0.</p>
|
7893 | |
* <p>m is the number of digits of divisor, m >= 1.</p>
|
|
7892 |
* <p>n is the difference between the number of digits of dividend and the number of digits of divisor, n >= 0.</p>
|
|
7893 |
* <p>m is the number of digits of divisor, m >= 1.</p>
|
7894 | 7894 |
* <p>x is an array containing digits of the dividend in elements x[0], x[1], ..., x[n+m-1].</p>
|
7895 | 7895 |
* <p>y is an array containing digits of the divisor in elements y[0], y[1], ..., y[m-1]. The highest digit y[m-1] must be non-zero.</p>
|
7896 | 7896 |
* <p>On exit n+1 digits of the quotient are stored in elements x[m], x[m+1], ..., x[n+m], and m digits of the remainder are stored in elements x[0], x[1], ..., x[m-1]. The array y is changed but then restored.</p>
|
|
8020 | 8020 |
* <p>RETURNS</p>
|
8021 | 8021 |
* <p>The routine returns a pointer to the character string.</p>
|
8022 | 8022 |
* <p>EXAMPLES</p>
|
8023 | |
* <p>strspx(\" Errare humanum est \") => \"Errarehumanumest\"</p>
|
8024 | |
* <p>strspx(\" \") => \"\" </p>
|
|
8023 |
* <p>strspx(\" Errare humanum est \") => \"Errarehumanumest\"</p>
|
|
8024 |
* <p>strspx(\" \") => \"\" </p>
|
8025 | 8025 |
*/
|
8026 | 8026 |
public";
|
8027 | 8027 |
|
|
8035 | 8035 |
* <p>RETURNS</p>
|
8036 | 8036 |
* <p>The routine returns a pointer to the character string.</p>
|
8037 | 8037 |
* <p>EXAMPLES</p>
|
8038 | |
* <p>strtrim(\"Errare humanum est \") => \"Errare humanum est\"</p>
|
8039 | |
* <p>strtrim(\" \") => \"\" </p>
|
|
8038 |
* <p>strtrim(\"Errare humanum est \") => \"Errare humanum est\"</p>
|
|
8039 |
* <p>strtrim(\" \") => \"\" </p>
|
8040 | 8040 |
*/
|
8041 | 8041 |
public";
|
8042 | 8042 |
|
|
8050 | 8050 |
* <p>RETURNS</p>
|
8051 | 8051 |
* <p>The routine returns the pointer s.</p>
|
8052 | 8052 |
* <p>EXAMPLES</p>
|
8053 | |
* <p>strrev(\"\") => \"\"</p>
|
8054 | |
* <p>strrev(\"Today is Monday\") => \"yadnoM si yadoT\" </p>
|
|
8053 |
* <p>strrev(\"\") => \"\"</p>
|
|
8054 |
* <p>strrev(\"Today is Monday\") => \"yadnoM si yadoT\" </p>
|
8055 | 8055 |
*/
|
8056 | 8056 |
public";
|
8057 | 8057 |
|
|
8075 | 8075 |
* <p>SYNOPSIS</p>
|
8076 | 8076 |
* <p>#include \"glplib.h\" int gcdn(int n, int x[]);</p>
|
8077 | 8077 |
* <p>RETURNS</p>
|
8078 | |
* <p>The routine gcdn returns gcd(x[1], x[2], ..., x[n]), the greatest common divisor of n positive integers given, n > 0.</p>
|
|
8078 |
* <p>The routine gcdn returns gcd(x[1], x[2], ..., x[n]), the greatest common divisor of n positive integers given, n > 0.</p>
|
8079 | 8079 |
* <p>BACKGROUND</p>
|
8080 | 8080 |
* <p>The routine gcdn is based on the following identity:</p>
|
8081 | 8081 |
* <p>gcd(x, y, z) = gcd(gcd(x, y), z).</p>
|
|
8104 | 8104 |
* <p>SYNOPSIS</p>
|
8105 | 8105 |
* <p>#include \"glplib.h\" int lcmn(int n, int x[]);</p>
|
8106 | 8106 |
* <p>RETURNS</p>
|
8107 | |
* <p>The routine lcmn returns lcm(x[1], x[2], ..., x[n]), the least common multiple of n positive integers given, n > 0. In case of integer overflow the routine returns zero.</p>
|
|
8107 |
* <p>The routine lcmn returns lcm(x[1], x[2], ..., x[n]), the least common multiple of n positive integers given, n > 0. In case of integer overflow the routine returns zero.</p>
|
8108 | 8108 |
* <p>BACKGROUND</p>
|
8109 | 8109 |
* <p>The routine lcmn is based on the following identity:</p>
|
8110 | 8110 |
* <p>lcmn(x, y, z) = lcm(lcm(x, y), z),</p>
|
|
8122 | 8122 |
* <p>EXAMPLES</p>
|
8123 | 8123 |
* <p>round2n(10.1) = 2^3 = 8 round2n(15.3) = 2^4 = 16 round2n(0.01) = 2^(-7) = 0.0078125</p>
|
8124 | 8124 |
* <p>BACKGROUND</p>
|
8125 | |
* <p>Let x = f * 2^e, where 0.5 <= f < 1 is a normalized fractional part, e is an integer exponent. Then, obviously, 0.5 * 2^e <= x < 2^e, so if x - 0.5 * 2^e <= 2^e - x, we choose 0.5 * 2^e = 2^(e-1), and 2^e otherwise. The latter condition can be written as 2 * x <= 1.5 * 2^e or 2 * f * 2^e <= 1.5 * 2^e or, finally, f <= 0.75. </p>
|
|
8125 |
* <p>Let x = f * 2^e, where 0.5 <= f < 1 is a normalized fractional part, e is an integer exponent. Then, obviously, 0.5 * 2^e <= x < 2^e, so if x - 0.5 * 2^e <= 2^e - x, we choose 0.5 * 2^e = 2^(e-1), and 2^e otherwise. The latter condition can be written as 2 * x <= 1.5 * 2^e or 2 * f * 2^e <= 1.5 * 2^e or, finally, f <= 0.75. </p>
|
8126 | 8126 |
*/
|
8127 | 8127 |
public";
|
8128 | 8128 |
|
|
8132 | 8132 |
* <p>SYNOPSIS</p>
|
8133 | 8133 |
* <p>#include \"glplib.h\" int fp2rat(double x, double eps, double *p, double *q);</p>
|
8134 | 8134 |
* <p>DESCRIPTION</p>
|
8135 | |
* <p>Given a floating-point number 0 <= x < 1 the routine fp2rat finds its \"best\" rational approximation p / q, where p >= 0 and q > 0 are integer numbers, such that |x - p / q| <= eps.</p>
|
|
8135 |
* <p>Given a floating-point number 0 <= x < 1 the routine fp2rat finds its \"best\" rational approximation p / q, where p >= 0 and q > 0 are integer numbers, such that |x - p / q| <= eps.</p>
|
8136 | 8136 |
* <p>RETURNS</p>
|
8137 | 8137 |
* <p>The routine fp2rat returns the number of iterations used to achieve the specified precision eps.</p>
|
8138 | 8138 |
* <p>EXAMPLES</p>
|
|
8152 | 8152 |
* <p>A[k] = b[k] * A[k-1] + a[k] * A[k-2],</p>
|
8153 | 8153 |
* <p>B[k] = b[k] * B[k-1] + a[k] * B[k-2].</p>
|
8154 | 8154 |
* <p>Once the condition</p>
|
8155 | |
* <p>|x - f[k]| <= eps</p>
|
|
8155 |
* <p>|x - f[k]| <= eps</p>
|
8156 | 8156 |
* <p>has been satisfied, the routine reports p = A[k] and q = B[k] as the final answer.</p>
|
8157 | 8157 |
* <p>In the table below here is some statistics obtained for one million random numbers uniformly distributed in the range [0, 1).</p>
|
8158 | 8158 |
* <p>eps max p mean p max q mean q max k mean k ------------------------------------------------------------- 1e-1 8 1.6 9 3.2 3 1.4 1e-2 98 6.2 99 12.4 5 2.4 1e-3 997 20.7 998 41.5 8 3.4 1e-4 9959 66.6 9960 133.5 10 4.4 1e-5 97403 211.7 97404 424.2 13 5.3 1e-6 479669 669.9 479670 1342.9 15 6.3 1e-7 1579030 2127.3 3962146 4257.8 16 7.3 1e-8 26188823 6749.4 26188824 13503.4 19 8.2</p>
|
|
8170 | 8170 |
* <p>DESCRIPTION</p>
|
8171 | 8171 |
* <p>The routine jday converts a calendar date, Gregorian calendar, to corresponding Julian day number j.</p>
|
8172 | 8172 |
* <p>From the given day d, month m, and year y, the Julian day number j is computed without using tables.</p>
|
8173 | |
* <p>The routine is valid for 1 <= y <= 4000.</p>
|
|
8173 |
* <p>The routine is valid for 1 <= y <= 4000.</p>
|
8174 | 8174 |
* <p>RETURNS</p>
|
8175 | 8175 |
* <p>The routine jday returns the Julian day number, or negative value if the specified date is incorrect.</p>
|
8176 | 8176 |
* <p>REFERENCES</p>
|
|
8186 | 8186 |
* <p>DESCRIPTION</p>
|
8187 | 8187 |
* <p>The routine jdate converts a Julian day number j to corresponding calendar date, Gregorian calendar.</p>
|
8188 | 8188 |
* <p>The day d, month m, and year y are computed without using tables and stored in corresponding locations.</p>
|
8189 | |
* <p>The routine is valid for 1721426 <= j <= 3182395.</p>
|
|
8189 |
* <p>The routine is valid for 1721426 <= j <= 3182395.</p>
|
8190 | 8190 |
* <p>RETURNS</p>
|
8191 | 8191 |
* <p>If the conversion is successful, the routine returns zero, otherwise non-zero.</p>
|
8192 | 8192 |
* <p>REFERENCES</p>
|
|
8201 | 8201 |
* <p>#include \"glplib.h\" void bigmul(int n, int m, unsigned short x[], unsigned short y[]);</p>
|
8202 | 8202 |
* <p>DESCRIPTION</p>
|
8203 | 8203 |
* <p>The routine bigmul multiplies unsigned integer numbers of arbitrary precision.</p>
|
8204 | |
* <p>n is the number of digits of multiplicand, n >= 1;</p>
|
8205 | |
* <p>m is the number of digits of multiplier, m >= 1;</p>
|
|
8204 |
* <p>n is the number of digits of multiplicand, n >= 1;</p>
|
|
8205 |
* <p>m is the number of digits of multiplier, m >= 1;</p>
|
8206 | 8206 |
* <p>x is an array containing digits of the multiplicand in elements x[m], x[m+1], ..., x[n+m-1]. Contents of x[0], x[1], ..., x[m-1] are ignored on entry.</p>
|
8207 | 8207 |
* <p>y is an array containing digits of the multiplier in elements y[0], y[1], ..., y[m-1].</p>
|
8208 | 8208 |
* <p>On exit digits of the product are stored in elements x[0], x[1], ..., x[n+m-1]. The array y is not changed. </p>
|
|
8216 | 8216 |
* <p>#include \"glplib.h\" void bigdiv(int n, int m, unsigned short x[], unsigned short y[]);</p>
|
8217 | 8217 |
* <p>DESCRIPTION</p>
|
8218 | 8218 |
* <p>The routine bigdiv divides one unsigned integer number of arbitrary precision by another with the algorithm described in [1].</p>
|
8219 | |
* <p>n is the difference between the number of digits of dividend and the number of digits of divisor, n >= 0.</p>
|
8220 | |
* <p>m is the number of digits of divisor, m >= 1.</p>
|
|
8219 |
* <p>n is the difference between the number of digits of dividend and the number of digits of divisor, n >= 0.</p>
|
|
8220 |
* <p>m is the number of digits of divisor, m >= 1.</p>
|
8221 | 8221 |
* <p>x is an array containing digits of the dividend in elements x[0], x[1], ..., x[n+m-1].</p>
|
8222 | 8222 |
* <p>y is an array containing digits of the divisor in elements y[0], y[1], ..., y[m-1]. The highest digit y[m-1] must be non-zero.</p>
|
8223 | 8223 |
* <p>On exit n+1 digits of the quotient are stored in elements x[m], x[m+1], ..., x[n+m], and m digits of the remainder are stored in elements x[0], x[1], ..., x[m-1]. The array y is changed but then restored.</p>
|
|
8347 | 8347 |
* <p>RETURNS</p>
|
8348 | 8348 |
* <p>The routine returns a pointer to the character string.</p>
|
8349 | 8349 |
* <p>EXAMPLES</p>
|
8350 | |
* <p>strspx(\" Errare humanum est \") => \"Errarehumanumest\"</p>
|
8351 | |
* <p>strspx(\" \") => \"\" </p>
|
|
8350 |
* <p>strspx(\" Errare humanum est \") => \"Errarehumanumest\"</p>
|
|
8351 |
* <p>strspx(\" \") => \"\" </p>
|
8352 | 8352 |
*/
|
8353 | 8353 |
public";
|
8354 | 8354 |
|
|
8362 | 8362 |
* <p>RETURNS</p>
|
8363 | 8363 |
* <p>The routine returns a pointer to the character string.</p>
|
8364 | 8364 |
* <p>EXAMPLES</p>
|
8365 | |
* <p>strtrim(\"Errare humanum est \") => \"Errare humanum est\"</p>
|
8366 | |
* <p>strtrim(\" \") => \"\" </p>
|
|
8365 |
* <p>strtrim(\"Errare humanum est \") => \"Errare humanum est\"</p>
|
|
8366 |
* <p>strtrim(\" \") => \"\" </p>
|
8367 | 8367 |
*/
|
8368 | 8368 |
public";
|
8369 | 8369 |
|
|
8377 | 8377 |
* <p>RETURNS</p>
|
8378 | 8378 |
* <p>The routine returns the pointer s.</p>
|
8379 | 8379 |
* <p>EXAMPLES</p>
|
8380 | |
* <p>strrev(\"\") => \"\"</p>
|
8381 | |
* <p>strrev(\"Today is Monday\") => \"yadnoM si yadoT\" </p>
|
|
8380 |
* <p>strrev(\"\") => \"\"</p>
|
|
8381 |
* <p>strrev(\"Today is Monday\") => \"yadnoM si yadoT\" </p>
|
8382 | 8382 |
*/
|
8383 | 8383 |
public";
|
8384 | 8384 |
|
|
8402 | 8402 |
* <p>SYNOPSIS</p>
|
8403 | 8403 |
* <p>#include \"glplib.h\" int gcdn(int n, int x[]);</p>
|
8404 | 8404 |
* <p>RETURNS</p>
|
8405 | |
* <p>The routine gcdn returns gcd(x[1], x[2], ..., x[n]), the greatest common divisor of n positive integers given, n > 0.</p>
|
|
8405 |
* <p>The routine gcdn returns gcd(x[1], x[2], ..., x[n]), the greatest common divisor of n positive integers given, n > 0.</p>
|
8406 | 8406 |
* <p>BACKGROUND</p>
|
8407 | 8407 |
* <p>The routine gcdn is based on the following identity:</p>
|
8408 | 8408 |
* <p>gcd(x, y, z) = gcd(gcd(x, y), z).</p>
|
|
8431 | 8431 |
* <p>SYNOPSIS</p>
|
8432 | 8432 |
* <p>#include \"glplib.h\" int lcmn(int n, int x[]);</p>
|
8433 | 8433 |
* <p>RETURNS</p>
|
8434 | |
* <p>The routine lcmn returns lcm(x[1], x[2], ..., x[n]), the least common multiple of n positive integers given, n > 0. In case of integer overflow the routine returns zero.</p>
|
|
8434 |
* <p>The routine lcmn returns lcm(x[1], x[2], ..., x[n]), the least common multiple of n positive integers given, n > 0. In case of integer overflow the routine returns zero.</p>
|
8435 | 8435 |
* <p>BACKGROUND</p>
|
8436 | 8436 |
* <p>The routine lcmn is based on the following identity:</p>
|
8437 | 8437 |
* <p>lcmn(x, y, z) = lcm(lcm(x, y), z),</p>
|
|
8449 | 8449 |
* <p>EXAMPLES</p>
|
8450 | 8450 |
* <p>round2n(10.1) = 2^3 = 8 round2n(15.3) = 2^4 = 16 round2n(0.01) = 2^(-7) = 0.0078125</p>
|
8451 | 8451 |
* <p>BACKGROUND</p>
|
8452 | |
* <p>Let x = f * 2^e, where 0.5 <= f < 1 is a normalized fractional part, e is an integer exponent. Then, obviously, 0.5 * 2^e <= x < 2^e, so if x - 0.5 * 2^e <= 2^e - x, we choose 0.5 * 2^e = 2^(e-1), and 2^e otherwise. The latter condition can be written as 2 * x <= 1.5 * 2^e or 2 * f * 2^e <= 1.5 * 2^e or, finally, f <= 0.75. </p>
|
|
8452 |
* <p>Let x = f * 2^e, where 0.5 <= f < 1 is a normalized fractional part, e is an integer exponent. Then, obviously, 0.5 * 2^e <= x < 2^e, so if x - 0.5 * 2^e <= 2^e - x, we choose 0.5 * 2^e = 2^(e-1), and 2^e otherwise. The latter condition can be written as 2 * x <= 1.5 * 2^e or 2 * f * 2^e <= 1.5 * 2^e or, finally, f <= 0.75. </p>
|
8453 | 8453 |
*/
|
8454 | 8454 |
public";
|
8455 | 8455 |
|
|
8459 | 8459 |
* <p>SYNOPSIS</p>
|
8460 | 8460 |
* <p>#include \"glplib.h\" int fp2rat(double x, double eps, double *p, double *q);</p>
|
8461 | 8461 |
* <p>DESCRIPTION</p>
|
8462 | |
* <p>Given a floating-point number 0 <= x < 1 the routine fp2rat finds its \"best\" rational approximation p / q, where p >= 0 and q > 0 are integer numbers, such that |x - p / q| <= eps.</p>
|
|
8462 |
* <p>Given a floating-point number 0 <= x < 1 the routine fp2rat finds its \"best\" rational approximation p / q, where p >= 0 and q > 0 are integer numbers, such that |x - p / q| <= eps.</p>
|
8463 | 8463 |
* <p>RETURNS</p>
|
8464 | 8464 |
* <p>The routine fp2rat returns the number of iterations used to achieve the specified precision eps.</p>
|
8465 | 8465 |
* <p>EXAMPLES</p>
|
|
8479 | 8479 |
* <p>A[k] = b[k] * A[k-1] + a[k] * A[k-2],</p>
|
8480 | 8480 |
* <p>B[k] = b[k] * B[k-1] + a[k] * B[k-2].</p>
|
8481 | 8481 |
* <p>Once the condition</p>
|
8482 | |
* <p>|x - f[k]| <= eps</p>
|
|
8482 |
* <p>|x - f[k]| <= eps</p>
|
8483 | 8483 |
* <p>has been satisfied, the routine reports p = A[k] and q = B[k] as the final answer.</p>
|
8484 | 8484 |
* <p>In the table below here is some statistics obtained for one million random numbers uniformly distributed in the range [0, 1).</p>
|
8485 | 8485 |
* <p>eps max p mean p max q mean q max k mean k ------------------------------------------------------------- 1e-1 8 1.6 9 3.2 3 1.4 1e-2 98 6.2 99 12.4 5 2.4 1e-3 997 20.7 998 41.5 8 3.4 1e-4 9959 66.6 9960 133.5 10 4.4 1e-5 97403 211.7 97404 424.2 13 5.3 1e-6 479669 669.9 479670 1342.9 15 6.3 1e-7 1579030 2127.3 3962146 4257.8 16 7.3 1e-8 26188823 6749.4 26188824 13503.4 19 8.2</p>
|
|
8497 | 8497 |
* <p>DESCRIPTION</p>
|
8498 | 8498 |
* <p>The routine jday converts a calendar date, Gregorian calendar, to corresponding Julian day number j.</p>
|
8499 | 8499 |
* <p>From the given day d, month m, and year y, the Julian day number j is computed without using tables.</p>
|
8500 | |
* <p>The routine is valid for 1 <= y <= 4000.</p>
|
|
8500 |
* <p>The routine is valid for 1 <= y <= 4000.</p>
|
8501 | 8501 |
* <p>RETURNS</p>
|
8502 | 8502 |
* <p>The routine jday returns the Julian day number, or negative value if the specified date is incorrect.</p>
|
8503 | 8503 |
* <p>REFERENCES</p>
|
|
8513 | 8513 |
* <p>DESCRIPTION</p>
|
8514 | 8514 |
* <p>The routine jdate converts a Julian day number j to corresponding calendar date, Gregorian calendar.</p>
|
8515 | 8515 |
* <p>The day d, month m, and year y are computed without using tables and stored in corresponding locations.</p>
|
8516 | |
* <p>The routine is valid for 1721426 <= j <= 3182395.</p>
|
|
8516 |
* <p>The routine is valid for 1721426 <= j <= 3182395.</p>
|
8517 | 8517 |
* <p>RETURNS</p>
|
8518 | 8518 |
* <p>If the conversion is successful, the routine returns zero, otherwise non-zero.</p>
|
8519 | 8519 |
* <p>REFERENCES</p>
|
|
8541 | 8541 |
* <p>DESCRIPTION</p>
|
8542 | 8542 |
* <p>The routine lpf_factorize computes the factorization of the basis matrix B specified by the routine col.</p>
|
8543 | 8543 |
* <p>The parameter lpf specified the basis factorization data structure created with the routine lpf_create_it.</p>
|
8544 | |
* <p>The parameter m specifies the order of B, m > 0.</p>
|
8545 | |
* <p>The array bh specifies the basis header: bh[j], 1 <= j <= m, is the number of j-th column of B in some original matrix. The array bh is optional and can be specified as NULL.</p>
|
8546 | |
* <p>The formal routine col specifies the matrix B to be factorized. To obtain j-th column of A the routine lpf_factorize calls the routine col with the parameter j (1 <= j <= n). In response the routine col should store row indices and numerical values of non-zero elements of j-th column of B to locations ind[1,...,len] and val[1,...,len], respectively, where len is the number of non-zeros in j-th column returned on exit. Neither zero nor duplicate elements are allowed.</p>
|
|
8544 |
* <p>The parameter m specifies the order of B, m > 0.</p>
|
|
8545 |
* <p>The array bh specifies the basis header: bh[j], 1 <= j <= m, is the number of j-th column of B in some original matrix. The array bh is optional and can be specified as NULL.</p>
|
|
8546 |
* <p>The formal routine col specifies the matrix B to be factorized. To obtain j-th column of A the routine lpf_factorize calls the routine col with the parameter j (1 <= j <= n). In response the routine col should store row indices and numerical values of non-zero elements of j-th column of B to locations ind[1,...,len] and val[1,...,len], respectively, where len is the number of non-zeros in j-th column returned on exit. Neither zero nor duplicate elements are allowed.</p>
|
8547 | 8547 |
* <p>The parameter info is a transit pointer passed to the routine col.</p>
|
8548 | 8548 |
* <p>RETURNS</p>
|
8549 | 8549 |
* <p>0 The factorization has been successfully computed.</p>
|
|
8592 | 8592 |
* <p>1. Compute</p>
|
8593 | 8593 |
* <p>( f ) ( b ) ( ) = P' ( ) ( g ) ( 0 )</p>
|
8594 | 8594 |
* <p>2. Solve the system</p>
|
8595 | |
* <p>( f1 ) ( L0 0 )-1 ( f ) ( L0 0 ) ( f1 ) ( f ) ( ) = ( ) ( ) => ( ) ( ) = ( ) ( g1 ) ( S I ) ( g ) ( S I ) ( g1 ) ( g )</p>
|
|
8595 |
* <p>( f1 ) ( L0 0 )-1 ( f ) ( L0 0 ) ( f1 ) ( f ) ( ) = ( ) ( ) => ( ) ( ) = ( ) ( g1 ) ( S I ) ( g ) ( S I ) ( g1 ) ( g )</p>
|
8596 | 8596 |
* <p>from which it follows that:</p>
|
8597 | |
* <p>{ L0 * f1 = f f1 = inv(L0) * f { => { S * f1 + g1 = g g1 = g - S * f1</p>
|
|
8597 |
* <p>{ L0 * f1 = f f1 = inv(L0) * f { => { S * f1 + g1 = g g1 = g - S * f1</p>
|
8598 | 8598 |
* <p>3. Solve the system</p>
|
8599 | |
* <p>( f2 ) ( U0 R )-1 ( f1 ) ( U0 R ) ( f2 ) ( f1 ) ( ) = ( ) ( ) => ( ) ( ) = ( ) ( g2 ) ( 0 C ) ( g1 ) ( 0 C ) ( g2 ) ( g1 )</p>
|
|
8599 |
* <p>( f2 ) ( U0 R )-1 ( f1 ) ( U0 R ) ( f2 ) ( f1 ) ( ) = ( ) ( ) => ( ) ( ) = ( ) ( g2 ) ( 0 C ) ( g1 ) ( 0 C ) ( g2 ) ( g1 )</p>
|
8600 | 8600 |
* <p>from which it follows that:</p>
|
8601 | |
* <p>{ U0 * f2 + R * g2 = f1 f2 = inv(U0) * (f1 - R * g2) { => { C * g2 = g1 g2 = inv(C) * g1</p>
|
|
8601 |
* <p>{ U0 * f2 + R * g2 = f1 f2 = inv(U0) * (f1 - R * g2) { => { C * g2 = g1 g2 = inv(C) * g1</p>
|
8602 | 8602 |
* <p>4. Compute</p>
|
8603 | 8603 |
* <p>( x ) ( f2 ) ( ) = Q' ( ) ( y ) ( g2 ) </p>
|
8604 | 8604 |
*/
|
|
8625 | 8625 |
* <p>1. Compute</p>
|
8626 | 8626 |
* <p>( f ) ( b ) ( ) = Q ( ) ( g ) ( 0 )</p>
|
8627 | 8627 |
* <p>2. Solve the system</p>
|
8628 | |
* <p>( f1 ) ( U'0 0 )-1 ( f ) ( U'0 0 ) ( f1 ) ( f ) ( ) = ( ) ( ) => ( ) ( ) = ( ) ( g1 ) ( R' C') ( g ) ( R' C') ( g1 ) ( g )</p>
|
|
8628 |
* <p>( f1 ) ( U'0 0 )-1 ( f ) ( U'0 0 ) ( f1 ) ( f ) ( ) = ( ) ( ) => ( ) ( ) = ( ) ( g1 ) ( R' C') ( g ) ( R' C') ( g1 ) ( g )</p>
|
8629 | 8629 |
* <p>from which it follows that:</p>
|
8630 | |
* <p>{ U'0 * f1 = f f1 = inv(U'0) * f { => { R' * f1 + C' * g1 = g g1 = inv(C') * (g - R' * f1)</p>
|
|
8630 |
* <p>{ U'0 * f1 = f f1 = inv(U'0) * f { => { R' * f1 + C' * g1 = g g1 = inv(C') * (g - R' * f1)</p>
|
8631 | 8631 |
* <p>3. Solve the system</p>
|
8632 | |
* <p>( f2 ) ( L'0 S')-1 ( f1 ) ( L'0 S') ( f2 ) ( f1 ) ( ) = ( ) ( ) => ( ) ( ) = ( ) ( g2 ) ( 0 I ) ( g1 ) ( 0 I ) ( g2 ) ( g1 )</p>
|
|
8632 |
* <p>( f2 ) ( L'0 S')-1 ( f1 ) ( L'0 S') ( f2 ) ( f1 ) ( ) = ( ) ( ) => ( ) ( ) = ( ) ( g2 ) ( 0 I ) ( g1 ) ( 0 I ) ( g2 ) ( g1 )</p>
|
8633 | 8633 |
* <p>from which it follows that:</p>
|
8634 | |
* <p>{ L'0 * f2 + S' * g2 = f1 { => f2 = inv(L'0) * ( f1 - S' * g2) { g2 = g1</p>
|
|
8634 |
* <p>{ L'0 * f2 + S' * g2 = f1 { => f2 = inv(L'0) * ( f1 - S' * g2) { g2 = g1</p>
|
8635 | 8635 |
* <p>4. Compute</p>
|
8636 | 8636 |
* <p>( x ) ( f2 ) ( ) = P ( ) ( y ) ( g2 ) </p>
|
8637 | 8637 |
*/
|
|
8649 | 8649 |
* <p>#include \"glplpf.h\" int lpf_update_it(LPF *lpf, int j, int bh, int len, const int ind[], const double val[]);</p>
|
8650 | 8650 |
* <p>DESCRIPTION</p>
|
8651 | 8651 |
* <p>The routine lpf_update_it updates the factorization of the basis matrix B after replacing its j-th column by a new vector.</p>
|
8652 | |
* <p>The parameter j specifies the number of column of B, which has been replaced, 1 <= j <= m, where m is the order of B.</p>
|
|
8652 |
* <p>The parameter j specifies the number of column of B, which has been replaced, 1 <= j <= m, where m is the order of B.</p>
|
8653 | 8653 |
* <p>The parameter bh specifies the basis header entry for the new column of B, which is the number of the new column in some original matrix. This parameter is optional and can be specified as 0.</p>
|
8654 | 8654 |
* <p>Row indices and numerical values of non-zero elements of the new column of B should be placed in locations ind[1], ..., ind[len] and val[1], ..., val[len], resp., where len is the number of non-zeros in the column. Neither zero nor duplicate elements are allowed.</p>
|
8655 | 8655 |
* <p>RETURNS</p>
|
|
8658 | 8658 |
* <p>LPF_ELIMIT Maximal number of additional rows and columns has been reached.</p>
|
8659 | 8659 |
* <p>BACKGROUND</p>
|
8660 | 8660 |
* <p>Let j-th column of the current basis matrix B have to be replaced by a new column a. This replacement is equivalent to removing the old j-th column by fixing it at zero and introducing the new column as follows:</p>
|
8661 | |
* <p>( B F^| a ) ( B F^) ( | ) ( ) ---> ( G^ H^| 0 ) ( G^ H^) (-------+---) ( e'j 0 | 0 )</p>
|
|
8661 |
* <p>( B F^| a ) ( B F^) ( | ) ( ) ---> ( G^ H^| 0 ) ( G^ H^) (-------+---) ( e'j 0 | 0 )</p>
|
8662 | 8662 |
* <p>where ej is a unit vector with 1 in j-th position which used to fix the old j-th column of B (at zero). Then using the main equality we have:</p>
|
8663 | 8663 |
* <p>( B F^| a ) ( B0 F | f ) ( | ) ( P 0 ) ( | ) ( Q 0 ) ( G^ H^| 0 ) = ( ) ( G H | g ) ( ) = (-------+---) ( 0 1 ) (-------+---) ( 0 1 ) ( e'j 0 | 0 ) ( v' w'| 0 )</p>
|
8664 | 8664 |
* <p>[ ( B0 F )| ( f ) ] [ ( B0 F ) | ( f ) ] [ P ( )| P ( ) ] ( Q 0 ) [ P ( ) Q| P ( ) ] = [ ( G H )| ( g ) ] ( ) = [ ( G H ) | ( g ) ] [------------+-------- ] ( 0 1 ) [-------------+---------] [ ( v' w')| 0 ] [ ( v' w') Q| 0 ]</p>
|
8665 | 8665 |
* <p>where:</p>
|
8666 | |
* <p>( a ) ( f ) ( f ) ( a ) ( ) = P ( ) => ( ) = P' * ( ) ( 0 ) ( g ) ( g ) ( 0 )</p>
|
8667 | |
* <p>( ej ) ( v ) ( v ) ( ej ) ( e'j 0 ) = ( v' w' ) Q => ( ) = Q' ( ) => ( ) = Q ( ) ( 0 ) ( w ) ( w ) ( 0 )</p>
|
|
8666 |
* <p>( a ) ( f ) ( f ) ( a ) ( ) = P ( ) => ( ) = P' * ( ) ( 0 ) ( g ) ( g ) ( 0 )</p>
|
|
8667 |
* <p>( ej ) ( v ) ( v ) ( ej ) ( e'j 0 ) = ( v' w' ) Q => ( ) = Q' ( ) => ( ) = Q ( ) ( 0 ) ( w ) ( w ) ( 0 )</p>
|
8668 | 8668 |
* <p>On the other hand:</p>
|
8669 | 8669 |
* <p>( B0| F f ) ( P 0 ) (---+------) ( Q 0 ) ( B0 new F ) ( ) ( G | H g ) ( ) = new P ( ) new Q ( 0 1 ) ( | ) ( 0 1 ) ( new G new H ) ( v'| w' 0 )</p>
|
8670 | 8670 |
* <p>where: ( G ) ( H g ) new F = ( F f ), new G = ( ), new H = ( ), ( v') ( w' 0 )</p>
|
|
8672 | 8672 |
* <p>The factorization structure for the new augmented matrix remains the same, therefore:</p>
|
8673 | 8673 |
* <p>( B0 new F ) ( L0 0 ) ( U0 new R ) new P ( ) new Q = ( ) ( ) ( new G new H ) ( new S I ) ( 0 new C )</p>
|
8674 | 8674 |
* <p>where:</p>
|
8675 | |
* <p>new F = L0 * new R =></p>
|
|
8675 |
* <p>new F = L0 * new R =></p>
|
8676 | 8676 |
* <p>new R = inv(L0) * new F = inv(L0) * (F f) = ( R inv(L0)*f )</p>
|
8677 | |
* <p>new G = new S * U0 =></p>
|
|
8677 |
* <p>new G = new S * U0 =></p>
|
8678 | 8678 |
* <p>( G ) ( S ) new S = new G * inv(U0) = ( ) * inv(U0) = ( ) ( v') ( v'*inv(U0) )</p>
|
8679 | |
* <p>new H = new S * new R + new C =></p>
|
|
8679 |
* <p>new H = new S * new R + new C =></p>
|
8680 | 8680 |
* <p>new C = new H - new S * new R =</p>
|
8681 | 8681 |
* <p>( H g ) ( S ) = ( ) - ( ) * ( R inv(L0)*f ) = ( w' 0 ) ( v'*inv(U0) )</p>
|
8682 | 8682 |
* <p>( H - S*R g - S*inv(L0)*f ) ( C x ) = ( ) = ( ) ( w'- v'*inv(U0)*R -v'*inv(U0)*inv(L0)*f) ( y' z )</p>
|
|
8720 | 8720 |
* <p>DESCRIPTION</p>
|
8721 | 8721 |
* <p>The routine lpf_factorize computes the factorization of the basis matrix B specified by the routine col.</p>
|
8722 | 8722 |
* <p>The parameter lpf specified the basis factorization data structure created with the routine lpf_create_it.</p>
|
8723 | |
* <p>The parameter m specifies the order of B, m > 0.</p>
|
8724 | |
* <p>The array bh specifies the basis header: bh[j], 1 <= j <= m, is the number of j-th column of B in some original matrix. The array bh is optional and can be specified as NULL.</p>
|
8725 | |
* <p>The formal routine col specifies the matrix B to be factorized. To obtain j-th column of A the routine lpf_factorize calls the routine col with the parameter j (1 <= j <= n). In response the routine col should store row indices and numerical values of non-zero elements of j-th column of B to locations ind[1,...,len] and val[1,...,len], respectively, where len is the number of non-zeros in j-th column returned on exit. Neither zero nor duplicate elements are allowed.</p>
|
|
8723 |
* <p>The parameter m specifies the order of B, m > 0.</p>
|
|
8724 |
* <p>The array bh specifies the basis header: bh[j], 1 <= j <= m, is the number of j-th column of B in some original matrix. The array bh is optional and can be specified as NULL.</p>
|
|
8725 |
* <p>The formal routine col specifies the matrix B to be factorized. To obtain j-th column of A the routine lpf_factorize calls the routine col with the parameter j (1 <= j <= n). In response the routine col should store row indices and numerical values of non-zero elements of j-th column of B to locations ind[1,...,len] and val[1,...,len], respectively, where len is the number of non-zeros in j-th column returned on exit. Neither zero nor duplicate elements are allowed.</p>
|
8726 | 8726 |
* <p>The parameter info is a transit pointer passed to the routine col.</p>
|
8727 | 8727 |
* <p>RETURNS</p>
|
8728 | 8728 |
* <p>0 The factorization has been successfully computed.</p>
|
|
8751 | 8751 |
* <p>1. Compute</p>
|
8752 | 8752 |
* <p>( f ) ( b ) ( ) = P' ( ) ( g ) ( 0 )</p>
|
8753 | 8753 |
* <p>2. Solve the system</p>
|
8754 | |
* <p>( f1 ) ( L0 0 )-1 ( f ) ( L0 0 ) ( f1 ) ( f ) ( ) = ( ) ( ) => ( ) ( ) = ( ) ( g1 ) ( S I ) ( g ) ( S I ) ( g1 ) ( g )</p>
|
|
8754 |
* <p>( f1 ) ( L0 0 )-1 ( f ) ( L0 0 ) ( f1 ) ( f ) ( ) = ( ) ( ) => ( ) ( ) = ( ) ( g1 ) ( S I ) ( g ) ( S I ) ( g1 ) ( g )</p>
|
8755 | 8755 |
* <p>from which it follows that:</p>
|
8756 | |
* <p>{ L0 * f1 = f f1 = inv(L0) * f { => { S * f1 + g1 = g g1 = g - S * f1</p>
|
|
8756 |
* <p>{ L0 * f1 = f f1 = inv(L0) * f { => { S * f1 + g1 = g g1 = g - S * f1</p>
|
8757 | 8757 |
* <p>3. Solve the system</p>
|
8758 | |
* <p>( f2 ) ( U0 R )-1 ( f1 ) ( U0 R ) ( f2 ) ( f1 ) ( ) = ( ) ( ) => ( ) ( ) = ( ) ( g2 ) ( 0 C ) ( g1 ) ( 0 C ) ( g2 ) ( g1 )</p>
|
|
8758 |
* <p>( f2 ) ( U0 R )-1 ( f1 ) ( U0 R ) ( f2 ) ( f1 ) ( ) = ( ) ( ) => ( ) ( ) = ( ) ( g2 ) ( 0 C ) ( g1 ) ( 0 C ) ( g2 ) ( g1 )</p>
|
8759 | 8759 |
* <p>from which it follows that:</p>
|
8760 | |
* <p>{ U0 * f2 + R * g2 = f1 f2 = inv(U0) * (f1 - R * g2) { => { C * g2 = g1 g2 = inv(C) * g1</p>
|
|
8760 |
* <p>{ U0 * f2 + R * g2 = f1 f2 = inv(U0) * (f1 - R * g2) { => { C * g2 = g1 g2 = inv(C) * g1</p>
|
8761 | 8761 |
* <p>4. Compute</p>
|
8762 | 8762 |
* <p>( x ) ( f2 ) ( ) = Q' ( ) ( y ) ( g2 ) </p>
|
8763 | 8763 |
*/
|
|
8784 | 8784 |
* <p>1. Compute</p>
|
8785 | 8785 |
* <p>( f ) ( b ) ( ) = Q ( ) ( g ) ( 0 )</p>
|
8786 | 8786 |
* <p>2. Solve the system</p>
|
8787 | |
* <p>( f1 ) ( U'0 0 )-1 ( f ) ( U'0 0 ) ( f1 ) ( f ) ( ) = ( ) ( ) => ( ) ( ) = ( ) ( g1 ) ( R' C') ( g ) ( R' C') ( g1 ) ( g )</p>
|
|
8787 |
* <p>( f1 ) ( U'0 0 )-1 ( f ) ( U'0 0 ) ( f1 ) ( f ) ( ) = ( ) ( ) => ( ) ( ) = ( ) ( g1 ) ( R' C') ( g ) ( R' C') ( g1 ) ( g )</p>
|
8788 | 8788 |
* <p>from which it follows that:</p>
|
8789 | |
* <p>{ U'0 * f1 = f f1 = inv(U'0) * f { => { R' * f1 + C' * g1 = g g1 = inv(C') * (g - R' * f1)</p>
|
|
8789 |
* <p>{ U'0 * f1 = f f1 = inv(U'0) * f { => { R' * f1 + C' * g1 = g g1 = inv(C') * (g - R' * f1)</p>
|
8790 | 8790 |
* <p>3. Solve the system</p>
|
8791 | |
* <p>( f2 ) ( L'0 S')-1 ( f1 ) ( L'0 S') ( f2 ) ( f1 ) ( ) = ( ) ( ) => ( ) ( ) = ( ) ( g2 ) ( 0 I ) ( g1 ) ( 0 I ) ( g2 ) ( g1 )</p>
|
|
8791 |
* <p>( f2 ) ( L'0 S')-1 ( f1 ) ( L'0 S') ( f2 ) ( f1 ) ( ) = ( ) ( ) => ( ) ( ) = ( ) ( g2 ) ( 0 I ) ( g1 ) ( 0 I ) ( g2 ) ( g1 )</p>
|
8792 | 8792 |
* <p>from which it follows that:</p>
|
8793 | |
* <p>{ L'0 * f2 + S' * g2 = f1 { => f2 = inv(L'0) * ( f1 - S' * g2) { g2 = g1</p>
|
|
8793 |
* <p>{ L'0 * f2 + S' * g2 = f1 { => f2 = inv(L'0) * ( f1 - S' * g2) { g2 = g1</p>
|
8794 | 8794 |
* <p>4. Compute</p>
|
8795 | 8795 |
* <p>( x ) ( f2 ) ( ) = P ( ) ( y ) ( g2 ) </p>
|
8796 | 8796 |
*/
|
|
8803 | 8803 |
* <p>#include \"glplpf.h\" int lpf_update_it(LPF *lpf, int j, int bh, int len, const int ind[], const double val[]);</p>
|
8804 | 8804 |
* <p>DESCRIPTION</p>
|
8805 | 8805 |
* <p>The routine lpf_update_it updates the factorization of the basis matrix B after replacing its j-th column by a new vector.</p>
|
8806 | |
* <p>The parameter j specifies the number of column of B, which has been replaced, 1 <= j <= m, where m is the order of B.</p>
|
|
8806 |
* <p>The parameter j specifies the number of column of B, which has been replaced, 1 <= j <= m, where m is the order of B.</p>
|
8807 | 8807 |
* <p>The parameter bh specifies the basis header entry for the new column of B, which is the number of the new column in some original matrix. This parameter is optional and can be specified as 0.</p>
|
8808 | 8808 |
* <p>Row indices and numerical values of non-zero elements of the new column of B should be placed in locations ind[1], ..., ind[len] and val[1], ..., val[len], resp., where len is the number of non-zeros in the column. Neither zero nor duplicate elements are allowed.</p>
|
8809 | 8809 |
* <p>RETURNS</p>
|
|
8812 | 8812 |
* <p>LPF_ELIMIT Maximal number of additional rows and columns has been reached.</p>
|
8813 | 8813 |
* <p>BACKGROUND</p>
|
8814 | 8814 |
* <p>Let j-th column of the current basis matrix B have to be replaced by a new column a. This replacement is equivalent to removing the old j-th column by fixing it at zero and introducing the new column as follows:</p>
|
8815 | |
* <p>( B F^| a ) ( B F^) ( | ) ( ) ---> ( G^ H^| 0 ) ( G^ H^) (-------+---) ( e'j 0 | 0 )</p>
|
|
8815 |
* <p>( B F^| a ) ( B F^) ( | ) ( ) ---> ( G^ H^| 0 ) ( G^ H^) (-------+---) ( e'j 0 | 0 )</p>
|
8816 | 8816 |
* <p>where ej is a unit vector with 1 in j-th position which used to fix the old j-th column of B (at zero). Then using the main equality we have:</p>
|
8817 | 8817 |
* <p>( B F^| a ) ( B0 F | f ) ( | ) ( P 0 ) ( | ) ( Q 0 ) ( G^ H^| 0 ) = ( ) ( G H | g ) ( ) = (-------+---) ( 0 1 ) (-------+---) ( 0 1 ) ( e'j 0 | 0 ) ( v' w'| 0 )</p>
|
8818 | 8818 |
* <p>[ ( B0 F )| ( f ) ] [ ( B0 F ) | ( f ) ] [ P ( )| P ( ) ] ( Q 0 ) [ P ( ) Q| P ( ) ] = [ ( G H )| ( g ) ] ( ) = [ ( G H ) | ( g ) ] [------------+-------- ] ( 0 1 ) [-------------+---------] [ ( v' w')| 0 ] [ ( v' w') Q| 0 ]</p>
|
8819 | 8819 |
* <p>where:</p>
|
8820 | |
* <p>( a ) ( f ) ( f ) ( a ) ( ) = P ( ) => ( ) = P' * ( ) ( 0 ) ( g ) ( g ) ( 0 )</p>
|
8821 | |
* <p>( ej ) ( v ) ( v ) ( ej ) ( e'j 0 ) = ( v' w' ) Q => ( ) = Q' ( ) => ( ) = Q ( ) ( 0 ) ( w ) ( w ) ( 0 )</p>
|
|
8820 |
* <p>( a ) ( f ) ( f ) ( a ) ( ) = P ( ) => ( ) = P' * ( ) ( 0 ) ( g ) ( g ) ( 0 )</p>
|
|
8821 |
* <p>( ej ) ( v ) ( v ) ( ej ) ( e'j 0 ) = ( v' w' ) Q => ( ) = Q' ( ) => ( ) = Q ( ) ( 0 ) ( w ) ( w ) ( 0 )</p>
|
8822 | 8822 |
* <p>On the other hand:</p>
|
8823 | 8823 |
* <p>( B0| F f ) ( P 0 ) (---+------) ( Q 0 ) ( B0 new F ) ( ) ( G | H g ) ( ) = new P ( ) new Q ( 0 1 ) ( | ) ( 0 1 ) ( new G new H ) ( v'| w' 0 )</p>
|
8824 | 8824 |
* <p>where: ( G ) ( H g ) new F = ( F f ), new G = ( ), new H = ( ), ( v') ( w' 0 )</p>
|
|
8826 | 8826 |
* <p>The factorization structure for the new augmented matrix remains the same, therefore:</p>
|
8827 | 8827 |
* <p>( B0 new F ) ( L0 0 ) ( U0 new R ) new P ( ) new Q = ( ) ( ) ( new G new H ) ( new S I ) ( 0 new C )</p>
|
8828 | 8828 |
* <p>where:</p>
|
8829 | |
* <p>new F = L0 * new R =></p>
|
|
8829 |
* <p>new F = L0 * new R =></p>
|
8830 | 8830 |
* <p>new R = inv(L0) * new F = inv(L0) * (F f) = ( R inv(L0)*f )</p>
|
8831 | |
* <p>new G = new S * U0 =></p>
|
|
8831 |
* <p>new G = new S * U0 =></p>
|
8832 | 8832 |
* <p>( G ) ( S ) new S = new G * inv(U0) = ( ) * inv(U0) = ( ) ( v') ( v'*inv(U0) )</p>
|
8833 | |
* <p>new H = new S * new R + new C =></p>
|
|
8833 |
* <p>new H = new S * new R + new C =></p>
|
8834 | 8834 |
* <p>new C = new H - new S * new R =</p>
|
8835 | 8835 |
* <p>( H g ) ( S ) = ( ) - ( ) * ( R inv(L0)*f ) = ( w' 0 ) ( v'*inv(U0) )</p>
|
8836 | 8836 |
* <p>( H - S*R g - S*inv(L0)*f ) ( C x ) = ( ) = ( ) ( w'- v'*inv(U0)*R -v'*inv(U0)*inv(L0)*f) ( y' z )</p>
|
|
10004 | 10004 |
* <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>
|
10005 | 10005 |
* <p>If the parameter d_stat is NULL, the current status of dual basic solution remains unchanged.</p>
|
10006 | 10006 |
* <p>The parameter obj_val is a pointer to the objective function value. If it is NULL, the current value of the objective function remains unchanged.</p>
|
10007 | |
* <p>The array element r_stat[i], 1 <= i <= m (where m is the number of rows in the problem object), specifies the status of i-th auxiliary variable, which should be specified as follows:</p>
|
|
10007 |
* <p>The array element r_stat[i], 1 <= i <= m (where m is the number of rows in the problem object), specifies the status of i-th auxiliary variable, which should be specified as follows:</p>
|
10008 | 10008 |
* <p>GLP_BS - basic variable; GLP_NL - non-basic variable on lower bound; GLP_NU - non-basic variable on upper bound; GLP_NF - non-basic free variable; GLP_NS - non-basic fixed variable.</p>
|
10009 | 10009 |
* <p>If the parameter r_stat is NULL, the current statuses of auxiliary variables remain unchanged.</p>
|
10010 | |
* <p>The array element r_prim[i], 1 <= i <= m (where m is the number of rows in the problem object), specifies a primal value of i-th auxiliary variable. If the parameter r_prim is NULL, the current primal values of auxiliary variables remain unchanged.</p>
|
10011 | |
* <p>The array element r_dual[i], 1 <= i <= m (where m is the number of rows in the problem object), specifies a dual value (reduced cost) of i-th auxiliary variable. If the parameter r_dual is NULL, the current dual values of auxiliary variables remain unchanged.</p>
|
10012 | |
* <p>The array element c_stat[j], 1 <= j <= n (where n is the number of columns in the problem object), specifies the status of j-th structural variable, which should be specified as follows:</p>
|
|
10010 |
* <p>The array element r_prim[i], 1 <= i <= m (where m is the number of rows in the problem object), specifies a primal value of i-th auxiliary variable. If the parameter r_prim is NULL, the current primal values of auxiliary variables remain unchanged.</p>
|
|
10011 |
* <p>The array element r_dual[i], 1 <= i <= m (where m is the number of rows in the problem object), specifies a dual value (reduced cost) of i-th auxiliary variable. If the parameter r_dual is NULL, the current dual values of auxiliary variables remain unchanged.</p>
|
|
10012 |
* <p>The array element c_stat[j], 1 <= j <= n (where n is the number of columns in the problem object), specifies the status of j-th structural variable, which should be specified as follows:</p>
|
10013 | 10013 |
* <p>GLP_BS - basic variable; GLP_NL - non-basic variable on lower bound; GLP_NU - non-basic variable on upper bound; GLP_NF - non-basic free variable; GLP_NS - non-basic fixed variable.</p>
|
10014 | 10014 |
* <p>If the parameter c_stat is NULL, the current statuses of structural variables remain unchanged.</p>
|
10015 | |
* <p>The array element c_prim[j], 1 <= j <= n (where n is the number of columns in the problem object), specifies a primal value of j-th structural variable. If the parameter c_prim is NULL, the current primal values of structural variables remain unchanged.</p>
|
10016 | |
* <p>The array element c_dual[j], 1 <= j <= n (where n is the number of columns in the problem object), specifies a dual value (reduced cost) of j-th structural variable. If the parameter c_dual is NULL, the current dual values of structural variables remain unchanged. </p>
|
|
10015 |
* <p>The array element c_prim[j], 1 <= j <= n (where n is the number of columns in the problem object), specifies a primal value of j-th structural variable. If the parameter c_prim is NULL, the current primal values of structural variables remain unchanged.</p>
|
|
10016 |
* <p>The array element c_dual[j], 1 <= j <= n (where n is the number of columns in the problem object), specifies a dual value (reduced cost) of j-th structural variable. If the parameter c_dual is NULL, the current dual values of structural variables remain unchanged. </p>
|
10017 | 10017 |
*/
|
10018 | 10018 |
public";
|
10019 | 10019 |
|
|
10114 | 10114 |
* <p>DESCRIPTION</p>
|
10115 | 10115 |
* <p>The routine luf_factorize computes LU-factorization of a specified square matrix A.</p>
|
10116 | 10116 |
* <p>The parameter luf specifies LU-factorization program object created by the routine luf_create_it.</p>
|
10117 | |
* <p>The parameter n specifies the order of A, n > 0.</p>
|
10118 | |
* <p>The formal routine col specifies the matrix A to be factorized. To obtain j-th column of A the routine luf_factorize calls the routine col with the parameter j (1 <= j <= n). In response the routine col should store row indices and numerical values of non-zero elements of j-th column of A to locations ind[1,...,len] and val[1,...,len], respectively, where len is the number of non-zeros in j-th column returned on exit. Neither zero nor duplicate elements are allowed.</p>
|
|
10117 |
* <p>The parameter n specifies the order of A, n > 0.</p>
|
|
10118 |
* <p>The formal routine col specifies the matrix A to be factorized. To obtain j-th column of A the routine luf_factorize calls the routine col with the parameter j (1 <= j <= n). In response the routine col should store row indices and numerical values of non-zero elements of j-th column of A to locations ind[1,...,len] and val[1,...,len], respectively, where len is the number of non-zeros in j-th column returned on exit. Neither zero nor duplicate elements are allowed.</p>
|
10119 | 10119 |
* <p>The parameter info is a transit pointer passed to the routine col.</p>
|
10120 | 10120 |
* <p>RETURNS</p>
|
10121 | 10121 |
* <p>0 LU-factorization has been successfully computed.</p>
|
|
10125 | 10125 |
* <p>In case of non-zero return code the factorization becomes invalid. It should not be used in other operations until the cause of failure has been eliminated and the factorization has been recomputed again with the routine luf_factorize.</p>
|
10126 | 10126 |
* <p>REPAIRING SINGULAR MATRIX</p>
|
10127 | 10127 |
* <p>If the routine luf_factorize returns non-zero code, it provides all necessary information that can be used for \"repairing\" the matrix A, where \"repairing\" means replacing linearly dependent columns of the matrix A by appropriate columns of the unity matrix. This feature is needed when this routine is used for factorizing the basis matrix within the simplex method procedure.</p>
|
10128 | |
* <p>On exit linearly dependent columns of the (partially transformed) matrix U have numbers rank+1, rank+2, ..., n, where rank is estimated rank of the matrix A stored by the routine to the member luf->rank. The correspondence between columns of A and U is the same as between columns of V and U. Thus, linearly dependent columns of the matrix A have numbers qq_col[rank+1], qq_col[rank+2], ..., qq_col[n], where qq_col is the column-like representation of the permutation matrix Q. It is understood that each j-th linearly dependent column of the matrix U should be replaced by the unity vector, where all elements are zero except the unity diagonal element u[j,j]. On the other hand j-th row of the matrix U corresponds to the row of the matrix V (and therefore of the matrix A) with the number pp_row[j], where pp_row is the row-like representation of the permutation matrix P. Thus, each j-th linearly dependent column of the matrix U should be replaced by column of the unity matrix with the number pp_row[j].</p>
|
|
10128 |
* <p>On exit linearly dependent columns of the (partially transformed) matrix U have numbers rank+1, rank+2, ..., n, where rank is estimated rank of the matrix A stored by the routine to the member luf->rank. The correspondence between columns of A and U is the same as between columns of V and U. Thus, linearly dependent columns of the matrix A have numbers qq_col[rank+1], qq_col[rank+2], ..., qq_col[n], where qq_col is the column-like representation of the permutation matrix Q. It is understood that each j-th linearly dependent column of the matrix U should be replaced by the unity vector, where all elements are zero except the unity diagonal element u[j,j]. On the other hand j-th row of the matrix U corresponds to the row of the matrix V (and therefore of the matrix A) with the number pp_row[j], where pp_row is the row-like representation of the permutation matrix P. Thus, each j-th linearly dependent column of the matrix U should be replaced by column of the unity matrix with the number pp_row[j].</p>
|
10129 | 10129 |
* <p>The code that repairs the matrix A may look like follows:</p>
|
10130 | |
* <p>for (j = rank+1; j <= n; j++) { replace the column qq_col[j] of the matrix A by the column pp_row[j] of the unity matrix; }</p>
|
|
10130 |
* <p>for (j = rank+1; j <= n; j++) { replace the column qq_col[j] of the matrix A by the column pp_row[j] of the unity matrix; }</p>
|
10131 | 10131 |
* <p>where rank, pp_row, and qq_col are members of the structure LUF. </p>
|
10132 | 10132 |
*/
|
10133 | 10133 |
public";
|
|
10232 | 10232 |
* <p>DESCRIPTION</p>
|
10233 | 10233 |
* <p>The routine luf_factorize computes LU-factorization of a specified square matrix A.</p>
|
10234 | 10234 |
* <p>The parameter luf specifies LU-factorization program object created by the routine luf_create_it.</p>
|
10235 | |
* <p>The parameter n specifies the order of A, n > 0.</p>
|
10236 | |
* <p>The formal routine col specifies the matrix A to be factorized. To obtain j-th column of A the routine luf_factorize calls the routine col with the parameter j (1 <= j <= n). In response the routine col should store row indices and numerical values of non-zero elements of j-th column of A to locations ind[1,...,len] and val[1,...,len], respectively, where len is the number of non-zeros in j-th column returned on exit. Neither zero nor duplicate elements are allowed.</p>
|
|
10235 |
* <p>The parameter n specifies the order of A, n > 0.</p>
|
|
10236 |
* <p>The formal routine col specifies the matrix A to be factorized. To obtain j-th column of A the routine luf_factorize calls the routine col with the parameter j (1 <= j <= n). In response the routine col should store row indices and numerical values of non-zero elements of j-th column of A to locations ind[1,...,len] and val[1,...,len], respectively, where len is the number of non-zeros in j-th column returned on exit. Neither zero nor duplicate elements are allowed.</p>
|
10237 | 10237 |
* <p>The parameter info is a transit pointer passed to the routine col.</p>
|
10238 | 10238 |
* <p>RETURNS</p>
|
10239 | 10239 |
* <p>0 LU-factorization has been successfully computed.</p>
|
|
10243 | 10243 |
* <p>In case of non-zero return code the factorization becomes invalid. It should not be used in other operations until the cause of failure has been eliminated and the factorization has been recomputed again with the routine luf_factorize.</p>
|
10244 | 10244 |
* <p>REPAIRING SINGULAR MATRIX</p>
|
10245 | 10245 |
* <p>If the routine luf_factorize returns non-zero code, it provides all necessary information that can be used for \"repairing\" the matrix A, where \"repairing\" means replacing linearly dependent columns of the matrix A by appropriate columns of the unity matrix. This feature is needed when this routine is used for factorizing the basis matrix within the simplex method procedure.</p>
|
10246 | |
* <p>On exit linearly dependent columns of the (partially transformed) matrix U have numbers rank+1, rank+2, ..., n, where rank is estimated rank of the matrix A stored by the routine to the member luf->rank. The correspondence between columns of A and U is the same as between columns of V and U. Thus, linearly dependent columns of the matrix A have numbers qq_col[rank+1], qq_col[rank+2], ..., qq_col[n], where qq_col is the column-like representation of the permutation matrix Q. It is understood that each j-th linearly dependent column of the matrix U should be replaced by the unity vector, where all elements are zero except the unity diagonal element u[j,j]. On the other hand j-th row of the matrix U corresponds to the row of the matrix V (and therefore of the matrix A) with the number pp_row[j], where pp_row is the row-like representation of the permutation matrix P. Thus, each j-th linearly dependent column of the matrix U should be replaced by column of the unity matrix with the number pp_row[j].</p>
|
|
10246 |
* <p>On exit linearly dependent columns of the (partially transformed) matrix U have numbers rank+1, rank+2, ..., n, where rank is estimated rank of the matrix A stored by the routine to the member luf->rank. The correspondence between columns of A and U is the same as between columns of V and U. Thus, linearly dependent columns of the matrix A have numbers qq_col[rank+1], qq_col[rank+2], ..., qq_col[n], where qq_col is the column-like representation of the permutation matrix Q. It is understood that each j-th linearly dependent column of the matrix U should be replaced by the unity vector, where all elements are zero except the unity diagonal element u[j,j]. On the other hand j-th row of the matrix U corresponds to the row of the matrix V (and therefore of the matrix A) with the number pp_row[j], where pp_row is the row-like representation of the permutation matrix P. Thus, each j-th linearly dependent column of the matrix U should be replaced by column of the unity matrix with the number pp_row[j].</p>
|
10247 | 10247 |
* <p>The code that repairs the matrix A may look like follows:</p>
|
10248 | |
* <p>for (j = rank+1; j <= n; j++) { replace the column qq_col[j] of the matrix A by the column pp_row[j] of the unity matrix; }</p>
|
|
10248 |
* <p>for (j = rank+1; j <= n; j++) { replace the column qq_col[j] of the matrix A by the column pp_row[j] of the unity matrix; }</p>
|
10249 | 10249 |
* <p>where rank, pp_row, and qq_col are members of the structure LUF. </p>
|
10250 | 10250 |
*/
|
10251 | 10251 |
public";
|
|
13507 | 13507 |
* <p>lenr lenr[i], i = 1,2,...,n, is the number of non-zeros in row i.</p>
|
13508 | 13508 |
* <p>OUTPUT PARAMETERS</p>
|
13509 | 13509 |
* <p>ior ior[i], i = 1,2,...,n, gives the position on the original ordering of the row or column which is in position i in the permuted form.</p>
|
13510 | |
* <p>ib ib[i], i = 1,2,...,num, is the row number in the permuted matrix of the beginning of block i, 1 <= num <= n.</p>
|
|
13510 |
* <p>ib ib[i], i = 1,2,...,num, is the row number in the permuted matrix of the beginning of block i, 1 <= num <= n.</p>
|
13511 | 13511 |
* <p>WORKING ARRAYS</p>
|
13512 | 13512 |
* <p>arp working array of length [1+n], where arp[0] is not used. arp[i] is one less than the number of unsearched edges leaving node i. At the end of the algorithm it is set to a permutation which puts the matrix in block lower triangular form.</p>
|
13513 | 13513 |
* <p>ib working array of length [1+n], where ib[0] is not used. ib[i] is the position in the ordering of the start of the ith block. ib[n+1-i] holds the node number of the ith node on the stack.</p>
|
|
13532 | 13532 |
* <p>DESCRIPTION</p>
|
13533 | 13533 |
* <p>The routine ffalg implements the Ford-Fulkerson algorithm to find a maximal flow in the specified flow network.</p>
|
13534 | 13534 |
* <p>INPUT PARAMETERS</p>
|
13535 | |
* <p>nv is the number of nodes, nv >= 2.</p>
|
13536 | |
* <p>na is the number of arcs, na >= 0.</p>
|
|
13535 |
* <p>nv is the number of nodes, nv >= 2.</p>
|
|
13536 |
* <p>na is the number of arcs, na >= 0.</p>
|
13537 | 13537 |
* <p>tail[a], a = 1,...,na, is the index of tail node of arc a.</p>
|
13538 | 13538 |
* <p>head[a], a = 1,...,na, is the index of head node of arc a.</p>
|
13539 | |
* <p>s is the source node index, 1 <= s <= nv.</p>
|
13540 | |
* <p>t is the sink node index, 1 <= t <= nv, t != s.</p>
|
13541 | |
* <p>cap[a], a = 1,...,na, is the capacity of arc a, cap[a] >= 0.</p>
|
|
13539 |
* <p>s is the source node index, 1 <= s <= nv.</p>
|
|
13540 |
* <p>t is the sink node index, 1 <= t <= nv, t != s.</p>
|
|
13541 |
* <p>cap[a], a = 1,...,na, is the capacity of arc a, cap[a] >= 0.</p>
|
13542 | 13542 |
* <p>NOTE: Multiple arcs are allowed, but self-loops are not allowed.</p>
|
13543 | 13543 |
* <p>OUTPUT PARAMETERS</p>
|
13544 | 13544 |
* <p>x[a], a = 1,...,na, is optimal value of the flow through arc a.</p>
|
|
13596 | 13596 |
* <p>lenr lenr[i], i = 1,2,...,n, is the number of non-zeros in row i.</p>
|
13597 | 13597 |
* <p>OUTPUT PARAMETERS</p>
|
13598 | 13598 |
* <p>ior ior[i], i = 1,2,...,n, gives the position on the original ordering of the row or column which is in position i in the permuted form.</p>
|
13599 | |
* <p>ib ib[i], i = 1,2,...,num, is the row number in the permuted matrix of the beginning of block i, 1 <= num <= n.</p>
|
|
13599 |
* <p>ib ib[i], i = 1,2,...,num, is the row number in the permuted matrix of the beginning of block i, 1 <= num <= n.</p>
|
13600 | 13600 |
* <p>WORKING ARRAYS</p>
|
13601 | 13601 |
* <p>arp working array of length [1+n], where arp[0] is not used. arp[i] is one less than the number of unsearched edges leaving node i. At the end of the algorithm it is set to a permutation which puts the matrix in block lower triangular form.</p>
|
13602 | 13602 |
* <p>ib working array of length [1+n], where ib[0] is not used. ib[i] is the position in the ordering of the start of the ith block. ib[n+1-i] holds the node number of the ith node on the stack.</p>
|
|
13766 | 13766 |
* <p>DESCRIPTION</p>
|
13767 | 13767 |
* <p>The routine okalg implements the out-of-kilter algorithm to find a minimal-cost circulation in the specified flow network.</p>
|
13768 | 13768 |
* <p>INPUT PARAMETERS</p>
|
13769 | |
* <p>nv is the number of nodes, nv >= 0.</p>
|
13770 | |
* <p>na is the number of arcs, na >= 0.</p>
|
|
13769 |
* <p>nv is the number of nodes, nv >= 0.</p>
|
|
13770 |
* <p>na is the number of arcs, na >= 0.</p>
|
13771 | 13771 |
* <p>tail[a], a = 1,...,na, is the index of tail node of arc a.</p>
|
13772 | 13772 |
* <p>head[a], a = 1,...,na, is the index of head node of arc a.</p>
|
13773 | 13773 |
* <p>low[a], a = 1,...,na, is an lower bound to the flow through arc a.</p>
|
|
13775 | 13775 |
* <p>cost[a], a = 1,...,na, is a per-unit cost of the flow through arc a.</p>
|
13776 | 13776 |
* <p>NOTES</p>
|
13777 | 13777 |
* <p>1. Multiple arcs are allowed, but self-loops are not allowed.</p>
|
13778 | |
* <p>2. It is required that 0 <= low[a] <= cap[a] for all arcs.</p>
|
|
13778 |
* <p>2. It is required that 0 <= low[a] <= cap[a] for all arcs.</p>
|
13779 | 13779 |
* <p>3. Arc costs may have any sign.</p>
|
13780 | 13780 |
* <p>OUTPUT PARAMETERS</p>
|
13781 | 13781 |
* <p>x[a], a = 1,...,na, is optimal value of the flow through arc a.</p>
|
|
13804 | 13804 |
* <p>DESCRIPTION</p>
|
13805 | 13805 |
* <p>The routine ffalg implements the Ford-Fulkerson algorithm to find a maximal flow in the specified flow network.</p>
|
13806 | 13806 |
* <p>INPUT PARAMETERS</p>
|
13807 | |
* <p>nv is the number of nodes, nv >= 2.</p>
|
13808 | |
* <p>na is the number of arcs, na >= 0.</p>
|
|
13807 |
* <p>nv is the number of nodes, nv >= 2.</p>
|
|
13808 |
* <p>na is the number of arcs, na >= 0.</p>
|
13809 | 13809 |
* <p>tail[a], a = 1,...,na, is the index of tail node of arc a.</p>
|
13810 | 13810 |
* <p>head[a], a = 1,...,na, is the index of head node of arc a.</p>
|
13811 | |
* <p>s is the source node index, 1 <= s <= nv.</p>
|
13812 | |
* <p>t is the sink node index, 1 <= t <= nv, t != s.</p>
|
13813 | |
* <p>cap[a], a = 1,...,na, is the capacity of arc a, cap[a] >= 0.</p>
|
|
13811 |
* <p>s is the source node index, 1 <= s <= nv.</p>
|
|
13812 |
* <p>t is the sink node index, 1 <= t <= nv, t != s.</p>
|
|
13813 |
* <p>cap[a], a = 1,...,na, is the capacity of arc a, cap[a] >= 0.</p>
|
13814 | 13814 |
* <p>NOTE: Multiple arcs are allowed, but self-loops are not allowed.</p>
|
13815 | 13815 |
* <p>OUTPUT PARAMETERS</p>
|
13816 | 13816 |
* <p>x[a], a = 1,...,na, is optimal value of the flow through arc a.</p>
|
|
14012 | 14012 |
* <p>#include \"glpnpp.h\" int npp_empty_row(NPP *npp, NPPROW *p);</p>
|
14013 | 14013 |
* <p>DESCRIPTION</p>
|
14014 | 14014 |
* <p>The routine npp_empty_row processes row p, which is empty, i.e. coefficients at all columns in this row are zero:</p>
|
14015 | |
* <p>L[p] <= sum 0 x[j] <= U[p], (1)</p>
|
14016 | |
* <p>where L[p] <= U[p].</p>
|
|
14015 |
* <p>L[p] <= sum 0 x[j] <= U[p], (1)</p>
|
|
14016 |
* <p>where L[p] <= U[p].</p>
|
14017 | 14017 |
* <p>RETURNS</p>
|
14018 | 14018 |
* <p>0 - success;</p>
|
14019 | 14019 |
* <p>1 - problem has no primal feasible solution.</p>
|
14020 | 14020 |
* <p>PROBLEM TRANSFORMATION</p>
|
14021 | 14021 |
* <p>If the following conditions hold:</p>
|
14022 | |
* <p>L[p] <= +eps, U[p] >= -eps, (2)</p>
|
|
14022 |
* <p>L[p] <= +eps, U[p] >= -eps, (2)</p>
|
14023 | 14023 |
* <p>where eps is an absolute tolerance for row value, the row p is redundant. In this case it can be replaced by equivalent redundant row, which is free (unbounded), and then removed from the problem. Otherwise, the row p is infeasible and, thus, the problem has no primal feasible solution.</p>
|
14024 | 14024 |
* <p>RECOVERING BASIC SOLUTION</p>
|
14025 | 14025 |
* <p>See the routine npp_free_row.</p>
|
|
14042 | 14042 |
* <p>#include \"glpnpp.h\" int npp_implied_value(NPP *npp, NPPCOL *q, double s);</p>
|
14043 | 14043 |
* <p>DESCRIPTION</p>
|
14044 | 14044 |
* <p>For column q:</p>
|
14045 | |
* <p>l[q] <= x[q] <= u[q], (1)</p>
|
14046 | |
* <p>where l[q] < u[q], the routine npp_implied_value processes its implied value s[q]. If this implied value satisfies to the current column bounds and integrality condition, the routine fixes column q at the given point. Note that the column is kept in the problem in any case.</p>
|
|
14045 |
* <p>l[q] <= x[q] <= u[q], (1)</p>
|
|
14046 |
* <p>where l[q] < u[q], the routine npp_implied_value processes its implied value s[q]. If this implied value satisfies to the current column bounds and integrality condition, the routine fixes column q at the given point. Note that the column is kept in the problem in any case.</p>
|
14047 | 14047 |
* <p>RETURNS</p>
|
14048 | 14048 |
* <p>0 - column has been fixed;</p>
|
14049 | 14049 |
* <p>1 - implied value violates to current column bounds;</p>
|
14050 | 14050 |
* <p>2 - implied value violates integrality condition.</p>
|
14051 | 14051 |
* <p>ALGORITHM</p>
|
14052 | 14052 |
* <p>Implied column value s[q] satisfies to the current column bounds if the following condition holds:</p>
|
14053 | |
* <p>l[q] - eps <= s[q] <= u[q] + eps, (2)</p>
|
|
14053 |
* <p>l[q] - eps <= s[q] <= u[q] + eps, (2)</p>
|
14054 | 14054 |
* <p>where eps is an absolute tolerance for column value. If the column is integral, the following condition also must hold:</p>
|
14055 | |
* <p>|s[q] - floor(s[q]+0.5)| <= eps, (3)</p>
|
|
14055 |
* <p>|s[q] - floor(s[q]+0.5)| <= eps, (3)</p>
|
14056 | 14056 |
* <p>where floor(s[q]+0.5) is the nearest integer to s[q].</p>
|
14057 | 14057 |
* <p>If both condition (2) and (3) are satisfied, the column can be fixed at the value s[q], or, if it is integral, at floor(s[q]+0.5). Otherwise, if s[q] violates (2) or (3), the problem has no feasible solution.</p>
|
14058 | 14058 |
* <p>Note: If s[q] is close to l[q] or u[q], it seems to be reasonable to fix the column at its lower or upper bound, resp. rather than at the implied value. </p>
|
|
14071 | 14071 |
* <p>#include \"glpnpp.h\" int npp_implied_lower(NPP *npp, NPPCOL *q, double l);</p>
|
14072 | 14072 |
* <p>DESCRIPTION</p>
|
14073 | 14073 |
* <p>For column q:</p>
|
14074 | |
* <p>l[q] <= x[q] <= u[q], (1)</p>
|
14075 | |
* <p>where l[q] < u[q], the routine npp_implied_lower processes its implied lower bound l'[q]. As the result the current column lower bound may increase. Note that the column is kept in the problem in any case.</p>
|
|
14074 |
* <p>l[q] <= x[q] <= u[q], (1)</p>
|
|
14075 |
* <p>where l[q] < u[q], the routine npp_implied_lower processes its implied lower bound l'[q]. As the result the current column lower bound may increase. Note that the column is kept in the problem in any case.</p>
|
14076 | 14076 |
* <p>RETURNS</p>
|
14077 | 14077 |
* <p>0 - current column lower bound has not changed;</p>
|
14078 | 14078 |
* <p>1 - current column lower bound has changed, but not significantly;</p>
|
|
14081 | 14081 |
* <p>4 - implied lower bound violates current column upper bound.</p>
|
14082 | 14082 |
* <p>ALGORITHM</p>
|
14083 | 14083 |
* <p>If column q is integral, before processing its implied lower bound should be rounded up:</p>
|
14084 | |
* <p>( floor(l'[q]+0.5), if |l'[q] - floor(l'[q]+0.5)| <= eps l'[q] := < (2) ( ceil(l'[q]), otherwise</p>
|
|
14084 |
* <p>( floor(l'[q]+0.5), if |l'[q] - floor(l'[q]+0.5)| <= eps l'[q] := < (2) ( ceil(l'[q]), otherwise</p>
|
14085 | 14085 |
* <p>where floor(l'[q]+0.5) is the nearest integer to l'[q], ceil(l'[q]) is smallest integer not less than l'[q], and eps is an absolute tolerance for column value.</p>
|
14086 | 14086 |
* <p>Processing implied column lower bound l'[q] includes the following cases:</p>
|
14087 | |
* <p>1) if l'[q] < l[q] + eps, implied lower bound is redundant;</p>
|
14088 | |
* <p>2) if l[q] + eps <= l[q] <= u[q] + eps, current column lower bound l[q] can be strengthened by replacing it with l'[q]. If in this case new column lower bound becomes close to current column upper bound u[q], the column can be fixed on its upper bound;</p>
|
14089 | |
* <p>3) if l'[q] > u[q] + eps, implied lower bound violates current column upper bound u[q], in which case the problem has no primal feasible solution. </p>
|
|
14087 |
* <p>1) if l'[q] < l[q] + eps, implied lower bound is redundant;</p>
|
|
14088 |
* <p>2) if l[q] + eps <= l[q] <= u[q] + eps, current column lower bound l[q] can be strengthened by replacing it with l'[q]. If in this case new column lower bound becomes close to current column upper bound u[q], the column can be fixed on its upper bound;</p>
|
|
14089 |
* <p>3) if l'[q] > u[q] + eps, implied lower bound violates current column upper bound u[q], in which case the problem has no primal feasible solution. </p>
|
14090 | 14090 |
*/
|
14091 | 14091 |
public";
|
14092 | 14092 |
|
|
14097 | 14097 |
* <p>#include \"glpnpp.h\" int npp_implied_upper(NPP *npp, NPPCOL *q, double u);</p>
|
14098 | 14098 |
* <p>DESCRIPTION</p>
|
14099 | 14099 |
* <p>For column q:</p>
|
14100 | |
* <p>l[q] <= x[q] <= u[q], (1)</p>
|
14101 | |
* <p>where l[q] < u[q], the routine npp_implied_upper processes its implied upper bound u'[q]. As the result the current column upper bound may decrease. Note that the column is kept in the problem in any case.</p>
|
|
14100 |
* <p>l[q] <= x[q] <= u[q], (1)</p>
|
|
14101 |
* <p>where l[q] < u[q], the routine npp_implied_upper processes its implied upper bound u'[q]. As the result the current column upper bound may decrease. Note that the column is kept in the problem in any case.</p>
|
14102 | 14102 |
* <p>RETURNS</p>
|
14103 | 14103 |
* <p>0 - current column upper bound has not changed;</p>
|
14104 | 14104 |
* <p>1 - current column upper bound has changed, but not significantly;</p>
|
|
14107 | 14107 |
* <p>4 - implied upper bound violates current column lower bound.</p>
|
14108 | 14108 |
* <p>ALGORITHM</p>
|
14109 | 14109 |
* <p>If column q is integral, before processing its implied upper bound should be rounded down:</p>
|
14110 | |
* <p>( floor(u'[q]+0.5), if |u'[q] - floor(l'[q]+0.5)| <= eps u'[q] := < (2) ( floor(l'[q]), otherwise</p>
|
|
14110 |
* <p>( floor(u'[q]+0.5), if |u'[q] - floor(l'[q]+0.5)| <= eps u'[q] := < (2) ( floor(l'[q]), otherwise</p>
|
14111 | 14111 |
* <p>where floor(u'[q]+0.5) is the nearest integer to u'[q], floor(u'[q]) is largest integer not greater than u'[q], and eps is an absolute tolerance for column value.</p>
|
14112 | 14112 |
* <p>Processing implied column upper bound u'[q] includes the following cases:</p>
|
14113 | |
* <p>1) if u'[q] > u[q] - eps, implied upper bound is redundant;</p>
|
14114 | |
* <p>2) if l[q] - eps <= u[q] <= u[q] - eps, current column upper bound u[q] can be strengthened by replacing it with u'[q]. If in this case new column upper bound becomes close to current column lower bound, the column can be fixed on its lower bound;</p>
|
14115 | |
* <p>3) if u'[q] < l[q] - eps, implied upper bound violates current column lower bound l[q], in which case the problem has no primal feasible solution. </p>
|
|
14113 |
* <p>1) if u'[q] > u[q] - eps, implied upper bound is redundant;</p>
|
|
14114 |
* <p>2) if l[q] - eps <= u[q] <= u[q] - eps, current column upper bound u[q] can be strengthened by replacing it with u'[q]. If in this case new column upper bound becomes close to current column lower bound, the column can be fixed on its lower bound;</p>
|
|
14115 |
* <p>3) if u'[q] < l[q] - eps, implied upper bound violates current column lower bound l[q], in which case the problem has no primal feasible solution. </p>
|
14116 | 14116 |
*/
|
14117 | 14117 |
public";
|
14118 | 14118 |
|
|
14148 | 14148 |
* <p>#include \"glpnpp.h\" int npp_analyze_row(NPP *npp, NPPROW *p);</p>
|
14149 | 14149 |
* <p>DESCRIPTION</p>
|
14150 | 14150 |
* <p>The routine npp_analyze_row performs analysis of row p of general format:</p>
|
14151 | |
* <p>L[p] <= sum a[p,j] x[j] <= U[p], (1) j</p>
|
14152 | |
* <p>l[j] <= x[j] <= u[j], (2)</p>
|
14153 | |
* <p>where L[p] <= U[p] and l[j] <= u[j] for all a[p,j] != 0.</p>
|
|
14151 |
* <p>L[p] <= sum a[p,j] x[j] <= U[p], (1) j</p>
|
|
14152 |
* <p>l[j] <= x[j] <= u[j], (2)</p>
|
|
14153 |
* <p>where L[p] <= U[p] and l[j] <= u[j] for all a[p,j] != 0.</p>
|
14154 | 14154 |
* <p>RETURNS</p>
|
14155 | 14155 |
* <p>0x?0 - row lower bound does not exist or is redundant;</p>
|
14156 | 14156 |
* <p>0x?1 - row lower bound can be active;</p>
|
|
14163 | 14163 |
* <p>Analysis of row (1) is based on analysis of its implied lower and upper bounds, which are determined by bounds of corresponding columns (variables) as follows:</p>
|
14164 | 14164 |
* <p>L'[p] = inf sum a[p,j] x[j] = j (3) = sum a[p,j] l[j] + sum a[p,j] u[j], j in Jp j in Jn</p>
|
14165 | 14165 |
* <p>U'[p] = sup sum a[p,j] x[j] = (4) = sum a[p,j] u[j] + sum a[p,j] l[j], j in Jp j in Jn</p>
|
14166 | |
* <p>Jp = {j: a[p,j] > 0}, Jn = {j: a[p,j] < 0}. (5)</p>
|
14167 | |
* <p>(Note that bounds of all columns in row p are assumed to be correct, so L'[p] <= U'[p].)</p>
|
|
14166 |
* <p>Jp = {j: a[p,j] > 0}, Jn = {j: a[p,j] < 0}. (5)</p>
|
|
14167 |
* <p>(Note that bounds of all columns in row p are assumed to be correct, so L'[p] <= U'[p].)</p>
|
14168 | 14168 |
* <p>Analysis of row lower bound L[p] includes the following cases:</p>
|
14169 | |
* <p>1) if L[p] > U'[p] + eps, where eps is an absolute tolerance for row value, row lower bound L[p] and implied row upper bound U'[p] are inconsistent, ergo, the problem has no primal feasible solution;</p>
|
14170 | |
* <p>2) if U'[p] - eps <= L[p] <= U'[p] + eps, i.e. if L[p] =~ U'[p], the row is a forcing row on its lower bound (see description of the routine npp_forcing_row);</p>
|
14171 | |
* <p>3) if L[p] > L'[p] + eps, row lower bound L[p] can be active (this conclusion does not account other rows in the problem);</p>
|
14172 | |
* <p>4) if L[p] <= L'[p] + eps, row lower bound L[p] cannot be active, so it is redundant and can be removed (replaced by -oo).</p>
|
|
14169 |
* <p>1) if L[p] > U'[p] + eps, where eps is an absolute tolerance for row value, row lower bound L[p] and implied row upper bound U'[p] are inconsistent, ergo, the problem has no primal feasible solution;</p>
|
|
14170 |
* <p>2) if U'[p] - eps <= L[p] <= U'[p] + eps, i.e. if L[p] =~ U'[p], the row is a forcing row on its lower bound (see description of the routine npp_forcing_row);</p>
|
|
14171 |
* <p>3) if L[p] > L'[p] + eps, row lower bound L[p] can be active (this conclusion does not account other rows in the problem);</p>
|
|
14172 |
* <p>4) if L[p] <= L'[p] + eps, row lower bound L[p] cannot be active, so it is redundant and can be removed (replaced by -oo).</p>
|
14173 | 14173 |
* <p>Analysis of row upper bound U[p] is performed in a similar way and includes the following cases:</p>
|
14174 | |
* <p>1) if U[p] < L'[p] - eps, row upper bound U[p] and implied row lower bound L'[p] are inconsistent, ergo the problem has no primal feasible solution;</p>
|
14175 | |
* <p>2) if L'[p] - eps <= U[p] <= L'[p] + eps, i.e. if U[p] =~ L'[p], the row is a forcing row on its upper bound (see description of the routine npp_forcing_row);</p>
|
14176 | |
* <p>3) if U[p] < U'[p] - eps, row upper bound U[p] can be active (this conclusion does not account other rows in the problem);</p>
|
14177 | |
* <p>4) if U[p] >= U'[p] - eps, row upper bound U[p] cannot be active, so it is redundant and can be removed (replaced by +oo). </p>
|
|
14174 |
* <p>1) if U[p] < L'[p] - eps, row upper bound U[p] and implied row lower bound L'[p] are inconsistent, ergo the problem has no primal feasible solution;</p>
|
|
14175 |
* <p>2) if L'[p] - eps <= U[p] <= L'[p] + eps, i.e. if U[p] =~ L'[p], the row is a forcing row on its upper bound (see description of the routine npp_forcing_row);</p>
|
|
14176 |
* <p>3) if U[p] < U'[p] - eps, row upper bound U[p] can be active (this conclusion does not account other rows in the problem);</p>
|
|
14177 |
* <p>4) if U[p] >= U'[p] - eps, row upper bound U[p] cannot be active, so it is redundant and can be removed (replaced by +oo). </p>
|
14178 | 14178 |
*/
|
14179 | 14179 |
public";
|
14180 | 14180 |
|
|
14190 | 14190 |
* <p>#include \"glpnpp.h\" void npp_implied_bounds(NPP *npp, NPPROW *p);</p>
|
14191 | 14191 |
* <p>DESCRIPTION</p>
|
14192 | 14192 |
* <p>The routine npp_implied_bounds inspects general row (constraint) p:</p>
|
14193 | |
* <p>L[p] <= sum a[p,j] x[j] <= U[p], (1)</p>
|
14194 | |
* <p>l[j] <= x[j] <= u[j], (2)</p>
|
14195 | |
* <p>where L[p] <= U[p] and l[j] <= u[j] for all a[p,j] != 0, to compute implied bounds of columns (variables x[j]) in this row.</p>
|
|
14193 |
* <p>L[p] <= sum a[p,j] x[j] <= U[p], (1)</p>
|
|
14194 |
* <p>l[j] <= x[j] <= u[j], (2)</p>
|
|
14195 |
* <p>where L[p] <= U[p] and l[j] <= u[j] for all a[p,j] != 0, to compute implied bounds of columns (variables x[j]) in this row.</p>
|
14196 | 14196 |
* <p>The routine stores implied column bounds l'[j] and u'[j] in column descriptors (NPPCOL); it does not change current column bounds l[j] and u[j]. (Implied column bounds can be then used to strengthen the current column bounds; see the routines npp_implied_lower and npp_implied_upper).</p>
|
14197 | 14197 |
* <p>ALGORITHM</p>
|
14198 | 14198 |
* <p>Current column bounds (2) define implied lower and upper bounds of row (1) as follows:</p>
|
14199 | 14199 |
* <p>L'[p] = inf sum a[p,j] x[j] = j (3) = sum a[p,j] l[j] + sum a[p,j] u[j], j in Jp j in Jn</p>
|
14200 | 14200 |
* <p>U'[p] = sup sum a[p,j] x[j] = (4) = sum a[p,j] u[j] + sum a[p,j] l[j], j in Jp j in Jn</p>
|
14201 | |
* <p>Jp = {j: a[p,j] > 0}, Jn = {j: a[p,j] < 0}. (5)</p>
|
14202 | |
* <p>(Note that bounds of all columns in row p are assumed to be correct, so L'[p] <= U'[p].)</p>
|
14203 | |
* <p>If L[p] > L'[p] and/or U[p] < U'[p], the lower and/or upper bound of row (1) can be active, in which case such row defines implied bounds of its variables.</p>
|
14204 | |
* <p>Let x[k] be some variable having in row (1) coefficient a[p,k] != 0. Consider a case when row lower bound can be active (L[p] > L'[p]):</p>
|
14205 | |
* <p>sum a[p,j] x[j] >= L[p] ==> j</p>
|
14206 | |
* <p>sum a[p,j] x[j] + a[p,k] x[k] >= L[p] ==> j!=k (6) a[p,k] x[k] >= L[p] - sum a[p,j] x[j] ==> j!=k</p>
|
14207 | |
* <p>a[p,k] x[k] >= L[p,k],</p>
|
|
14201 |
* <p>Jp = {j: a[p,j] > 0}, Jn = {j: a[p,j] < 0}. (5)</p>
|
|
14202 |
* <p>(Note that bounds of all columns in row p are assumed to be correct, so L'[p] <= U'[p].)</p>
|
|
14203 |
* <p>If L[p] > L'[p] and/or U[p] < U'[p], the lower and/or upper bound of row (1) can be active, in which case such row defines implied bounds of its variables.</p>
|
|
14204 |
* <p>Let x[k] be some variable having in row (1) coefficient a[p,k] != 0. Consider a case when row lower bound can be active (L[p] > L'[p]):</p>
|
|
14205 |
* <p>sum a[p,j] x[j] >= L[p] ==> j</p>
|
|
14206 |
* <p>sum a[p,j] x[j] + a[p,k] x[k] >= L[p] ==> j!=k (6) a[p,k] x[k] >= L[p] - sum a[p,j] x[j] ==> j!=k</p>
|
|
14207 |
* <p>a[p,k] x[k] >= L[p,k],</p>
|
14208 | 14208 |
* <p>where</p>
|
14209 | 14209 |
* <p>L[p,k] = inf(L[p] - sum a[p,j] x[j]) = j!=k</p>
|
14210 | 14210 |
* <p>= L[p] - sup sum a[p,j] x[j] = (7) j!=k</p>
|
14211 | 14211 |
* <p>= L[p] - sum a[p,j] u[j] - sum a[p,j] l[j]. j in Jpk} j in Jnk}</p>
|
14212 | 14212 |
* <p>Thus:</p>
|
14213 | |
* <p>x[k] >= l'[k] = L[p,k] / a[p,k], if a[p,k] > 0, (8)</p>
|
14214 | |
* <p>x[k] <= u'[k] = L[p,k] / a[p,k], if a[p,k] < 0. (9)</p>
|
|
14213 |
* <p>x[k] >= l'[k] = L[p,k] / a[p,k], if a[p,k] > 0, (8)</p>
|
|
14214 |
* <p>x[k] <= u'[k] = L[p,k] / a[p,k], if a[p,k] < 0. (9)</p>
|
14215 | 14215 |
* <p>where l'[k] and u'[k] are implied lower and upper bounds of variable x[k], resp.</p>
|
14216 | |
* <p>Now consider a similar case when row upper bound can be active (U[p] < U'[p]):</p>
|
14217 | |
* <p>sum a[p,j] x[j] <= U[p] ==> j</p>
|
14218 | |
* <p>sum a[p,j] x[j] + a[p,k] x[k] <= U[p] ==> j!=k (10) a[p,k] x[k] <= U[p] - sum a[p,j] x[j] ==> j!=k</p>
|
14219 | |
* <p>a[p,k] x[k] <= U[p,k],</p>
|
|
14216 |
* <p>Now consider a similar case when row upper bound can be active (U[p] < U'[p]):</p>
|
|
14217 |
* <p>sum a[p,j] x[j] <= U[p] ==> j</p>
|
|
14218 |
* <p>sum a[p,j] x[j] + a[p,k] x[k] <= U[p] ==> j!=k (10) a[p,k] x[k] <= U[p] - sum a[p,j] x[j] ==> j!=k</p>
|
|
14219 |
* <p>a[p,k] x[k] <= U[p,k],</p>
|
14220 | 14220 |
* <p>where:</p>
|
14221 | 14221 |
* <p>U[p,k] = sup(U[p] - sum a[p,j] x[j]) = j!=k</p>
|
14222 | 14222 |
* <p>= U[p] - inf sum a[p,j] x[j] = (11) j!=k</p>
|
14223 | 14223 |
* <p>= U[p] - sum a[p,j] l[j] - sum a[p,j] u[j]. j in Jpk} j in Jnk}</p>
|
14224 | 14224 |
* <p>Thus:</p>
|
14225 | |
* <p>x[k] <= u'[k] = U[p,k] / a[p,k], if a[p,k] > 0, (12)</p>
|
14226 | |
* <p>x[k] >= l'[k] = U[p,k] / a[p,k], if a[p,k] < 0. (13)</p>
|
|
14225 |
* <p>x[k] <= u'[k] = U[p,k] / a[p,k], if a[p,k] > 0, (12)</p>
|
|
14226 |
* <p>x[k] >= l'[k] = U[p,k] / a[p,k], if a[p,k] < 0. (13)</p>
|
14227 | 14227 |
* <p>Note that in formulae (8), (9), (12), and (13) coefficient a[p,k] must not be too small in magnitude relatively to other non-zero coefficients in row (1), i.e. the following condition must hold:</p>
|
14228 | |
* <p>|a[p,k]| >= eps * max(1, |a[p,j]|), (14) j</p>
|
|
14228 |
* <p>|a[p,k]| >= eps * max(1, |a[p,j]|), (14) j</p>
|
14229 | 14229 |
* <p>where eps is a relative tolerance for constraint coefficients. Otherwise the implied column bounds can be numerical inreliable. For example, using formula (8) for the following inequality constraint:</p>
|
14230 | |
* <p>1e-12 x1 - x2 - x3 >= 0,</p>
|
14231 | |
* <p>where x1 >= -1, x2, x3, >= 0, may lead to numerically unreliable conclusion that x1 >= 0.</p>
|
|
14230 |
* <p>1e-12 x1 - x2 - x3 >= 0,</p>
|
|
14231 |
* <p>where x1 >= -1, x2, x3, >= 0, may lead to numerically unreliable conclusion that x1 >= 0.</p>
|
14232 | 14232 |
* <p>Using formulae (8), (9), (12), and (13) to compute implied bounds for one variable requires |J| operations, where J = {j: a[p,j] != 0}, because this needs computing L[p,k] and U[p,k]. Thus, computing implied bounds for all variables in row (1) would require |J|^2 operations, that is not a good technique. However, the total number of operations can be reduced to |J| as follows.</p>
|
14233 | |
* <p>Let a[p,k] > 0. Then from (7) and (11) we have:</p>
|
|
14233 |
* <p>Let a[p,k] > 0. Then from (7) and (11) we have:</p>
|
14234 | 14234 |
* <p>L[p,k] = L[p] - (U'[p] - a[p,k] u[k]) =</p>
|
14235 | 14235 |
* <p>= L[p] - U'[p] + a[p,k] u[k],</p>
|
14236 | 14236 |
* <p>U[p,k] = U[p] - (L'[p] - a[p,k] l[k]) =</p>
|
|
14238 | 14238 |
* <p>where L'[p] and U'[p] are implied row lower and upper bounds defined by formulae (3) and (4). Substituting these expressions into (8) and (12) gives:</p>
|
14239 | 14239 |
* <p>l'[k] = L[p,k] / a[p,k] = u[k] + (L[p] - U'[p]) / a[p,k], (15)</p>
|
14240 | 14240 |
* <p>u'[k] = U[p,k] / a[p,k] = l[k] + (U[p] - L'[p]) / a[p,k]. (16)</p>
|
14241 | |
* <p>Similarly, if a[p,k] < 0, according to (7) and (11) we have:</p>
|
|
14241 |
* <p>Similarly, if a[p,k] < 0, according to (7) and (11) we have:</p>
|
14242 | 14242 |
* <p>L[p,k] = L[p] - (U'[p] - a[p,k] l[k]) =</p>
|
14243 | 14243 |
* <p>= L[p] - U'[p] + a[p,k] l[k],</p>
|
14244 | 14244 |
* <p>U[p,k] = U[p] - (L'[p] - a[p,k] u[k]) =</p>
|
|
14246 | 14246 |
* <p>and substituting these expressions into (8) and (12) gives:</p>
|
14247 | 14247 |
* <p>l'[k] = U[p,k] / a[p,k] = u[k] + (U[p] - L'[p]) / a[p,k], (17)</p>
|
14248 | 14248 |
* <p>u'[k] = L[p,k] / a[p,k] = l[k] + (L[p] - U'[p]) / a[p,k]. (18)</p>
|
14249 | |
* <p>Note that formulae (15)-(18) can be used only if L'[p] and U'[p] exist. However, if for some variable x[j] it happens that l[j] = -oo and/or u[j] = +oo, values of L'[p] (if a[p,j] > 0) and/or U'[p] (if a[p,j] < 0) are undefined. Consider, therefore, the most general situation, when some column bounds (2) may not exist.</p>
|
|
14249 |
* <p>Note that formulae (15)-(18) can be used only if L'[p] and U'[p] exist. However, if for some variable x[j] it happens that l[j] = -oo and/or u[j] = +oo, values of L'[p] (if a[p,j] > 0) and/or U'[p] (if a[p,j] < 0) are undefined. Consider, therefore, the most general situation, when some column bounds (2) may not exist.</p>
|
14250 | 14250 |
* <p>Let:</p>
|
14251 | |
* <p>J' = {j : (a[p,j] > 0 and l[j] = -oo) or (19) (a[p,j] < 0 and u[j] = +oo)}.</p>
|
|
14251 |
* <p>J' = {j : (a[p,j] > 0 and l[j] = -oo) or (19) (a[p,j] < 0 and u[j] = +oo)}.</p>
|
14252 | 14252 |
* <p>Then (assuming that row upper bound U[p] can be active) the following three cases are possible:</p>
|
14253 | 14253 |
* <p>1) |J'| = 0. In this case L'[p] exists, thus, for all variables x[j] in row (1) we can use formulae (16) and (17);</p>
|
14254 | |
* <p>2) J' = {k}. In this case L'[p] = -oo, however, U[p,k] (11) exists, so for variable x[k] we can use formulae (12) and (13). Note that for all other variables x[j] (j != k) l'[j] = -oo (if a[p,j] < 0) or u'[j] = +oo (if a[p,j] > 0);</p>
|
14255 | |
* <p>3) |J'| > 1. In this case for all variables x[j] in row [1] we have l'[j] = -oo (if a[p,j] < 0) or u'[j] = +oo (if a[p,j] > 0).</p>
|
|
14254 |
* <p>2) J' = {k}. In this case L'[p] = -oo, however, U[p,k] (11) exists, so for variable x[k] we can use formulae (12) and (13). Note that for all other variables x[j] (j != k) l'[j] = -oo (if a[p,j] < 0) or u'[j] = +oo (if a[p,j] > 0);</p>
|
|
14255 |
* <p>3) |J'| > 1. In this case for all variables x[j] in row [1] we have l'[j] = -oo (if a[p,j] < 0) or u'[j] = +oo (if a[p,j] > 0).</p>
|
14256 | 14256 |
* <p>Similarly, let:</p>
|
14257 | |
* <p>J'' = {j : (a[p,j] > 0 and u[j] = +oo) or (20) (a[p,j] < 0 and l[j] = -oo)}.</p>
|
|
14257 |
* <p>J'' = {j : (a[p,j] > 0 and u[j] = +oo) or (20) (a[p,j] < 0 and l[j] = -oo)}.</p>
|
14258 | 14258 |
* <p>Then (assuming that row lower bound L[p] can be active) the following three cases are possible:</p>
|
14259 | 14259 |
* <p>1) |J''| = 0. In this case U'[p] exists, thus, for all variables x[j] in row (1) we can use formulae (15) and (18);</p>
|
14260 | |
* <p>2) J'' = {k}. In this case U'[p] = +oo, however, L[p,k] (7) exists, so for variable x[k] we can use formulae (8) and (9). Note that for all other variables x[j] (j != k) l'[j] = -oo (if a[p,j] > 0) or u'[j] = +oo (if a[p,j] < 0);</p>
|
14261 | |
* <p>3) |J''| > 1. In this case for all variables x[j] in row (1) we have l'[j] = -oo (if a[p,j] > 0) or u'[j] = +oo (if a[p,j] < 0). </p>
|
|
14260 |
* <p>2) J'' = {k}. In this case U'[p] = +oo, however, L[p,k] (7) exists, so for variable x[k] we can use formulae (8) and (9). Note that for all other variables x[j] (j != k) l'[j] = -oo (if a[p,j] > 0) or u'[j] = +oo (if a[p,j] < 0);</p>
|
|
14261 |
* <p>3) |J''| > 1. In this case for all variables x[j] in row (1) we have l'[j] = -oo (if a[p,j] > 0) or u'[j] = +oo (if a[p,j] < 0). </p>
|
14262 | 14262 |
*/
|
14263 | 14263 |
public";
|
14264 | 14264 |
|
|
14276 | 14276 |
* <p>If the specified row (constraint) is packing inequality (see below), the routine npp_is_packing returns non-zero. Otherwise, it returns zero.</p>
|
14277 | 14277 |
* <p>PACKING INEQUALITIES</p>
|
14278 | 14278 |
* <p>In canonical format the packing inequality is the following:</p>
|
14279 | |
* <p>sum x[j] <= 1, (1) j in J</p>
|
14280 | |
* <p>where all variables x[j] are binary. This inequality expresses the condition that in any integer feasible solution at most one variable from set J can take non-zero (unity) value while other variables must be equal to zero. W.l.o.g. it is assumed that |J| >= 2, because if J is empty or |J| = 1, the inequality (1) is redundant.</p>
|
|
14279 |
* <p>sum x[j] <= 1, (1) j in J</p>
|
|
14280 |
* <p>where all variables x[j] are binary. This inequality expresses the condition that in any integer feasible solution at most one variable from set J can take non-zero (unity) value while other variables must be equal to zero. W.l.o.g. it is assumed that |J| >= 2, because if J is empty or |J| = 1, the inequality (1) is redundant.</p>
|
14281 | 14281 |
* <p>In general case the packing inequality may include original variables x[j] as well as their complements x~[j]:</p>
|
14282 | |
* <p>sum x[j] + sum x~[j] <= 1, (2) j in Jp j in Jn</p>
|
|
14282 |
* <p>sum x[j] + sum x~[j] <= 1, (2) j in Jp j in Jn</p>
|
14283 | 14283 |
* <p>where Jp and Jn are not intersected. Therefore, using substitution x~[j] = 1 - x[j] gives the packing inequality in generalized format:</p>
|
14284 | |
* <p>sum x[j] - sum x[j] <= 1 - |Jn|. (3) j in Jp j in Jn </p>
|
|
14284 |
* <p>sum x[j] - sum x[j] <= 1 - |Jn|. (3) j in Jp j in Jn </p>
|
14285 | 14285 |
*/
|
14286 | 14286 |
public";
|
14287 | 14287 |
|
|
14297 | 14297 |
* <p>#include \"glpnpp.h\" int npp_implied_packing(NPP *npp, NPPROW *row, int which, NPPCOL *var[], char set[]);</p>
|
14298 | 14298 |
* <p>DESCRIPTION</p>
|
14299 | 14299 |
* <p>The routine npp_implied_packing processes specified row (constraint) of general format:</p>
|
14300 | |
* <p>L <= sum a[j] x[j] <= U. (1) j</p>
|
|
14300 |
* <p>L <= sum a[j] x[j] <= U. (1) j</p>
|
14301 | 14301 |
* <p>If which = 0, only lower bound L, which must exist, is considered, while upper bound U is ignored. Similarly, if which = 1, only upper bound U, which must exist, is considered, while lower bound L is ignored. Thus, if the specified row is a double-sided inequality or equality constraint, this routine should be called twice for both lower and upper bounds.</p>
|
14302 | 14302 |
* <p>The routine npp_implied_packing attempts to find a non-trivial (i.e. having not less than two binary variables) packing inequality:</p>
|
14303 | |
* <p>sum x[j] - sum x[j] <= 1 - |Jn|, (2) j in Jp j in Jn</p>
|
|
14303 |
* <p>sum x[j] - sum x[j] <= 1 - |Jn|, (2) j in Jp j in Jn</p>
|
14304 | 14304 |
* <p>which is relaxation of the constraint (1) in the sense that any solution satisfying to that constraint also satisfies to the packing inequality (2). If such relaxation exists, the routine stores pointers to descriptors of corresponding binary variables and their flags, resp., to locations var[1], var[2], ..., var[len] and set[1], set[2], ..., set[len], where set[j] = 0 means that j in Jp and set[j] = 1 means that j in Jn.</p>
|
14305 | 14305 |
* <p>RETURNS</p>
|
14306 | |
* <p>The routine npp_implied_packing returns len, which is the total number of binary variables in the packing inequality found, len >= 2. However, if the relaxation does not exist, the routine returns zero.</p>
|
|
14306 |
* <p>The routine npp_implied_packing returns len, which is the total number of binary variables in the packing inequality found, len >= 2. However, if the relaxation does not exist, the routine returns zero.</p>
|
14307 | 14307 |
* <p>ALGORITHM</p>
|
14308 | 14308 |
* <p>If which = 0, the constraint coefficients (1) are multiplied by -1 and b is assigned -L; if which = 1, the constraint coefficients (1) are not changed and b is assigned +U. In both cases the specified constraint gets the following format:</p>
|
14309 | |
* <p>sum a[j] x[j] <= b. (3) j</p>
|
|
14309 |
* <p>sum a[j] x[j] <= b. (3) j</p>
|
14310 | 14310 |
* <p>(Note that (3) is a relaxation of (1), because one of bounds L or U is ignored.)</p>
|
14311 | |
* <p>Let J be set of binary variables, Kp be set of non-binary (integer or continuous) variables with a[j] > 0, and Kn be set of non-binary variables with a[j] < 0. Then the inequality (3) can be written as follows:</p>
|
14312 | |
* <p>sum a[j] x[j] <= b - sum a[j] x[j] - sum a[j] x[j]. (4) j in J j in Kp j in Kn</p>
|
|
14311 |
* <p>Let J be set of binary variables, Kp be set of non-binary (integer or continuous) variables with a[j] > 0, and Kn be set of non-binary variables with a[j] < 0. Then the inequality (3) can be written as follows:</p>
|
|
14312 |
* <p>sum a[j] x[j] <= b - sum a[j] x[j] - sum a[j] x[j]. (4) j in J j in Kp j in Kn</p>
|
14313 | 14313 |
* <p>To get rid of non-binary variables we can replace the inequality (4) by the following relaxed inequality:</p>
|
14314 | |
* <p>sum a[j] x[j] <= b~, (5) j in J</p>
|
|
14314 |
* <p>sum a[j] x[j] <= b~, (5) j in J</p>
|
14315 | 14315 |
* <p>where:</p>
|
14316 | 14316 |
* <p>b~ = sup(b - sum a[j] x[j] - sum a[j] x[j]) = j in Kp j in Kn</p>
|
14317 | 14317 |
* <p>= b - inf sum a[j] x[j] - inf sum a[j] x[j] = (6) j in Kp j in Kn</p>
|
14318 | 14318 |
* <p>= b - sum a[j] l[j] - sum a[j] u[j]. j in Kp j in Kn</p>
|
14319 | 14319 |
* <p>Note that if lower bound l[j] (if j in Kp) or upper bound u[j] (if j in Kn) of some non-binary variable x[j] does not exist, then formally b = +oo, in which case further analysis is not performed.</p>
|
14320 | |
* <p>Let Bp = {j in J: a[j] > 0}, Bn = {j in J: a[j] < 0}. To make all the inequality coefficients in (5) positive, we replace all x[j] in Bn by their complementaries, substituting x[j] = 1 - x~[j] for all j in Bn, that gives:</p>
|
14321 | |
* <p>sum a[j] x[j] - sum a[j] x~[j] <= b~ - sum a[j]. (7) j in Bp j in Bn j in Bn</p>
|
|
14320 |
* <p>Let Bp = {j in J: a[j] > 0}, Bn = {j in J: a[j] < 0}. To make all the inequality coefficients in (5) positive, we replace all x[j] in Bn by their complementaries, substituting x[j] = 1 - x~[j] for all j in Bn, that gives:</p>
|
|
14321 |
* <p>sum a[j] x[j] - sum a[j] x~[j] <= b~ - sum a[j]. (7) j in Bp j in Bn j in Bn</p>
|
14322 | 14322 |
* <p>This inequality is a relaxation of the original constraint (1), and it is a binary knapsack inequality. Writing it in the standard format we have:</p>
|
14323 | |
* <p>sum alfa[j] z[j] <= beta, (8) j in J</p>
|
14324 | |
* <p>where: ( + a[j], if j in Bp, alfa[j] = < (9) ( - a[j], if j in Bn,</p>
|
14325 | |
* <p>( x[j], if j in Bp, z[j] = < (10) ( 1 - x[j], if j in Bn,</p>
|
|
14323 |
* <p>sum alfa[j] z[j] <= beta, (8) j in J</p>
|
|
14324 |
* <p>where: ( + a[j], if j in Bp, alfa[j] = < (9) ( - a[j], if j in Bn,</p>
|
|
14325 |
* <p>( x[j], if j in Bp, z[j] = < (10) ( 1 - x[j], if j in Bn,</p>
|
14326 | 14326 |
* <p>beta = b~ - sum a[j]. (11) j in Bn</p>
|
14327 | 14327 |
* <p>In the inequality (8) all coefficients are positive, therefore, the packing relaxation to be found for this inequality is the following:</p>
|
14328 | |
* <p>sum z[j] <= 1. (12) j in P</p>
|
|
14328 |
* <p>sum z[j] <= 1. (12) j in P</p>
|
14329 | 14329 |
* <p>It is obvious that set P within J, which we would like to find, must satisfy to the following condition:</p>
|
14330 | |
* <p>alfa[j] + alfa[k] > beta + eps for all j, k in P, j != k, (13)</p>
|
14331 | |
* <p>where eps is an absolute tolerance for value of the linear form. Thus, it is natural to take P = {j: alpha[j] > (beta + eps) / 2}. Moreover, if in the equality (8) there exist coefficients alfa[k], for which alfa[k] <= (beta + eps) / 2, but which, nevertheless, satisfies to the condition (13) for all j in P, *one* corresponding variable z[k] (having, for example, maximal coefficient alfa[k]) can be included in set P, that allows increasing the number of binary variables in (12) by one.</p>
|
|
14330 |
* <p>alfa[j] + alfa[k] > beta + eps for all j, k in P, j != k, (13)</p>
|
|
14331 |
* <p>where eps is an absolute tolerance for value of the linear form. Thus, it is natural to take P = {j: alpha[j] > (beta + eps) / 2}. Moreover, if in the equality (8) there exist coefficients alfa[k], for which alfa[k] <= (beta + eps) / 2, but which, nevertheless, satisfies to the condition (13) for all j in P, *one* corresponding variable z[k] (having, for example, maximal coefficient alfa[k]) can be included in set P, that allows increasing the number of binary variables in (12) by one.</p>
|
14332 | 14332 |
* <p>Once the set P has been built, for the inequality (12) we need to perform back substitution according to (10) in order to express it through the original binary variables. As the result of such back substitution the relaxed packing inequality get its final format (2), where Jp = J intersect Bp, and Jn = J intersect Bn. </p>
|
14333 | 14333 |
*/
|
14334 | 14334 |
public";
|
|
14342 | 14342 |
* <p>If the specified row (constraint) is covering inequality (see below), the routine npp_is_covering returns non-zero. Otherwise, it returns zero.</p>
|
14343 | 14343 |
* <p>COVERING INEQUALITIES</p>
|
14344 | 14344 |
* <p>In canonical format the covering inequality is the following:</p>
|
14345 | |
* <p>sum x[j] >= 1, (1) j in J</p>
|
14346 | |
* <p>where all variables x[j] are binary. This inequality expresses the condition that in any integer feasible solution variables in set J cannot be all equal to zero at the same time, i.e. at least one variable must take non-zero (unity) value. W.l.o.g. it is assumed that |J| >= 2, because if J is empty, the inequality (1) is infeasible, and if |J| = 1, the inequality (1) is a forcing row.</p>
|
|
14345 |
* <p>sum x[j] >= 1, (1) j in J</p>
|
|
14346 |
* <p>where all variables x[j] are binary. This inequality expresses the condition that in any integer feasible solution variables in set J cannot be all equal to zero at the same time, i.e. at least one variable must take non-zero (unity) value. W.l.o.g. it is assumed that |J| >= 2, because if J is empty, the inequality (1) is infeasible, and if |J| = 1, the inequality (1) is a forcing row.</p>
|
14347 | 14347 |
* <p>In general case the covering inequality may include original variables x[j] as well as their complements x~[j]:</p>
|
14348 | |
* <p>sum x[j] + sum x~[j] >= 1, (2) j in Jp j in Jn</p>
|
|
14348 |
* <p>sum x[j] + sum x~[j] >= 1, (2) j in Jp j in Jn</p>
|
14349 | 14349 |
* <p>where Jp and Jn are not intersected. Therefore, using substitution x~[j] = 1 - x[j] gives the packing inequality in generalized format:</p>
|
14350 | |
* <p>sum x[j] - sum x[j] >= 1 - |Jn|. (3) j in Jp j in Jn</p>
|
|
14350 |
* <p>sum x[j] - sum x[j] >= 1 - |Jn|. (3) j in Jp j in Jn</p>
|
14351 | 14351 |
* <p>(May note that the inequality (3) cuts off infeasible solutions, where x[j] = 0 for all j in Jp and x[j] = 1 for all j in Jn.)</p>
|
14352 | 14352 |
* <p>NOTE: If |J| = 2, the inequality (3) is equivalent to packing inequality (see the routine npp_is_packing). </p>
|
14353 | 14353 |
*/
|
|
14368 | 14368 |
* <p>PARTITIONING EQUALITIES</p>
|
14369 | 14369 |
* <p>In canonical format the partitioning equality is the following:</p>
|
14370 | 14370 |
* <p>sum x[j] = 1, (1) j in J</p>
|
14371 | |
* <p>where all variables x[j] are binary. This equality expresses the condition that in any integer feasible solution exactly one variable in set J must take non-zero (unity) value while other variables must be equal to zero. W.l.o.g. it is assumed that |J| >= 2, because if J is empty, the inequality (1) is infeasible, and if |J| = 1, the inequality (1) is a fixing row.</p>
|
|
14371 |
* <p>where all variables x[j] are binary. This equality expresses the condition that in any integer feasible solution exactly one variable in set J must take non-zero (unity) value while other variables must be equal to zero. W.l.o.g. it is assumed that |J| >= 2, because if J is empty, the inequality (1) is infeasible, and if |J| = 1, the inequality (1) is a fixing row.</p>
|
14372 | 14372 |
* <p>In general case the partitioning equality may include original variables x[j] as well as their complements x~[j]:</p>
|
14373 | 14373 |
* <p>sum x[j] + sum x~[j] = 1, (2) j in Jp j in Jn</p>
|
14374 | 14374 |
* <p>where Jp and Jn are not intersected. Therefore, using substitution x~[j] = 1 - x[j] leads to the partitioning equality in generalized format:</p>
|
|
14728 | 14728 |
* <p>#include \"glpnpp.h\" void npp_leq_row(NPP *npp, NPPROW *p);</p>
|
14729 | 14729 |
* <p>DESCRIPTION</p>
|
14730 | 14730 |
* <p>The routine npp_leq_row processes row p, which is 'not greater than' inequality constraint:</p>
|
14731 | |
* <p>(L[p] <=) sum a[p,j] x[j] <= U[p], (1) j</p>
|
14732 | |
* <p>where L[p] < U[p], and lower bound may not exist (L[p] = +oo).</p>
|
|
14731 |
* <p>(L[p] <=) sum a[p,j] x[j] <= U[p], (1) j</p>
|
|
14732 |
* <p>where L[p] < U[p], and lower bound may not exist (L[p] = +oo).</p>
|
14733 | 14733 |
* <p>PROBLEM TRANSFORMATION</p>
|
14734 | 14734 |
* <p>Constraint (1) can be replaced by equality constraint:</p>
|
14735 | 14735 |
* <p>sum a[p,j] x[j] + s = L[p], (2) j</p>
|
14736 | 14736 |
* <p>where</p>
|
14737 | |
* <p>0 <= s (<= U[p] - L[p]) (3)</p>
|
|
14737 |
* <p>0 <= s (<= U[p] - L[p]) (3)</p>
|
14738 | 14738 |
* <p>is a non-negative slack variable.</p>
|
14739 | 14739 |
* <p>Since in the primal system there appears column s having the only non-zero coefficient in row p, in the dual system there appears a new row:</p>
|
14740 | 14740 |
* <p>(+1) pi[p] + lambda = 0, (4)</p>
|
|
14784 | 14784 |
* <p>#include \"glpnpp.h\" void npp_ubnd_col(NPP *npp, NPPCOL *q);</p>
|
14785 | 14785 |
* <p>DESCRIPTION</p>
|
14786 | 14786 |
* <p>The routine npp_ubnd_col processes column q, which has upper bound:</p>
|
14787 | |
* <p>(l[q] <=) x[q] <= u[q], (1)</p>
|
14788 | |
* <p>where l[q] < u[q], and lower bound may not exist (l[q] = -oo).</p>
|
|
14787 |
* <p>(l[q] <=) x[q] <= u[q], (1)</p>
|
|
14788 |
* <p>where l[q] < u[q], and lower bound may not exist (l[q] = -oo).</p>
|
14789 | 14789 |
* <p>PROBLEM TRANSFORMATION</p>
|
14790 | 14790 |
* <p>Column q can be replaced as follows:</p>
|
14791 | 14791 |
* <p>x[q] = u[q] - s, (2)</p>
|
14792 | 14792 |
* <p>where</p>
|
14793 | |
* <p>0 <= s (<= u[q] - l[q]) (3)</p>
|
|
14793 |
* <p>0 <= s (<= u[q] - l[q]) (3)</p>
|
14794 | 14794 |
* <p>is a non-negative variable.</p>
|
14795 | 14795 |
* <p>Substituting x[q] from (2) into the objective row, we have:</p>
|
14796 | 14796 |
* <p>z = sum c[j] x[j] + c0 = j</p>
|
|
14800 | 14800 |
* <p>where</p>
|
14801 | 14801 |
* <p>c~0 = c0 + c[q] u[q] (4)</p>
|
14802 | 14802 |
* <p>is the constant term of the objective in the transformed problem. Similarly, substituting x[q] into constraint row i, we have:</p>
|
14803 | |
* <p>L[i] <= sum a[i,j] x[j] <= U[i] ==> j</p>
|
14804 | |
* <p>L[i] <= sum a[i,j] x[j] + a[i,q] x[q] <= U[i] ==> j!=q</p>
|
14805 | |
* <p>L[i] <= sum a[i,j] x[j] + a[i,q] (u[q] - s) <= U[i] ==> j!=q</p>
|
14806 | |
* <p>L~[i] <= sum a[i,j] x[j] - a[i,q] s <= U~[i], j!=q</p>
|
|
14803 |
* <p>L[i] <= sum a[i,j] x[j] <= U[i] ==> j</p>
|
|
14804 |
* <p>L[i] <= sum a[i,j] x[j] + a[i,q] x[q] <= U[i] ==> j!=q</p>
|
|
14805 |
* <p>L[i] <= sum a[i,j] x[j] + a[i,q] (u[q] - s) <= U[i] ==> j!=q</p>
|
|
14806 |
* <p>L~[i] <= sum a[i,j] x[j] - a[i,q] s <= U~[i], j!=q</p>
|
14807 | 14807 |
* <p>where</p>
|
14808 | 14808 |
* <p>L~[i] = L[i] - a[i,q] u[q], U~[i] = U[i] - a[i,q] u[q] (5)</p>
|
14809 | 14809 |
* <p>are lower and upper bounds of row i in the transformed problem, resp.</p>
|
|
14877 | 14877 |
* <p>#include \"glpnpp.h\" void npp_implied_bounds(NPP *npp, NPPROW *p);</p>
|
14878 | 14878 |
* <p>DESCRIPTION</p>
|
14879 | 14879 |
* <p>The routine npp_implied_bounds inspects general row (constraint) p:</p>
|
14880 | |
* <p>L[p] <= sum a[p,j] x[j] <= U[p], (1)</p>
|
14881 | |
* <p>l[j] <= x[j] <= u[j], (2)</p>
|
14882 | |
* <p>where L[p] <= U[p] and l[j] <= u[j] for all a[p,j] != 0, to compute implied bounds of columns (variables x[j]) in this row.</p>
|
|
14880 |
* <p>L[p] <= sum a[p,j] x[j] <= U[p], (1)</p>
|
|
14881 |
* <p>l[j] <= x[j] <= u[j], (2)</p>
|
|
14882 |
* <p>where L[p] <= U[p] and l[j] <= u[j] for all a[p,j] != 0, to compute implied bounds of columns (variables x[j]) in this row.</p>
|
14883 | 14883 |
* <p>The routine stores implied column bounds l'[j] and u'[j] in column descriptors (NPPCOL); it does not change current column bounds l[j] and u[j]. (Implied column bounds can be then used to strengthen the current column bounds; see the routines npp_implied_lower and npp_implied_upper).</p>
|
14884 | 14884 |
* <p>ALGORITHM</p>
|
14885 | 14885 |
* <p>Current column bounds (2) define implied lower and upper bounds of row (1) as follows:</p>
|
14886 | 14886 |
* <p>L'[p] = inf sum a[p,j] x[j] = j (3) = sum a[p,j] l[j] + sum a[p,j] u[j], j in Jp j in Jn</p>
|
14887 | 14887 |
* <p>U'[p] = sup sum a[p,j] x[j] = (4) = sum a[p,j] u[j] + sum a[p,j] l[j], j in Jp j in Jn</p>
|
14888 | |
* <p>Jp = {j: a[p,j] > 0}, Jn = {j: a[p,j] < 0}. (5)</p>
|
14889 | |
* <p>(Note that bounds of all columns in row p are assumed to be correct, so L'[p] <= U'[p].)</p>
|
14890 | |
* <p>If L[p] > L'[p] and/or U[p] < U'[p], the lower and/or upper bound of row (1) can be active, in which case such row defines implied bounds of its variables.</p>
|
14891 | |
* <p>Let x[k] be some variable having in row (1) coefficient a[p,k] != 0. Consider a case when row lower bound can be active (L[p] > L'[p]):</p>
|
14892 | |
* <p>sum a[p,j] x[j] >= L[p] ==> j</p>
|
14893 | |
* <p>sum a[p,j] x[j] + a[p,k] x[k] >= L[p] ==> j!=k (6) a[p,k] x[k] >= L[p] - sum a[p,j] x[j] ==> j!=k</p>
|
14894 | |
* <p>a[p,k] x[k] >= L[p,k],</p>
|
|
14888 |
* <p>Jp = {j: a[p,j] > 0}, Jn = {j: a[p,j] < 0}. (5)</p>
|
|
14889 |
* <p>(Note that bounds of all columns in row p are assumed to be correct, so L'[p] <= U'[p].)</p>
|
|
14890 |
* <p>If L[p] > L'[p] and/or U[p] < U'[p], the lower and/or upper bound of row (1) can be active, in which case such row defines implied bounds of its variables.</p>
|
|
14891 |
* <p>Let x[k] be some variable having in row (1) coefficient a[p,k] != 0. Consider a case when row lower bound can be active (L[p] > L'[p]):</p>
|
|
14892 |
* <p>sum a[p,j] x[j] >= L[p] ==> j</p>
|
|
14893 |
* <p>sum a[p,j] x[j] + a[p,k] x[k] >= L[p] ==> j!=k (6) a[p,k] x[k] >= L[p] - sum a[p,j] x[j] ==> j!=k</p>
|
|
14894 |
* <p>a[p,k] x[k] >= L[p,k],</p>
|
14895 | 14895 |
* <p>where</p>
|
14896 | 14896 |
* <p>L[p,k] = inf(L[p] - sum a[p,j] x[j]) = j!=k</p>
|
14897 | 14897 |
* <p>= L[p] - sup sum a[p,j] x[j] = (7) j!=k</p>
|
14898 | 14898 |
* <p>= L[p] - sum a[p,j] u[j] - sum a[p,j] l[j]. j in Jpk} j in Jnk}</p>
|
14899 | 14899 |
* <p>Thus:</p>
|
14900 | |
* <p>x[k] >= l'[k] = L[p,k] / a[p,k], if a[p,k] > 0, (8)</p>
|
14901 | |
* <p>x[k] <= u'[k] = L[p,k] / a[p,k], if a[p,k] < 0. (9)</p>
|
|
14900 |
* <p>x[k] >= l'[k] = L[p,k] / a[p,k], if a[p,k] > 0, (8)</p>
|
|
14901 |
* <p>x[k] <= u'[k] = L[p,k] / a[p,k], if a[p,k] < 0. (9)</p>
|
14902 | 14902 |
* <p>where l'[k] and u'[k] are implied lower and upper bounds of variable x[k], resp.</p>
|
14903 | |
* <p>Now consider a similar case when row upper bound can be active (U[p] < U'[p]):</p>
|
14904 | |
* <p>sum a[p,j] x[j] <= U[p] ==> j</p>
|
14905 | |
* <p>sum a[p,j] x[j] + a[p,k] x[k] <= U[p] ==> j!=k (10) a[p,k] x[k] <= U[p] - sum a[p,j] x[j] ==> j!=k</p>
|
14906 | |
* <p>a[p,k] x[k] <= U[p,k],</p>
|
|
14903 |
* <p>Now consider a similar case when row upper bound can be active (U[p] < U'[p]):</p>
|
|
14904 |
* <p>sum a[p,j] x[j] <= U[p] ==> j</p>
|
|
14905 |
* <p>sum a[p,j] x[j] + a[p,k] x[k] <= U[p] ==> j!=k (10) a[p,k] x[k] <= U[p] - sum a[p,j] x[j] ==> j!=k</p>
|
|
14906 |
* <p>a[p,k] x[k] <= U[p,k],</p>
|
14907 | 14907 |
* <p>where:</p>
|
14908 | 14908 |
* <p>U[p,k] = sup(U[p] - sum a[p,j] x[j]) = j!=k</p>
|
14909 | 14909 |
* <p>= U[p] - inf sum a[p,j] x[j] = (11) j!=k</p>
|
14910 | 14910 |
* <p>= U[p] - sum a[p,j] l[j] - sum a[p,j] u[j]. j in Jpk} j in Jnk}</p>
|
14911 | 14911 |
* <p>Thus:</p>
|
14912 | |
* <p>x[k] <= u'[k] = U[p,k] / a[p,k], if a[p,k] > 0, (12)</p>
|
14913 | |
* <p>x[k] >= l'[k] = U[p,k] / a[p,k], if a[p,k] < 0. (13)</p>
|
|
14912 |
* <p>x[k] <= u'[k] = U[p,k] / a[p,k], if a[p,k] > 0, (12)</p>
|
|
14913 |
* <p>x[k] >= l'[k] = U[p,k] / a[p,k], if a[p,k] < 0. (13)</p>
|
14914 | 14914 |
* <p>Note that in formulae (8), (9), (12), and (13) coefficient a[p,k] must not be too small in magnitude relatively to other non-zero coefficients in row (1), i.e. the following condition must hold:</p>
|
14915 | |
* <p>|a[p,k]| >= eps * max(1, |a[p,j]|), (14) j</p>
|
|
14915 |
* <p>|a[p,k]| >= eps * max(1, |a[p,j]|), (14) j</p>
|
14916 | 14916 |
* <p>where eps is a relative tolerance for constraint coefficients. Otherwise the implied column bounds can be numerical inreliable. For example, using formula (8) for the following inequality constraint:</p>
|
14917 | |
* <p>1e-12 x1 - x2 - x3 >= 0,</p>
|
14918 | |
* <p>where x1 >= -1, x2, x3, >= 0, may lead to numerically unreliable conclusion that x1 >= 0.</p>
|
|
14917 |
* <p>1e-12 x1 - x2 - x3 >= 0,</p>
|
|
14918 |
* <p>where x1 >= -1, x2, x3, >= 0, may lead to numerically unreliable conclusion that x1 >= 0.</p>
|
14919 | 14919 |
* <p>Using formulae (8), (9), (12), and (13) to compute implied bounds for one variable requires |J| operations, where J = {j: a[p,j] != 0}, because this needs computing L[p,k] and U[p,k]. Thus, computing implied bounds for all variables in row (1) would require |J|^2 operations, that is not a good technique. However, the total number of operations can be reduced to |J| as follows.</p>
|
14920 | |
* <p>Let a[p,k] > 0. Then from (7) and (11) we have:</p>
|
|
14920 |
* <p>Let a[p,k] > 0. Then from (7) and (11) we have:</p>
|
14921 | 14921 |
* <p>L[p,k] = L[p] - (U'[p] - a[p,k] u[k]) =</p>
|
14922 | 14922 |
* <p>= L[p] - U'[p] + a[p,k] u[k],</p>
|
14923 | 14923 |
* <p>U[p,k] = U[p] - (L'[p] - a[p,k] l[k]) =</p>
|
|
14925 | 14925 |
* <p>where L'[p] and U'[p] are implied row lower and upper bounds defined by formulae (3) and (4). Substituting these expressions into (8) and (12) gives:</p>
|
14926 | 14926 |
* <p>l'[k] = L[p,k] / a[p,k] = u[k] + (L[p] - U'[p]) / a[p,k], (15)</p>
|
14927 | 14927 |
* <p>u'[k] = U[p,k] / a[p,k] = l[k] + (U[p] - L'[p]) / a[p,k]. (16)</p>
|
14928 | |
* <p>Similarly, if a[p,k] < 0, according to (7) and (11) we have:</p>
|
|
14928 |
* <p>Similarly, if a[p,k] < 0, according to (7) and (11) we have:</p>
|
14929 | 14929 |
* <p>L[p,k] = L[p] - (U'[p] - a[p,k] l[k]) =</p>
|
14930 | 14930 |
* <p>= L[p] - U'[p] + a[p,k] l[k],</p>
|
14931 | 14931 |
* <p>U[p,k] = U[p] - (L'[p] - a[p,k] u[k]) =</p>
|
|
14933 | 14933 |
* <p>and substituting these expressions into (8) and (12) gives:</p>
|
14934 | 14934 |
* <p>l'[k] = U[p,k] / a[p,k] = u[k] + (U[p] - L'[p]) / a[p,k], (17)</p>
|
14935 | 14935 |
* <p>u'[k] = L[p,k] / a[p,k] = l[k] + (L[p] - U'[p]) / a[p,k]. (18)</p>
|
14936 | |
* <p>Note that formulae (15)-(18) can be used only if L'[p] and U'[p] exist. However, if for some variable x[j] it happens that l[j] = -oo and/or u[j] = +oo, values of L'[p] (if a[p,j] > 0) and/or U'[p] (if a[p,j] < 0) are undefined. Consider, therefore, the most general situation, when some column bounds (2) may not exist.</p>
|
|
14936 |
* <p>Note that formulae (15)-(18) can be used only if L'[p] and U'[p] exist. However, if for some variable x[j] it happens that l[j] = -oo and/or u[j] = +oo, values of L'[p] (if a[p,j] > 0) and/or U'[p] (if a[p,j] < 0) are undefined. Consider, therefore, the most general situation, when some column bounds (2) may not exist.</p>
|
14937 | 14937 |
* <p>Let:</p>
|
14938 | |
* <p>J' = {j : (a[p,j] > 0 and l[j] = -oo) or (19) (a[p,j] < 0 and u[j] = +oo)}.</p>
|
|
14938 |
* <p>J' = {j : (a[p,j] > 0 and l[j] = -oo) or (19) (a[p,j] < 0 and u[j] = +oo)}.</p>
|
14939 | 14939 |
* <p>Then (assuming that row upper bound U[p] can be active) the following three cases are possible:</p>
|
14940 | 14940 |
* <p>1) |J'| = 0. In this case L'[p] exists, thus, for all variables x[j] in row (1) we can use formulae (16) and (17);</p>
|
14941 | |
* <p>2) J' = {k}. In this case L'[p] = -oo, however, U[p,k] (11) exists, so for variable x[k] we can use formulae (12) and (13). Note that for all other variables x[j] (j != k) l'[j] = -oo (if a[p,j] < 0) or u'[j] = +oo (if a[p,j] > 0);</p>
|
14942 | |
* <p>3) |J'| > 1. In this case for all variables x[j] in row [1] we have l'[j] = -oo (if a[p,j] < 0) or u'[j] = +oo (if a[p,j] > 0).</p>
|
|
14941 |
* <p>2) J' = {k}. In this case L'[p] = -oo, however, U[p,k] (11) exists, so for variable x[k] we can use formulae (12) and (13). Note that for all other variables x[j] (j != k) l'[j] = -oo (if a[p,j] < 0) or u'[j] = +oo (if a[p,j] > 0);</p>
|
|
14942 |
* <p>3) |J'| > 1. In this case for all variables x[j] in row [1] we have l'[j] = -oo (if a[p,j] < 0) or u'[j] = +oo (if a[p,j] > 0).</p>
|
14943 | 14943 |
* <p>Similarly, let:</p>
|
14944 | |
* <p>J'' = {j : (a[p,j] > 0 and u[j] = +oo) or (20) (a[p,j] < 0 and l[j] = -oo)}.</p>
|
|
14944 |
* <p>J'' = {j : (a[p,j] > 0 and u[j] = +oo) or (20) (a[p,j] < 0 and l[j] = -oo)}.</p>
|
14945 | 14945 |
* <p>Then (assuming that row lower bound L[p] can be active) the following three cases are possible:</p>
|
14946 | 14946 |
* <p>1) |J''| = 0. In this case U'[p] exists, thus, for all variables x[j] in row (1) we can use formulae (15) and (18);</p>
|
14947 | |
* <p>2) J'' = {k}. In this case U'[p] = +oo, however, L[p,k] (7) exists, so for variable x[k] we can use formulae (8) and (9). Note that for all other variables x[j] (j != k) l'[j] = -oo (if a[p,j] > 0) or u'[j] = +oo (if a[p,j] < 0);</p>
|
14948 | |
* <p>3) |J''| > 1. In this case for all variables x[j] in row (1) we have l'[j] = -oo (if a[p,j] > 0) or u'[j] = +oo (if a[p,j] < 0). </p>
|
|
14947 |
* <p>2) J'' = {k}. In this case U'[p] = +oo, however, L[p,k] (7) exists, so for variable x[k] we can use formulae (8) and (9). Note that for all other variables x[j] (j != k) l'[j] = -oo (if a[p,j] > 0) or u'[j] = +oo (if a[p,j] < 0);</p>
|
|
14948 |
* <p>3) |J''| > 1. In this case for all variables x[j] in row (1) we have l'[j] = -oo (if a[p,j] > 0) or u'[j] = +oo (if a[p,j] < 0). </p>
|
14949 | 14949 |
*/
|
14950 | 14950 |
public";
|
14951 | 14951 |
|
|
14956 | 14956 |
* <p>#include \"glpnpp.h\" int npp_empty_row(NPP *npp, NPPROW *p);</p>
|
14957 | 14957 |
* <p>DESCRIPTION</p>
|
14958 | 14958 |
* <p>The routine npp_empty_row processes row p, which is empty, i.e. coefficients at all columns in this row are zero:</p>
|
14959 | |
* <p>L[p] <= sum 0 x[j] <= U[p], (1)</p>
|
14960 | |
* <p>where L[p] <= U[p].</p>
|
|
14959 |
* <p>L[p] <= sum 0 x[j] <= U[p], (1)</p>
|
|
14960 |
* <p>where L[p] <= U[p].</p>
|
14961 | 14961 |
* <p>RETURNS</p>
|
14962 | 14962 |
* <p>0 - success;</p>
|
14963 | 14963 |
* <p>1 - problem has no primal feasible solution.</p>
|
14964 | 14964 |
* <p>PROBLEM TRANSFORMATION</p>
|
14965 | 14965 |
* <p>If the following conditions hold:</p>
|
14966 | |
* <p>L[p] <= +eps, U[p] >= -eps, (2)</p>
|
|
14966 |
* <p>L[p] <= +eps, U[p] >= -eps, (2)</p>
|
14967 | 14967 |
* <p>where eps is an absolute tolerance for row value, the row p is redundant. In this case it can be replaced by equivalent redundant row, which is free (unbounded), and then removed from the problem. Otherwise, the row p is infeasible and, thus, the problem has no primal feasible solution.</p>
|
14968 | 14968 |
* <p>RECOVERING BASIC SOLUTION</p>
|
14969 | 14969 |
* <p>See the routine npp_free_row.</p>
|
|
14991 | 14991 |
* <p>#include \"glpnpp.h\" int npp_implied_value(NPP *npp, NPPCOL *q, double s);</p>
|
14992 | 14992 |
* <p>DESCRIPTION</p>
|
14993 | 14993 |
* <p>For column q:</p>
|
14994 | |
* <p>l[q] <= x[q] <= u[q], (1)</p>
|
14995 | |
* <p>where l[q] < u[q], the routine npp_implied_value processes its implied value s[q]. If this implied value satisfies to the current column bounds and integrality condition, the routine fixes column q at the given point. Note that the column is kept in the problem in any case.</p>
|
|
14994 |
* <p>l[q] <= x[q] <= u[q], (1)</p>
|
|
14995 |
* <p>where l[q] < u[q], the routine npp_implied_value processes its implied value s[q]. If this implied value satisfies to the current column bounds and integrality condition, the routine fixes column q at the given point. Note that the column is kept in the problem in any case.</p>
|
14996 | 14996 |
* <p>RETURNS</p>
|
14997 | 14997 |
* <p>0 - column has been fixed;</p>
|
14998 | 14998 |
* <p>1 - implied value violates to current column bounds;</p>
|
14999 | 14999 |
* <p>2 - implied value violates integrality condition.</p>
|
15000 | 15000 |
* <p>ALGORITHM</p>
|
15001 | 15001 |
* <p>Implied column value s[q] satisfies to the current column bounds if the following condition holds:</p>
|
15002 | |
* <p>l[q] - eps <= s[q] <= u[q] + eps, (2)</p>
|
|
15002 |
* <p>l[q] - eps <= s[q] <= u[q] + eps, (2)</p>
|
15003 | 15003 |
* <p>where eps is an absolute tolerance for column value. If the column is integral, the following condition also must hold:</p>
|
15004 | |
* <p>|s[q] - floor(s[q]+0.5)| <= eps, (3)</p>
|
|
15004 |
* <p>|s[q] - floor(s[q]+0.5)| <= eps, (3)</p>
|
15005 | 15005 |
* <p>where floor(s[q]+0.5) is the nearest integer to s[q].</p>
|
15006 | 15006 |
* <p>If both condition (2) and (3) are satisfied, the column can be fixed at the value s[q], or, if it is integral, at floor(s[q]+0.5). Otherwise, if s[q] violates (2) or (3), the problem has no feasible solution.</p>
|
15007 | 15007 |
* <p>Note: If s[q] is close to l[q] or u[q], it seems to be reasonable to fix the column at its lower or upper bound, resp. rather than at the implied value. </p>
|
|
15025 | 15025 |
* <p>#include \"glpnpp.h\" int npp_implied_lower(NPP *npp, NPPCOL *q, double l);</p>
|
15026 | 15026 |
* <p>DESCRIPTION</p>
|
15027 | 15027 |
* <p>For column q:</p>
|
15028 | |
* <p>l[q] <= x[q] <= u[q], (1)</p>
|
15029 | |
* <p>where l[q] < u[q], the routine npp_implied_lower processes its implied lower bound l'[q]. As the result the current column lower bound may increase. Note that the column is kept in the problem in any case.</p>
|
|
15028 |
* <p>l[q] <= x[q] <= u[q], (1)</p>
|
|
15029 |
* <p>where l[q] < u[q], the routine npp_implied_lower processes its implied lower bound l'[q]. As the result the current column lower bound may increase. Note that the column is kept in the problem in any case.</p>
|
15030 | 15030 |
* <p>RETURNS</p>
|
15031 | 15031 |
* <p>0 - current column lower bound has not changed;</p>
|
15032 | 15032 |
* <p>1 - current column lower bound has changed, but not significantly;</p>
|
|
15035 | 15035 |
* <p>4 - implied lower bound violates current column upper bound.</p>
|
15036 | 15036 |
* <p>ALGORITHM</p>
|
15037 | 15037 |
* <p>If column q is integral, before processing its implied lower bound should be rounded up:</p>
|
15038 | |
* <p>( floor(l'[q]+0.5), if |l'[q] - floor(l'[q]+0.5)| <= eps l'[q] := < (2) ( ceil(l'[q]), otherwise</p>
|
|
15038 |
* <p>( floor(l'[q]+0.5), if |l'[q] - floor(l'[q]+0.5)| <= eps l'[q] := < (2) ( ceil(l'[q]), otherwise</p>
|
15039 | 15039 |
* <p>where floor(l'[q]+0.5) is the nearest integer to l'[q], ceil(l'[q]) is smallest integer not less than l'[q], and eps is an absolute tolerance for column value.</p>
|
15040 | 15040 |
* <p>Processing implied column lower bound l'[q] includes the following cases:</p>
|
15041 | |
* <p>1) if l'[q] < l[q] + eps, implied lower bound is redundant;</p>
|
15042 | |
* <p>2) if l[q] + eps <= l[q] <= u[q] + eps, current column lower bound l[q] can be strengthened by replacing it with l'[q]. If in this case new column lower bound becomes close to current column upper bound u[q], the column can be fixed on its upper bound;</p>
|
15043 | |
* <p>3) if l'[q] > u[q] + eps, implied lower bound violates current column upper bound u[q], in which case the problem has no primal feasible solution. </p>
|
|
15041 |
* <p>1) if l'[q] < l[q] + eps, implied lower bound is redundant;</p>
|
|
15042 |
* <p>2) if l[q] + eps <= l[q] <= u[q] + eps, current column lower bound l[q] can be strengthened by replacing it with l'[q]. If in this case new column lower bound becomes close to current column upper bound u[q], the column can be fixed on its upper bound;</p>
|
|
15043 |
* <p>3) if l'[q] > u[q] + eps, implied lower bound violates current column upper bound u[q], in which case the problem has no primal feasible solution. </p>
|
15044 | 15044 |
*/
|
15045 | 15045 |
public";
|
15046 | 15046 |
|
|
15051 | 15051 |
* <p>#include \"glpnpp.h\" int npp_implied_upper(NPP *npp, NPPCOL *q, double u);</p>
|
15052 | 15052 |
* <p>DESCRIPTION</p>
|
15053 | 15053 |
* <p>For column q:</p>
|
15054 | |
* <p>l[q] <= x[q] <= u[q], (1)</p>
|
15055 | |
* <p>where l[q] < u[q], the routine npp_implied_upper processes its implied upper bound u'[q]. As the result the current column upper bound may decrease. Note that the column is kept in the problem in any case.</p>
|
|
15054 |
* <p>l[q] <= x[q] <= u[q], (1)</p>
|
|
15055 |
* <p>where l[q] < u[q], the routine npp_implied_upper processes its implied upper bound u'[q]. As the result the current column upper bound may decrease. Note that the column is kept in the problem in any case.</p>
|
15056 | 15056 |
* <p>RETURNS</p>
|
15057 | 15057 |
* <p>0 - current column upper bound has not changed;</p>
|
15058 | 15058 |
* <p>1 - current column upper bound has changed, but not significantly;</p>
|
|
15061 | 15061 |
* <p>4 - implied upper bound violates current column lower bound.</p>
|
15062 | 15062 |
* <p>ALGORITHM</p>
|
15063 | 15063 |
* <p>If column q is integral, before processing its implied upper bound should be rounded down:</p>
|
15064 | |
* <p>( floor(u'[q]+0.5), if |u'[q] - floor(l'[q]+0.5)| <= eps u'[q] := < (2) ( floor(l'[q]), otherwise</p>
|
|
15064 |
* <p>( floor(u'[q]+0.5), if |u'[q] - floor(l'[q]+0.5)| <= eps u'[q] := < (2) ( floor(l'[q]), otherwise</p>
|
15065 | 15065 |
* <p>where floor(u'[q]+0.5) is the nearest integer to u'[q], floor(u'[q]) is largest integer not greater than u'[q], and eps is an absolute tolerance for column value.</p>
|
15066 | 15066 |
* <p>Processing implied column upper bound u'[q] includes the following cases:</p>
|
15067 | |
* <p>1) if u'[q] > u[q] - eps, implied upper bound is redundant;</p>
|
15068 | |
* <p>2) if l[q] - eps <= u[q] <= u[q] - eps, current column upper bound u[q] can be strengthened by replacing it with u'[q]. If in this case new column upper bound becomes close to current column lower bound, the column can be fixed on its lower bound;</p>
|
15069 | |
* <p>3) if u'[q] < l[q] - eps, implied upper bound violates current column lower bound l[q], in which case the problem has no primal feasible solution. </p>
|
|
15067 |
* <p>1) if u'[q] > u[q] - eps, implied upper bound is redundant;</p>
|
|
15068 |
* <p>2) if l[q] - eps <= u[q] <= u[q] - eps, current column upper bound u[q] can be strengthened by replacing it with u'[q]. If in this case new column upper bound becomes close to current column lower bound, the column can be fixed on its lower bound;</p>
|
|
15069 |
* <p>3) if u'[q] < l[q] - eps, implied upper bound violates current column lower bound l[q], in which case the problem has no primal feasible solution. </p>
|
15070 | 15070 |
*/
|
15071 | 15071 |
public";
|
15072 | 15072 |
|
|
15127 | 15127 |
* <p>#include \"glpnpp.h\" int npp_analyze_row(NPP *npp, NPPROW *p);</p>
|
15128 | 15128 |
* <p>DESCRIPTION</p>
|
15129 | 15129 |
* <p>The routine npp_analyze_row performs analysis of row p of general format:</p>
|
15130 | |
* <p>L[p] <= sum a[p,j] x[j] <= U[p], (1) j</p>
|
15131 | |
* <p>l[j] <= x[j] <= u[j], (2)</p>
|
15132 | |
* <p>where L[p] <= U[p] and l[j] <= u[j] for all a[p,j] != 0.</p>
|
|
15130 |
* <p>L[p] <= sum a[p,j] x[j] <= U[p], (1) j</p>
|
|
15131 |
* <p>l[j] <= x[j] <= u[j], (2)</p>
|
|
15132 |
* <p>where L[p] <= U[p] and l[j] <= u[j] for all a[p,j] != 0.</p>
|
15133 | 15133 |
* <p>RETURNS</p>
|
15134 | 15134 |
* <p>0x?0 - row lower bound does not exist or is redundant;</p>
|
15135 | 15135 |
* <p>0x?1 - row lower bound can be active;</p>
|
|
15142 | 15142 |
* <p>Analysis of row (1) is based on analysis of its implied lower and upper bounds, which are determined by bounds of corresponding columns (variables) as follows:</p>
|
15143 | 15143 |
* <p>L'[p] = inf sum a[p,j] x[j] = j (3) = sum a[p,j] l[j] + sum a[p,j] u[j], j in Jp j in Jn</p>
|
15144 | 15144 |
* <p>U'[p] = sup sum a[p,j] x[j] = (4) = sum a[p,j] u[j] + sum a[p,j] l[j], j in Jp j in Jn</p>
|
15145 | |
* <p>Jp = {j: a[p,j] > 0}, Jn = {j: a[p,j] < 0}. (5)</p>
|
15146 | |
* <p>(Note that bounds of all columns in row p are assumed to be correct, so L'[p] <= U'[p].)</p>
|
|
15145 |
* <p>Jp = {j: a[p,j] > 0}, Jn = {j: a[p,j] < 0}. (5)</p>
|
|
15146 |
* <p>(Note that bounds of all columns in row p are assumed to be correct, so L'[p] <= U'[p].)</p>
|
15147 | 15147 |
* <p>Analysis of row lower bound L[p] includes the following cases:</p>
|
15148 | |
* <p>1) if L[p] > U'[p] + eps, where eps is an absolute tolerance for row value, row lower bound L[p] and implied row upper bound U'[p] are inconsistent, ergo, the problem has no primal feasible solution;</p>
|
15149 | |
* <p>2) if U'[p] - eps <= L[p] <= U'[p] + eps, i.e. if L[p] =~ U'[p], the row is a forcing row on its lower bound (see description of the routine npp_forcing_row);</p>
|
15150 | |
* <p>3) if L[p] > L'[p] + eps, row lower bound L[p] can be active (this conclusion does not account other rows in the problem);</p>
|
15151 | |
* <p>4) if L[p] <= L'[p] + eps, row lower bound L[p] cannot be active, so it is redundant and can be removed (replaced by -oo).</p>
|
|
15148 |
* <p>1) if L[p] > U'[p] + eps, where eps is an absolute tolerance for row value, row lower bound L[p] and implied row upper bound U'[p] are inconsistent, ergo, the problem has no primal feasible solution;</p>
|
|
15149 |
* <p>2) if U'[p] - eps <= L[p] <= U'[p] + eps, i.e. if L[p] =~ U'[p], the row is a forcing row on its lower bound (see description of the routine npp_forcing_row);</p>
|
|
15150 |
* <p>3) if L[p] > L'[p] + eps, row lower bound L[p] can be active (this conclusion does not account other rows in the problem);</p>
|
|
15151 |
* <p>4) if L[p] <= L'[p] + eps, row lower bound L[p] cannot be active, so it is redundant and can be removed (replaced by -oo).</p>
|
15152 | 15152 |
* <p>Analysis of row upper bound U[p] is performed in a similar way and includes the following cases:</p>
|
15153 | |
* <p>1) if U[p] < L'[p] - eps, row upper bound U[p] and implied row lower bound L'[p] are inconsistent, ergo the problem has no primal feasible solution;</p>
|
15154 | |
* <p>2) if L'[p] - eps <= U[p] <= L'[p] + eps, i.e. if U[p] =~ L'[p], the row is a forcing row on its upper bound (see description of the routine npp_forcing_row);</p>
|
15155 | |
* <p>3) if U[p] < U'[p] - eps, row upper bound U[p] can be active (this conclusion does not account other rows in the problem);</p>
|
15156 | |
* <p>4) if U[p] >= U'[p] - eps, row upper bound U[p] cannot be active, so it is redundant and can be removed (replaced by +oo). </p>
|
|
15153 |
* <p>1) if U[p] < L'[p] - eps, row upper bound U[p] and implied row lower bound L'[p] are inconsistent, ergo the problem has no primal feasible solution;</p>
|
|
15154 |
* <p>2) if L'[p] - eps <= U[p] <= L'[p] + eps, i.e. if U[p] =~ L'[p], the row is a forcing row on its upper bound (see description of the routine npp_forcing_row);</p>
|
|
15155 |
* <p>3) if U[p] < U'[p] - eps, row upper bound U[p] can be active (this conclusion does not account other rows in the problem);</p>
|
|
15156 |
* <p>4) if U[p] >= U'[p] - eps, row upper bound U[p] cannot be active, so it is redundant and can be removed (replaced by +oo). </p>
|
15157 | 15157 |
*/
|
15158 | 15158 |
public";
|
15159 | 15159 |
|
|
15178 | 15178 |
* <p>The routine npp_reduce_ineq_coef returns the number of coefficients reduced.</p>
|
15179 | 15179 |
* <p>BACKGROUND</p>
|
15180 | 15180 |
* <p>Consider an inequality constraint:</p>
|
15181 | |
* <p>sum a[j] x[j] >= b. (1) j in J</p>
|
15182 | |
* <p>(In case of '<=' inequality it can be transformed to '>=' format by multiplying both its sides by -1.) Let x[k] be a binary variable; other variables can be integer as well as continuous. We can write constraint (1) as follows:</p>
|
15183 | |
* <p>a[k] x[k] + t[k] >= b, (2)</p>
|
|
15181 |
* <p>sum a[j] x[j] >= b. (1) j in J</p>
|
|
15182 |
* <p>(In case of '<=' inequality it can be transformed to '>=' format by multiplying both its sides by -1.) Let x[k] be a binary variable; other variables can be integer as well as continuous. We can write constraint (1) as follows:</p>
|
|
15183 |
* <p>a[k] x[k] + t[k] >= b, (2)</p>
|
15184 | 15184 |
* <p>where:</p>
|
15185 | 15185 |
* <p>t[k] = sum a[j] x[j]. (3) j in Jk}</p>
|
15186 | 15186 |
* <p>Since x[k] is binary, constraint (2) is equivalent to disjunction of the following two constraints:</p>
|
15187 | |
* <p>x[k] = 0, t[k] >= b (4)</p>
|
|
15187 |
* <p>x[k] = 0, t[k] >= b (4)</p>
|
15188 | 15188 |
* <p>OR</p>
|
15189 | |
* <p>x[k] = 1, t[k] >= b - a[k]. (5)</p>
|
|
15189 |
* <p>x[k] = 1, t[k] >= b - a[k]. (5)</p>
|
15190 | 15190 |
* <p>Let also that for the partial sum t[k] be known some its implied lower bound inf t[k].</p>
|
15191 | |
* <p>Case a[k] > 0. Let inf t[k] < b, since otherwise both constraints (4) and (5) and therefore constraint (2) are redundant. If inf t[k] > b - a[k], only constraint (5) is redundant, in which case it can be replaced with the following redundant and therefore equivalent constraint:</p>
|
15192 | |
* <p>t[k] >= b - a'[k] = inf t[k], (6)</p>
|
|
15191 |
* <p>Case a[k] > 0. Let inf t[k] < b, since otherwise both constraints (4) and (5) and therefore constraint (2) are redundant. If inf t[k] > b - a[k], only constraint (5) is redundant, in which case it can be replaced with the following redundant and therefore equivalent constraint:</p>
|
|
15192 |
* <p>t[k] >= b - a'[k] = inf t[k], (6)</p>
|
15193 | 15193 |
* <p>where:</p>
|
15194 | 15194 |
* <p>a'[k] = b - inf t[k]. (7)</p>
|
15195 | 15195 |
* <p>Thus, the original constraint (2) is equivalent to the following constraint with coefficient at variable x[k] changed:</p>
|
15196 | |
* <p>a'[k] x[k] + t[k] >= b. (8)</p>
|
15197 | |
* <p>From inf t[k] < b it follows that a'[k] > 0, i.e. the coefficient at x[k] keeps its sign. And from inf t[k] > b - a[k] it follows that a'[k] < a[k], i.e. the coefficient reduces in magnitude.</p>
|
15198 | |
* <p>Case a[k] < 0. Let inf t[k] < b - a[k], since otherwise both constraints (4) and (5) and therefore constraint (2) are redundant. If inf t[k] > b, only constraint (4) is redundant, in which case it can be replaced with the following redundant and therefore equivalent constraint:</p>
|
15199 | |
* <p>t[k] >= b' = inf t[k]. (9)</p>
|
|
15196 |
* <p>a'[k] x[k] + t[k] >= b. (8)</p>
|
|
15197 |
* <p>From inf t[k] < b it follows that a'[k] > 0, i.e. the coefficient at x[k] keeps its sign. And from inf t[k] > b - a[k] it follows that a'[k] < a[k], i.e. the coefficient reduces in magnitude.</p>
|
|
15198 |
* <p>Case a[k] < 0. Let inf t[k] < b - a[k], since otherwise both constraints (4) and (5) and therefore constraint (2) are redundant. If inf t[k] > b, only constraint (4) is redundant, in which case it can be replaced with the following redundant and therefore equivalent constraint:</p>
|
|
15199 |
* <p>t[k] >= b' = inf t[k]. (9)</p>
|
15200 | 15200 |
* <p>Rewriting constraint (5) as follows:</p>
|
15201 | |
* <p>t[k] >= b - a[k] = b' - a'[k], (10)</p>
|
|
15201 |
* <p>t[k] >= b - a[k] = b' - a'[k], (10)</p>
|
15202 | 15202 |
* <p>where:</p>
|
15203 | 15203 |
* <p>a'[k] = a[k] + b' - b = a[k] + inf t[k] - b, (11)</p>
|
15204 | 15204 |
* <p>we can see that disjunction of constraint (9) and (10) is equivalent to disjunction of constraint (4) and (5), from which it follows that the original constraint (2) is equivalent to the following constraint with both coefficient at variable x[k] and right-hand side changed:</p>
|
15205 | |
* <p>a'[k] x[k] + t[k] >= b'. (12)</p>
|
15206 | |
* <p>From inf t[k] < b - a[k] it follows that a'[k] < 0, i.e. the coefficient at x[k] keeps its sign. And from inf t[k] > b it follows that a'[k] > a[k], i.e. the coefficient reduces in magnitude.</p>
|
|
15205 |
* <p>a'[k] x[k] + t[k] >= b'. (12)</p>
|
|
15206 |
* <p>From inf t[k] < b - a[k] it follows that a'[k] < 0, i.e. the coefficient at x[k] keeps its sign. And from inf t[k] > b it follows that a'[k] > a[k], i.e. the coefficient reduces in magnitude.</p>
|
15207 | 15207 |
* <p>PROBLEM TRANSFORMATION</p>
|
15208 | 15208 |
* <p>In the routine npp_reduce_ineq_coef the following implied lower bound of the partial sum (3) is used:</p>
|
15209 | 15209 |
* <p>inf t[k] = sum a[j] l[j] + sum a[j] u[j], (13) j in Jpk} k in Jnk}</p>
|
15210 | |
* <p>where Jp = {j : a[j] > 0}, Jn = {j : a[j] < 0}, l[j] and u[j] are lower and upper bounds, resp., of variable x[j].</p>
|
|
15210 |
* <p>where Jp = {j : a[j] > 0}, Jn = {j : a[j] < 0}, l[j] and u[j] are lower and upper bounds, resp., of variable x[j].</p>
|
15211 | 15211 |
* <p>In order to compute inf t[k] more efficiently, the following formula, which is equivalent to (13), is actually used:</p>
|
15212 | |
* <p>( h - a[k] l[k] = h, if a[k] > 0, inf t[k] = < (14) ( h - a[k] u[k] = h - a[k], if a[k] < 0,</p>
|
|
15212 |
* <p>( h - a[k] l[k] = h, if a[k] > 0, inf t[k] = < (14) ( h - a[k] u[k] = h - a[k], if a[k] < 0,</p>
|
15213 | 15213 |
* <p>where:</p>
|
15214 | 15214 |
* <p>h = sum a[j] l[j] + sum a[j] u[j] (15) j in Jp j in Jn</p>
|
15215 | 15215 |
* <p>is the implied lower bound of row (1).</p>
|
15216 | |
* <p>Reduction of positive coefficient (a[k] > 0) does not change value of h, since l[k] = 0. In case of reduction of negative coefficient (a[k] < 0) from (11) it follows that:</p>
|
15217 | |
* <p>delta a[k] = a'[k] - a[k] = inf t[k] - b (> 0), (16)</p>
|
|
15216 |
* <p>Reduction of positive coefficient (a[k] > 0) does not change value of h, since l[k] = 0. In case of reduction of negative coefficient (a[k] < 0) from (11) it follows that:</p>
|
|
15217 |
* <p>delta a[k] = a'[k] - a[k] = inf t[k] - b (> 0), (16)</p>
|
15218 | 15218 |
* <p>so new value of h (accounting that u[k] = 1) can be computed as follows:</p>
|
15219 | 15219 |
* <p>h := h + delta a[k] = h + (inf t[k] - b). (17)</p>
|
15220 | 15220 |
* <p>RECOVERING SOLUTION</p>
|
|
15256 | 15256 |
* <p>If the specified row (constraint) is packing inequality (see below), the routine npp_is_packing returns non-zero. Otherwise, it returns zero.</p>
|
15257 | 15257 |
* <p>PACKING INEQUALITIES</p>
|
15258 | 15258 |
* <p>In canonical format the packing inequality is the following:</p>
|
15259 | |
* <p>sum x[j] <= 1, (1) j in J</p>
|
15260 | |
* <p>where all variables x[j] are binary. This inequality expresses the condition that in any integer feasible solution at most one variable from set J can take non-zero (unity) value while other variables must be equal to zero. W.l.o.g. it is assumed that |J| >= 2, because if J is empty or |J| = 1, the inequality (1) is redundant.</p>
|
|
15259 |
* <p>sum x[j] <= 1, (1) j in J</p>
|
|
15260 |
* <p>where all variables x[j] are binary. This inequality expresses the condition that in any integer feasible solution at most one variable from set J can take non-zero (unity) value while other variables must be equal to zero. W.l.o.g. it is assumed that |J| >= 2, because if J is empty or |J| = 1, the inequality (1) is redundant.</p>
|
15261 | 15261 |
* <p>In general case the packing inequality may include original variables x[j] as well as their complements x~[j]:</p>
|
15262 | |
* <p>sum x[j] + sum x~[j] <= 1, (2) j in Jp j in Jn</p>
|
|
15262 |
* <p>sum x[j] + sum x~[j] <= 1, (2) j in Jp j in Jn</p>
|
15263 | 15263 |
* <p>where Jp and Jn are not intersected. Therefore, using substitution x~[j] = 1 - x[j] gives the packing inequality in generalized format:</p>
|
15264 | |
* <p>sum x[j] - sum x[j] <= 1 - |Jn|. (3) j in Jp j in Jn </p>
|
|
15264 |
* <p>sum x[j] - sum x[j] <= 1 - |Jn|. (3) j in Jp j in Jn </p>
|
15265 | 15265 |
*/
|
15266 | 15266 |
public";
|
15267 | 15267 |
|
|
15276 | 15276 |
* <p>If the original inequality constraint was replaced by equivalent packing inequality, the routine npp_hidden_packing returns non-zero. Otherwise, it returns zero.</p>
|
15277 | 15277 |
* <p>PROBLEM TRANSFORMATION</p>
|
15278 | 15278 |
* <p>Consider an inequality constraint:</p>
|
15279 | |
* <p>sum a[j] x[j] <= b, (1) j in J</p>
|
15280 | |
* <p>where all variables x[j] are binary, and |J| >= 2. (In case of '>=' inequality it can be transformed to '<=' format by multiplying both its sides by -1.)</p>
|
15281 | |
* <p>Let Jp = {j: a[j] > 0}, Jn = {j: a[j] < 0}. Performing substitution x[j] = 1 - x~[j] for all j in Jn, we have:</p>
|
15282 | |
* <p>sum a[j] x[j] <= b ==> j in J</p>
|
15283 | |
* <p>sum a[j] x[j] + sum a[j] x[j] <= b ==> j in Jp j in Jn</p>
|
15284 | |
* <p>sum a[j] x[j] + sum a[j] (1 - x~[j]) <= b ==> j in Jp j in Jn</p>
|
15285 | |
* <p>sum a[j] x[j] - sum a[j] x~[j] <= b - sum a[j]. j in Jp j in Jn j in Jn</p>
|
15286 | |
* <p>Thus, meaning the transformation above, we can assume that in inequality (1) all coefficients a[j] are positive. Moreover, we can assume that a[j] <= b. In fact, let a[j] > b; then the following three cases are possible:</p>
|
15287 | |
* <p>1) b < 0. In this case inequality (1) is infeasible, so the problem has no feasible solution (see the routine npp_analyze_row);</p>
|
|
15279 |
* <p>sum a[j] x[j] <= b, (1) j in J</p>
|
|
15280 |
* <p>where all variables x[j] are binary, and |J| >= 2. (In case of '>=' inequality it can be transformed to '<=' format by multiplying both its sides by -1.)</p>
|
|
15281 |
* <p>Let Jp = {j: a[j] > 0}, Jn = {j: a[j] < 0}. Performing substitution x[j] = 1 - x~[j] for all j in Jn, we have:</p>
|
|
15282 |
* <p>sum a[j] x[j] <= b ==> j in J</p>
|
|
15283 |
* <p>sum a[j] x[j] + sum a[j] x[j] <= b ==> j in Jp j in Jn</p>
|
|
15284 |
* <p>sum a[j] x[j] + sum a[j] (1 - x~[j]) <= b ==> j in Jp j in Jn</p>
|
|
15285 |
* <p>sum a[j] x[j] - sum a[j] x~[j] <= b - sum a[j]. j in Jp j in Jn j in Jn</p>
|
|
15286 |
* <p>Thus, meaning the transformation above, we can assume that in inequality (1) all coefficients a[j] are positive. Moreover, we can assume that a[j] <= b. In fact, let a[j] > b; then the following three cases are possible:</p>
|
|
15287 |
* <p>1) b < 0. In this case inequality (1) is infeasible, so the problem has no feasible solution (see the routine npp_analyze_row);</p>
|
15288 | 15288 |
* <p>2) b = 0. In this case inequality (1) is a forcing inequality on its upper bound (see the routine npp_forcing row), from which it follows that all variables x[j] should be fixed at zero;</p>
|
15289 | |
* <p>3) b > 0. In this case inequality (1) defines an implied zero upper bound for variable x[j] (see the routine npp_implied_bounds), from which it follows that x[j] should be fixed at zero.</p>
|
|
15289 |
* <p>3) b > 0. In this case inequality (1) defines an implied zero upper bound for variable x[j] (see the routine npp_implied_bounds), from which it follows that x[j] should be fixed at zero.</p>
|
15290 | 15290 |
* <p>It is assumed that all three cases listed above have been recognized by the routine npp_process_prob, which performs basic MIP processing prior to a call the routine npp_hidden_packing. So, if one of these cases occurs, we should just skip processing such constraint.</p>
|
15291 | |
* <p>Thus, let 0 < a[j] <= b. Then it is obvious that constraint (1) is equivalent to packing inquality only if:</p>
|
15292 | |
* <p>a[j] + a[k] > b + eps (2)</p>
|
|
15291 |
* <p>Thus, let 0 < a[j] <= b. Then it is obvious that constraint (1) is equivalent to packing inquality only if:</p>
|
|
15292 |
* <p>a[j] + a[k] > b + eps (2)</p>
|
15293 | 15293 |
* <p>for all j, k in J, j != k, where eps is an absolute tolerance for row (linear form) value. Checking the condition (2) for all j and k, j != k, requires time O(|J|^2). However, this time can be reduced to O(|J|), if use minimal a[j] and a[k], in which case it is sufficient to check the condition (2) only once.</p>
|
15294 | 15294 |
* <p>Once the original inequality (1) is replaced by equivalent packing inequality, we need to perform back substitution x~[j] = 1 - x[j] for all j in Jn (see above).</p>
|
15295 | 15295 |
* <p>RECOVERING SOLUTION</p>
|
|
15309 | 15309 |
* <p>#include \"glpnpp.h\" int npp_implied_packing(NPP *npp, NPPROW *row, int which, NPPCOL *var[], char set[]);</p>
|
15310 | 15310 |
* <p>DESCRIPTION</p>
|
15311 | 15311 |
* <p>The routine npp_implied_packing processes specified row (constraint) of general format:</p>
|
15312 | |
* <p>L <= sum a[j] x[j] <= U. (1) j</p>
|
|
15312 |
* <p>L <= sum a[j] x[j] <= U. (1) j</p>
|
15313 | 15313 |
* <p>If which = 0, only lower bound L, which must exist, is considered, while upper bound U is ignored. Similarly, if which = 1, only upper bound U, which must exist, is considered, while lower bound L is ignored. Thus, if the specified row is a double-sided inequality or equality constraint, this routine should be called twice for both lower and upper bounds.</p>
|
15314 | 15314 |
* <p>The routine npp_implied_packing attempts to find a non-trivial (i.e. having not less than two binary variables) packing inequality:</p>
|
15315 | |
* <p>sum x[j] - sum x[j] <= 1 - |Jn|, (2) j in Jp j in Jn</p>
|
|
15315 |
* <p>sum x[j] - sum x[j] <= 1 - |Jn|, (2) j in Jp j in Jn</p>
|
15316 | 15316 |
* <p>which is relaxation of the constraint (1) in the sense that any solution satisfying to that constraint also satisfies to the packing inequality (2). If such relaxation exists, the routine stores pointers to descriptors of corresponding binary variables and their flags, resp., to locations var[1], var[2], ..., var[len] and set[1], set[2], ..., set[len], where set[j] = 0 means that j in Jp and set[j] = 1 means that j in Jn.</p>
|
15317 | 15317 |
* <p>RETURNS</p>
|
15318 | |
* <p>The routine npp_implied_packing returns len, which is the total number of binary variables in the packing inequality found, len >= 2. However, if the relaxation does not exist, the routine returns zero.</p>
|
|
15318 |
* <p>The routine npp_implied_packing returns len, which is the total number of binary variables in the packing inequality found, len >= 2. However, if the relaxation does not exist, the routine returns zero.</p>
|
15319 | 15319 |
* <p>ALGORITHM</p>
|
15320 | 15320 |
* <p>If which = 0, the constraint coefficients (1) are multiplied by -1 and b is assigned -L; if which = 1, the constraint coefficients (1) are not changed and b is assigned +U. In both cases the specified constraint gets the following format:</p>
|
15321 | |
* <p>sum a[j] x[j] <= b. (3) j</p>
|
|
15321 |
* <p>sum a[j] x[j] <= b. (3) j</p>
|
15322 | 15322 |
* <p>(Note that (3) is a relaxation of (1), because one of bounds L or U is ignored.)</p>
|
15323 | |
* <p>Let J be set of binary variables, Kp be set of non-binary (integer or continuous) variables with a[j] > 0, and Kn be set of non-binary variables with a[j] < 0. Then the inequality (3) can be written as follows:</p>
|
15324 | |
* <p>sum a[j] x[j] <= b - sum a[j] x[j] - sum a[j] x[j]. (4) j in J j in Kp j in Kn</p>
|
|
15323 |
* <p>Let J be set of binary variables, Kp be set of non-binary (integer or continuous) variables with a[j] > 0, and Kn be set of non-binary variables with a[j] < 0. Then the inequality (3) can be written as follows:</p>
|
|
15324 |
* <p>sum a[j] x[j] <= b - sum a[j] x[j] - sum a[j] x[j]. (4) j in J j in Kp j in Kn</p>
|
15325 | 15325 |
* <p>To get rid of non-binary variables we can replace the inequality (4) by the following relaxed inequality:</p>
|
15326 | |
* <p>sum a[j] x[j] <= b~, (5) j in J</p>
|
|
15326 |
* <p>sum a[j] x[j] <= b~, (5) j in J</p>
|
15327 | 15327 |
* <p>where:</p>
|
15328 | 15328 |
* <p>b~ = sup(b - sum a[j] x[j] - sum a[j] x[j]) = j in Kp j in Kn</p>
|
15329 | 15329 |
* <p>= b - inf sum a[j] x[j] - inf sum a[j] x[j] = (6) j in Kp j in Kn</p>
|
15330 | 15330 |
* <p>= b - sum a[j] l[j] - sum a[j] u[j]. j in Kp j in Kn</p>
|
15331 | 15331 |
* <p>Note that if lower bound l[j] (if j in Kp) or upper bound u[j] (if j in Kn) of some non-binary variable x[j] does not exist, then formally b = +oo, in which case further analysis is not performed.</p>
|
15332 | |
* <p>Let Bp = {j in J: a[j] > 0}, Bn = {j in J: a[j] < 0}. To make all the inequality coefficients in (5) positive, we replace all x[j] in Bn by their complementaries, substituting x[j] = 1 - x~[j] for all j in Bn, that gives:</p>
|
15333 | |
* <p>sum a[j] x[j] - sum a[j] x~[j] <= b~ - sum a[j]. (7) j in Bp j in Bn j in Bn</p>
|
|
15332 |
* <p>Let Bp = {j in J: a[j] > 0}, Bn = {j in J: a[j] < 0}. To make all the inequality coefficients in (5) positive, we replace all x[j] in Bn by their complementaries, substituting x[j] = 1 - x~[j] for all j in Bn, that gives:</p>
|
|
15333 |
* <p>sum a[j] x[j] - sum a[j] x~[j] <= b~ - sum a[j]. (7) j in Bp j in Bn j in Bn</p>
|
15334 | 15334 |
* <p>This inequality is a relaxation of the original constraint (1), and it is a binary knapsack inequality. Writing it in the standard format we have:</p>
|
15335 | |
* <p>sum alfa[j] z[j] <= beta, (8) j in J</p>
|
15336 | |
* <p>where: ( + a[j], if j in Bp, alfa[j] = < (9) ( - a[j], if j in Bn,</p>
|
15337 | |
* <p>( x[j], if j in Bp, z[j] = < (10) ( 1 - x[j], if j in Bn,</p>
|
|
15335 |
* <p>sum alfa[j] z[j] <= beta, (8) j in J</p>
|
|
15336 |
* <p>where: ( + a[j], if j in Bp, alfa[j] = < (9) ( - a[j], if j in Bn,</p>
|
|
15337 |
* <p>( x[j], if j in Bp, z[j] = < (10) ( 1 - x[j], if j in Bn,</p>
|
15338 | 15338 |
* <p>beta = b~ - sum a[j]. (11) j in Bn</p>
|
15339 | 15339 |
* <p>In the inequality (8) all coefficients are positive, therefore, the packing relaxation to be found for this inequality is the following:</p>
|
15340 | |
* <p>sum z[j] <= 1. (12) j in P</p>
|
|
15340 |
* <p>sum z[j] <= 1. (12) j in P</p>
|
15341 | 15341 |
* <p>It is obvious that set P within J, which we would like to find, must satisfy to the following condition:</p>
|
15342 | |
* <p>alfa[j] + alfa[k] > beta + eps for all j, k in P, j != k, (13)</p>
|
15343 | |
* <p>where eps is an absolute tolerance for value of the linear form. Thus, it is natural to take P = {j: alpha[j] > (beta + eps) / 2}. Moreover, if in the equality (8) there exist coefficients alfa[k], for which alfa[k] <= (beta + eps) / 2, but which, nevertheless, satisfies to the condition (13) for all j in P, *one* corresponding variable z[k] (having, for example, maximal coefficient alfa[k]) can be included in set P, that allows increasing the number of binary variables in (12) by one.</p>
|
|
15342 |
* <p>alfa[j] + alfa[k] > beta + eps for all j, k in P, j != k, (13)</p>
|
|
15343 |
* <p>where eps is an absolute tolerance for value of the linear form. Thus, it is natural to take P = {j: alpha[j] > (beta + eps) / 2}. Moreover, if in the equality (8) there exist coefficients alfa[k], for which alfa[k] <= (beta + eps) / 2, but which, nevertheless, satisfies to the condition (13) for all j in P, *one* corresponding variable z[k] (having, for example, maximal coefficient alfa[k]) can be included in set P, that allows increasing the number of binary variables in (12) by one.</p>
|
15344 | 15344 |
* <p>Once the set P has been built, for the inequality (12) we need to perform back substitution according to (10) in order to express it through the original binary variables. As the result of such back substitution the relaxed packing inequality get its final format (2), where Jp = J intersect Bp, and Jn = J intersect Bn. </p>
|
15345 | 15345 |
*/
|
15346 | 15346 |
public";
|
|
15354 | 15354 |
* <p>If the specified row (constraint) is covering inequality (see below), the routine npp_is_covering returns non-zero. Otherwise, it returns zero.</p>
|
15355 | 15355 |
* <p>COVERING INEQUALITIES</p>
|
15356 | 15356 |
* <p>In canonical format the covering inequality is the following:</p>
|
15357 | |
* <p>sum x[j] >= 1, (1) j in J</p>
|
15358 | |
* <p>where all variables x[j] are binary. This inequality expresses the condition that in any integer feasible solution variables in set J cannot be all equal to zero at the same time, i.e. at least one variable must take non-zero (unity) value. W.l.o.g. it is assumed that |J| >= 2, because if J is empty, the inequality (1) is infeasible, and if |J| = 1, the inequality (1) is a forcing row.</p>
|
|
15357 |
* <p>sum x[j] >= 1, (1) j in J</p>
|
|
15358 |
* <p>where all variables x[j] are binary. This inequality expresses the condition that in any integer feasible solution variables in set J cannot be all equal to zero at the same time, i.e. at least one variable must take non-zero (unity) value. W.l.o.g. it is assumed that |J| >= 2, because if J is empty, the inequality (1) is infeasible, and if |J| = 1, the inequality (1) is a forcing row.</p>
|
15359 | 15359 |
* <p>In general case the covering inequality may include original variables x[j] as well as their complements x~[j]:</p>
|
15360 | |
* <p>sum x[j] + sum x~[j] >= 1, (2) j in Jp j in Jn</p>
|
|
15360 |
* <p>sum x[j] + sum x~[j] >= 1, (2) j in Jp j in Jn</p>
|
15361 | 15361 |
* <p>where Jp and Jn are not intersected. Therefore, using substitution x~[j] = 1 - x[j] gives the packing inequality in generalized format:</p>
|
15362 | |
* <p>sum x[j] - sum x[j] >= 1 - |Jn|. (3) j in Jp j in Jn</p>
|
|
15362 |
* <p>sum x[j] - sum x[j] >= 1 - |Jn|. (3) j in Jp j in Jn</p>
|
15363 | 15363 |
* <p>(May note that the inequality (3) cuts off infeasible solutions, where x[j] = 0 for all j in Jp and x[j] = 1 for all j in Jn.)</p>
|
15364 | 15364 |
* <p>NOTE: If |J| = 2, the inequality (3) is equivalent to packing inequality (see the routine npp_is_packing). </p>
|
15365 | 15365 |
*/
|
|
15376 | 15376 |
* <p>If the original inequality constraint was replaced by equivalent covering inequality, the routine npp_hidden_covering returns non-zero. Otherwise, it returns zero.</p>
|
15377 | 15377 |
* <p>PROBLEM TRANSFORMATION</p>
|
15378 | 15378 |
* <p>Consider an inequality constraint:</p>
|
15379 | |
* <p>sum a[j] x[j] >= b, (1) j in J</p>
|
15380 | |
* <p>where all variables x[j] are binary, and |J| >= 3. (In case of '<=' inequality it can be transformed to '>=' format by multiplying both its sides by -1.)</p>
|
15381 | |
* <p>Let Jp = {j: a[j] > 0}, Jn = {j: a[j] < 0}. Performing substitution x[j] = 1 - x~[j] for all j in Jn, we have:</p>
|
15382 | |
* <p>sum a[j] x[j] >= b ==> j in J</p>
|
15383 | |
* <p>sum a[j] x[j] + sum a[j] x[j] >= b ==> j in Jp j in Jn</p>
|
15384 | |
* <p>sum a[j] x[j] + sum a[j] (1 - x~[j]) >= b ==> j in Jp j in Jn</p>
|
15385 | |
* <p>sum m a[j] x[j] - sum a[j] x~[j] >= b - sum a[j]. j in Jp j in Jn j in Jn</p>
|
15386 | |
* <p>Thus, meaning the transformation above, we can assume that in inequality (1) all coefficients a[j] are positive. Moreover, we can assume that b > 0, because otherwise the inequality (1) would be redundant (see the routine npp_analyze_row). It is then obvious that constraint (1) is equivalent to covering inequality only if:</p>
|
15387 | |
* <p>a[j] >= b, (2)</p>
|
|
15379 |
* <p>sum a[j] x[j] >= b, (1) j in J</p>
|
|
15380 |
* <p>where all variables x[j] are binary, and |J| >= 3. (In case of '<=' inequality it can be transformed to '>=' format by multiplying both its sides by -1.)</p>
|
|
15381 |
* <p>Let Jp = {j: a[j] > 0}, Jn = {j: a[j] < 0}. Performing substitution x[j] = 1 - x~[j] for all j in Jn, we have:</p>
|
|
15382 |
* <p>sum a[j] x[j] >= b ==> j in J</p>
|
|
15383 |
* <p>sum a[j] x[j] + sum a[j] x[j] >= b ==> j in Jp j in Jn</p>
|
|
15384 |
* <p>sum a[j] x[j] + sum a[j] (1 - x~[j]) >= b ==> j in Jp j in Jn</p>
|
|
15385 |
* <p>sum m a[j] x[j] - sum a[j] x~[j] >= b - sum a[j]. j in Jp j in Jn j in Jn</p>
|
|
15386 |
* <p>Thus, meaning the transformation above, we can assume that in inequality (1) all coefficients a[j] are positive. Moreover, we can assume that b > 0, because otherwise the inequality (1) would be redundant (see the routine npp_analyze_row). It is then obvious that constraint (1) is equivalent to covering inequality only if:</p>
|
|
15387 |
* <p>a[j] >= b, (2)</p>
|
15388 | 15388 |
* <p>for all j in J.</p>
|
15389 | 15389 |
* <p>Once the original inequality (1) is replaced by equivalent covering inequality, we need to perform back substitution x~[j] = 1 - x[j] for all j in Jn (see above).</p>
|
15390 | 15390 |
* <p>RECOVERING SOLUTION</p>
|
|
15407 | 15407 |
* <p>PARTITIONING EQUALITIES</p>
|
15408 | 15408 |
* <p>In canonical format the partitioning equality is the following:</p>
|
15409 | 15409 |
* <p>sum x[j] = 1, (1) j in J</p>
|
15410 | |
* <p>where all variables x[j] are binary. This equality expresses the condition that in any integer feasible solution exactly one variable in set J must take non-zero (unity) value while other variables must be equal to zero. W.l.o.g. it is assumed that |J| >= 2, because if J is empty, the inequality (1) is infeasible, and if |J| = 1, the inequality (1) is a fixing row.</p>
|
|
15410 |
* <p>where all variables x[j] are binary. This equality expresses the condition that in any integer feasible solution exactly one variable in set J must take non-zero (unity) value while other variables must be equal to zero. W.l.o.g. it is assumed that |J| >= 2, because if J is empty, the inequality (1) is infeasible, and if |J| = 1, the inequality (1) is a fixing row.</p>
|
15411 | 15411 |
* <p>In general case the partitioning equality may include original variables x[j] as well as their complements x~[j]:</p>
|
15412 | 15412 |
* <p>sum x[j] + sum x~[j] = 1, (2) j in Jp j in Jn</p>
|
15413 | 15413 |
* <p>where Jp and Jn are not intersected. Therefore, using substitution x~[j] = 1 - x[j] leads to the partitioning equality in generalized format:</p>
|
|
15653 | 15653 |
* <p>PURPOSE</p>
|
15654 | 15654 |
* <p>This subroutine determines the reachable set of a node through a given subset. The adjancy structure is assumed to be stored in a quotient graph format.</p>
|
15655 | 15655 |
* <p>INPUT PARAMETERS</p>
|
15656 | |
* <p>root - the given node not in the subset; (xadj, adjncy) - the adjancy structure pair; deg - the degree vector. deg[i] < 0 means the node belongs to the given subset.</p>
|
|
15656 |
* <p>root - the given node not in the subset; (xadj, adjncy) - the adjancy structure pair; deg - the degree vector. deg[i] < 0 means the node belongs to the given subset.</p>
|
15657 | 15657 |
* <p>OUTPUT PARAMETERS</p>
|
15658 | 15658 |
* <p>(rchsze, rchset) - the reachable set; (nhdsze, nbrhd) - the neighborhood set.</p>
|
15659 | 15659 |
* <p>UPDATED PARAMETERS</p>
|
15660 | |
* <p>marker - the marker vector for reach and nbrhd sets. > 0 means the node is in reach set. < 0 means the node has been merged with others in the quotient or it is in nbrhd set. </p>
|
|
15660 |
* <p>marker - the marker vector for reach and nbrhd sets. > 0 means the node is in reach set. < 0 means the node has been merged with others in the quotient or it is in nbrhd set. </p>
|
15661 | 15661 |
*/
|
15662 | 15662 |
public";
|
15663 | 15663 |
|
|
15737 | 15737 |
* <p>PURPOSE</p>
|
15738 | 15738 |
* <p>This subroutine determines the reachable set of a node through a given subset. The adjancy structure is assumed to be stored in a quotient graph format.</p>
|
15739 | 15739 |
* <p>INPUT PARAMETERS</p>
|
15740 | |
* <p>root - the given node not in the subset; (xadj, adjncy) - the adjancy structure pair; deg - the degree vector. deg[i] < 0 means the node belongs to the given subset.</p>
|
|
15740 |
* <p>root - the given node not in the subset; (xadj, adjncy) - the adjancy structure pair; deg - the degree vector. deg[i] < 0 means the node belongs to the given subset.</p>
|
15741 | 15741 |
* <p>OUTPUT PARAMETERS</p>
|
15742 | 15742 |
* <p>(rchsze, rchset) - the reachable set; (nhdsze, nbrhd) - the neighborhood set.</p>
|
15743 | 15743 |
* <p>UPDATED PARAMETERS</p>
|
15744 | |
* <p>marker - the marker vector for reach and nbrhd sets. > 0 means the node is in reach set. < 0 means the node has been merged with others in the quotient or it is in nbrhd set. </p>
|
|
15744 |
* <p>marker - the marker vector for reach and nbrhd sets. > 0 means the node is in reach set. < 0 means the node has been merged with others in the quotient or it is in nbrhd set. </p>
|
15745 | 15745 |
*/
|
15746 | 15746 |
public";
|
15747 | 15747 |
|
|
15852 | 15852 |
for the Minimum Cost Flow Problem\", LIDS Report P-2146, MIT, Nov. 1992.</p>
|
15853 | 15853 |
* <p>For inquiries about the original Fortran code, please contact:</p>
|
15854 | 15854 |
* <p>Dimitri P. Bertsekas Laboratory for information and decision systems Massachusetts Institute of Technology Cambridge, MA 02139 (617) 253-7267, dimitrib@mit.edu</p>
|
15855 | |
* <p>This code is the result of translation of the original Fortran code. The translation was made by Andrew Makhorin <mao@gnu.org>.</p>
|
|
15855 |
* <p>This code is the result of translation of the original Fortran code. The translation was made by Andrew Makhorin <mao@gnu.org>.</p>
|
15856 | 15856 |
* <p>USER GUIDELINES</p>
|
15857 | 15857 |
* <p>This routine is in the public domain to be used only for research purposes. It cannot be used as part of a commercial product, or to satisfy in any part commercial delivery requirements to government or industry, without prior agreement with the authors. Users are requested to acknowledge the authorship of the code, and the relaxation method.</p>
|
15858 | 15858 |
* <p>No modification should be made to this code other than the minimal necessary to make it compatible with specific platforms.</p>
|
|
16097 | 16097 |
* <p>#include \"glpscf.h\" SCF *scf_create_it(int n_max);</p>
|
16098 | 16098 |
* <p>DESCRIPTION</p>
|
16099 | 16099 |
* <p>The routine scf_create_it creates the factorization of matrix C, which initially has no rows and columns.</p>
|
16100 | |
* <p>The parameter n_max specifies the maximal order of matrix C to be factorized, 1 <= n_max <= 32767.</p>
|
|
16100 |
* <p>The parameter n_max specifies the maximal order of matrix C to be factorized, 1 <= n_max <= 32767.</p>
|
16101 | 16101 |
* <p>RETURNS</p>
|
16102 | 16102 |
* <p>The routine scf_create_it returns a pointer to the structure SCF, which defines the factorization. </p>
|
16103 | 16103 |
*/
|
|
16205 | 16205 |
* <p>#include \"glpscf.h\" SCF *scf_create_it(int n_max);</p>
|
16206 | 16206 |
* <p>DESCRIPTION</p>
|
16207 | 16207 |
* <p>The routine scf_create_it creates the factorization of matrix C, which initially has no rows and columns.</p>
|
16208 | |
* <p>The parameter n_max specifies the maximal order of matrix C to be factorized, 1 <= n_max <= 32767.</p>
|
|
16208 |
* <p>The parameter n_max specifies the maximal order of matrix C to be factorized, 1 <= n_max <= 32767.</p>
|
16209 | 16209 |
* <p>RETURNS</p>
|
16210 | 16210 |
* <p>The routine scf_create_it returns a pointer to the structure SCF, which defines the factorization. </p>
|
16211 | 16211 |
*/
|
|
16496 | 16496 |
* <p>DESCRIPTION</p>
|
16497 | 16497 |
* <p>The routine spm_test_mat_e creates a test sparse matrix of E(n,c) class as described in the book: Ole 0sterby, Zahari Zlatev. Direct Methods for Sparse Matrices. Springer-Verlag, 1983.</p>
|
16498 | 16498 |
* <p>Matrix of E(n,c) class is a symmetric positive definite matrix of the order n. It has the number 4 on its main diagonal and the number -1 on its four co-diagonals, two of which are neighbour to the main diagonal and two others are shifted from the main diagonal on the distance c.</p>
|
16499 | |
* <p>It is necessary that n >= 3 and 2 <= c <= n-1.</p>
|
|
16499 |
* <p>It is necessary that n >= 3 and 2 <= c <= n-1.</p>
|
16500 | 16500 |
* <p>RETURNS</p>
|
16501 | 16501 |
* <p>The routine returns a pointer to the matrix created. </p>
|
16502 | 16502 |
*/
|
|
16510 | 16510 |
* <p>DESCRIPTION</p>
|
16511 | 16511 |
* <p>The routine spm_test_mat_d creates a test sparse matrix of D(n,c) class as described in the book: Ole 0sterby, Zahari Zlatev. Direct Methods for Sparse Matrices. Springer-Verlag, 1983.</p>
|
16512 | 16512 |
* <p>Matrix of D(n,c) class is a non-singular matrix of the order n. It has unity main diagonal, three co-diagonals above the main diagonal on the distance c, which are cyclically continued below the main diagonal, and a triangle block of the size 10x10 in the upper right corner.</p>
|
16513 | |
* <p>It is necessary that n >= 14 and 1 <= c <= n-13.</p>
|
|
16513 |
* <p>It is necessary that n >= 14 and 1 <= c <= n-13.</p>
|
16514 | 16514 |
* <p>RETURNS</p>
|
16515 | 16515 |
* <p>The routine returns a pointer to the matrix created. </p>
|
16516 | 16516 |
*/
|
|
16695 | 16695 |
* <p>DESCRIPTION</p>
|
16696 | 16696 |
* <p>The routine spm_test_mat_e creates a test sparse matrix of E(n,c) class as described in the book: Ole 0sterby, Zahari Zlatev. Direct Methods for Sparse Matrices. Springer-Verlag, 1983.</p>
|
16697 | 16697 |
* <p>Matrix of E(n,c) class is a symmetric positive definite matrix of the order n. It has the number 4 on its main diagonal and the number -1 on its four co-diagonals, two of which are neighbour to the main diagonal and two others are shifted from the main diagonal on the distance c.</p>
|
16698 | |
* <p>It is necessary that n >= 3 and 2 <= c <= n-1.</p>
|
|
16698 |
* <p>It is necessary that n >= 3 and 2 <= c <= n-1.</p>
|
16699 | 16699 |
* <p>RETURNS</p>
|
16700 | 16700 |
* <p>The routine returns a pointer to the matrix created. </p>
|
16701 | 16701 |
*/
|
|
16709 | 16709 |
* <p>DESCRIPTION</p>
|
16710 | 16710 |
* <p>The routine spm_test_mat_d creates a test sparse matrix of D(n,c) class as described in the book: Ole 0sterby, Zahari Zlatev. Direct Methods for Sparse Matrices. Springer-Verlag, 1983.</p>
|
16711 | 16711 |
* <p>Matrix of D(n,c) class is a non-singular matrix of the order n. It has unity main diagonal, three co-diagonals above the main diagonal on the distance c, which are cyclically continued below the main diagonal, and a triangle block of the size 10x10 in the upper right corner.</p>
|
16712 | |
* <p>It is necessary that n >= 14 and 1 <= c <= n-13.</p>
|
|
16712 |
* <p>It is necessary that n >= 14 and 1 <= c <= n-13.</p>
|
16713 | 16713 |
* <p>RETURNS</p>
|
16714 | 16714 |
* <p>The routine returns a pointer to the matrix created. </p>
|
16715 | 16715 |
*/
|