1 |
/* |
2 |
* MPS: Ascend MPS file generator |
3 |
* by Craig Schmidt |
4 |
* Created: 2/11/95 |
5 |
* Version: $Revision: 1.13 $ |
6 |
* Version control file: $RCSfile: slv6.h,v $ |
7 |
* Date last modified: $Date: 1997/07/18 12:16:23 $ |
8 |
* Last modified by: $Author: mthomas $ |
9 |
* |
10 |
* This file is part of the SLV solver. |
11 |
* |
12 |
* Copyright (C) 1990 Karl Michael Westerberg |
13 |
* Copyright (C) 1993 Joseph Zaher |
14 |
* Copyright (C) 1994 Joseph Zaher, Benjamin Andrew Allan |
15 |
* Copyright (C) 1995 Craig Schmidt |
16 |
* |
17 |
* The SLV solver is free software; you can redistribute |
18 |
* it and/or modify it under the terms of the GNU General Public License as |
19 |
* published by the Free Software Foundation; either version 2 of the |
20 |
* License, or (at your option) any later version. |
21 |
* |
22 |
* The SLV solver is distributed in hope that it will be |
23 |
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
24 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
25 |
* General Public License for more details. |
26 |
* |
27 |
* You should have received a copy of the GNU General Public License along with |
28 |
* the program; if not, write to the Free Software Foundation, Inc., 675 |
29 |
* Mass Ave, Cambridge, MA 02139 USA. Check the file named COPYING. |
30 |
* COPYING is found in ../compiler. |
31 |
*/ |
32 |
|
33 |
/*************************************************************************** |
34 |
*** Contents: Slv module |
35 |
*** |
36 |
*** Authors: Karl Westerberg |
37 |
*** Joseph Zaher |
38 |
*** |
39 |
*** Dates: 06/90 - original version |
40 |
*** 04/91 - fine tuned modified marquadt computation, |
41 |
*** provided minor iterations for step generation |
42 |
*** within each major iteration of jacobian |
43 |
*** updates |
44 |
*** 06/93 - eliminated pointer sublists being generated |
45 |
*** at the beginning of each block |
46 |
*** 04/94 - extended scope to equality constrained |
47 |
*** optimization. |
48 |
*** |
49 |
*** Description: This file is created by make_slv_header, so don't |
50 |
*** modify it yourself. All functions defined in this |
51 |
*** header have identical protocols to the corresponding |
52 |
*** functions in slv.h except that slv_system_t ==> |
53 |
*** slv6_system_t and slv6_eligible_solver() only takes one |
54 |
*** parameter: the system. Note also that the select |
55 |
*** solver functions don't exist. |
56 |
***************************************************************************/ |
57 |
#ifndef slv6__already_included |
58 |
#define slv6__already_included |
59 |
|
60 |
/* requires #include "slv_client.h" */ |
61 |
|
62 |
typedef struct slv6_system_structure *slv6_system_t; |
63 |
|
64 |
int slv6_register(SlvFunctionsT *); |
65 |
/**********************************************************************\ |
66 |
This is the function that tells the system about the makeMPS solver. |
67 |
Our index is not necessarily going to be 6. That everything here is |
68 |
named slv6* is just a historical event. |
69 |
\**********************************************************************/ |
70 |
|
71 |
#endif |
72 |
|
73 |
/* REMOVE EVERYTHING BELOW THIS POINT */ |
74 |
# if 0 |
75 |
#ifdef STATIC_MPS |
76 |
#define slv6_solver_name "makeMPS" /* Solver's name. don't mess with the caps!*/ |
77 |
#define slv6_solver_number 6 /* Solver's number */ |
78 |
|
79 |
extern boolean free_inc_var_filter(struct var_variable *var); |
80 |
/** |
81 |
*** I've been calling this particular var filter a lot , |
82 |
*** so I decided to make it a subroutine. Returns true if |
83 |
*** var is not fixed and incident in something. |
84 |
**/ |
85 |
|
86 |
extern slv6_system_t slv6_create(); |
87 |
extern int slv6_destroy(); |
88 |
extern void slv6_set_var_list(); |
89 |
extern struct var_variable **slv6_get_var_list(); |
90 |
extern void slv6_set_bnd_list(); |
91 |
extern void slv6_set_rel_list(); |
92 |
extern struct rel_relation **slv6_get_rel_list(); |
93 |
extern void slv6_set_extrel_list(); |
94 |
extern struct ExtRelCache **slv6_get_extrel_list(); |
95 |
extern int slv6_count_vars(); |
96 |
extern int slv6_count_bnds(); |
97 |
extern int slv6_count_rels(); |
98 |
extern void slv6_set_obj_relation(); |
99 |
extern struct rel_relation *slv6_get_obj_relation(); |
100 |
extern boolean slv6_eligible_solver(); |
101 |
extern void slv6_get_parameters(); |
102 |
extern void slv6_set_parameters(); |
103 |
extern void slv6_get_status(); |
104 |
extern linsol_system_t slv6_get_linsol_sys(); |
105 |
extern void slv6_dump_internals(); |
106 |
extern void slv6_presolve(); |
107 |
extern boolean slv6_change_basis(); |
108 |
extern void slv6_resolve(); |
109 |
extern void slv6_iterate(); |
110 |
extern void slv6_solve(); |
111 |
|
112 |
|
113 |
/********************************************************************* |
114 |
Craig Schmidt 2/15/95 |
115 |
|
116 |
This section describes the parameters, subparameters, |
117 |
and status flags as used by the solver. |
118 |
|
119 |
*** See slv6_create for more specific information *** |
120 |
*** on parameters and status flags *** |
121 |
|
122 |
*** Note: the parameters can be changed by the user *** |
123 |
*** with the slv6_set_parameters routine *** |
124 |
|
125 |
|
126 |
Use of subparameters in iarray and rarray: |
127 |
|
128 |
iarray[SP6_NONLIN] 0->require linear model, |
129 |
1->solve linearization at current pt |
130 |
iarray[SP6_RELAXED] 0->solve regular problem |
131 |
1->solve LP relaxation of problem |
132 |
iarray[SP6_NONNEG] 0->solver handles free vars |
133 |
1->solver requires that all vars have LB=0, UB=infinity, no FR or MI |
134 |
iarray[SP6_OBJ] 0->solver assumes minimization, do nothing special |
135 |
1->solver assumes maximization, swap obj coeff for min problems |
136 |
2->solver support SCICONIC style MINIMIZE |
137 |
3->solver supports QOMILP style MAX/MIN in names section |
138 |
iarray[SP6_BINARY] 0->solver supports binary variables using INTORG |
139 |
1->solver supports binary variables with BV option in BOUNDS |
140 |
2->no support |
141 |
iarray[SP6_INTEGER] 0->solver defines integer vars using INTORG |
142 |
1->solver defines integer vars using UI in BOUNDS |
143 |
2->no support for integer vars |
144 |
iarray[SP6_SEMI] 0->no support |
145 |
1->solver supports SCICONIC style semi-continuous vars |
146 |
iarray[SP6_SOS1] 0->no support |
147 |
1->solver supports SOS1, i.e. sum(Xi) = 1 |
148 |
iarray[SP6_SOS2] 0->no support |
149 |
1->solver supports SOS2, i.e. sum(xi) <=2, with 2 nonzeros being adjacent |
150 |
Note: this parameter currently ignored, no support offered for type 2 |
151 |
iarray[SP6_SOS3] 0->no support |
152 |
1->solver supports SOS3, i.e. sum(xi) <= 1 |
153 |
iarray[SP6_BO] 0->no support |
154 |
1->solver supports QOMILP style BO cutoff bound in names section |
155 |
Note: value of bound is in rarray[SP6_BNDVAL] |
156 |
iarray[SP6_EPS] 0->no support |
157 |
1->solver supports QOMILP style EPS termination criterion |
158 |
Note: value of bound is in rarray[SP6_EPSVAL] |
159 |
|
160 |
rarray[SP6_BOVAL] value of QOMILP style BO cutoff bound in names section |
161 |
Note: Ignored if iarray[SP6_BO]=0 |
162 |
rarray[SP6_EPSVAL] value of QOMILP style EPS termination criterion |
163 |
Note: Ignored if iarray[SP6_EPS]=0 |
164 |
rarray[SP6_PINF] any UB >= pinf is set to + infinity |
165 |
rarray[SP6_MINF] any LB <= minf is set to - infinity |
166 |
|
167 |
carray[SP6_FILENAME] pointer to filename to create |
168 |
|
169 |
*********************************************************************/ |
170 |
|
171 |
#define slv6_IA_SIZE 12 |
172 |
#define slv6_RA_SIZE 4 |
173 |
#define slv6_CA_SIZE 1 |
174 |
#define slv6_VA_SIZE 0 |
175 |
|
176 |
/* subscripts for ia */ |
177 |
#define SP6_NONLIN 0 |
178 |
#define SP6_RELAXED 1 |
179 |
#define SP6_NONNEG 2 |
180 |
#define SP6_OBJ 3 |
181 |
#define SP6_BINARY 4 |
182 |
#define SP6_INTEGER 5 |
183 |
#define SP6_SEMI 6 |
184 |
#define SP6_SOS1 7 |
185 |
#define SP6_SOS2 8 |
186 |
#define SP6_SOS3 9 |
187 |
#define SP6_BO 10 |
188 |
#define SP6_EPS 11 |
189 |
|
190 |
/* subscripts for ra */ |
191 |
#define SP6_BOVAL 0 |
192 |
#define SP6_EPSVAL 1 |
193 |
#define SP6_PINF 2 |
194 |
#define SP6_MINF 3 |
195 |
|
196 |
/* subscripts for ca */ |
197 |
#define SP6_FILENAME 0 |
198 |
|
199 |
/*** |
200 |
*** MPS matrix strucutre |
201 |
*** v |
202 |
*** min/max cx: Ax<=b u |
203 |
*** s |
204 |
*** e |
205 |
*** 1 d |
206 |
*** |
207 |
*** | | |
208 |
*** | | |
209 |
*** \ / \ / |
210 |
*** |
211 |
*** +- -+ |
212 |
*** 1 -> | | |
213 |
*** | | |
214 |
*** | A | |
215 |
*** | | |
216 |
*** rused -> | | |
217 |
*** +- -+ |
218 |
*** |
219 |
*** crow -> [ c ] |
220 |
**/ |
221 |
|
222 |
typedef struct mps_data { /* see more detailed comments in calc_matrix */ |
223 |
|
224 |
int32 rused; /* row of last relation (incident or not) */ |
225 |
int32 rinc; /* number of incident relations */ |
226 |
int32 crow; /* row of cost vector (rused+1)*/ |
227 |
int32 vused; /* column of last variable (incident or not) */ |
228 |
int32 vinc; /* number of incident variables */ |
229 |
int32 cap; /* size of sparse square matrix=max(vused+2+1,rused+4+1) */ |
230 |
int32 rank; /* Symbolic rank of problem */ |
231 |
int32 bused; /* Included boundaries */ |
232 |
|
233 |
int solver_var_used; /* values are calculated in calc_svtlist */ |
234 |
int solver_relaxed_used; /* is cache of how many of each vars used */ |
235 |
int solver_int_used; |
236 |
int solver_binary_used; |
237 |
int solver_semi_used; |
238 |
int solver_other_used; |
239 |
int solver_fixed; /* number of fixed or non-incident vars */ |
240 |
|
241 |
mtx_matrix_t Ac_mtx; /* Matrix representation of the A matrix and c vector */ |
242 |
|
243 |
real64 *lbrow; /* pointer to array of lower bounds */ |
244 |
real64 *ubrow; /* pointer to array of upper bounds */ |
245 |
real64 *bcol; /* pointer to array of RHS b vector */ |
246 |
char *typerow; /* pointer to array of variable types */ |
247 |
char *relopcol; /* pointer to array of relational operators i.e. <=, >=, = */ |
248 |
|
249 |
} mps_data_t; |
250 |
|
251 |
|
252 |
|
253 |
/* _____________________________________________________________________ */ |
254 |
|
255 |
/* define solver variable types */ |
256 |
/* note: 0 not defined since default value for sparse matrix, and so a value of |
257 |
0 will imply an invalid row/col is being accessed */ |
258 |
#define SOLVER_VAR 1 /* original solver_var, or some other refinement */ |
259 |
#define SOLVER_RELAXED 2 /* something else, but are working on a relaxed */ |
260 |
/* problem, so treat it as a regular solver_var */ |
261 |
#define SOLVER_INT 3 /* integer var, refines solver_var */ |
262 |
#define SOLVER_BINARY 4 /* binary var, refines solver_int */ |
263 |
#define SOLVER_SEMI 5 /* semicontinuos solver_var, refines solver_var */ |
264 |
#define SOLVER_FIXED 6 /* a fixed or nonincident var */ |
265 |
|
266 |
|
267 |
/* define another token to go with |
268 |
rel_TOK_less, rel_TOK_equal, and rel_TOK_greater, |
269 |
defined in rel.h */ |
270 |
#define rel_TOK_nonincident 00 |
271 |
|
272 |
#else |
273 |
#define slv6_solver_name "no_makeMPS" /* Solver's name */ |
274 |
#define slv6_solver_number 6 /* Solver's number */ |
275 |
#endif |
276 |
|
277 |
#endif |
278 |
|