aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/glpk-4.65/src/simplex/spychuzr.h
blob: 31f01b78acd4173d9d3f312c817fdb0ed1041fec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/* spychuzr.h */

/***********************************************************************
*  This code is part of GLPK (GNU Linear Programming Kit).
*
*  Copyright (C) 2015 Andrew Makhorin, Department for Applied
*  Informatics, Moscow Aviation Institute, Moscow, Russia. All rights
*  reserved. E-mail: <mao@gnu.org>.
*
*  GLPK is free software: you can redistribute it and/or modify it
*  under the terms of the GNU General Public License as published by
*  the Free Software Foundation, either version 3 of the License, or
*  (at your option) any later version.
*
*  GLPK is distributed in the hope that it will be useful, but WITHOUT
*  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
*  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
*  License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with GLPK. If not, see <http://www.gnu.org/licenses/>.
***********************************************************************/

#ifndef SPYCHUZR_H
#define SPYCHUZR_H

#include "spxlp.h"

#define spy_chuzr_sel _glp_spy_chuzr_sel
int spy_chuzr_sel(SPXLP *lp, const double beta[/*1+m*/], double tol,
      double tol1, int list[/*1+m*/]);
/* select eligible basic variables */

#define spy_chuzr_std _glp_spy_chuzr_std
int spy_chuzr_std(SPXLP *lp, const double beta[/*1+m*/], int num,
      const int list[]);
/* choose basic variable (dual Dantzig's rule) */

typedef struct SPYSE SPYSE;

struct SPYSE
{     /* dual projected steepest edge and Devex pricing data block */
      int valid;
      /* content validity flag */
      char *refsp; /* char refsp[1+n]; */
      /* refsp[0] is not used;
       * refsp[k], 1 <= k <= n, is the flag meaning that dual variable
       * lambda[k] is in the dual reference space */
      double *gamma; /* double gamma[1+m]; */
      /* gamma[0] is not used;
       * gamma[i], 1 <= i <= m, is the weight for reduced cost r[i]
       * of dual non-basic variable lambdaB[j] in the current basis
       * (r[i] is bound violation for basic variable xB[i]) */
      double *work; /* double work[1+m]; */
      /* working array */
#if 1 /* 30/III-2016 */
      FVS u; /* FVS u[1:m]; */
      /* working vector */
#endif
};

#define spy_alloc_se _glp_spy_alloc_se
void spy_alloc_se(SPXLP *lp, SPYSE *se);
/* allocate dual pricing data block */

#define spy_reset_refsp _glp_spy_reset_refsp
void spy_reset_refsp(SPXLP *lp, SPYSE *se);
/* reset dual reference space */

#define spy_eval_gamma_i _glp_spy_eval_gamma_i
double spy_eval_gamma_i(SPXLP *lp, SPYSE *se, int i);
/* compute dual projected steepest edge weight directly */

#define spy_chuzr_pse _glp_spy_chuzr_pse
int spy_chuzr_pse(SPXLP *lp, SPYSE *se, const double beta[/*1+m*/],
      int num, const int list[]);
/* choose basic variable (dual projected steepest edge) */

#define spy_update_gamma _glp_spy_update_gamma
double spy_update_gamma(SPXLP *lp, SPYSE *se, int p, int q,
      const double trow[/*1+n-m*/], const double tcol[/*1+m*/]);
/* update dual projected steepest edge weights exactly */

#if 1 /* 30/III-2016 */
#define spy_update_gamma_s _glp_spy_update_gamma_s
double spy_update_gamma_s(SPXLP *lp, SPYSE *se, int p, int q,
      const FVS *trow, const FVS *tcol);
/* sparse version of spy_update_gamma */
#endif

#define spy_free_se _glp_spy_free_se
void spy_free_se(SPXLP *lp, SPYSE *se);
/* deallocate dual pricing data block */

#endif

/* eof */