Debian Codegraph @

external/glpk/glpnpp01.c

raw symbols SCIP
1 /* glpnpp01.c */cxx . . $ `<file>/external/glpk/glpnpp01.c`/
2
3 /***********************************************************************
4 * This code is part of GLPK (GNU Linear Programming Kit).
5 *
6 * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
7 * 2009, 2010 Andrew Makhorin, Department for Applied Informatics,
8 * Moscow Aviation Institute, Moscow, Russia. All rights reserved.
9 * E-mail: <[email protected]>.
10 *
11 * GLPK is free software: you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * GLPK is distributed in the hope that it will be useful, but WITHOUT
17 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
19 * License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with GLPK. If not, see <http://www.gnu.org/licenses/>.
23 ***********************************************************************/
24
25 #include "glpnpp.h"cxx . . $ `<file>/external/glpk/glpnpp.h`/
26
27 NPPcxx . . $ NPP# *npp_create_wkspcxx . . $ `external/glpk/glpnpp.h:261:9`!(void)
28 { /* create LP/MIP preprocessor workspace */
29 NPPcxx . . $ NPP# *npp;
30 npp = xmalloccxx . . $ `external/glpk/glpenv.h:167:9`!(sizeof(NPPcxx . . $ NPP#));
31 npp->orig_dircxx . . $ NPP#orig_dir. = 0;
32 npp->orig_mcxx . . $ NPP#orig_m. = npp->orig_ncxx . . $ NPP#orig_n. = npp->orig_nnzcxx . . $ NPP#orig_nnz. = 0;
33 npp->poolcxx . . $ NPP#pool. = dmp_create_poolcxx . . $ `external/glpk/glpdmp.h:58:9`!();
34 npp->namecxx . . $ NPP#name. = npp->objcxx . . $ NPP#obj. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
35 npp->c0cxx . . $ NPP#c0. = 0.0;
36 npp->nrowscxx . . $ NPP#nrows. = npp->ncolscxx . . $ NPP#ncols. = 0;
37 npp->r_headcxx . . $ NPP#r_head. = npp->r_tailcxx . . $ NPP#r_tail. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
38 npp->c_headcxx . . $ NPP#c_head. = npp->c_tailcxx . . $ NPP#c_tail. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
39 npp->stackcxx . . $ NPP#stack. = dmp_create_poolcxx . . $ `external/glpk/glpdmp.h:58:9`!();
40 npp->topcxx . . $ NPP#top. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
41 #if 0 /* 16/XII-2009 */
42 memset(&npp->count, 0, sizeof(npp->count));
43 #endif
44 npp->mcxx . . $ NPP#m. = npp->ncxx . . $ NPP#n. = npp->nnzcxx . . $ NPP#nnz. = 0;
45 npp->row_refcxx . . $ NPP#row_ref. = npp->col_refcxx . . $ NPP#col_ref. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
46 npp->solcxx . . $ NPP#sol. = npp->scalingcxx . . $ NPP#scaling. = 0;
47 npp->p_statcxx . . $ NPP#p_stat. = npp->d_statcxx . . $ NPP#d_stat. = npp->t_statcxx . . $ NPP#t_stat. = npp->i_statcxx . . $ NPP#i_stat. = 0;
48 npp->r_statcxx . . $ NPP#r_stat. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
49 /*npp->r_prim =*/ npp->r_picxx . . $ NPP#r_pi. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
50 npp->c_statcxx . . $ NPP#c_stat. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
51 npp->c_valuecxx . . $ NPP#c_value. = /*npp->c_dual =*/ NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
52 return npp;
53 }
54
55 void npp_insert_rowcxx . . $ `external/glpk/glpnpp.h:265:9`!(NPPcxx . . $ NPP# *npp, NPPROWcxx . . $ NPPROW# *row, int where)
56 { /* insert row to the row list */
57 if (where == 0)
58 { /* insert row to the beginning of the row list */
59 row->prevcxx . . $ NPPROW#prev. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
60 row->nextcxx . . $ NPPROW#next. = npp->r_headcxx . . $ NPP#r_head.;
61 if (row->nextcxx . . $ NPPROW#next. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
62 npp->r_tailcxx . . $ NPP#r_tail. = row;
63 else
64 row->nextcxx . . $ NPPROW#next.->prevcxx . . $ NPPROW#prev. = row;
65 npp->r_headcxx . . $ NPP#r_head. = row;
66 }
67 else
68 { /* insert row to the end of the row list */
69 row->prevcxx . . $ NPPROW#prev. = npp->r_tailcxx . . $ NPP#r_tail.;
70 row->nextcxx . . $ NPPROW#next. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
71 if (row->prevcxx . . $ NPPROW#prev. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
72 npp->r_headcxx . . $ NPP#r_head. = row;
73 else
74 row->prevcxx . . $ NPPROW#prev.->nextcxx . . $ NPPROW#next. = row;
75 npp->r_tailcxx . . $ NPP#r_tail. = row;
76 }
77 return;
78 }
79
80 void npp_remove_rowcxx . . $ `external/glpk/glpnpp.h:269:9`!(NPPcxx . . $ NPP# *npp, NPPROWcxx . . $ NPPROW# *row)
81 { /* remove row from the row list */
82 if (row->prevcxx . . $ NPPROW#prev. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
83 npp->r_headcxx . . $ NPP#r_head. = row->nextcxx . . $ NPPROW#next.;
84 else
85 row->prevcxx . . $ NPPROW#prev.->nextcxx . . $ NPPROW#next. = row->nextcxx . . $ NPPROW#next.;
86 if (row->nextcxx . . $ NPPROW#next. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
87 npp->r_tailcxx . . $ NPP#r_tail. = row->prevcxx . . $ NPPROW#prev.;
88 else
89 row->nextcxx . . $ NPPROW#next.->prevcxx . . $ NPPROW#prev. = row->prevcxx . . $ NPPROW#prev.;
90 return;
91 }
92
93 void npp_activate_rowcxx . . $ `external/glpk/glpnpp.h:273:9`!(NPPcxx . . $ NPP# *npp, NPPROWcxx . . $ NPPROW# *row)
94 { /* make row active */
95 if (!row->tempcxx . . $ NPPROW#temp.)
96 { row->tempcxx . . $ NPPROW#temp. = 1;
97 /* move the row to the beginning of the row list */
98 npp_remove_rowcxx . . $ `external/glpk/glpnpp.h:269:9`!(npp, row);
99 npp_insert_rowcxx . . $ `external/glpk/glpnpp.h:265:9`!(npp, row, 0);
100 }
101 return;
102 }
103
104 void npp_deactivate_rowcxx . . $ `external/glpk/glpnpp.h:277:9`!(NPPcxx . . $ NPP# *npp, NPPROWcxx . . $ NPPROW# *row)
105 { /* make row inactive */
106 if (row->tempcxx . . $ NPPROW#temp.)
107 { row->tempcxx . . $ NPPROW#temp. = 0;
108 /* move the row to the end of the row list */
109 npp_remove_rowcxx . . $ `external/glpk/glpnpp.h:269:9`!(npp, row);
110 npp_insert_rowcxx . . $ `external/glpk/glpnpp.h:265:9`!(npp, row, 1);
111 }
112 return;
113 }
114
115 void npp_insert_colcxx . . $ `external/glpk/glpnpp.h:281:9`!(NPPcxx . . $ NPP# *npp, NPPCOLcxx . . $ NPPCOL# *col, int where)
116 { /* insert column to the column list */
117 if (where == 0)
118 { /* insert column to the beginning of the column list */
119 col->prevcxx . . $ NPPCOL#prev. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
120 col->nextcxx . . $ NPPCOL#next. = npp->c_headcxx . . $ NPP#c_head.;
121 if (col->nextcxx . . $ NPPCOL#next. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
122 npp->c_tailcxx . . $ NPP#c_tail. = col;
123 else
124 col->nextcxx . . $ NPPCOL#next.->prevcxx . . $ NPPCOL#prev. = col;
125 npp->c_headcxx . . $ NPP#c_head. = col;
126 }
127 else
128 { /* insert column to the end of the column list */
129 col->prevcxx . . $ NPPCOL#prev. = npp->c_tailcxx . . $ NPP#c_tail.;
130 col->nextcxx . . $ NPPCOL#next. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
131 if (col->prevcxx . . $ NPPCOL#prev. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
132 npp->c_headcxx . . $ NPP#c_head. = col;
133 else
134 col->prevcxx . . $ NPPCOL#prev.->nextcxx . . $ NPPCOL#next. = col;
135 npp->c_tailcxx . . $ NPP#c_tail. = col;
136 }
137 return;
138 }
139
140 void npp_remove_colcxx . . $ `external/glpk/glpnpp.h:285:9`!(NPPcxx . . $ NPP# *npp, NPPCOLcxx . . $ NPPCOL# *col)
141 { /* remove column from the column list */
142 if (col->prevcxx . . $ NPPCOL#prev. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
143 npp->c_headcxx . . $ NPP#c_head. = col->nextcxx . . $ NPPCOL#next.;
144 else
145 col->prevcxx . . $ NPPCOL#prev.->nextcxx . . $ NPPCOL#next. = col->nextcxx . . $ NPPCOL#next.;
146 if (col->nextcxx . . $ NPPCOL#next. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
147 npp->c_tailcxx . . $ NPP#c_tail. = col->prevcxx . . $ NPPCOL#prev.;
148 else
149 col->nextcxx . . $ NPPCOL#next.->prevcxx . . $ NPPCOL#prev. = col->prevcxx . . $ NPPCOL#prev.;
150 return;
151 }
152
153 void npp_activate_colcxx . . $ `external/glpk/glpnpp.h:289:9`!(NPPcxx . . $ NPP# *npp, NPPCOLcxx . . $ NPPCOL# *col)
154 { /* make column active */
155 if (!col->tempcxx . . $ NPPCOL#temp.)
156 { col->tempcxx . . $ NPPCOL#temp. = 1;
157 /* move the column to the beginning of the column list */
158 npp_remove_colcxx . . $ `external/glpk/glpnpp.h:285:9`!(npp, col);
159 npp_insert_colcxx . . $ `external/glpk/glpnpp.h:281:9`!(npp, col, 0);
160 }
161 return;
162 }
163
164 void npp_deactivate_colcxx . . $ `external/glpk/glpnpp.h:293:9`!(NPPcxx . . $ NPP# *npp, NPPCOLcxx . . $ NPPCOL# *col)
165 { /* make column inactive */
166 if (col->tempcxx . . $ NPPCOL#temp.)
167 { col->tempcxx . . $ NPPCOL#temp. = 0;
168 /* move the column to the end of the column list */
169 npp_remove_colcxx . . $ `external/glpk/glpnpp.h:285:9`!(npp, col);
170 npp_insert_colcxx . . $ `external/glpk/glpnpp.h:281:9`!(npp, col, 1);
171 }
172 return;
173 }
174
175 NPPROWcxx . . $ NPPROW# *npp_add_rowcxx . . $ `external/glpk/glpnpp.h:297:9`!(NPPcxx . . $ NPP# *npp)
176 { /* add new row to the current problem */
177 NPPROWcxx . . $ NPPROW# *row;
178 row = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(npp->poolcxx . . $ NPP#pool., sizeof(NPPROWcxx . . $ NPPROW#));
179 row->icxx . . $ NPPROW#i. = ++(npp->nrowscxx . . $ NPP#nrows.);
180 row->namecxx . . $ NPPROW#name. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
181 row->lbcxx . . $ NPPROW#lb. = -DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!, row->ubcxx . . $ NPPROW#ub. = +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!;
182 row->ptrcxx . . $ NPPROW#ptr. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
183 row->tempcxx . . $ NPPROW#temp. = 0;
184 npp_insert_rowcxx . . $ `external/glpk/glpnpp.h:265:9`!(npp, row, 1);
185 return row;
186 }
187
188 NPPCOLcxx . . $ NPPCOL# *npp_add_colcxx . . $ `external/glpk/glpnpp.h:301:9`!(NPPcxx . . $ NPP# *npp)
189 { /* add new column to the current problem */
190 NPPCOLcxx . . $ NPPCOL# *col;
191 col = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(npp->poolcxx . . $ NPP#pool., sizeof(NPPCOLcxx . . $ NPPCOL#));
192 col->jcxx . . $ NPPCOL#j. = ++(npp->ncolscxx . . $ NPP#ncols.);
193 col->namecxx . . $ NPPCOL#name. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
194 #if 0
195 col->kind = GLP_CV;
196 #else
197 col->is_intcxx . . $ NPPCOL#is_int. = 0;
198 #endif
199 col->lbcxx . . $ NPPCOL#lb. = col->ubcxx . . $ NPPCOL#ub. = col->coefcxx . . $ NPPCOL#coef. = 0.0;
200 col->ptrcxx . . $ NPPCOL#ptr. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
201 col->tempcxx . . $ NPPCOL#temp. = 0;
202 npp_insert_colcxx . . $ `external/glpk/glpnpp.h:281:9`!(npp, col, 1);
203 return col;
204 }
205
206 NPPAIJcxx . . $ NPPAIJ# *npp_add_aijcxx . . $ `external/glpk/glpnpp.h:305:9`!(NPPcxx . . $ NPP# *npp, NPPROWcxx . . $ NPPROW# *row, NPPCOLcxx . . $ NPPCOL# *col, double val)
207 { /* add new element to the constraint matrix */
208 NPPAIJcxx . . $ NPPAIJ# *aij;
209 aij = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(npp->poolcxx . . $ NPP#pool., sizeof(NPPAIJcxx . . $ NPPAIJ#));
210 aij->rowcxx . . $ NPPAIJ#row. = row;
211 aij->colcxx . . $ NPPAIJ#col. = col;
212 aij->valcxx . . $ NPPAIJ#val. = val;
213 aij->r_prevcxx . . $ NPPAIJ#r_prev. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
214 aij->r_nextcxx . . $ NPPAIJ#r_next. = row->ptrcxx . . $ NPPROW#ptr.;
215 aij->c_prevcxx . . $ NPPAIJ#c_prev. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
216 aij->c_nextcxx . . $ NPPAIJ#c_next. = col->ptrcxx . . $ NPPCOL#ptr.;
217 if (aij->r_nextcxx . . $ NPPAIJ#r_next. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
218 aij->r_nextcxx . . $ NPPAIJ#r_next.->r_prevcxx . . $ NPPAIJ#r_prev. = aij;
219 if (aij->c_nextcxx . . $ NPPAIJ#c_next. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
220 aij->c_nextcxx . . $ NPPAIJ#c_next.->c_prevcxx . . $ NPPAIJ#c_prev. = aij;
221 row->ptrcxx . . $ NPPROW#ptr. = col->ptrcxx . . $ NPPCOL#ptr. = aij;
222 return aij;
223 }
224
225 int npp_row_nnzcxx . . $ `external/glpk/glpnpp.h:309:9`!(NPPcxx . . $ NPP# *npp, NPPROWcxx . . $ NPPROW# *row)
226 { /* count number of non-zero coefficients in row */
227 NPPAIJcxx . . $ NPPAIJ# *aij;
228 int nnz;
229 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(npp == npp);
230 nnz = 0;
231 for (aij = row->ptrcxx . . $ NPPROW#ptr.; aij != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; aij = aij->r_nextcxx . . $ NPPAIJ#r_next.)
232 nnz++;
233 return nnz;
234 }
235
236 int npp_col_nnzcxx . . $ `external/glpk/glpnpp.h:313:9`!(NPPcxx . . $ NPP# *npp, NPPCOLcxx . . $ NPPCOL# *col)
237 { /* count number of non-zero coefficients in column */
238 NPPAIJcxx . . $ NPPAIJ# *aij;
239 int nnz;
240 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(npp == npp);
241 nnz = 0;
242 for (aij = col->ptrcxx . . $ NPPCOL#ptr.; aij != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; aij = aij->c_nextcxx . . $ NPPAIJ#c_next.)
243 nnz++;
244 return nnz;
245 }
246
247 void *npp_push_tsecxx . . $ `external/glpk/glpnpp.h:317:9`!(NPPcxx . . $ NPP# *npp, int (*func)(NPPcxx . . $ NPP# *npp, void *info),
248 int size)
249 { /* push new entry to the transformation stack */
250 NPPTSEcxx . . $ NPPTSE# *tse;
251 tse = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(npp->stackcxx . . $ NPP#stack., sizeof(NPPTSEcxx . . $ NPPTSE#));
252 tse->funccxx . . $ NPPTSE#func. = func;
253 tse->infocxx . . $ NPPTSE#info. = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(npp->stackcxx . . $ NPP#stack., size);
254 tse->linkcxx . . $ NPPTSE#link. = npp->topcxx . . $ NPP#top.;
255 npp->topcxx . . $ NPP#top. = tse;
256 return tse->infocxx . . $ NPPTSE#info.;
257 }
258
259 #if 1 /* 23/XII-2009 */
260 void npp_erase_rowcxx . . $ `external/glpk/glpnpp.h:322:9`!(NPPcxx . . $ NPP# *npp, NPPROWcxx . . $ NPPROW# *row)
261 { /* erase row content to make it empty */
262 NPPAIJcxx . . $ NPPAIJ# *aij;
263 while (row->ptrcxx . . $ NPPROW#ptr. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
264 { aij = row->ptrcxx . . $ NPPROW#ptr.;
265 row->ptrcxx . . $ NPPROW#ptr. = aij->r_nextcxx . . $ NPPAIJ#r_next.;
266 if (aij->c_prevcxx . . $ NPPAIJ#c_prev. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
267 aij->colcxx . . $ NPPAIJ#col.->ptrcxx . . $ NPPCOL#ptr. = aij->c_nextcxx . . $ NPPAIJ#c_next.;
268 else
269 aij->c_prevcxx . . $ NPPAIJ#c_prev.->c_nextcxx . . $ NPPAIJ#c_next. = aij->c_nextcxx . . $ NPPAIJ#c_next.;
270 if (aij->c_nextcxx . . $ NPPAIJ#c_next. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
271 ;
272 else
273 aij->c_nextcxx . . $ NPPAIJ#c_next.->c_prevcxx . . $ NPPAIJ#c_prev. = aij->c_prevcxx . . $ NPPAIJ#c_prev.;
274 dmp_free_atomcxx . . $ `external/glpk/glpdmp.h:66:9`!(npp->poolcxx . . $ NPP#pool., aij, sizeof(NPPAIJcxx . . $ NPPAIJ#));
275 }
276 return;
277 }
278 #endif
279
280 void npp_del_rowcxx . . $ `external/glpk/glpnpp.h:326:9`!(NPPcxx . . $ NPP# *npp, NPPROWcxx . . $ NPPROW# *row)
281 { /* remove row from the current problem */
282 #if 0 /* 23/XII-2009 */
283 NPPAIJ *aij;
284 #endif
285 if (row->namecxx . . $ NPPROW#name. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
286 dmp_free_atomcxx . . $ `external/glpk/glpdmp.h:66:9`!(npp->poolcxx . . $ NPP#pool., row->namecxx . . $ NPPROW#name., strlencxx . . $ strlen(751346f8406fd082).(row->namecxx . . $ NPPROW#name.)+1);
287 #if 0 /* 23/XII-2009 */
288 while (row->ptr != NULL)
289 { aij = row->ptr;
290 row->ptr = aij->r_next;
291 if (aij->c_prev == NULL)
292 aij->col->ptr = aij->c_next;
293 else
294 aij->c_prev->c_next = aij->c_next;
295 if (aij->c_next == NULL)
296 ;
297 else
298 aij->c_next->c_prev = aij->c_prev;
299 dmp_free_atom(npp->pool, aij, sizeof(NPPAIJ));
300 }
301 #else
302 npp_erase_rowcxx . . $ `external/glpk/glpnpp.h:322:9`!(npp, row);
303 #endif
304 npp_remove_rowcxx . . $ `external/glpk/glpnpp.h:269:9`!(npp, row);
305 dmp_free_atomcxx . . $ `external/glpk/glpdmp.h:66:9`!(npp->poolcxx . . $ NPP#pool., row, sizeof(NPPROWcxx . . $ NPPROW#));
306 return;
307 }
308
309 void npp_del_colcxx . . $ `external/glpk/glpnpp.h:330:9`!(NPPcxx . . $ NPP# *npp, NPPCOLcxx . . $ NPPCOL# *col)
310 { /* remove column from the current problem */
311 NPPAIJcxx . . $ NPPAIJ# *aij;
312 if (col->namecxx . . $ NPPCOL#name. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
313 dmp_free_atomcxx . . $ `external/glpk/glpdmp.h:66:9`!(npp->poolcxx . . $ NPP#pool., col->namecxx . . $ NPPCOL#name., strlencxx . . $ strlen(751346f8406fd082).(col->namecxx . . $ NPPCOL#name.)+1);
314 while (col->ptrcxx . . $ NPPCOL#ptr. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
315 { aij = col->ptrcxx . . $ NPPCOL#ptr.;
316 col->ptrcxx . . $ NPPCOL#ptr. = aij->c_nextcxx . . $ NPPAIJ#c_next.;
317 if (aij->r_prevcxx . . $ NPPAIJ#r_prev. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
318 aij->rowcxx . . $ NPPAIJ#row.->ptrcxx . . $ NPPROW#ptr. = aij->r_nextcxx . . $ NPPAIJ#r_next.;
319 else
320 aij->r_prevcxx . . $ NPPAIJ#r_prev.->r_nextcxx . . $ NPPAIJ#r_next. = aij->r_nextcxx . . $ NPPAIJ#r_next.;
321 if (aij->r_nextcxx . . $ NPPAIJ#r_next. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
322 ;
323 else
324 aij->r_nextcxx . . $ NPPAIJ#r_next.->r_prevcxx . . $ NPPAIJ#r_prev. = aij->r_prevcxx . . $ NPPAIJ#r_prev.;
325 dmp_free_atomcxx . . $ `external/glpk/glpdmp.h:66:9`!(npp->poolcxx . . $ NPP#pool., aij, sizeof(NPPAIJcxx . . $ NPPAIJ#));
326 }
327 npp_remove_colcxx . . $ `external/glpk/glpnpp.h:285:9`!(npp, col);
328 dmp_free_atomcxx . . $ `external/glpk/glpdmp.h:66:9`!(npp->poolcxx . . $ NPP#pool., col, sizeof(NPPCOLcxx . . $ NPPCOL#));
329 return;
330 }
331
332 void npp_del_aijcxx . . $ `external/glpk/glpnpp.h:334:9`!(NPPcxx . . $ NPP# *npp, NPPAIJcxx . . $ NPPAIJ# *aij)
333 { /* remove element from the constraint matrix */
334 if (aij->r_prevcxx . . $ NPPAIJ#r_prev. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
335 aij->rowcxx . . $ NPPAIJ#row.->ptrcxx . . $ NPPROW#ptr. = aij->r_nextcxx . . $ NPPAIJ#r_next.;
336 else
337 aij->r_prevcxx . . $ NPPAIJ#r_prev.->r_nextcxx . . $ NPPAIJ#r_next. = aij->r_nextcxx . . $ NPPAIJ#r_next.;
338 if (aij->r_nextcxx . . $ NPPAIJ#r_next. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
339 ;
340 else
341 aij->r_nextcxx . . $ NPPAIJ#r_next.->r_prevcxx . . $ NPPAIJ#r_prev. = aij->r_prevcxx . . $ NPPAIJ#r_prev.;
342 if (aij->c_prevcxx . . $ NPPAIJ#c_prev. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
343 aij->colcxx . . $ NPPAIJ#col.->ptrcxx . . $ NPPCOL#ptr. = aij->c_nextcxx . . $ NPPAIJ#c_next.;
344 else
345 aij->c_prevcxx . . $ NPPAIJ#c_prev.->c_nextcxx . . $ NPPAIJ#c_next. = aij->c_nextcxx . . $ NPPAIJ#c_next.;
346 if (aij->c_nextcxx . . $ NPPAIJ#c_next. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
347 ;
348 else
349 aij->c_nextcxx . . $ NPPAIJ#c_next.->c_prevcxx . . $ NPPAIJ#c_prev. = aij->c_prevcxx . . $ NPPAIJ#c_prev.;
350 dmp_free_atomcxx . . $ `external/glpk/glpdmp.h:66:9`!(npp->poolcxx . . $ NPP#pool., aij, sizeof(NPPAIJcxx . . $ NPPAIJ#));
351 return;
352 }
353
354 void npp_load_probcxx . . $ `external/glpk/glpnpp.h:338:9`!(NPPcxx . . $ NPP# *npp, glp_probcxx . . $ glp_prob# *orig, int names, int sol,
355 int scaling)
356 { /* load original problem into the preprocessor workspace */
357 int m = orig->mcxx . . $ glp_prob#m.;
358 int n = orig->ncxx . . $ glp_prob#n.;
359 NPPROWcxx . . $ NPPROW# **link;
360 int i, j;
361 double dir;
362 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(names == GLP_OFFcxx . . $ `external/glpk/glpk.h:222:9`! || names == GLP_ONcxx . . $ `external/glpk/glpk.h:221:9`!);
363 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(sol == GLP_SOLcxx . . $ `external/glpk/glpk.h:80:9`! || sol == GLP_IPTcxx . . $ `external/glpk/glpk.h:81:9`! || sol == GLP_MIPcxx . . $ `external/glpk/glpk.h:82:9`!);
364 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(scaling == GLP_OFFcxx . . $ `external/glpk/glpk.h:222:9`! || scaling == GLP_ONcxx . . $ `external/glpk/glpk.h:221:9`!);
365 if (sol == GLP_MIPcxx . . $ `external/glpk/glpk.h:82:9`!) xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(!scaling);
366 npp->orig_dircxx . . $ NPP#orig_dir. = orig->dircxx . . $ glp_prob#dir.;
367 if (npp->orig_dircxx . . $ NPP#orig_dir. == GLP_MINcxx . . $ `external/glpk/glpk.h:50:9`!)
368 dir = +1.0;
369 else if (npp->orig_dircxx . . $ NPP#orig_dir. == GLP_MAXcxx . . $ `external/glpk/glpk.h:51:9`!)
370 dir = -1.0;
371 else
372 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(npp != npp);
373 npp->orig_mcxx . . $ NPP#orig_m. = m;
374 npp->orig_ncxx . . $ NPP#orig_n. = n;
375 npp->orig_nnzcxx . . $ NPP#orig_nnz. = orig->nnzcxx . . $ glp_prob#nnz.;
376 if (names && orig->namecxx . . $ glp_prob#name. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
377 { npp->namecxx . . $ NPP#name. = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(npp->poolcxx . . $ NPP#pool., strlencxx . . $ strlen(751346f8406fd082).(orig->namecxx . . $ glp_prob#name.)+1);
378 strcpycxx . . $ strcpy(b7b3a83273496486).(npp->namecxx . . $ NPP#name., orig->namecxx . . $ glp_prob#name.);
379 }
380 if (names && orig->objcxx . . $ glp_prob#obj. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
381 { npp->objcxx . . $ NPP#obj. = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(npp->poolcxx . . $ NPP#pool., strlencxx . . $ strlen(751346f8406fd082).(orig->objcxx . . $ glp_prob#obj.)+1);
382 strcpycxx . . $ strcpy(b7b3a83273496486).(npp->objcxx . . $ NPP#obj., orig->objcxx . . $ glp_prob#obj.);
383 }
384 npp->c0cxx . . $ NPP#c0. = dir * orig->c0cxx . . $ glp_prob#c0.;
385 /* load rows */
386 link = xcalloccxx . . $ `external/glpk/glpenv.h:171:9`!(1+m, sizeof(NPPROWcxx . . $ NPPROW# *));
387 for (i = 1; i <= m; i++)
388 { GLPROWcxx . . $ GLPROW# *rrr = orig->rowcxx . . $ glp_prob#row.[i];
389 NPPROWcxx . . $ NPPROW# *row;
390 link[i] = row = npp_add_rowcxx . . $ `external/glpk/glpnpp.h:297:9`!(npp);
391 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(row->i == i);
392 if (names && rrr->namecxx . . $ GLPROW#name. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
393 { row->namecxx . . $ NPPROW#name. = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(npp->poolcxx . . $ NPP#pool., strlencxx . . $ strlen(751346f8406fd082).(rrr->namecxx . . $ GLPROW#name.)+1);
394 strcpycxx . . $ strcpy(b7b3a83273496486).(row->namecxx . . $ NPPROW#name., rrr->namecxx . . $ GLPROW#name.);
395 }
396 if (!scaling)
397 { if (rrr->typecxx . . $ GLPROW#type. == GLP_FRcxx . . $ `external/glpk/glpk.h:59:9`!)
398 row->lbcxx . . $ NPPROW#lb. = -DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!, row->ubcxx . . $ NPPROW#ub. = +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!;
399 else if (rrr->typecxx . . $ GLPROW#type. == GLP_LOcxx . . $ `external/glpk/glpk.h:60:9`!)
400 row->lbcxx . . $ NPPROW#lb. = rrr->lbcxx . . $ GLPROW#lb., row->ubcxx . . $ NPPROW#ub. = +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!;
401 else if (rrr->typecxx . . $ GLPROW#type. == GLP_UPcxx . . $ `external/glpk/glpk.h:61:9`!)
402 row->lbcxx . . $ NPPROW#lb. = -DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!, row->ubcxx . . $ NPPROW#ub. = rrr->ubcxx . . $ GLPROW#ub.;
403 else if (rrr->typecxx . . $ GLPROW#type. == GLP_DBcxx . . $ `external/glpk/glpk.h:62:9`!)
404 row->lbcxx . . $ NPPROW#lb. = rrr->lbcxx . . $ GLPROW#lb., row->ubcxx . . $ NPPROW#ub. = rrr->ubcxx . . $ GLPROW#ub.;
405 else if (rrr->typecxx . . $ GLPROW#type. == GLP_FXcxx . . $ `external/glpk/glpk.h:63:9`!)
406 row->lbcxx . . $ NPPROW#lb. = row->ubcxx . . $ NPPROW#ub. = rrr->lbcxx . . $ GLPROW#lb.;
407 else
408 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(rrr != rrr);
409 }
410 else
411 { double rii = rrr->riicxx . . $ GLPROW#rii.;
412 if (rrr->typecxx . . $ GLPROW#type. == GLP_FRcxx . . $ `external/glpk/glpk.h:59:9`!)
413 row->lbcxx . . $ NPPROW#lb. = -DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!, row->ubcxx . . $ NPPROW#ub. = +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!;
414 else if (rrr->typecxx . . $ GLPROW#type. == GLP_LOcxx . . $ `external/glpk/glpk.h:60:9`!)
415 row->lbcxx . . $ NPPROW#lb. = rrr->lbcxx . . $ GLPROW#lb. * rii, row->ubcxx . . $ NPPROW#ub. = +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!;
416 else if (rrr->typecxx . . $ GLPROW#type. == GLP_UPcxx . . $ `external/glpk/glpk.h:61:9`!)
417 row->lbcxx . . $ NPPROW#lb. = -DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!, row->ubcxx . . $ NPPROW#ub. = rrr->ubcxx . . $ GLPROW#ub. * rii;
418 else if (rrr->typecxx . . $ GLPROW#type. == GLP_DBcxx . . $ `external/glpk/glpk.h:62:9`!)
419 row->lbcxx . . $ NPPROW#lb. = rrr->lbcxx . . $ GLPROW#lb. * rii, row->ubcxx . . $ NPPROW#ub. = rrr->ubcxx . . $ GLPROW#ub. * rii;
420 else if (rrr->typecxx . . $ GLPROW#type. == GLP_FXcxx . . $ `external/glpk/glpk.h:63:9`!)
421 row->lbcxx . . $ NPPROW#lb. = row->ubcxx . . $ NPPROW#ub. = rrr->lbcxx . . $ GLPROW#lb. * rii;
422 else
423 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(rrr != rrr);
424 }
425 }
426 /* load columns and constraint coefficients */
427 for (j = 1; j <= n; j++)
428 { GLPCOLcxx . . $ GLPCOL# *ccc = orig->colcxx . . $ glp_prob#col.[j];
429 GLPAIJcxx . . $ GLPAIJ# *aaa;
430 NPPCOLcxx . . $ NPPCOL# *col;
431 col = npp_add_colcxx . . $ `external/glpk/glpnpp.h:301:9`!(npp);
432 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(col->j == j);
433 if (names && ccc->namecxx . . $ GLPCOL#name. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
434 { col->namecxx . . $ NPPCOL#name. = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(npp->poolcxx . . $ NPP#pool., strlencxx . . $ strlen(751346f8406fd082).(ccc->namecxx . . $ GLPCOL#name.)+1);
435 strcpycxx . . $ strcpy(b7b3a83273496486).(col->namecxx . . $ NPPCOL#name., ccc->namecxx . . $ GLPCOL#name.);
436 }
437 if (sol == GLP_MIPcxx . . $ `external/glpk/glpk.h:82:9`!)
438 #if 0
439 col->kind = ccc->kind;
440 #else
441 col->is_intcxx . . $ NPPCOL#is_int. = (char)(ccc->kindcxx . . $ GLPCOL#kind. == GLP_IVcxx . . $ `external/glpk/glpk.h:55:9`!);
442 #endif
443 if (!scaling)
444 { if (ccc->typecxx . . $ GLPCOL#type. == GLP_FRcxx . . $ `external/glpk/glpk.h:59:9`!)
445 col->lbcxx . . $ NPPCOL#lb. = -DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!, col->ubcxx . . $ NPPCOL#ub. = +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!;
446 else if (ccc->typecxx . . $ GLPCOL#type. == GLP_LOcxx . . $ `external/glpk/glpk.h:60:9`!)
447 col->lbcxx . . $ NPPCOL#lb. = ccc->lbcxx . . $ GLPCOL#lb., col->ubcxx . . $ NPPCOL#ub. = +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!;
448 else if (ccc->typecxx . . $ GLPCOL#type. == GLP_UPcxx . . $ `external/glpk/glpk.h:61:9`!)
449 col->lbcxx . . $ NPPCOL#lb. = -DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!, col->ubcxx . . $ NPPCOL#ub. = ccc->ubcxx . . $ GLPCOL#ub.;
450 else if (ccc->typecxx . . $ GLPCOL#type. == GLP_DBcxx . . $ `external/glpk/glpk.h:62:9`!)
451 col->lbcxx . . $ NPPCOL#lb. = ccc->lbcxx . . $ GLPCOL#lb., col->ubcxx . . $ NPPCOL#ub. = ccc->ubcxx . . $ GLPCOL#ub.;
452 else if (ccc->typecxx . . $ GLPCOL#type. == GLP_FXcxx . . $ `external/glpk/glpk.h:63:9`!)
453 col->lbcxx . . $ NPPCOL#lb. = col->ubcxx . . $ NPPCOL#ub. = ccc->lbcxx . . $ GLPCOL#lb.;
454 else
455 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(ccc != ccc);
456 col->coefcxx . . $ NPPCOL#coef. = dir * ccc->coefcxx . . $ GLPCOL#coef.;
457 for (aaa = ccc->ptrcxx . . $ GLPCOL#ptr.; aaa != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; aaa = aaa->c_nextcxx . . $ GLPAIJ#c_next.)
458 npp_add_aijcxx . . $ `external/glpk/glpnpp.h:305:9`!(npp, link[aaa->rowcxx . . $ GLPAIJ#row.->icxx . . $ GLPROW#i.], col, aaa->valcxx . . $ GLPAIJ#val.);
459 }
460 else
461 { double sjj = ccc->sjjcxx . . $ GLPCOL#sjj.;
462 if (ccc->typecxx . . $ GLPCOL#type. == GLP_FRcxx . . $ `external/glpk/glpk.h:59:9`!)
463 col->lbcxx . . $ NPPCOL#lb. = -DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!, col->ubcxx . . $ NPPCOL#ub. = +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!;
464 else if (ccc->typecxx . . $ GLPCOL#type. == GLP_LOcxx . . $ `external/glpk/glpk.h:60:9`!)
465 col->lbcxx . . $ NPPCOL#lb. = ccc->lbcxx . . $ GLPCOL#lb. / sjj, col->ubcxx . . $ NPPCOL#ub. = +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!;
466 else if (ccc->typecxx . . $ GLPCOL#type. == GLP_UPcxx . . $ `external/glpk/glpk.h:61:9`!)
467 col->lbcxx . . $ NPPCOL#lb. = -DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!, col->ubcxx . . $ NPPCOL#ub. = ccc->ubcxx . . $ GLPCOL#ub. / sjj;
468 else if (ccc->typecxx . . $ GLPCOL#type. == GLP_DBcxx . . $ `external/glpk/glpk.h:62:9`!)
469 col->lbcxx . . $ NPPCOL#lb. = ccc->lbcxx . . $ GLPCOL#lb. / sjj, col->ubcxx . . $ NPPCOL#ub. = ccc->ubcxx . . $ GLPCOL#ub. / sjj;
470 else if (ccc->typecxx . . $ GLPCOL#type. == GLP_FXcxx . . $ `external/glpk/glpk.h:63:9`!)
471 col->lbcxx . . $ NPPCOL#lb. = col->ubcxx . . $ NPPCOL#ub. = ccc->lbcxx . . $ GLPCOL#lb. / sjj;
472 else
473 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(ccc != ccc);
474 col->coefcxx . . $ NPPCOL#coef. = dir * ccc->coefcxx . . $ GLPCOL#coef. * sjj;
475 for (aaa = ccc->ptrcxx . . $ GLPCOL#ptr.; aaa != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; aaa = aaa->c_nextcxx . . $ GLPAIJ#c_next.)
476 npp_add_aijcxx . . $ `external/glpk/glpnpp.h:305:9`!(npp, link[aaa->rowcxx . . $ GLPAIJ#row.->icxx . . $ GLPROW#i.], col,
477 aaa->rowcxx . . $ GLPAIJ#row.->riicxx . . $ GLPROW#rii. * aaa->valcxx . . $ GLPAIJ#val. * sjj);
478 }
479 }
480 xfreecxx . . $ `external/glpk/glpenv.h:175:9`!(link);
481 /* keep solution indicator and scaling option */
482 npp->solcxx . . $ NPP#sol. = sol;
483 npp->scalingcxx . . $ NPP#scaling. = scaling;
484 return;
485 }
486
487 void npp_build_probcxx . . $ `external/glpk/glpnpp.h:343:9`!(NPPcxx . . $ NPP# *npp, glp_probcxx . . $ glp_prob# *prob)
488 { /* build resultant (preprocessed) problem */
489 NPPROWcxx . . $ NPPROW# *row;
490 NPPCOLcxx . . $ NPPCOL# *col;
491 NPPAIJcxx . . $ NPPAIJ# *aij;
492 int i, j, type, len, *ind;
493 double dir, *val;
494 glp_erase_probcxx . . $ glp_erase_prob(84c60d68cac39b9a).(prob);
495 glp_set_prob_namecxx . . $ glp_set_prob_name(d84c0d6c877919f6).(prob, npp->namecxx . . $ NPP#name.);
496 glp_set_obj_namecxx . . $ glp_set_obj_name(d84c0d6c877919f6).(prob, npp->objcxx . . $ NPP#obj.);
497 glp_set_obj_dircxx . . $ glp_set_obj_dir(e00ef8be97973834).(prob, npp->orig_dircxx . . $ NPP#orig_dir.);
498 if (npp->orig_dircxx . . $ NPP#orig_dir. == GLP_MINcxx . . $ `external/glpk/glpk.h:50:9`!)
499 dir = +1.0;
500 else if (npp->orig_dircxx . . $ NPP#orig_dir. == GLP_MAXcxx . . $ `external/glpk/glpk.h:51:9`!)
501 dir = -1.0;
502 else
503 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(npp != npp);
504 glp_set_obj_coefcxx . . $ glp_set_obj_coef(d60e14834b632e5e).(prob, 0, dir * npp->c0cxx . . $ NPP#c0.);
505 /* build rows */
506 for (row = npp->r_headcxx . . $ NPP#r_head.; row != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; row = row->nextcxx . . $ NPPROW#next.)
507 { row->tempcxx . . $ NPPROW#temp. = i = glp_add_rowscxx . . $ glp_add_rows(423829e847ef1a83).(prob, 1);
508 glp_set_row_namecxx . . $ glp_set_row_name(7764df469f6d9ace).(prob, i, row->namecxx . . $ NPPROW#name.);
509 if (row->lbcxx . . $ NPPROW#lb. == -DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`! && row->ubcxx . . $ NPPROW#ub. == +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!)
510 type = GLP_FRcxx . . $ `external/glpk/glpk.h:59:9`!;
511 else if (row->ubcxx . . $ NPPROW#ub. == +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!)
512 type = GLP_LOcxx . . $ `external/glpk/glpk.h:60:9`!;
513 else if (row->lbcxx . . $ NPPROW#lb. == -DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!)
514 type = GLP_UPcxx . . $ `external/glpk/glpk.h:61:9`!;
515 else if (row->lbcxx . . $ NPPROW#lb. != row->ubcxx . . $ NPPROW#ub.)
516 type = GLP_DBcxx . . $ `external/glpk/glpk.h:62:9`!;
517 else
518 type = GLP_FXcxx . . $ `external/glpk/glpk.h:63:9`!;
519 glp_set_row_bndscxx . . $ glp_set_row_bnds(9376c6e48e598b7a).(prob, i, type, row->lbcxx . . $ NPPROW#lb., row->ubcxx . . $ NPPROW#ub.);
520 }
521 /* build columns and the constraint matrix */
522 ind = xcalloccxx . . $ `external/glpk/glpenv.h:171:9`!(1+prob->mcxx . . $ glp_prob#m., sizeof(int));
523 val = xcalloccxx . . $ `external/glpk/glpenv.h:171:9`!(1+prob->mcxx . . $ glp_prob#m., sizeof(double));
524 for (col = npp->c_headcxx . . $ NPP#c_head.; col != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; col = col->nextcxx . . $ NPPCOL#next.)
525 { j = glp_add_colscxx . . $ glp_add_cols(423829e847ef1a83).(prob, 1);
526 glp_set_col_namecxx . . $ glp_set_col_name(7764df469f6d9ace).(prob, j, col->namecxx . . $ NPPCOL#name.);
527 #if 0
528 glp_set_col_kind(prob, j, col->kind);
529 #else
530 glp_set_col_kindcxx . . $ glp_set_col_kind(b083f42914639ad0).(prob, j, col->is_intcxx . . $ NPPCOL#is_int. ? GLP_IVcxx . . $ `external/glpk/glpk.h:55:9`! : GLP_CVcxx . . $ `external/glpk/glpk.h:54:9`!);
531 #endif
532 if (col->lbcxx . . $ NPPCOL#lb. == -DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`! && col->ubcxx . . $ NPPCOL#ub. == +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!)
533 type = GLP_FRcxx . . $ `external/glpk/glpk.h:59:9`!;
534 else if (col->ubcxx . . $ NPPCOL#ub. == +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!)
535 type = GLP_LOcxx . . $ `external/glpk/glpk.h:60:9`!;
536 else if (col->lbcxx . . $ NPPCOL#lb. == -DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!)
537 type = GLP_UPcxx . . $ `external/glpk/glpk.h:61:9`!;
538 else if (col->lbcxx . . $ NPPCOL#lb. != col->ubcxx . . $ NPPCOL#ub.)
539 type = GLP_DBcxx . . $ `external/glpk/glpk.h:62:9`!;
540 else
541 type = GLP_FXcxx . . $ `external/glpk/glpk.h:63:9`!;
542 glp_set_col_bndscxx . . $ glp_set_col_bnds(9376c6e48e598b7a).(prob, j, type, col->lbcxx . . $ NPPCOL#lb., col->ubcxx . . $ NPPCOL#ub.);
543 glp_set_obj_coefcxx . . $ glp_set_obj_coef(d60e14834b632e5e).(prob, j, dir * col->coefcxx . . $ NPPCOL#coef.);
544 len = 0;
545 for (aij = col->ptrcxx . . $ NPPCOL#ptr.; aij != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; aij = aij->c_nextcxx . . $ NPPAIJ#c_next.)
546 { len++;
547 ind[len] = aij->rowcxx . . $ NPPAIJ#row.->tempcxx . . $ NPPROW#temp.;
548 val[len] = aij->valcxx . . $ NPPAIJ#val.;
549 }
550 glp_set_mat_colcxx . . $ glp_set_mat_col(9cc64c3737aa01c2).(prob, j, len, ind, val);
551 }
552 xfreecxx . . $ `external/glpk/glpenv.h:175:9`!(ind);
553 xfreecxx . . $ `external/glpk/glpenv.h:175:9`!(val);
554 /* resultant problem has been built */
555 npp->mcxx . . $ NPP#m. = prob->mcxx . . $ glp_prob#m.;
556 npp->ncxx . . $ NPP#n. = prob->ncxx . . $ glp_prob#n.;
557 npp->nnzcxx . . $ NPP#nnz. = prob->nnzcxx . . $ glp_prob#nnz.;
558 npp->row_refcxx . . $ NPP#row_ref. = xcalloccxx . . $ `external/glpk/glpenv.h:171:9`!(1+npp->mcxx . . $ NPP#m., sizeof(int));
559 npp->col_refcxx . . $ NPP#col_ref. = xcalloccxx . . $ `external/glpk/glpenv.h:171:9`!(1+npp->ncxx . . $ NPP#n., sizeof(int));
560 for (row = npp->r_headcxx . . $ NPP#r_head., i = 0; row != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; row = row->nextcxx . . $ NPPROW#next.)
561 npp->row_refcxx . . $ NPP#row_ref.[++i] = row->icxx . . $ NPPROW#i.;
562 for (col = npp->c_headcxx . . $ NPP#c_head., j = 0; col != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; col = col->nextcxx . . $ NPPCOL#next.)
563 npp->col_refcxx . . $ NPP#col_ref.[++j] = col->jcxx . . $ NPPCOL#j.;
564 /* transformed problem segment is no longer needed */
565 dmp_delete_poolcxx . . $ `external/glpk/glpdmp.h:74:9`!(npp->poolcxx . . $ NPP#pool.), npp->poolcxx . . $ NPP#pool. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
566 npp->namecxx . . $ NPP#name. = npp->objcxx . . $ NPP#obj. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
567 npp->c0cxx . . $ NPP#c0. = 0.0;
568 npp->r_headcxx . . $ NPP#r_head. = npp->r_tailcxx . . $ NPP#r_tail. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
569 npp->c_headcxx . . $ NPP#c_head. = npp->c_tailcxx . . $ NPP#c_tail. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
570 return;
571 }
572
573 void npp_postprocesscxx . . $ `external/glpk/glpnpp.h:347:9`!(NPPcxx . . $ NPP# *npp, glp_probcxx . . $ glp_prob# *prob)
574 { /* postprocess solution from the resultant problem */
575 GLPROWcxx . . $ GLPROW# *row;
576 GLPCOLcxx . . $ GLPCOL# *col;
577 NPPTSEcxx . . $ NPPTSE# *tse;
578 int i, j, k;
579 double dir;
580 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(npp->orig_dir == prob->dir);
581 if (npp->orig_dircxx . . $ NPP#orig_dir. == GLP_MINcxx . . $ `external/glpk/glpk.h:50:9`!)
582 dir = +1.0;
583 else if (npp->orig_dircxx . . $ NPP#orig_dir. == GLP_MAXcxx . . $ `external/glpk/glpk.h:51:9`!)
584 dir = -1.0;
585 else
586 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(npp != npp);
587 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(npp->m == prob->m);
588 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(npp->n == prob->n);
589 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(npp->nnz == prob->nnz);
590 /* copy solution status */
591 if (npp->solcxx . . $ NPP#sol. == GLP_SOLcxx . . $ `external/glpk/glpk.h:80:9`!)
592 { npp->p_statcxx . . $ NPP#p_stat. = prob->pbs_statcxx . . $ glp_prob#pbs_stat.;
593 npp->d_statcxx . . $ NPP#d_stat. = prob->dbs_statcxx . . $ glp_prob#dbs_stat.;
594 }
595 else if (npp->solcxx . . $ NPP#sol. == GLP_IPTcxx . . $ `external/glpk/glpk.h:81:9`!)
596 npp->t_statcxx . . $ NPP#t_stat. = prob->ipt_statcxx . . $ glp_prob#ipt_stat.;
597 else if (npp->solcxx . . $ NPP#sol. == GLP_MIPcxx . . $ `external/glpk/glpk.h:82:9`!)
598 npp->i_statcxx . . $ NPP#i_stat. = prob->mip_statcxx . . $ glp_prob#mip_stat.;
599 else
600 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(npp != npp);
601 /* allocate solution arrays */
602 if (npp->solcxx . . $ NPP#sol. == GLP_SOLcxx . . $ `external/glpk/glpk.h:80:9`!)
603 { if (npp->r_statcxx . . $ NPP#r_stat. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
604 npp->r_statcxx . . $ NPP#r_stat. = xcalloccxx . . $ `external/glpk/glpenv.h:171:9`!(1+npp->nrowscxx . . $ NPP#nrows., sizeof(char));
605 for (i = 1; i <= npp->nrowscxx . . $ NPP#nrows.; i++)
606 npp->r_statcxx . . $ NPP#r_stat.[i] = 0;
607 if (npp->c_statcxx . . $ NPP#c_stat. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
608 npp->c_statcxx . . $ NPP#c_stat. = xcalloccxx . . $ `external/glpk/glpenv.h:171:9`!(1+npp->ncolscxx . . $ NPP#ncols., sizeof(char));
609 for (j = 1; j <= npp->ncolscxx . . $ NPP#ncols.; j++)
610 npp->c_statcxx . . $ NPP#c_stat.[j] = 0;
611 }
612 #if 0
613 if (npp->r_prim == NULL)
614 npp->r_prim = xcalloc(1+npp->nrows, sizeof(double));
615 for (i = 1; i <= npp->nrows; i++)
616 npp->r_prim[i] = DBL_MAX;
617 #endif
618 if (npp->c_valuecxx . . $ NPP#c_value. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
619 npp->c_valuecxx . . $ NPP#c_value. = xcalloccxx . . $ `external/glpk/glpenv.h:171:9`!(1+npp->ncolscxx . . $ NPP#ncols., sizeof(double));
620 for (j = 1; j <= npp->ncolscxx . . $ NPP#ncols.; j++)
621 npp->c_valuecxx . . $ NPP#c_value.[j] = DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!;
622 if (npp->solcxx . . $ NPP#sol. != GLP_MIPcxx . . $ `external/glpk/glpk.h:82:9`!)
623 { if (npp->r_picxx . . $ NPP#r_pi. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
624 npp->r_picxx . . $ NPP#r_pi. = xcalloccxx . . $ `external/glpk/glpenv.h:171:9`!(1+npp->nrowscxx . . $ NPP#nrows., sizeof(double));
625 for (i = 1; i <= npp->nrowscxx . . $ NPP#nrows.; i++)
626 npp->r_picxx . . $ NPP#r_pi.[i] = DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!;
627 #if 0
628 if (npp->c_dual == NULL)
629 npp->c_dual = xcalloc(1+npp->ncols, sizeof(double));
630 for (j = 1; j <= npp->ncols; j++)
631 npp->c_dual[j] = DBL_MAX;
632 #endif
633 }
634 /* copy solution components from the resultant problem */
635 if (npp->solcxx . . $ NPP#sol. == GLP_SOLcxx . . $ `external/glpk/glpk.h:80:9`!)
636 { for (i = 1; i <= npp->mcxx . . $ NPP#m.; i++)
637 { row = prob->rowcxx . . $ glp_prob#row.[i];
638 k = npp->row_refcxx . . $ NPP#row_ref.[i];
639 npp->r_statcxx . . $ NPP#r_stat.[k] = (char)row->statcxx . . $ GLPROW#stat.;
640 /*npp->r_prim[k] = row->prim;*/
641 npp->r_picxx . . $ NPP#r_pi.[k] = dir * row->dualcxx . . $ GLPROW#dual.;
642 }
643 for (j = 1; j <= npp->ncxx . . $ NPP#n.; j++)
644 { col = prob->colcxx . . $ glp_prob#col.[j];
645 k = npp->col_refcxx . . $ NPP#col_ref.[j];
646 npp->c_statcxx . . $ NPP#c_stat.[k] = (char)col->statcxx . . $ GLPCOL#stat.;
647 npp->c_valuecxx . . $ NPP#c_value.[k] = col->primcxx . . $ GLPCOL#prim.;
648 /*npp->c_dual[k] = dir * col->dual;*/
649 }
650 }
651 else if (npp->solcxx . . $ NPP#sol. == GLP_IPTcxx . . $ `external/glpk/glpk.h:81:9`!)
652 { for (i = 1; i <= npp->mcxx . . $ NPP#m.; i++)
653 { row = prob->rowcxx . . $ glp_prob#row.[i];
654 k = npp->row_refcxx . . $ NPP#row_ref.[i];
655 /*npp->r_prim[k] = row->pval;*/
656 npp->r_picxx . . $ NPP#r_pi.[k] = dir * row->dvalcxx . . $ GLPROW#dval.;
657 }
658 for (j = 1; j <= npp->ncxx . . $ NPP#n.; j++)
659 { col = prob->colcxx . . $ glp_prob#col.[j];
660 k = npp->col_refcxx . . $ NPP#col_ref.[j];
661 npp->c_valuecxx . . $ NPP#c_value.[k] = col->pvalcxx . . $ GLPCOL#pval.;
662 /*npp->c_dual[k] = dir * col->dval;*/
663 }
664 }
665 else if (npp->solcxx . . $ NPP#sol. == GLP_MIPcxx . . $ `external/glpk/glpk.h:82:9`!)
666 {
667 #if 0
668 for (i = 1; i <= npp->m; i++)
669 { row = prob->row[i];
670 k = npp->row_ref[i];
671 /*npp->r_prim[k] = row->mipx;*/
672 }
673 #endif
674 for (j = 1; j <= npp->ncxx . . $ NPP#n.; j++)
675 { col = prob->colcxx . . $ glp_prob#col.[j];
676 k = npp->col_refcxx . . $ NPP#col_ref.[j];
677 npp->c_valuecxx . . $ NPP#c_value.[k] = col->mipxcxx . . $ GLPCOL#mipx.;
678 }
679 }
680 else
681 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(npp != npp);
682 /* perform postprocessing to construct solution to the original
683 problem */
684 for (tse = npp->topcxx . . $ NPP#top.; tse != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; tse = tse->linkcxx . . $ NPPTSE#link.)
685 { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(tse->func != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
686 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(tse->func(npp, tse->info) == 0);
687 }
688 return;
689 }
690
691 void npp_unload_solcxx . . $ `external/glpk/glpnpp.h:351:9`!(NPPcxx . . $ NPP# *npp, glp_probcxx . . $ glp_prob# *orig)
692 { /* store solution to the original problem */
693 GLPROWcxx . . $ GLPROW# *row;
694 GLPCOLcxx . . $ GLPCOL# *col;
695 int i, j;
696 double dir;
697 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(npp->orig_dir == orig->dir);
698 if (npp->orig_dircxx . . $ NPP#orig_dir. == GLP_MINcxx . . $ `external/glpk/glpk.h:50:9`!)
699 dir = +1.0;
700 else if (npp->orig_dircxx . . $ NPP#orig_dir. == GLP_MAXcxx . . $ `external/glpk/glpk.h:51:9`!)
701 dir = -1.0;
702 else
703 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(npp != npp);
704 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(npp->orig_m == orig->m);
705 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(npp->orig_n == orig->n);
706 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(npp->orig_nnz == orig->nnz);
707 if (npp->solcxx . . $ NPP#sol. == GLP_SOLcxx . . $ `external/glpk/glpk.h:80:9`!)
708 { /* store basic solution */
709 orig->validcxx . . $ glp_prob#valid. = 0;
710 orig->pbs_statcxx . . $ glp_prob#pbs_stat. = npp->p_statcxx . . $ NPP#p_stat.;
711 orig->dbs_statcxx . . $ glp_prob#dbs_stat. = npp->d_statcxx . . $ NPP#d_stat.;
712 orig->obj_valcxx . . $ glp_prob#obj_val. = orig->c0cxx . . $ glp_prob#c0.;
713 orig->somecxx . . $ glp_prob#some. = 0;
714 for (i = 1; i <= orig->mcxx . . $ glp_prob#m.; i++)
715 { row = orig->rowcxx . . $ glp_prob#row.[i];
716 row->statcxx . . $ GLPROW#stat. = npp->r_statcxx . . $ NPP#r_stat.[i];
717 if (!npp->scalingcxx . . $ NPP#scaling.)
718 { /*row->prim = npp->r_prim[i];*/
719 row->dualcxx . . $ GLPROW#dual. = dir * npp->r_picxx . . $ NPP#r_pi.[i];
720 }
721 else
722 { /*row->prim = npp->r_prim[i] / row->rii;*/
723 row->dualcxx . . $ GLPROW#dual. = dir * npp->r_picxx . . $ NPP#r_pi.[i] * row->riicxx . . $ GLPROW#rii.;
724 }
725 if (row->statcxx . . $ GLPROW#stat. == GLP_BScxx . . $ `external/glpk/glpk.h:66:9`!)
726 row->dualcxx . . $ GLPROW#dual. = 0.0;
727 else if (row->statcxx . . $ GLPROW#stat. == GLP_NLcxx . . $ `external/glpk/glpk.h:67:9`!)
728 { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(row->type == GLP_LOcxx . . $ `external/glpk/glpk.h:60:9`! || row->type == GLP_DBcxx . . $ `external/glpk/glpk.h:62:9`!);
729 row->primcxx . . $ GLPROW#prim. = row->lbcxx . . $ GLPROW#lb.;
730 }
731 else if (row->statcxx . . $ GLPROW#stat. == GLP_NUcxx . . $ `external/glpk/glpk.h:68:9`!)
732 { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(row->type == GLP_UPcxx . . $ `external/glpk/glpk.h:61:9`! || row->type == GLP_DBcxx . . $ `external/glpk/glpk.h:62:9`!);
733 row->primcxx . . $ GLPROW#prim. = row->ubcxx . . $ GLPROW#ub.;
734 }
735 else if (row->statcxx . . $ GLPROW#stat. == GLP_NFcxx . . $ `external/glpk/glpk.h:69:9`!)
736 { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(row->type == GLP_FRcxx . . $ `external/glpk/glpk.h:59:9`!);
737 row->primcxx . . $ GLPROW#prim. = 0.0;
738 }
739 else if (row->statcxx . . $ GLPROW#stat. == GLP_NScxx . . $ `external/glpk/glpk.h:70:9`!)
740 { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(row->type == GLP_FXcxx . . $ `external/glpk/glpk.h:63:9`!);
741 row->primcxx . . $ GLPROW#prim. = row->lbcxx . . $ GLPROW#lb.;
742 }
743 else
744 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(row != row);
745 }
746 for (j = 1; j <= orig->ncxx . . $ glp_prob#n.; j++)
747 { col = orig->colcxx . . $ glp_prob#col.[j];
748 col->statcxx . . $ GLPCOL#stat. = npp->c_statcxx . . $ NPP#c_stat.[j];
749 if (!npp->scalingcxx . . $ NPP#scaling.)
750 { col->primcxx . . $ GLPCOL#prim. = npp->c_valuecxx . . $ NPP#c_value.[j];
751 /*col->dual = dir * npp->c_dual[j];*/
752 }
753 else
754 { col->primcxx . . $ GLPCOL#prim. = npp->c_valuecxx . . $ NPP#c_value.[j] * col->sjjcxx . . $ GLPCOL#sjj.;
755 /*col->dual = dir * npp->c_dual[j] / col->sjj;*/
756 }
757 if (col->statcxx . . $ GLPCOL#stat. == GLP_BScxx . . $ `external/glpk/glpk.h:66:9`!)
758 col->dualcxx . . $ GLPCOL#dual. = 0.0;
759 #if 1
760 else if (col->statcxx . . $ GLPCOL#stat. == GLP_NLcxx . . $ `external/glpk/glpk.h:67:9`!)
761 { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(col->type == GLP_LOcxx . . $ `external/glpk/glpk.h:60:9`! || col->type == GLP_DBcxx . . $ `external/glpk/glpk.h:62:9`!);
762 col->primcxx . . $ GLPCOL#prim. = col->lbcxx . . $ GLPCOL#lb.;
763 }
764 else if (col->statcxx . . $ GLPCOL#stat. == GLP_NUcxx . . $ `external/glpk/glpk.h:68:9`!)
765 { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(col->type == GLP_UPcxx . . $ `external/glpk/glpk.h:61:9`! || col->type == GLP_DBcxx . . $ `external/glpk/glpk.h:62:9`!);
766 col->primcxx . . $ GLPCOL#prim. = col->ubcxx . . $ GLPCOL#ub.;
767 }
768 else if (col->statcxx . . $ GLPCOL#stat. == GLP_NFcxx . . $ `external/glpk/glpk.h:69:9`!)
769 { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(col->type == GLP_FRcxx . . $ `external/glpk/glpk.h:59:9`!);
770 col->primcxx . . $ GLPCOL#prim. = 0.0;
771 }
772 else if (col->statcxx . . $ GLPCOL#stat. == GLP_NScxx . . $ `external/glpk/glpk.h:70:9`!)
773 { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(col->type == GLP_FXcxx . . $ `external/glpk/glpk.h:63:9`!);
774 col->primcxx . . $ GLPCOL#prim. = col->lbcxx . . $ GLPCOL#lb.;
775 }
776 else
777 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(col != col);
778 #endif
779 orig->obj_valcxx . . $ glp_prob#obj_val. += col->coefcxx . . $ GLPCOL#coef. * col->primcxx . . $ GLPCOL#prim.;
780 }
781 #if 1
782 /* compute primal values of inactive rows */
783 for (i = 1; i <= orig->mcxx . . $ glp_prob#m.; i++)
784 { row = orig->rowcxx . . $ glp_prob#row.[i];
785 if (row->statcxx . . $ GLPROW#stat. == GLP_BScxx . . $ `external/glpk/glpk.h:66:9`!)
786 { GLPAIJcxx . . $ GLPAIJ# *aij;
787 double temp;
788 temp = 0.0;
789 for (aij = row->ptrcxx . . $ GLPROW#ptr.; aij != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; aij = aij->r_nextcxx . . $ GLPAIJ#r_next.)
790 temp += aij->valcxx . . $ GLPAIJ#val. * aij->colcxx . . $ GLPAIJ#col.->primcxx . . $ GLPCOL#prim.;
791 row->primcxx . . $ GLPROW#prim. = temp;
792 }
793 }
794 /* compute reduced costs of active columns */
795 for (j = 1; j <= orig->ncxx . . $ glp_prob#n.; j++)
796 { col = orig->colcxx . . $ glp_prob#col.[j];
797 if (col->statcxx . . $ GLPCOL#stat. != GLP_BScxx . . $ `external/glpk/glpk.h:66:9`!)
798 { GLPAIJcxx . . $ GLPAIJ# *aij;
799 double temp;
800 temp = col->coefcxx . . $ GLPCOL#coef.;
801 for (aij = col->ptrcxx . . $ GLPCOL#ptr.; aij != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; aij = aij->c_nextcxx . . $ GLPAIJ#c_next.)
802 temp -= aij->valcxx . . $ GLPAIJ#val. * aij->rowcxx . . $ GLPAIJ#row.->dualcxx . . $ GLPROW#dual.;
803 col->dualcxx . . $ GLPCOL#dual. = temp;
804 }
805 }
806 #endif
807 }
808 else if (npp->solcxx . . $ NPP#sol. == GLP_IPTcxx . . $ `external/glpk/glpk.h:81:9`!)
809 { /* store interior-point solution */
810 orig->ipt_statcxx . . $ glp_prob#ipt_stat. = npp->t_statcxx . . $ NPP#t_stat.;
811 orig->ipt_objcxx . . $ glp_prob#ipt_obj. = orig->c0cxx . . $ glp_prob#c0.;
812 for (i = 1; i <= orig->mcxx . . $ glp_prob#m.; i++)
813 { row = orig->rowcxx . . $ glp_prob#row.[i];
814 if (!npp->scalingcxx . . $ NPP#scaling.)
815 { /*row->pval = npp->r_prim[i];*/
816 row->dvalcxx . . $ GLPROW#dval. = dir * npp->r_picxx . . $ NPP#r_pi.[i];
817 }
818 else
819 { /*row->pval = npp->r_prim[i] / row->rii;*/
820 row->dvalcxx . . $ GLPROW#dval. = dir * npp->r_picxx . . $ NPP#r_pi.[i] * row->riicxx . . $ GLPROW#rii.;
821 }
822 }
823 for (j = 1; j <= orig->ncxx . . $ glp_prob#n.; j++)
824 { col = orig->colcxx . . $ glp_prob#col.[j];
825 if (!npp->scalingcxx . . $ NPP#scaling.)
826 { col->pvalcxx . . $ GLPCOL#pval. = npp->c_valuecxx . . $ NPP#c_value.[j];
827 /*col->dval = dir * npp->c_dual[j];*/
828 }
829 else
830 { col->pvalcxx . . $ GLPCOL#pval. = npp->c_valuecxx . . $ NPP#c_value.[j] * col->sjjcxx . . $ GLPCOL#sjj.;
831 /*col->dval = dir * npp->c_dual[j] / col->sjj;*/
832 }
833 orig->ipt_objcxx . . $ glp_prob#ipt_obj. += col->coefcxx . . $ GLPCOL#coef. * col->pvalcxx . . $ GLPCOL#pval.;
834 }
835 #if 1
836 /* compute row primal values */
837 for (i = 1; i <= orig->mcxx . . $ glp_prob#m.; i++)
838 { row = orig->rowcxx . . $ glp_prob#row.[i];
839 { GLPAIJcxx . . $ GLPAIJ# *aij;
840 double temp;
841 temp = 0.0;
842 for (aij = row->ptrcxx . . $ GLPROW#ptr.; aij != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; aij = aij->r_nextcxx . . $ GLPAIJ#r_next.)
843 temp += aij->valcxx . . $ GLPAIJ#val. * aij->colcxx . . $ GLPAIJ#col.->pvalcxx . . $ GLPCOL#pval.;
844 row->pvalcxx . . $ GLPROW#pval. = temp;
845 }
846 }
847 /* compute column dual values */
848 for (j = 1; j <= orig->ncxx . . $ glp_prob#n.; j++)
849 { col = orig->colcxx . . $ glp_prob#col.[j];
850 { GLPAIJcxx . . $ GLPAIJ# *aij;
851 double temp;
852 temp = col->coefcxx . . $ GLPCOL#coef.;
853 for (aij = col->ptrcxx . . $ GLPCOL#ptr.; aij != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; aij = aij->c_nextcxx . . $ GLPAIJ#c_next.)
854 temp -= aij->valcxx . . $ GLPAIJ#val. * aij->rowcxx . . $ GLPAIJ#row.->dvalcxx . . $ GLPROW#dval.;
855 col->dvalcxx . . $ GLPCOL#dval. = temp;
856 }
857 }
858 #endif
859 }
860 else if (npp->solcxx . . $ NPP#sol. == GLP_MIPcxx . . $ `external/glpk/glpk.h:82:9`!)
861 { /* store MIP solution */
862 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(!npp->scaling);
863 orig->mip_statcxx . . $ glp_prob#mip_stat. = npp->i_statcxx . . $ NPP#i_stat.;
864 orig->mip_objcxx . . $ glp_prob#mip_obj. = orig->c0cxx . . $ glp_prob#c0.;
865 #if 0
866 for (i = 1; i <= orig->m; i++)
867 { row = orig->row[i];
868 /*row->mipx = npp->r_prim[i];*/
869 }
870 #endif
871 for (j = 1; j <= orig->ncxx . . $ glp_prob#n.; j++)
872 { col = orig->colcxx . . $ glp_prob#col.[j];
873 col->mipxcxx . . $ GLPCOL#mipx. = npp->c_valuecxx . . $ NPP#c_value.[j];
874 if (col->kindcxx . . $ GLPCOL#kind. == GLP_IVcxx . . $ `external/glpk/glpk.h:55:9`!)
875 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(col->mipx == floor(col->mipx));
876 orig->mip_objcxx . . $ glp_prob#mip_obj. += col->coefcxx . . $ GLPCOL#coef. * col->mipxcxx . . $ GLPCOL#mipx.;
877 }
878 #if 1
879 /* compute row primal values */
880 for (i = 1; i <= orig->mcxx . . $ glp_prob#m.; i++)
881 { row = orig->rowcxx . . $ glp_prob#row.[i];
882 { GLPAIJcxx . . $ GLPAIJ# *aij;
883 double temp;
884 temp = 0.0;
885 for (aij = row->ptrcxx . . $ GLPROW#ptr.; aij != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; aij = aij->r_nextcxx . . $ GLPAIJ#r_next.)
886 temp += aij->valcxx . . $ GLPAIJ#val. * aij->colcxx . . $ GLPAIJ#col.->mipxcxx . . $ GLPCOL#mipx.;
887 row->mipxcxx . . $ GLPROW#mipx. = temp;
888 }
889 }
890 #endif
891 }
892 else
893 xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(npp != npp);
894 return;
895 }
896
897 void npp_delete_wkspcxx . . $ `external/glpk/glpnpp.h:355:9`!(NPPcxx . . $ NPP# *npp)
898 { /* delete LP/MIP preprocessor workspace */
899 if (npp->poolcxx . . $ NPP#pool. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
900 dmp_delete_poolcxx . . $ `external/glpk/glpdmp.h:74:9`!(npp->poolcxx . . $ NPP#pool.);
901 if (npp->stackcxx . . $ NPP#stack. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
902 dmp_delete_poolcxx . . $ `external/glpk/glpdmp.h:74:9`!(npp->stackcxx . . $ NPP#stack.);
903 if (npp->row_refcxx . . $ NPP#row_ref. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
904 xfreecxx . . $ `external/glpk/glpenv.h:175:9`!(npp->row_refcxx . . $ NPP#row_ref.);
905 if (npp->col_refcxx . . $ NPP#col_ref. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
906 xfreecxx . . $ `external/glpk/glpenv.h:175:9`!(npp->col_refcxx . . $ NPP#col_ref.);
907 if (npp->r_statcxx . . $ NPP#r_stat. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
908 xfreecxx . . $ `external/glpk/glpenv.h:175:9`!(npp->r_statcxx . . $ NPP#r_stat.);
909 #if 0
910 if (npp->r_prim != NULL)
911 xfree(npp->r_prim);
912 #endif
913 if (npp->r_picxx . . $ NPP#r_pi. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
914 xfreecxx . . $ `external/glpk/glpenv.h:175:9`!(npp->r_picxx . . $ NPP#r_pi.);
915 if (npp->c_statcxx . . $ NPP#c_stat. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
916 xfreecxx . . $ `external/glpk/glpenv.h:175:9`!(npp->c_statcxx . . $ NPP#c_stat.);
917 if (npp->c_valuecxx . . $ NPP#c_value. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
918 xfreecxx . . $ `external/glpk/glpenv.h:175:9`!(npp->c_valuecxx . . $ NPP#c_value.);
919 #if 0
920 if (npp->c_dual != NULL)
921 xfree(npp->c_dual);
922 #endif
923 xfreecxx . . $ `external/glpk/glpenv.h:175:9`!(npp);
924 return;
925 }
926
927 /* eof */