1 /* spxchuzr.h */
2 
3 /***********************************************************************
4 *  This code is part of GLPK (GNU Linear Programming Kit).
5 *  Copyright (C) 2015-2017 Free Software Foundation, Inc.
6 *  Written by Andrew Makhorin <mao@gnu.org>.
7 *
8 *  GLPK is free software: you can redistribute it and/or modify it
9 *  under the terms of the GNU General Public License as published by
10 *  the Free Software Foundation, either version 3 of the License, or
11 *  (at your option) any later version.
12 *
13 *  GLPK is distributed in the hope that it will be useful, but WITHOUT
14 *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 *  License for more details.
17 *
18 *  You should have received a copy of the GNU General Public License
19 *  along with GLPK. If not, see <http://www.gnu.org/licenses/>.
20 ***********************************************************************/
21 
22 #ifndef SPXCHUZR_H
23 #define SPXCHUZR_H
24 
25 #include "spxlp.h"
26 
27 #define spx_chuzr_std _glp_spx_chuzr_std
28 int spx_chuzr_std(SPXLP *lp, int phase, const double beta[/*1+m*/],
29       int q, double s, const double tcol[/*1+m*/], int *p_flag,
30       double tol_piv, double tol, double tol1);
31 /* choose basic variable (textbook ratio test) */
32 
33 #define spx_chuzr_harris _glp_spx_chuzr_harris
34 int spx_chuzr_harris(SPXLP *lp, int phase, const double beta[/*1+m*/],
35       int q, double s, const double tcol[/*1+m*/], int *p_flag,
36       double tol_piv, double tol, double tol1);
37 /* choose basic variable (Harris' ratio test) */
38 
39 #if 1 /* 22/VI-2017 */
40 typedef struct SPXBP SPXBP;
41 
42 struct SPXBP
43 {     /* penalty function (sum of infeasibilities) break point */
44       int i;
45       /* basic variable xB[i], 1 <= i <= m, that intersects its bound
46        * at this break point
47        * i > 0 if xB[i] intersects its lower bound (or fixed value)
48        * i < 0 if xB[i] intersects its upper bound
49        * i = 0 if xN[q] intersects its opposite bound */
50       double teta;
51       /* ray parameter value, teta >= 0, at this break point */
52       double dc;
53       /* increment of the penalty function coefficient cB[i] at this
54        * break point */
55       double dz;
56       /* increment, z[t] - z[0], of the penalty function at this break
57        * point */
58 };
59 
60 #define spx_ls_eval_bp _glp_spx_ls_eval_bp
61 int spx_ls_eval_bp(SPXLP *lp, const double beta[/*1+m*/],
62       int q, double dq, const double tcol[/*1+m*/], double tol_piv,
63       SPXBP bp[/*1+2*m+1*/]);
64 /* determine penalty function break points */
65 
66 #define spx_ls_select_bp _glp_spx_ls_select_bp
67 int spx_ls_select_bp(SPXLP *lp, const double tcol[/*1+m*/],
68       int nbp, SPXBP bp[/*1+m+m+1*/], int num, double *slope, double
69       teta_lim);
70 /* select and process penalty function break points */
71 #endif
72 
73 #endif
74 
75 /* eof */
76