| 1 | /* glpmpl03.c */cxx . . $ `<file>/external/glpk/glpmpl03.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 | #define _GLPSTD_ERRNOcxx . . $ `external/glpk/glpmpl03.c:25:9`! |
| 26 | #define _GLPSTD_STDIOcxx . . $ `external/glpk/glpmpl03.c:26:9`! |
| 27 | #include "glpenv.h"cxx . . $ `<file>/external/glpk/glpenv.h`/ |
| 28 | #include "glpmpl.h"cxx . . $ `<file>/external/glpk/glpmpl.h`/ |
| 29 | |
| 30 | /**********************************************************************/ |
| 31 | /* * * FLOATING-POINT NUMBERS * * */ |
| 32 | /**********************************************************************/ |
| 33 | |
| 34 | /*---------------------------------------------------------------------- |
| 35 | -- fp_add - floating-point addition. |
| 36 | -- |
| 37 | -- This routine computes the sum x + y. */ |
| 38 | |
| 39 | double fp_addcxx . . $ `external/glpk/glpmpl.h:773:9`!(MPLcxx . . $ MPL# *mpl, double x, double y) |
| 40 | { if (x > 0.0 && y > 0.0 && x > + 0.999 * DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`! - y || |
| 41 | x < 0.0 && y < 0.0 && x < - 0.999 * DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`! - y) |
| 42 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%.*g + %.*g; floating-point overflow", |
| 43 | DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, x, DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, y); |
| 44 | return x + y; |
| 45 | } |
| 46 | |
| 47 | /*---------------------------------------------------------------------- |
| 48 | -- fp_sub - floating-point subtraction. |
| 49 | -- |
| 50 | -- This routine computes the difference x - y. */ |
| 51 | |
| 52 | double fp_subcxx . . $ `external/glpk/glpmpl.h:777:9`!(MPLcxx . . $ MPL# *mpl, double x, double y) |
| 53 | { if (x > 0.0 && y < 0.0 && x > + 0.999 * DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`! + y || |
| 54 | x < 0.0 && y > 0.0 && x < - 0.999 * DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`! + y) |
| 55 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%.*g - %.*g; floating-point overflow", |
| 56 | DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, x, DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, y); |
| 57 | return x - y; |
| 58 | } |
| 59 | |
| 60 | /*---------------------------------------------------------------------- |
| 61 | -- fp_less - floating-point non-negative subtraction. |
| 62 | -- |
| 63 | -- This routine computes the non-negative difference max(0, x - y). */ |
| 64 | |
| 65 | double fp_lesscxx . . $ `external/glpk/glpmpl.h:781:9`!(MPLcxx . . $ MPL# *mpl, double x, double y) |
| 66 | { if (x < y) return 0.0; |
| 67 | if (x > 0.0 && y < 0.0 && x > + 0.999 * DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`! + y) |
| 68 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%.*g less %.*g; floating-point overflow", |
| 69 | DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, x, DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, y); |
| 70 | return x - y; |
| 71 | } |
| 72 | |
| 73 | /*---------------------------------------------------------------------- |
| 74 | -- fp_mul - floating-point multiplication. |
| 75 | -- |
| 76 | -- This routine computes the product x * y. */ |
| 77 | |
| 78 | double fp_mulcxx . . $ `external/glpk/glpmpl.h:785:9`!(MPLcxx . . $ MPL# *mpl, double x, double y) |
| 79 | { if (fabscxx . . $ fabs(447c67c6676f75c3).(y) > 1.0 && fabscxx . . $ fabs(447c67c6676f75c3).(x) > (0.999 * DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!) / fabscxx . . $ fabs(447c67c6676f75c3).(y)) |
| 80 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%.*g * %.*g; floating-point overflow", |
| 81 | DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, x, DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, y); |
| 82 | return x * y; |
| 83 | } |
| 84 | |
| 85 | /*---------------------------------------------------------------------- |
| 86 | -- fp_div - floating-point division. |
| 87 | -- |
| 88 | -- This routine computes the quotient x / y. */ |
| 89 | |
| 90 | double fp_divcxx . . $ `external/glpk/glpmpl.h:789:9`!(MPLcxx . . $ MPL# *mpl, double x, double y) |
| 91 | { if (fabscxx . . $ fabs(447c67c6676f75c3).(y) < DBL_MINcxx . . $ `<external>/18143172452841944454/float.h:122:9`!) |
| 92 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%.*g / %.*g; floating-point zero divide", |
| 93 | DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, x, DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, y); |
| 94 | if (fabscxx . . $ fabs(447c67c6676f75c3).(y) < 1.0 && fabscxx . . $ fabs(447c67c6676f75c3).(x) > (0.999 * DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!) * fabscxx . . $ fabs(447c67c6676f75c3).(y)) |
| 95 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%.*g / %.*g; floating-point overflow", |
| 96 | DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, x, DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, y); |
| 97 | return x / y; |
| 98 | } |
| 99 | |
| 100 | /*---------------------------------------------------------------------- |
| 101 | -- fp_idiv - floating-point quotient of exact division. |
| 102 | -- |
| 103 | -- This routine computes the quotient of exact division x div y. */ |
| 104 | |
| 105 | double fp_idivcxx . . $ `external/glpk/glpmpl.h:793:9`!(MPLcxx . . $ MPL# *mpl, double x, double y) |
| 106 | { if (fabscxx . . $ fabs(447c67c6676f75c3).(y) < DBL_MINcxx . . $ `<external>/18143172452841944454/float.h:122:9`!) |
| 107 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%.*g div %.*g; floating-point zero divide", |
| 108 | DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, x, DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, y); |
| 109 | if (fabscxx . . $ fabs(447c67c6676f75c3).(y) < 1.0 && fabscxx . . $ fabs(447c67c6676f75c3).(x) > (0.999 * DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!) * fabscxx . . $ fabs(447c67c6676f75c3).(y)) |
| 110 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%.*g div %.*g; floating-point overflow", |
| 111 | DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, x, DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, y); |
| 112 | x /= y; |
| 113 | return x > 0.0 ? floorcxx . . $ floor(447c67c6676f75c3).(x) : x < 0.0 ? ceilcxx . . $ ceil(447c67c6676f75c3).(x) : 0.0; |
| 114 | } |
| 115 | |
| 116 | /*---------------------------------------------------------------------- |
| 117 | -- fp_mod - floating-point remainder of exact division. |
| 118 | -- |
| 119 | -- This routine computes the remainder of exact division x mod y. |
| 120 | -- |
| 121 | -- NOTE: By definition x mod y = x - y * floor(x / y). */ |
| 122 | |
| 123 | double fp_modcxx . . $ `external/glpk/glpmpl.h:797:9`!(MPLcxx . . $ MPL# *mpl, double x, double y) |
| 124 | { double r; |
| 125 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(mpl == mpl); |
| 126 | if (x == 0.0) |
| 127 | r = 0.0; |
| 128 | else if (y == 0.0) |
| 129 | r = x; |
| 130 | else |
| 131 | { r = fmodcxx . . $ fmod(d8e7e0733fa41c87).(fabscxx . . $ fabs(447c67c6676f75c3).(x), fabscxx . . $ fabs(447c67c6676f75c3).(y)); |
| 132 | if (r != 0.0) |
| 133 | { if (x < 0.0) r = - r; |
| 134 | if (x > 0.0 && y < 0.0 || x < 0.0 && y > 0.0) r += y; |
| 135 | } |
| 136 | } |
| 137 | return r; |
| 138 | } |
| 139 | |
| 140 | /*---------------------------------------------------------------------- |
| 141 | -- fp_power - floating-point exponentiation (raise to power). |
| 142 | -- |
| 143 | -- This routine computes the exponentiation x ** y. */ |
| 144 | |
| 145 | double fp_powercxx . . $ `external/glpk/glpmpl.h:801:9`!(MPLcxx . . $ MPL# *mpl, double x, double y) |
| 146 | { double r; |
| 147 | if (x == 0.0 && y <= 0.0 || x < 0.0 && y != floorcxx . . $ floor(447c67c6676f75c3).(y)) |
| 148 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%.*g ** %.*g; result undefined", |
| 149 | DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, x, DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, y); |
| 150 | if (x == 0.0) goto eval; |
| 151 | if (fabscxx . . $ fabs(447c67c6676f75c3).(x) > 1.0 && y > +1.0 && |
| 152 | +logcxx . . $ log(447c67c6676f75c3).(fabscxx . . $ fabs(447c67c6676f75c3).(x)) > (0.999 * logcxx . . $ log(447c67c6676f75c3).(DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!)) / y || |
| 153 | fabscxx . . $ fabs(447c67c6676f75c3).(x) < 1.0 && y < -1.0 && |
| 154 | +logcxx . . $ log(447c67c6676f75c3).(fabscxx . . $ fabs(447c67c6676f75c3).(x)) < (0.999 * logcxx . . $ log(447c67c6676f75c3).(DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!)) / y) |
| 155 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%.*g ** %.*g; floating-point overflow", |
| 156 | DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, x, DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, y); |
| 157 | if (fabscxx . . $ fabs(447c67c6676f75c3).(x) > 1.0 && y < -1.0 && |
| 158 | -logcxx . . $ log(447c67c6676f75c3).(fabscxx . . $ fabs(447c67c6676f75c3).(x)) < (0.999 * logcxx . . $ log(447c67c6676f75c3).(DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!)) / y || |
| 159 | fabscxx . . $ fabs(447c67c6676f75c3).(x) < 1.0 && y > +1.0 && |
| 160 | -logcxx . . $ log(447c67c6676f75c3).(fabscxx . . $ fabs(447c67c6676f75c3).(x)) > (0.999 * logcxx . . $ log(447c67c6676f75c3).(DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!)) / y) |
| 161 | r = 0.0; |
| 162 | else |
| 163 | eval: r = powcxx . . $ pow(d8e7e0733fa41c87).(x, y); |
| 164 | return r; |
| 165 | } |
| 166 | |
| 167 | /*---------------------------------------------------------------------- |
| 168 | -- fp_exp - floating-point base-e exponential. |
| 169 | -- |
| 170 | -- This routine computes the base-e exponential e ** x. */ |
| 171 | |
| 172 | double fp_expcxx . . $ `external/glpk/glpmpl.h:805:9`!(MPLcxx . . $ MPL# *mpl, double x) |
| 173 | { if (x > 0.999 * logcxx . . $ log(447c67c6676f75c3).(DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!)) |
| 174 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "exp(%.*g); floating-point overflow", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, x); |
| 175 | return expcxx . . $ exp(447c67c6676f75c3).(x); |
| 176 | } |
| 177 | |
| 178 | /*---------------------------------------------------------------------- |
| 179 | -- fp_log - floating-point natural logarithm. |
| 180 | -- |
| 181 | -- This routine computes the natural logarithm log x. */ |
| 182 | |
| 183 | double fp_logcxx . . $ `external/glpk/glpmpl.h:809:9`!(MPLcxx . . $ MPL# *mpl, double x) |
| 184 | { if (x <= 0.0) |
| 185 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "log(%.*g); non-positive argument", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, x); |
| 186 | return logcxx . . $ log(447c67c6676f75c3).(x); |
| 187 | } |
| 188 | |
| 189 | /*---------------------------------------------------------------------- |
| 190 | -- fp_log10 - floating-point common (decimal) logarithm. |
| 191 | -- |
| 192 | -- This routine computes the common (decimal) logarithm lg x. */ |
| 193 | |
| 194 | double fp_log10cxx . . $ `external/glpk/glpmpl.h:813:9`!(MPLcxx . . $ MPL# *mpl, double x) |
| 195 | { if (x <= 0.0) |
| 196 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "log10(%.*g); non-positive argument", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, x); |
| 197 | return log10cxx . . $ log10(447c67c6676f75c3).(x); |
| 198 | } |
| 199 | |
| 200 | /*---------------------------------------------------------------------- |
| 201 | -- fp_sqrt - floating-point square root. |
| 202 | -- |
| 203 | -- This routine computes the square root x ** 0.5. */ |
| 204 | |
| 205 | double fp_sqrtcxx . . $ `external/glpk/glpmpl.h:817:9`!(MPLcxx . . $ MPL# *mpl, double x) |
| 206 | { if (x < 0.0) |
| 207 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "sqrt(%.*g); negative argument", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, x); |
| 208 | return sqrtcxx . . $ sqrt(447c67c6676f75c3).(x); |
| 209 | } |
| 210 | |
| 211 | /*---------------------------------------------------------------------- |
| 212 | -- fp_sin - floating-point trigonometric sine. |
| 213 | -- |
| 214 | -- This routine computes the trigonometric sine sin(x). */ |
| 215 | |
| 216 | double fp_sincxx . . $ `external/glpk/glpmpl.h:821:9`!(MPLcxx . . $ MPL# *mpl, double x) |
| 217 | { if (!(-1e6 <= x && x <= +1e6)) |
| 218 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "sin(%.*g); argument too large", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, x); |
| 219 | return sincxx . . $ sin(447c67c6676f75c3).(x); |
| 220 | } |
| 221 | |
| 222 | /*---------------------------------------------------------------------- |
| 223 | -- fp_cos - floating-point trigonometric cosine. |
| 224 | -- |
| 225 | -- This routine computes the trigonometric cosine cos(x). */ |
| 226 | |
| 227 | double fp_coscxx . . $ `external/glpk/glpmpl.h:825:9`!(MPLcxx . . $ MPL# *mpl, double x) |
| 228 | { if (!(-1e6 <= x && x <= +1e6)) |
| 229 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "cos(%.*g); argument too large", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, x); |
| 230 | return coscxx . . $ cos(447c67c6676f75c3).(x); |
| 231 | } |
| 232 | |
| 233 | /*---------------------------------------------------------------------- |
| 234 | -- fp_atan - floating-point trigonometric arctangent. |
| 235 | -- |
| 236 | -- This routine computes the trigonometric arctangent atan(x). */ |
| 237 | |
| 238 | double fp_atancxx . . $ `external/glpk/glpmpl.h:829:9`!(MPLcxx . . $ MPL# *mpl, double x) |
| 239 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(mpl == mpl); |
| 240 | return atancxx . . $ atan(447c67c6676f75c3).(x); |
| 241 | } |
| 242 | |
| 243 | /*---------------------------------------------------------------------- |
| 244 | -- fp_atan2 - floating-point trigonometric arctangent. |
| 245 | -- |
| 246 | -- This routine computes the trigonometric arctangent atan(y / x). */ |
| 247 | |
| 248 | double fp_atan2cxx . . $ `external/glpk/glpmpl.h:833:9`!(MPLcxx . . $ MPL# *mpl, double y, double x) |
| 249 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(mpl == mpl); |
| 250 | return atan2cxx . . $ atan2(d8e7e0733fa41c87).(y, x); |
| 251 | } |
| 252 | |
| 253 | /*---------------------------------------------------------------------- |
| 254 | -- fp_round - round floating-point value to n fractional digits. |
| 255 | -- |
| 256 | -- This routine rounds given floating-point value x to n fractional |
| 257 | -- digits with the formula: |
| 258 | -- |
| 259 | -- round(x, n) = floor(x * 10^n + 0.5) / 10^n. |
| 260 | -- |
| 261 | -- The parameter n is assumed to be integer. */ |
| 262 | |
| 263 | double fp_roundcxx . . $ `external/glpk/glpmpl.h:837:9`!(MPLcxx . . $ MPL# *mpl, double x, double n) |
| 264 | { double ten_to_n; |
| 265 | if (n != floorcxx . . $ floor(447c67c6676f75c3).(n)) |
| 266 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "round(%.*g, %.*g); non-integer second argument", |
| 267 | DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, x, DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, n); |
| 268 | if (n <= DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`! + 2) |
| 269 | { ten_to_n = powcxx . . $ pow(d8e7e0733fa41c87).(10.0, n); |
| 270 | if (fabscxx . . $ fabs(447c67c6676f75c3).(x) < (0.999 * DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!) / ten_to_n) |
| 271 | { x = floorcxx . . $ floor(447c67c6676f75c3).(x * ten_to_n + 0.5); |
| 272 | if (x != 0.0) x /= ten_to_n; |
| 273 | } |
| 274 | } |
| 275 | return x; |
| 276 | } |
| 277 | |
| 278 | /*---------------------------------------------------------------------- |
| 279 | -- fp_trunc - truncate floating-point value to n fractional digits. |
| 280 | -- |
| 281 | -- This routine truncates given floating-point value x to n fractional |
| 282 | -- digits with the formula: |
| 283 | -- |
| 284 | -- ( floor(x * 10^n) / 10^n, if x >= 0 |
| 285 | -- trunc(x, n) = < |
| 286 | -- ( ceil(x * 10^n) / 10^n, if x < 0 |
| 287 | -- |
| 288 | -- The parameter n is assumed to be integer. */ |
| 289 | |
| 290 | double fp_trunccxx . . $ `external/glpk/glpmpl.h:841:9`!(MPLcxx . . $ MPL# *mpl, double x, double n) |
| 291 | { double ten_to_n; |
| 292 | if (n != floorcxx . . $ floor(447c67c6676f75c3).(n)) |
| 293 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "trunc(%.*g, %.*g); non-integer second argument", |
| 294 | DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, x, DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, n); |
| 295 | if (n <= DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`! + 2) |
| 296 | { ten_to_n = powcxx . . $ pow(d8e7e0733fa41c87).(10.0, n); |
| 297 | if (fabscxx . . $ fabs(447c67c6676f75c3).(x) < (0.999 * DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!) / ten_to_n) |
| 298 | { x = (x >= 0.0 ? floorcxx . . $ floor(447c67c6676f75c3).(x * ten_to_n) : ceilcxx . . $ ceil(447c67c6676f75c3).(x * ten_to_n)); |
| 299 | if (x != 0.0) x /= ten_to_n; |
| 300 | } |
| 301 | } |
| 302 | return x; |
| 303 | } |
| 304 | |
| 305 | /**********************************************************************/ |
| 306 | /* * * PSEUDO-RANDOM NUMBER GENERATORS * * */ |
| 307 | /**********************************************************************/ |
| 308 | |
| 309 | /*---------------------------------------------------------------------- |
| 310 | -- fp_irand224 - pseudo-random integer in the range [0, 2^24). |
| 311 | -- |
| 312 | -- This routine returns a next pseudo-random integer (converted to |
| 313 | -- floating-point) which is uniformly distributed between 0 and 2^24-1, |
| 314 | -- inclusive. */ |
| 315 | |
| 316 | #define two_to_the_24cxx . . $ `external/glpk/glpmpl03.c:316:9`! 0x1000000 |
| 317 | |
| 318 | double fp_irand224cxx . . $ `external/glpk/glpmpl.h:849:9`!(MPLcxx . . $ MPL# *mpl) |
| 319 | { return |
| 320 | (double)rng_unif_randcxx . . $ `external/glpk/glprng.h:50:9`!(mpl->randcxx . . $ MPL#rand., two_to_the_24cxx . . $ `external/glpk/glpmpl03.c:316:9`!); |
| 321 | } |
| 322 | |
| 323 | /*---------------------------------------------------------------------- |
| 324 | -- fp_uniform01 - pseudo-random number in the range [0, 1). |
| 325 | -- |
| 326 | -- This routine returns a next pseudo-random number which is uniformly |
| 327 | -- distributed in the range [0, 1). */ |
| 328 | |
| 329 | #define two_to_the_31cxx . . $ `external/glpk/glpmpl03.c:329:9`! ((unsigned int)0x80000000) |
| 330 | |
| 331 | double fp_uniform01cxx . . $ `external/glpk/glpmpl.h:853:9`!(MPLcxx . . $ MPL# *mpl) |
| 332 | { return |
| 333 | (double)rng_next_randcxx . . $ `external/glpk/glprng.h:46:9`!(mpl->randcxx . . $ MPL#rand.) / (double)two_to_the_31cxx . . $ `external/glpk/glpmpl03.c:329:9`!; |
| 334 | } |
| 335 | |
| 336 | /*---------------------------------------------------------------------- |
| 337 | -- fp_uniform - pseudo-random number in the range [a, b). |
| 338 | -- |
| 339 | -- This routine returns a next pseudo-random number which is uniformly |
| 340 | -- distributed in the range [a, b). */ |
| 341 | |
| 342 | double fp_uniformcxx . . $ `external/glpk/glpmpl.h:857:9`!(MPLcxx . . $ MPL# *mpl, double a, double b) |
| 343 | { double x; |
| 344 | if (a >= b) |
| 345 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "Uniform(%.*g, %.*g); invalid range", |
| 346 | DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, a, DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, b); |
| 347 | x = fp_uniform01cxx . . $ `external/glpk/glpmpl.h:853:9`!(mpl); |
| 348 | #if 0 |
| 349 | x = a * (1.0 - x) + b * x; |
| 350 | #else |
| 351 | x = fp_addcxx . . $ `external/glpk/glpmpl.h:773:9`!(mpl, a * (1.0 - x), b * x); |
| 352 | #endif |
| 353 | return x; |
| 354 | } |
| 355 | |
| 356 | /*---------------------------------------------------------------------- |
| 357 | -- fp_normal01 - Gaussian random variate with mu = 0 and sigma = 1. |
| 358 | -- |
| 359 | -- This routine returns a Gaussian random variate with zero mean and |
| 360 | -- unit standard deviation. The polar (Box-Mueller) method is used. |
| 361 | -- |
| 362 | -- This code is a modified version of the routine gsl_ran_gaussian from |
| 363 | -- the GNU Scientific Library Version 1.0. */ |
| 364 | |
| 365 | double fp_normal01cxx . . $ `external/glpk/glpmpl.h:861:9`!(MPLcxx . . $ MPL# *mpl) |
| 366 | { double x, y, r2; |
| 367 | do |
| 368 | { /* choose x, y in uniform square (-1,-1) to (+1,+1) */ |
| 369 | x = -1.0 + 2.0 * fp_uniform01cxx . . $ `external/glpk/glpmpl.h:853:9`!(mpl); |
| 370 | y = -1.0 + 2.0 * fp_uniform01cxx . . $ `external/glpk/glpmpl.h:853:9`!(mpl); |
| 371 | /* see if it is in the unit circle */ |
| 372 | r2 = x * x + y * y; |
| 373 | } while (r2 > 1.0 || r2 == 0.0); |
| 374 | /* Box-Muller transform */ |
| 375 | return y * sqrtcxx . . $ sqrt(447c67c6676f75c3).(-2.0 * logcxx . . $ log(447c67c6676f75c3). (r2) / r2); |
| 376 | } |
| 377 | |
| 378 | /*---------------------------------------------------------------------- |
| 379 | -- fp_normal - Gaussian random variate with specified mu and sigma. |
| 380 | -- |
| 381 | -- This routine returns a Gaussian random variate with mean mu and |
| 382 | -- standard deviation sigma. */ |
| 383 | |
| 384 | double fp_normalcxx . . $ `external/glpk/glpmpl.h:865:9`!(MPLcxx . . $ MPL# *mpl, double mu, double sigma) |
| 385 | { double x; |
| 386 | #if 0 |
| 387 | x = mu + sigma * fp_normal01(mpl); |
| 388 | #else |
| 389 | x = fp_addcxx . . $ `external/glpk/glpmpl.h:773:9`!(mpl, mu, fp_mulcxx . . $ `external/glpk/glpmpl.h:785:9`!(mpl, sigma, fp_normal01cxx . . $ `external/glpk/glpmpl.h:861:9`!(mpl))); |
| 390 | #endif |
| 391 | return x; |
| 392 | } |
| 393 | |
| 394 | /**********************************************************************/ |
| 395 | /* * * SEGMENTED CHARACTER STRINGS * * */ |
| 396 | /**********************************************************************/ |
| 397 | |
| 398 | /*---------------------------------------------------------------------- |
| 399 | -- create_string - create character string. |
| 400 | -- |
| 401 | -- This routine creates a segmented character string, which is exactly |
| 402 | -- equivalent to specified character string. */ |
| 403 | |
| 404 | STRINGcxx . . $ STRING# *create_stringcxx . . $ `external/glpk/glpmpl.h:889:9`! |
| 405 | ( MPLcxx . . $ MPL# *mpl, |
| 406 | char buf[MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!+1] /* not changed */ |
| 407 | ) |
| 408 | #if 0 |
| 409 | { STRING *head, *tail; |
| 410 | int i, j; |
| 411 | xassert(buf != NULL); |
| 412 | xassert(strlen(buf) <= MAX_LENGTH); |
| 413 | head = tail = dmp_get_atom(mpl->strings, sizeof(STRING)); |
| 414 | for (i = j = 0; ; i++) |
| 415 | { if ((tail->seg[j++] = buf[i]) == '\0') break; |
| 416 | if (j == STRSEG_SIZE) |
| 417 | tail = (tail->next = dmp_get_atom(mpl->strings, sizeof(STRING))), j = 0; |
| 418 | } |
| 419 | tail->next = NULL; |
| 420 | return head; |
| 421 | } |
| 422 | #else |
| 423 | { STRINGcxx . . $ STRING# *str; |
| 424 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(strlen(buf) <= MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!); |
| 425 | str = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(mpl->stringscxx . . $ MPL#strings., strlencxx . . $ strlen(751346f8406fd082).(buf)+1); |
| 426 | strcpycxx . . $ strcpy(b7b3a83273496486).(str, buf); |
| 427 | return str; |
| 428 | } |
| 429 | #endif |
| 430 | |
| 431 | /*---------------------------------------------------------------------- |
| 432 | -- copy_string - make copy of character string. |
| 433 | -- |
| 434 | -- This routine returns an exact copy of segmented character string. */ |
| 435 | |
| 436 | STRINGcxx . . $ STRING# *copy_stringcxx . . $ `external/glpk/glpmpl.h:896:9`! |
| 437 | ( MPLcxx . . $ MPL# *mpl, |
| 438 | STRINGcxx . . $ STRING# *str /* not changed */ |
| 439 | ) |
| 440 | #if 0 |
| 441 | { STRING *head, *tail; |
| 442 | xassert(str != NULL); |
| 443 | head = tail = dmp_get_atom(mpl->strings, sizeof(STRING)); |
| 444 | for (; str != NULL; str = str->next) |
| 445 | { memcpy(tail->seg, str->seg, STRSEG_SIZE); |
| 446 | if (str->next != NULL) |
| 447 | tail = (tail->next = dmp_get_atom(mpl->strings, sizeof(STRING))); |
| 448 | } |
| 449 | tail->next = NULL; |
| 450 | return head; |
| 451 | } |
| 452 | #else |
| 453 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(mpl == mpl); |
| 454 | return create_stringcxx . . $ `external/glpk/glpmpl.h:889:9`!(mpl, str); |
| 455 | } |
| 456 | #endif |
| 457 | |
| 458 | /*---------------------------------------------------------------------- |
| 459 | -- compare_strings - compare one character string with another. |
| 460 | -- |
| 461 | -- This routine compares one segmented character strings with another |
| 462 | -- and returns the result of comparison as follows: |
| 463 | -- |
| 464 | -- = 0 - both strings are identical; |
| 465 | -- < 0 - the first string precedes the second one; |
| 466 | -- > 0 - the first string follows the second one. */ |
| 467 | |
| 468 | int compare_stringscxx . . $ `external/glpk/glpmpl.h:903:9`! |
| 469 | ( MPLcxx . . $ MPL# *mpl, |
| 470 | STRINGcxx . . $ STRING# *str1, /* not changed */ |
| 471 | STRINGcxx . . $ STRING# *str2 /* not changed */ |
| 472 | ) |
| 473 | #if 0 |
| 474 | { int j, c1, c2; |
| 475 | xassert(mpl == mpl); |
| 476 | for (;; str1 = str1->next, str2 = str2->next) |
| 477 | { xassert(str1 != NULL); |
| 478 | xassert(str2 != NULL); |
| 479 | for (j = 0; j < STRSEG_SIZE; j++) |
| 480 | { c1 = (unsigned char)str1->seg[j]; |
| 481 | c2 = (unsigned char)str2->seg[j]; |
| 482 | if (c1 < c2) return -1; |
| 483 | if (c1 > c2) return +1; |
| 484 | if (c1 == '\0') goto done; |
| 485 | } |
| 486 | } |
| 487 | done: return 0; |
| 488 | } |
| 489 | #else |
| 490 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(mpl == mpl); |
| 491 | return strcmpcxx . . $ strcmp(5ae29d726ae57f88).(str1, str2); |
| 492 | } |
| 493 | #endif |
| 494 | |
| 495 | /*---------------------------------------------------------------------- |
| 496 | -- fetch_string - extract content of character string. |
| 497 | -- |
| 498 | -- This routine returns a character string, which is exactly equivalent |
| 499 | -- to specified segmented character string. */ |
| 500 | |
| 501 | char *fetch_stringcxx . . $ `external/glpk/glpmpl.h:911:9`! |
| 502 | ( MPLcxx . . $ MPL# *mpl, |
| 503 | STRINGcxx . . $ STRING# *str, /* not changed */ |
| 504 | char buf[MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!+1] /* modified */ |
| 505 | ) |
| 506 | #if 0 |
| 507 | { int i, j; |
| 508 | xassert(mpl == mpl); |
| 509 | xassert(buf != NULL); |
| 510 | for (i = 0; ; str = str->next) |
| 511 | { xassert(str != NULL); |
| 512 | for (j = 0; j < STRSEG_SIZE; j++) |
| 513 | if ((buf[i++] = str->seg[j]) == '\0') goto done; |
| 514 | } |
| 515 | done: xassert(strlen(buf) <= MAX_LENGTH); |
| 516 | return buf; |
| 517 | } |
| 518 | #else |
| 519 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(mpl == mpl); |
| 520 | return strcpycxx . . $ strcpy(b7b3a83273496486).(buf, str); |
| 521 | } |
| 522 | #endif |
| 523 | |
| 524 | /*---------------------------------------------------------------------- |
| 525 | -- delete_string - delete character string. |
| 526 | -- |
| 527 | -- This routine deletes specified segmented character string. */ |
| 528 | |
| 529 | void delete_stringcxx . . $ `external/glpk/glpmpl.h:919:9`! |
| 530 | ( MPLcxx . . $ MPL# *mpl, |
| 531 | STRINGcxx . . $ STRING# *str /* destroyed */ |
| 532 | ) |
| 533 | #if 0 |
| 534 | { STRING *temp; |
| 535 | xassert(str != NULL); |
| 536 | while (str != NULL) |
| 537 | { temp = str; |
| 538 | str = str->next; |
| 539 | dmp_free_atom(mpl->strings, temp, sizeof(STRING)); |
| 540 | } |
| 541 | return; |
| 542 | } |
| 543 | #else |
| 544 | { dmp_free_atomcxx . . $ `external/glpk/glpdmp.h:66:9`!(mpl->stringscxx . . $ MPL#strings., str, strlencxx . . $ strlen(751346f8406fd082).(str)+1); |
| 545 | return; |
| 546 | } |
| 547 | #endif |
| 548 | |
| 549 | /**********************************************************************/ |
| 550 | /* * * SYMBOLS * * */ |
| 551 | /**********************************************************************/ |
| 552 | |
| 553 | /*---------------------------------------------------------------------- |
| 554 | -- create_symbol_num - create symbol of numeric type. |
| 555 | -- |
| 556 | -- This routine creates a symbol, which has a numeric value specified |
| 557 | -- as floating-point number. */ |
| 558 | |
| 559 | SYMBOLcxx . . $ SYMBOL# *create_symbol_numcxx . . $ `external/glpk/glpmpl.h:938:9`!(MPLcxx . . $ MPL# *mpl, double num) |
| 560 | { SYMBOLcxx . . $ SYMBOL# *sym; |
| 561 | sym = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(mpl->symbolscxx . . $ MPL#symbols., sizeof(SYMBOLcxx . . $ SYMBOL#)); |
| 562 | sym->numcxx . . $ SYMBOL#num. = num; |
| 563 | sym->strcxx . . $ SYMBOL#str. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 564 | return sym; |
| 565 | } |
| 566 | |
| 567 | /*---------------------------------------------------------------------- |
| 568 | -- create_symbol_str - create symbol of abstract type. |
| 569 | -- |
| 570 | -- This routine creates a symbol, which has an abstract value specified |
| 571 | -- as segmented character string. */ |
| 572 | |
| 573 | SYMBOLcxx . . $ SYMBOL# *create_symbol_strcxx . . $ `external/glpk/glpmpl.h:942:9`! |
| 574 | ( MPLcxx . . $ MPL# *mpl, |
| 575 | STRINGcxx . . $ STRING# *str /* destroyed */ |
| 576 | ) |
| 577 | { SYMBOLcxx . . $ SYMBOL# *sym; |
| 578 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(str != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 579 | sym = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(mpl->symbolscxx . . $ MPL#symbols., sizeof(SYMBOLcxx . . $ SYMBOL#)); |
| 580 | sym->numcxx . . $ SYMBOL#num. = 0.0; |
| 581 | sym->strcxx . . $ SYMBOL#str. = str; |
| 582 | return sym; |
| 583 | } |
| 584 | |
| 585 | /*---------------------------------------------------------------------- |
| 586 | -- copy_symbol - make copy of symbol. |
| 587 | -- |
| 588 | -- This routine returns an exact copy of symbol. */ |
| 589 | |
| 590 | SYMBOLcxx . . $ SYMBOL# *copy_symbolcxx . . $ `external/glpk/glpmpl.h:949:9`! |
| 591 | ( MPLcxx . . $ MPL# *mpl, |
| 592 | SYMBOLcxx . . $ SYMBOL# *sym /* not changed */ |
| 593 | ) |
| 594 | { SYMBOLcxx . . $ SYMBOL# *copy; |
| 595 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(sym != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 596 | copy = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(mpl->symbolscxx . . $ MPL#symbols., sizeof(SYMBOLcxx . . $ SYMBOL#)); |
| 597 | if (sym->strcxx . . $ SYMBOL#str. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 598 | { copy->numcxx . . $ SYMBOL#num. = sym->numcxx . . $ SYMBOL#num.; |
| 599 | copy->strcxx . . $ SYMBOL#str. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 600 | } |
| 601 | else |
| 602 | { copy->numcxx . . $ SYMBOL#num. = 0.0; |
| 603 | copy->strcxx . . $ SYMBOL#str. = copy_stringcxx . . $ `external/glpk/glpmpl.h:896:9`!(mpl, sym->strcxx . . $ SYMBOL#str.); |
| 604 | } |
| 605 | return copy; |
| 606 | } |
| 607 | |
| 608 | /*---------------------------------------------------------------------- |
| 609 | -- compare_symbols - compare one symbol with another. |
| 610 | -- |
| 611 | -- This routine compares one symbol with another and returns the result |
| 612 | -- of comparison as follows: |
| 613 | -- |
| 614 | -- = 0 - both symbols are identical; |
| 615 | -- < 0 - the first symbol precedes the second one; |
| 616 | -- > 0 - the first symbol follows the second one. |
| 617 | -- |
| 618 | -- Note that the linear order, in which symbols follow each other, is |
| 619 | -- implementation-dependent. It may be not an alphabetical order. */ |
| 620 | |
| 621 | int compare_symbolscxx . . $ `external/glpk/glpmpl.h:956:9`! |
| 622 | ( MPLcxx . . $ MPL# *mpl, |
| 623 | SYMBOLcxx . . $ SYMBOL# *sym1, /* not changed */ |
| 624 | SYMBOLcxx . . $ SYMBOL# *sym2 /* not changed */ |
| 625 | ) |
| 626 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(sym1 != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 627 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(sym2 != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 628 | /* let all numeric quantities precede all symbolic quantities */ |
| 629 | if (sym1->strcxx . . $ SYMBOL#str. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! && sym2->strcxx . . $ SYMBOL#str. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 630 | { if (sym1->numcxx . . $ SYMBOL#num. < sym2->numcxx . . $ SYMBOL#num.) return -1; |
| 631 | if (sym1->numcxx . . $ SYMBOL#num. > sym2->numcxx . . $ SYMBOL#num.) return +1; |
| 632 | return 0; |
| 633 | } |
| 634 | if (sym1->strcxx . . $ SYMBOL#str. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) return -1; |
| 635 | if (sym2->strcxx . . $ SYMBOL#str. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) return +1; |
| 636 | return compare_stringscxx . . $ `external/glpk/glpmpl.h:903:9`!(mpl, sym1->strcxx . . $ SYMBOL#str., sym2->strcxx . . $ SYMBOL#str.); |
| 637 | } |
| 638 | |
| 639 | /*---------------------------------------------------------------------- |
| 640 | -- delete_symbol - delete symbol. |
| 641 | -- |
| 642 | -- This routine deletes specified symbol. */ |
| 643 | |
| 644 | void delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`! |
| 645 | ( MPLcxx . . $ MPL# *mpl, |
| 646 | SYMBOLcxx . . $ SYMBOL# *sym /* destroyed */ |
| 647 | ) |
| 648 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(sym != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 649 | if (sym->strcxx . . $ SYMBOL#str. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) delete_stringcxx . . $ `external/glpk/glpmpl.h:919:9`!(mpl, sym->strcxx . . $ SYMBOL#str.); |
| 650 | dmp_free_atomcxx . . $ `external/glpk/glpdmp.h:66:9`!(mpl->symbolscxx . . $ MPL#symbols., sym, sizeof(SYMBOLcxx . . $ SYMBOL#)); |
| 651 | return; |
| 652 | } |
| 653 | |
| 654 | /*---------------------------------------------------------------------- |
| 655 | -- format_symbol - format symbol for displaying or printing. |
| 656 | -- |
| 657 | -- This routine converts specified symbol to a charater string, which |
| 658 | -- is suitable for displaying or printing. |
| 659 | -- |
| 660 | -- The resultant string is never longer than 255 characters. If it gets |
| 661 | -- longer, it is truncated from the right and appended by dots. */ |
| 662 | |
| 663 | char *format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`! |
| 664 | ( MPLcxx . . $ MPL# *mpl, |
| 665 | SYMBOLcxx . . $ SYMBOL# *sym /* not changed */ |
| 666 | ) |
| 667 | { char *buf = mpl->sym_bufcxx . . $ MPL#sym_buf.; |
| 668 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(sym != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 669 | if (sym->strcxx . . $ SYMBOL#str. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 670 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(buf, "%.*g", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, sym->numcxx . . $ SYMBOL#num.); |
| 671 | else |
| 672 | { char str[MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!+1]; |
| 673 | int quoted, j, len; |
| 674 | fetch_stringcxx . . $ `external/glpk/glpmpl.h:911:9`!(mpl, sym->strcxx . . $ SYMBOL#str., str); |
| 675 | if (!(isalphacxx . . $ `<external>/17904084882347303253/ctype.h:190:10`!((unsigned char)str[0]) || str[0] == '_')) |
| 676 | quoted = 1; |
| 677 | else |
| 678 | { quoted = 0; |
| 679 | for (j = 1; str[j] != '\0'; j++) |
| 680 | { if (!(isalnumcxx . . $ `<external>/17904084882347303253/ctype.h:189:10`!((unsigned char)str[j]) || |
| 681 | strchrcxx . . $ strchr(2050848944e00d54).("+-._", (unsigned char)str[j]) != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!)) |
| 682 | { quoted = 1; |
| 683 | break; |
| 684 | } |
| 685 | } |
| 686 | } |
| 687 | # define safe_appendcxx . . $ `external/glpk/glpmpl03.c:687:17`!(c) \ |
| 688 | (void)(len < 255 ? (buf[len++] = (char)(c)) : 0) |
| 689 | buf[0] = '\0', len = 0; |
| 690 | if (quoted) safe_appendcxx . . $ `external/glpk/glpmpl03.c:687:17`!('\''); |
| 691 | for (j = 0; str[j] != '\0'; j++) |
| 692 | { if (quoted && str[j] == '\'') safe_appendcxx . . $ `external/glpk/glpmpl03.c:687:17`!('\''); |
| 693 | safe_appendcxx . . $ `external/glpk/glpmpl03.c:687:17`!(str[j]); |
| 694 | } |
| 695 | if (quoted) safe_appendcxx . . $ `external/glpk/glpmpl03.c:687:17`!('\''); |
| 696 | # undef safe_appendcxx . . $ `external/glpk/glpmpl03.c:687:17`! |
| 697 | buf[len] = '\0'; |
| 698 | if (len == 255) strcpycxx . . $ strcpy(b7b3a83273496486).(buf+252, "..."); |
| 699 | } |
| 700 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(strlen(buf) <= 255); |
| 701 | return buf; |
| 702 | } |
| 703 | |
| 704 | /*---------------------------------------------------------------------- |
| 705 | -- concat_symbols - concatenate one symbol with another. |
| 706 | -- |
| 707 | -- This routine concatenates values of two given symbols and assigns |
| 708 | -- the resultant character string to a new symbol, which is returned on |
| 709 | -- exit. Both original symbols are destroyed. */ |
| 710 | |
| 711 | SYMBOLcxx . . $ SYMBOL# *concat_symbolscxx . . $ `external/glpk/glpmpl.h:978:9`! |
| 712 | ( MPLcxx . . $ MPL# *mpl, |
| 713 | SYMBOLcxx . . $ SYMBOL# *sym1, /* destroyed */ |
| 714 | SYMBOLcxx . . $ SYMBOL# *sym2 /* destroyed */ |
| 715 | ) |
| 716 | { char str1[MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!+1], str2[MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!+1]; |
| 717 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`! >= DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`! + DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!); |
| 718 | if (sym1->strcxx . . $ SYMBOL#str. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 719 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(str1, "%.*g", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, sym1->numcxx . . $ SYMBOL#num.); |
| 720 | else |
| 721 | fetch_stringcxx . . $ `external/glpk/glpmpl.h:911:9`!(mpl, sym1->strcxx . . $ SYMBOL#str., str1); |
| 722 | if (sym2->strcxx . . $ SYMBOL#str. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 723 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(str2, "%.*g", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, sym2->numcxx . . $ SYMBOL#num.); |
| 724 | else |
| 725 | fetch_stringcxx . . $ `external/glpk/glpmpl.h:911:9`!(mpl, sym2->strcxx . . $ SYMBOL#str., str2); |
| 726 | if (strlencxx . . $ strlen(751346f8406fd082).(str1) + strlencxx . . $ strlen(751346f8406fd082).(str2) > MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!) |
| 727 | { char buf[255+1]; |
| 728 | strcpycxx . . $ strcpy(b7b3a83273496486).(buf, format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, sym1)); |
| 729 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(strlen(buf) < sizeof(buf)); |
| 730 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%s & %s; resultant symbol exceeds %d characters", |
| 731 | buf, format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, sym2), MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!); |
| 732 | } |
| 733 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym1); |
| 734 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym2); |
| 735 | return create_symbol_strcxx . . $ `external/glpk/glpmpl.h:942:9`!(mpl, create_stringcxx . . $ `external/glpk/glpmpl.h:889:9`!(mpl, strcatcxx . . $ strcat(b7b3a83273496486).(str1, |
| 736 | str2))); |
| 737 | } |
| 738 | |
| 739 | /**********************************************************************/ |
| 740 | /* * * N-TUPLES * * */ |
| 741 | /**********************************************************************/ |
| 742 | |
| 743 | /*---------------------------------------------------------------------- |
| 744 | -- create_tuple - create n-tuple. |
| 745 | -- |
| 746 | -- This routine creates a n-tuple, which initially has no components, |
| 747 | -- i.e. which is 0-tuple. */ |
| 748 | |
| 749 | TUPLEcxx . . $ TUPLE# *create_tuplecxx . . $ `external/glpk/glpmpl.h:999:9`!(MPLcxx . . $ MPL# *mpl) |
| 750 | { TUPLEcxx . . $ TUPLE# *tuple; |
| 751 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(mpl == mpl); |
| 752 | tuple = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 753 | return tuple; |
| 754 | } |
| 755 | |
| 756 | /*---------------------------------------------------------------------- |
| 757 | -- expand_tuple - append symbol to n-tuple. |
| 758 | -- |
| 759 | -- This routine expands n-tuple appending to it a given symbol, which |
| 760 | -- becomes its new last component. */ |
| 761 | |
| 762 | TUPLEcxx . . $ TUPLE# *expand_tuplecxx . . $ `external/glpk/glpmpl.h:1003:9`! |
| 763 | ( MPLcxx . . $ MPL# *mpl, |
| 764 | TUPLEcxx . . $ TUPLE# *tuple, /* destroyed */ |
| 765 | SYMBOLcxx . . $ SYMBOL# *sym /* destroyed */ |
| 766 | ) |
| 767 | { TUPLEcxx . . $ TUPLE# *tail, *temp; |
| 768 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(sym != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 769 | /* create a new component */ |
| 770 | tail = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(mpl->tuplescxx . . $ MPL#tuples., sizeof(TUPLEcxx . . $ TUPLE#)); |
| 771 | tail->symcxx . . $ TUPLE#sym. = sym; |
| 772 | tail->nextcxx . . $ TUPLE#next. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 773 | /* and append it to the component list */ |
| 774 | if (tuple == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 775 | tuple = tail; |
| 776 | else |
| 777 | { for (temp = tuple; temp->nextcxx . . $ TUPLE#next. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; temp = temp->nextcxx . . $ TUPLE#next.); |
| 778 | temp->nextcxx . . $ TUPLE#next. = tail; |
| 779 | } |
| 780 | return tuple; |
| 781 | } |
| 782 | |
| 783 | /*---------------------------------------------------------------------- |
| 784 | -- tuple_dimen - determine dimension of n-tuple. |
| 785 | -- |
| 786 | -- This routine returns dimension of n-tuple, i.e. number of components |
| 787 | -- in the n-tuple. */ |
| 788 | |
| 789 | int tuple_dimencxx . . $ `external/glpk/glpmpl.h:1011:9`! |
| 790 | ( MPLcxx . . $ MPL# *mpl, |
| 791 | TUPLEcxx . . $ TUPLE# *tuple /* not changed */ |
| 792 | ) |
| 793 | { TUPLEcxx . . $ TUPLE# *temp; |
| 794 | int dim = 0; |
| 795 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(mpl == mpl); |
| 796 | for (temp = tuple; temp != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; temp = temp->nextcxx . . $ TUPLE#next.) dim++; |
| 797 | return dim; |
| 798 | } |
| 799 | |
| 800 | /*---------------------------------------------------------------------- |
| 801 | -- copy_tuple - make copy of n-tuple. |
| 802 | -- |
| 803 | -- This routine returns an exact copy of n-tuple. */ |
| 804 | |
| 805 | TUPLEcxx . . $ TUPLE# *copy_tuplecxx . . $ `external/glpk/glpmpl.h:1018:9`! |
| 806 | ( MPLcxx . . $ MPL# *mpl, |
| 807 | TUPLEcxx . . $ TUPLE# *tuple /* not changed */ |
| 808 | ) |
| 809 | { TUPLEcxx . . $ TUPLE# *head, *tail; |
| 810 | if (tuple == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 811 | head = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 812 | else |
| 813 | { head = tail = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(mpl->tuplescxx . . $ MPL#tuples., sizeof(TUPLEcxx . . $ TUPLE#)); |
| 814 | for (; tuple != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; tuple = tuple->nextcxx . . $ TUPLE#next.) |
| 815 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(tuple->sym != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 816 | tail->symcxx . . $ TUPLE#sym. = copy_symbolcxx . . $ `external/glpk/glpmpl.h:949:9`!(mpl, tuple->symcxx . . $ TUPLE#sym.); |
| 817 | if (tuple->nextcxx . . $ TUPLE#next. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 818 | tail = (tail->nextcxx . . $ TUPLE#next. = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(mpl->tuplescxx . . $ MPL#tuples., sizeof(TUPLEcxx . . $ TUPLE#))); |
| 819 | } |
| 820 | tail->nextcxx . . $ TUPLE#next. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 821 | } |
| 822 | return head; |
| 823 | } |
| 824 | |
| 825 | /*---------------------------------------------------------------------- |
| 826 | -- compare_tuples - compare one n-tuple with another. |
| 827 | -- |
| 828 | -- This routine compares two given n-tuples, which must have the same |
| 829 | -- dimension (not checked for the sake of efficiency), and returns one |
| 830 | -- of the following codes: |
| 831 | -- |
| 832 | -- = 0 - both n-tuples are identical; |
| 833 | -- < 0 - the first n-tuple precedes the second one; |
| 834 | -- > 0 - the first n-tuple follows the second one. |
| 835 | -- |
| 836 | -- Note that the linear order, in which n-tuples follow each other, is |
| 837 | -- implementation-dependent. It may be not an alphabetical order. */ |
| 838 | |
| 839 | int compare_tuplescxx . . $ `external/glpk/glpmpl.h:1025:9`! |
| 840 | ( MPLcxx . . $ MPL# *mpl, |
| 841 | TUPLEcxx . . $ TUPLE# *tuple1, /* not changed */ |
| 842 | TUPLEcxx . . $ TUPLE# *tuple2 /* not changed */ |
| 843 | ) |
| 844 | { TUPLEcxx . . $ TUPLE# *item1, *item2; |
| 845 | int ret; |
| 846 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(mpl == mpl); |
| 847 | for (item1 = tuple1, item2 = tuple2; item1 != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 848 | item1 = item1->nextcxx . . $ TUPLE#next., item2 = item2->nextcxx . . $ TUPLE#next.) |
| 849 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(item2 != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 850 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(item1->sym != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 851 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(item2->sym != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 852 | ret = compare_symbolscxx . . $ `external/glpk/glpmpl.h:956:9`!(mpl, item1->symcxx . . $ TUPLE#sym., item2->symcxx . . $ TUPLE#sym.); |
| 853 | if (ret != 0) return ret; |
| 854 | } |
| 855 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(item2 == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 856 | return 0; |
| 857 | } |
| 858 | |
| 859 | /*---------------------------------------------------------------------- |
| 860 | -- build_subtuple - build subtuple of given n-tuple. |
| 861 | -- |
| 862 | -- This routine builds subtuple, which consists of first dim components |
| 863 | -- of given n-tuple. */ |
| 864 | |
| 865 | TUPLEcxx . . $ TUPLE# *build_subtuplecxx . . $ `external/glpk/glpmpl.h:1033:9`! |
| 866 | ( MPLcxx . . $ MPL# *mpl, |
| 867 | TUPLEcxx . . $ TUPLE# *tuple, /* not changed */ |
| 868 | int dim |
| 869 | ) |
| 870 | { TUPLEcxx . . $ TUPLE# *head, *temp; |
| 871 | int j; |
| 872 | head = create_tuplecxx . . $ `external/glpk/glpmpl.h:999:9`!(mpl); |
| 873 | for (j = 1, temp = tuple; j <= dim; j++, temp = temp->nextcxx . . $ TUPLE#next.) |
| 874 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(temp != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 875 | head = expand_tuplecxx . . $ `external/glpk/glpmpl.h:1003:9`!(mpl, head, copy_symbolcxx . . $ `external/glpk/glpmpl.h:949:9`!(mpl, temp->symcxx . . $ TUPLE#sym.)); |
| 876 | } |
| 877 | return head; |
| 878 | } |
| 879 | |
| 880 | /*---------------------------------------------------------------------- |
| 881 | -- delete_tuple - delete n-tuple. |
| 882 | -- |
| 883 | -- This routine deletes specified n-tuple. */ |
| 884 | |
| 885 | void delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`! |
| 886 | ( MPLcxx . . $ MPL# *mpl, |
| 887 | TUPLEcxx . . $ TUPLE# *tuple /* destroyed */ |
| 888 | ) |
| 889 | { TUPLEcxx . . $ TUPLE# *temp; |
| 890 | while (tuple != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 891 | { temp = tuple; |
| 892 | tuple = temp->nextcxx . . $ TUPLE#next.; |
| 893 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(temp->sym != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 894 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, temp->symcxx . . $ TUPLE#sym.); |
| 895 | dmp_free_atomcxx . . $ `external/glpk/glpdmp.h:66:9`!(mpl->tuplescxx . . $ MPL#tuples., temp, sizeof(TUPLEcxx . . $ TUPLE#)); |
| 896 | } |
| 897 | return; |
| 898 | } |
| 899 | |
| 900 | /*---------------------------------------------------------------------- |
| 901 | -- format_tuple - format n-tuple for displaying or printing. |
| 902 | -- |
| 903 | -- This routine converts specified n-tuple to a character string, which |
| 904 | -- is suitable for displaying or printing. |
| 905 | -- |
| 906 | -- The resultant string is never longer than 255 characters. If it gets |
| 907 | -- longer, it is truncated from the right and appended by dots. */ |
| 908 | |
| 909 | char *format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`! |
| 910 | ( MPLcxx . . $ MPL# *mpl, |
| 911 | int c, |
| 912 | TUPLEcxx . . $ TUPLE# *tuple /* not changed */ |
| 913 | ) |
| 914 | { TUPLEcxx . . $ TUPLE# *temp; |
| 915 | int dim, j, len; |
| 916 | char *buf = mpl->tup_bufcxx . . $ MPL#tup_buf., str[255+1], *save; |
| 917 | # define safe_appendcxx . . $ `external/glpk/glpmpl03.c:917:14`!(c) \ |
| 918 | (void)(len < 255 ? (buf[len++] = (char)(c)) : 0) |
| 919 | buf[0] = '\0', len = 0; |
| 920 | dim = tuple_dimencxx . . $ `external/glpk/glpmpl.h:1011:9`!(mpl, tuple); |
| 921 | if (c == '[' && dim > 0) safe_appendcxx . . $ `external/glpk/glpmpl03.c:917:14`!('['); |
| 922 | if (c == '(' && dim > 1) safe_appendcxx . . $ `external/glpk/glpmpl03.c:917:14`!('('); |
| 923 | for (temp = tuple; temp != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; temp = temp->nextcxx . . $ TUPLE#next.) |
| 924 | { if (temp != tuple) safe_appendcxx . . $ `external/glpk/glpmpl03.c:917:14`!(','); |
| 925 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(temp->sym != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 926 | save = mpl->sym_bufcxx . . $ MPL#sym_buf.; |
| 927 | mpl->sym_bufcxx . . $ MPL#sym_buf. = str; |
| 928 | format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, temp->symcxx . . $ TUPLE#sym.); |
| 929 | mpl->sym_bufcxx . . $ MPL#sym_buf. = save; |
| 930 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(strlen(str) < sizeof(str)); |
| 931 | for (j = 0; str[j] != '\0'; j++) safe_appendcxx . . $ `external/glpk/glpmpl03.c:917:14`!(str[j]); |
| 932 | } |
| 933 | if (c == '[' && dim > 0) safe_appendcxx . . $ `external/glpk/glpmpl03.c:917:14`!(']'); |
| 934 | if (c == '(' && dim > 1) safe_appendcxx . . $ `external/glpk/glpmpl03.c:917:14`!(')'); |
| 935 | # undef safe_appendcxx . . $ `external/glpk/glpmpl03.c:917:14`! |
| 936 | buf[len] = '\0'; |
| 937 | if (len == 255) strcpycxx . . $ strcpy(b7b3a83273496486).(buf+252, "..."); |
| 938 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(strlen(buf) <= 255); |
| 939 | return buf; |
| 940 | } |
| 941 | |
| 942 | /**********************************************************************/ |
| 943 | /* * * ELEMENTAL SETS * * */ |
| 944 | /**********************************************************************/ |
| 945 | |
| 946 | /*---------------------------------------------------------------------- |
| 947 | -- create_elemset - create elemental set. |
| 948 | -- |
| 949 | -- This routine creates an elemental set, whose members are n-tuples of |
| 950 | -- specified dimension. Being created the set is initially empty. */ |
| 951 | |
| 952 | ELEMSETcxx . . $ ELEMSET# *create_elemsetcxx . . $ `external/glpk/glpmpl.h:1070:9`!(MPLcxx . . $ MPL# *mpl, int dim) |
| 953 | { ELEMSETcxx . . $ ELEMSET# *set; |
| 954 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(dim > 0); |
| 955 | set = create_arraycxx . . $ `external/glpk/glpmpl.h:1372:9`!(mpl, A_NONEcxx . . $ `external/glpk/glpmpl.h:95:9`!, dim); |
| 956 | return set; |
| 957 | } |
| 958 | |
| 959 | /*---------------------------------------------------------------------- |
| 960 | -- find_tuple - check if elemental set contains given n-tuple. |
| 961 | -- |
| 962 | -- This routine finds given n-tuple in specified elemental set in order |
| 963 | -- to check if the set contains that n-tuple. If the n-tuple is found, |
| 964 | -- the routine returns pointer to corresponding array member. Otherwise |
| 965 | -- null pointer is returned. */ |
| 966 | |
| 967 | MEMBERcxx . . $ MEMBER# *find_tuplecxx . . $ `external/glpk/glpmpl.h:1074:9`! |
| 968 | ( MPLcxx . . $ MPL# *mpl, |
| 969 | ELEMSETcxx . . $ ELEMSET# *set, /* not changed */ |
| 970 | TUPLEcxx . . $ TUPLE# *tuple /* not changed */ |
| 971 | ) |
| 972 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(set != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 973 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(set->type == A_NONEcxx . . $ `external/glpk/glpmpl.h:95:9`!); |
| 974 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(set->dim == tuple_dimencxx . . $ `external/glpk/glpmpl.h:1011:9`!(mpl, tuple)); |
| 975 | return find_membercxx . . $ `external/glpk/glpmpl.h:1376:9`!(mpl, set, tuple); |
| 976 | } |
| 977 | |
| 978 | /*---------------------------------------------------------------------- |
| 979 | -- add_tuple - add new n-tuple to elemental set. |
| 980 | -- |
| 981 | -- This routine adds given n-tuple to specified elemental set. |
| 982 | -- |
| 983 | -- For the sake of efficiency this routine doesn't check whether the |
| 984 | -- set already contains the same n-tuple or not. Therefore the calling |
| 985 | -- program should use the routine find_tuple (if necessary) in order to |
| 986 | -- make sure that the given n-tuple is not contained in the set, since |
| 987 | -- duplicate n-tuples within the same set are not allowed. */ |
| 988 | |
| 989 | MEMBERcxx . . $ MEMBER# *add_tuplecxx . . $ `external/glpk/glpmpl.h:1082:9`! |
| 990 | ( MPLcxx . . $ MPL# *mpl, |
| 991 | ELEMSETcxx . . $ ELEMSET# *set, /* modified */ |
| 992 | TUPLEcxx . . $ TUPLE# *tuple /* destroyed */ |
| 993 | ) |
| 994 | { MEMBERcxx . . $ MEMBER# *memb; |
| 995 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(set != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 996 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(set->type == A_NONEcxx . . $ `external/glpk/glpmpl.h:95:9`!); |
| 997 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(set->dim == tuple_dimencxx . . $ `external/glpk/glpmpl.h:1011:9`!(mpl, tuple)); |
| 998 | memb = add_membercxx . . $ `external/glpk/glpmpl.h:1384:9`!(mpl, set, tuple); |
| 999 | memb->valuecxx . . $ MEMBER#value..nonecxx . . $ VALUE#none. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1000 | return memb; |
| 1001 | } |
| 1002 | |
| 1003 | /*---------------------------------------------------------------------- |
| 1004 | -- check_then_add - check and add new n-tuple to elemental set. |
| 1005 | -- |
| 1006 | -- This routine is equivalent to the routine add_tuple except that it |
| 1007 | -- does check for duplicate n-tuples. */ |
| 1008 | |
| 1009 | MEMBERcxx . . $ MEMBER# *check_then_addcxx . . $ `external/glpk/glpmpl.h:1090:9`! |
| 1010 | ( MPLcxx . . $ MPL# *mpl, |
| 1011 | ELEMSETcxx . . $ ELEMSET# *set, /* modified */ |
| 1012 | TUPLEcxx . . $ TUPLE# *tuple /* destroyed */ |
| 1013 | ) |
| 1014 | { if (find_tuplecxx . . $ `external/glpk/glpmpl.h:1074:9`!(mpl, set, tuple) != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1015 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "duplicate tuple %s detected", format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, |
| 1016 | '(', tuple)); |
| 1017 | return add_tuplecxx . . $ `external/glpk/glpmpl.h:1082:9`!(mpl, set, tuple); |
| 1018 | } |
| 1019 | |
| 1020 | /*---------------------------------------------------------------------- |
| 1021 | -- copy_elemset - make copy of elemental set. |
| 1022 | -- |
| 1023 | -- This routine makes an exact copy of elemental set. */ |
| 1024 | |
| 1025 | ELEMSETcxx . . $ ELEMSET# *copy_elemsetcxx . . $ `external/glpk/glpmpl.h:1098:9`! |
| 1026 | ( MPLcxx . . $ MPL# *mpl, |
| 1027 | ELEMSETcxx . . $ ELEMSET# *set /* not changed */ |
| 1028 | ) |
| 1029 | { ELEMSETcxx . . $ ELEMSET# *copy; |
| 1030 | MEMBERcxx . . $ MEMBER# *memb; |
| 1031 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(set != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1032 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(set->type == A_NONEcxx . . $ `external/glpk/glpmpl.h:95:9`!); |
| 1033 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(set->dim > 0); |
| 1034 | copy = create_elemsetcxx . . $ `external/glpk/glpmpl.h:1070:9`!(mpl, set->dimcxx . . $ ARRAY#dim.); |
| 1035 | for (memb = set->headcxx . . $ ARRAY#head.; memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memb = memb->nextcxx . . $ MEMBER#next.) |
| 1036 | add_tuplecxx . . $ `external/glpk/glpmpl.h:1082:9`!(mpl, copy, copy_tuplecxx . . $ `external/glpk/glpmpl.h:1018:9`!(mpl, memb->tuplecxx . . $ MEMBER#tuple.)); |
| 1037 | return copy; |
| 1038 | } |
| 1039 | |
| 1040 | /*---------------------------------------------------------------------- |
| 1041 | -- delete_elemset - delete elemental set. |
| 1042 | -- |
| 1043 | -- This routine deletes specified elemental set. */ |
| 1044 | |
| 1045 | void delete_elemsetcxx . . $ `external/glpk/glpmpl.h:1105:9`! |
| 1046 | ( MPLcxx . . $ MPL# *mpl, |
| 1047 | ELEMSETcxx . . $ ELEMSET# *set /* destroyed */ |
| 1048 | ) |
| 1049 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(set != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1050 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(set->type == A_NONEcxx . . $ `external/glpk/glpmpl.h:95:9`!); |
| 1051 | delete_arraycxx . . $ `external/glpk/glpmpl.h:1392:9`!(mpl, set); |
| 1052 | return; |
| 1053 | } |
| 1054 | |
| 1055 | /*---------------------------------------------------------------------- |
| 1056 | -- arelset_size - compute size of "arithmetic" elemental set. |
| 1057 | -- |
| 1058 | -- This routine computes the size of "arithmetic" elemental set, which |
| 1059 | -- is specified in the form of arithmetic progression: |
| 1060 | -- |
| 1061 | -- { t0 .. tf by dt }. |
| 1062 | -- |
| 1063 | -- The size is computed using the formula: |
| 1064 | -- |
| 1065 | -- n = max(0, floor((tf - t0) / dt) + 1). */ |
| 1066 | |
| 1067 | int arelset_sizecxx . . $ `external/glpk/glpmpl.h:1112:9`!(MPLcxx . . $ MPL# *mpl, double t0, double tf, double dt) |
| 1068 | { double temp; |
| 1069 | if (dt == 0.0) |
| 1070 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%.*g .. %.*g by %.*g; zero stride not allowed", |
| 1071 | DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, t0, DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, tf, DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, dt); |
| 1072 | if (tf > 0.0 && t0 < 0.0 && tf > + 0.999 * DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`! + t0) |
| 1073 | temp = +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!; |
| 1074 | else if (tf < 0.0 && t0 > 0.0 && tf < - 0.999 * DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`! + t0) |
| 1075 | temp = -DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!; |
| 1076 | else |
| 1077 | temp = tf - t0; |
| 1078 | if (fabscxx . . $ fabs(447c67c6676f75c3).(dt) < 1.0 && fabscxx . . $ fabs(447c67c6676f75c3).(temp) > (0.999 * DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!) * fabscxx . . $ fabs(447c67c6676f75c3).(dt)) |
| 1079 | { if (temp > 0.0 && dt > 0.0 || temp < 0.0 && dt < 0.0) |
| 1080 | temp = +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!; |
| 1081 | else |
| 1082 | temp = 0.0; |
| 1083 | } |
| 1084 | else |
| 1085 | { temp = floorcxx . . $ floor(447c67c6676f75c3).(temp / dt) + 1.0; |
| 1086 | if (temp < 0.0) temp = 0.0; |
| 1087 | } |
| 1088 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(temp >= 0.0); |
| 1089 | if (temp > (double)(INT_MAXcxx . . $ `<external>/67164224788392828/limits.h:120:9`! - 1)) |
| 1090 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%.*g .. %.*g by %.*g; set too large", |
| 1091 | DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, t0, DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, tf, DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, dt); |
| 1092 | return (int)(temp + 0.5); |
| 1093 | } |
| 1094 | |
| 1095 | /*---------------------------------------------------------------------- |
| 1096 | -- arelset_member - compute member of "arithmetic" elemental set. |
| 1097 | -- |
| 1098 | -- This routine returns a numeric value of symbol, which is equivalent |
| 1099 | -- to j-th member of given "arithmetic" elemental set specified in the |
| 1100 | -- form of arithmetic progression: |
| 1101 | -- |
| 1102 | -- { t0 .. tf by dt }. |
| 1103 | -- |
| 1104 | -- The symbol value is computed with the formula: |
| 1105 | -- |
| 1106 | -- j-th member = t0 + (j - 1) * dt, |
| 1107 | -- |
| 1108 | -- The number j must satisfy to the restriction 1 <= j <= n, where n is |
| 1109 | -- the set size computed by the routine arelset_size. */ |
| 1110 | |
| 1111 | double arelset_membercxx . . $ `external/glpk/glpmpl.h:1116:9`!(MPLcxx . . $ MPL# *mpl, double t0, double tf, double dt, int j) |
| 1112 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(1 <= j && j <= arelset_sizecxx . . $ `external/glpk/glpmpl.h:1112:9`!(mpl, t0, tf, dt)); |
| 1113 | return t0 + (double)(j - 1) * dt; |
| 1114 | } |
| 1115 | |
| 1116 | /*---------------------------------------------------------------------- |
| 1117 | -- create_arelset - create "arithmetic" elemental set. |
| 1118 | -- |
| 1119 | -- This routine creates "arithmetic" elemental set, which is specified |
| 1120 | -- in the form of arithmetic progression: |
| 1121 | -- |
| 1122 | -- { t0 .. tf by dt }. |
| 1123 | -- |
| 1124 | -- Components of this set are 1-tuples. */ |
| 1125 | |
| 1126 | ELEMSETcxx . . $ ELEMSET# *create_arelsetcxx . . $ `external/glpk/glpmpl.h:1120:9`!(MPLcxx . . $ MPL# *mpl, double t0, double tf, double dt) |
| 1127 | { ELEMSETcxx . . $ ELEMSET# *set; |
| 1128 | int j, n; |
| 1129 | set = create_elemsetcxx . . $ `external/glpk/glpmpl.h:1070:9`!(mpl, 1); |
| 1130 | n = arelset_sizecxx . . $ `external/glpk/glpmpl.h:1112:9`!(mpl, t0, tf, dt); |
| 1131 | for (j = 1; j <= n; j++) |
| 1132 | { add_tuplecxx . . $ `external/glpk/glpmpl.h:1082:9`! |
| 1133 | ( mpl, |
| 1134 | set, |
| 1135 | expand_tuplecxx . . $ `external/glpk/glpmpl.h:1003:9`! |
| 1136 | ( mpl, |
| 1137 | create_tuplecxx . . $ `external/glpk/glpmpl.h:999:9`!(mpl), |
| 1138 | create_symbol_numcxx . . $ `external/glpk/glpmpl.h:938:9`! |
| 1139 | ( mpl, |
| 1140 | arelset_membercxx . . $ `external/glpk/glpmpl.h:1116:9`!(mpl, t0, tf, dt, j) |
| 1141 | ) |
| 1142 | ) |
| 1143 | ); |
| 1144 | } |
| 1145 | return set; |
| 1146 | } |
| 1147 | |
| 1148 | /*---------------------------------------------------------------------- |
| 1149 | -- set_union - union of two elemental sets. |
| 1150 | -- |
| 1151 | -- This routine computes the union: |
| 1152 | -- |
| 1153 | -- X U Y = { j | (j in X) or (j in Y) }, |
| 1154 | -- |
| 1155 | -- where X and Y are given elemental sets (destroyed on exit). */ |
| 1156 | |
| 1157 | ELEMSETcxx . . $ ELEMSET# *set_unioncxx . . $ `external/glpk/glpmpl.h:1124:9`! |
| 1158 | ( MPLcxx . . $ MPL# *mpl, |
| 1159 | ELEMSETcxx . . $ ELEMSET# *X, /* destroyed */ |
| 1160 | ELEMSETcxx . . $ ELEMSET# *Y /* destroyed */ |
| 1161 | ) |
| 1162 | { MEMBERcxx . . $ MEMBER# *memb; |
| 1163 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(X != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1164 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(X->type == A_NONEcxx . . $ `external/glpk/glpmpl.h:95:9`!); |
| 1165 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(X->dim > 0); |
| 1166 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(Y != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1167 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(Y->type == A_NONEcxx . . $ `external/glpk/glpmpl.h:95:9`!); |
| 1168 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(Y->dim > 0); |
| 1169 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(X->dim == Y->dim); |
| 1170 | for (memb = Y->headcxx . . $ ARRAY#head.; memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memb = memb->nextcxx . . $ MEMBER#next.) |
| 1171 | { if (find_tuplecxx . . $ `external/glpk/glpmpl.h:1074:9`!(mpl, X, memb->tuplecxx . . $ MEMBER#tuple.) == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1172 | add_tuplecxx . . $ `external/glpk/glpmpl.h:1082:9`!(mpl, X, copy_tuplecxx . . $ `external/glpk/glpmpl.h:1018:9`!(mpl, memb->tuplecxx . . $ MEMBER#tuple.)); |
| 1173 | } |
| 1174 | delete_elemsetcxx . . $ `external/glpk/glpmpl.h:1105:9`!(mpl, Y); |
| 1175 | return X; |
| 1176 | } |
| 1177 | |
| 1178 | /*---------------------------------------------------------------------- |
| 1179 | -- set_diff - difference between two elemental sets. |
| 1180 | -- |
| 1181 | -- This routine computes the difference: |
| 1182 | -- |
| 1183 | -- X \ Y = { j | (j in X) and (j not in Y) }, |
| 1184 | -- |
| 1185 | -- where X and Y are given elemental sets (destroyed on exit). */ |
| 1186 | |
| 1187 | ELEMSETcxx . . $ ELEMSET# *set_diffcxx . . $ `external/glpk/glpmpl.h:1132:9`! |
| 1188 | ( MPLcxx . . $ MPL# *mpl, |
| 1189 | ELEMSETcxx . . $ ELEMSET# *X, /* destroyed */ |
| 1190 | ELEMSETcxx . . $ ELEMSET# *Y /* destroyed */ |
| 1191 | ) |
| 1192 | { ELEMSETcxx . . $ ELEMSET# *Z; |
| 1193 | MEMBERcxx . . $ MEMBER# *memb; |
| 1194 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(X != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1195 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(X->type == A_NONEcxx . . $ `external/glpk/glpmpl.h:95:9`!); |
| 1196 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(X->dim > 0); |
| 1197 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(Y != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1198 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(Y->type == A_NONEcxx . . $ `external/glpk/glpmpl.h:95:9`!); |
| 1199 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(Y->dim > 0); |
| 1200 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(X->dim == Y->dim); |
| 1201 | Z = create_elemsetcxx . . $ `external/glpk/glpmpl.h:1070:9`!(mpl, X->dimcxx . . $ ARRAY#dim.); |
| 1202 | for (memb = X->headcxx . . $ ARRAY#head.; memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memb = memb->nextcxx . . $ MEMBER#next.) |
| 1203 | { if (find_tuplecxx . . $ `external/glpk/glpmpl.h:1074:9`!(mpl, Y, memb->tuplecxx . . $ MEMBER#tuple.) == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1204 | add_tuplecxx . . $ `external/glpk/glpmpl.h:1082:9`!(mpl, Z, copy_tuplecxx . . $ `external/glpk/glpmpl.h:1018:9`!(mpl, memb->tuplecxx . . $ MEMBER#tuple.)); |
| 1205 | } |
| 1206 | delete_elemsetcxx . . $ `external/glpk/glpmpl.h:1105:9`!(mpl, X); |
| 1207 | delete_elemsetcxx . . $ `external/glpk/glpmpl.h:1105:9`!(mpl, Y); |
| 1208 | return Z; |
| 1209 | } |
| 1210 | |
| 1211 | /*---------------------------------------------------------------------- |
| 1212 | -- set_symdiff - symmetric difference between two elemental sets. |
| 1213 | -- |
| 1214 | -- This routine computes the symmetric difference: |
| 1215 | -- |
| 1216 | -- X (+) Y = (X \ Y) U (Y \ X), |
| 1217 | -- |
| 1218 | -- where X and Y are given elemental sets (destroyed on exit). */ |
| 1219 | |
| 1220 | ELEMSETcxx . . $ ELEMSET# *set_symdiffcxx . . $ `external/glpk/glpmpl.h:1140:9`! |
| 1221 | ( MPLcxx . . $ MPL# *mpl, |
| 1222 | ELEMSETcxx . . $ ELEMSET# *X, /* destroyed */ |
| 1223 | ELEMSETcxx . . $ ELEMSET# *Y /* destroyed */ |
| 1224 | ) |
| 1225 | { ELEMSETcxx . . $ ELEMSET# *Z; |
| 1226 | MEMBERcxx . . $ MEMBER# *memb; |
| 1227 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(X != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1228 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(X->type == A_NONEcxx . . $ `external/glpk/glpmpl.h:95:9`!); |
| 1229 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(X->dim > 0); |
| 1230 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(Y != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1231 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(Y->type == A_NONEcxx . . $ `external/glpk/glpmpl.h:95:9`!); |
| 1232 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(Y->dim > 0); |
| 1233 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(X->dim == Y->dim); |
| 1234 | /* Z := X \ Y */ |
| 1235 | Z = create_elemsetcxx . . $ `external/glpk/glpmpl.h:1070:9`!(mpl, X->dimcxx . . $ ARRAY#dim.); |
| 1236 | for (memb = X->headcxx . . $ ARRAY#head.; memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memb = memb->nextcxx . . $ MEMBER#next.) |
| 1237 | { if (find_tuplecxx . . $ `external/glpk/glpmpl.h:1074:9`!(mpl, Y, memb->tuplecxx . . $ MEMBER#tuple.) == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1238 | add_tuplecxx . . $ `external/glpk/glpmpl.h:1082:9`!(mpl, Z, copy_tuplecxx . . $ `external/glpk/glpmpl.h:1018:9`!(mpl, memb->tuplecxx . . $ MEMBER#tuple.)); |
| 1239 | } |
| 1240 | /* Z := Z U (Y \ X) */ |
| 1241 | for (memb = Y->headcxx . . $ ARRAY#head.; memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memb = memb->nextcxx . . $ MEMBER#next.) |
| 1242 | { if (find_tuplecxx . . $ `external/glpk/glpmpl.h:1074:9`!(mpl, X, memb->tuplecxx . . $ MEMBER#tuple.) == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1243 | add_tuplecxx . . $ `external/glpk/glpmpl.h:1082:9`!(mpl, Z, copy_tuplecxx . . $ `external/glpk/glpmpl.h:1018:9`!(mpl, memb->tuplecxx . . $ MEMBER#tuple.)); |
| 1244 | } |
| 1245 | delete_elemsetcxx . . $ `external/glpk/glpmpl.h:1105:9`!(mpl, X); |
| 1246 | delete_elemsetcxx . . $ `external/glpk/glpmpl.h:1105:9`!(mpl, Y); |
| 1247 | return Z; |
| 1248 | } |
| 1249 | |
| 1250 | /*---------------------------------------------------------------------- |
| 1251 | -- set_inter - intersection of two elemental sets. |
| 1252 | -- |
| 1253 | -- This routine computes the intersection: |
| 1254 | -- |
| 1255 | -- X ^ Y = { j | (j in X) and (j in Y) }, |
| 1256 | -- |
| 1257 | -- where X and Y are given elemental sets (destroyed on exit). */ |
| 1258 | |
| 1259 | ELEMSETcxx . . $ ELEMSET# *set_intercxx . . $ `external/glpk/glpmpl.h:1148:9`! |
| 1260 | ( MPLcxx . . $ MPL# *mpl, |
| 1261 | ELEMSETcxx . . $ ELEMSET# *X, /* destroyed */ |
| 1262 | ELEMSETcxx . . $ ELEMSET# *Y /* destroyed */ |
| 1263 | ) |
| 1264 | { ELEMSETcxx . . $ ELEMSET# *Z; |
| 1265 | MEMBERcxx . . $ MEMBER# *memb; |
| 1266 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(X != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1267 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(X->type == A_NONEcxx . . $ `external/glpk/glpmpl.h:95:9`!); |
| 1268 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(X->dim > 0); |
| 1269 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(Y != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1270 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(Y->type == A_NONEcxx . . $ `external/glpk/glpmpl.h:95:9`!); |
| 1271 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(Y->dim > 0); |
| 1272 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(X->dim == Y->dim); |
| 1273 | Z = create_elemsetcxx . . $ `external/glpk/glpmpl.h:1070:9`!(mpl, X->dimcxx . . $ ARRAY#dim.); |
| 1274 | for (memb = X->headcxx . . $ ARRAY#head.; memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memb = memb->nextcxx . . $ MEMBER#next.) |
| 1275 | { if (find_tuplecxx . . $ `external/glpk/glpmpl.h:1074:9`!(mpl, Y, memb->tuplecxx . . $ MEMBER#tuple.) != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1276 | add_tuplecxx . . $ `external/glpk/glpmpl.h:1082:9`!(mpl, Z, copy_tuplecxx . . $ `external/glpk/glpmpl.h:1018:9`!(mpl, memb->tuplecxx . . $ MEMBER#tuple.)); |
| 1277 | } |
| 1278 | delete_elemsetcxx . . $ `external/glpk/glpmpl.h:1105:9`!(mpl, X); |
| 1279 | delete_elemsetcxx . . $ `external/glpk/glpmpl.h:1105:9`!(mpl, Y); |
| 1280 | return Z; |
| 1281 | } |
| 1282 | |
| 1283 | /*---------------------------------------------------------------------- |
| 1284 | -- set_cross - cross (Cartesian) product of two elemental sets. |
| 1285 | -- |
| 1286 | -- This routine computes the cross (Cartesian) product: |
| 1287 | -- |
| 1288 | -- X x Y = { (i,j) | (i in X) and (j in Y) }, |
| 1289 | -- |
| 1290 | -- where X and Y are given elemental sets (destroyed on exit). */ |
| 1291 | |
| 1292 | ELEMSETcxx . . $ ELEMSET# *set_crosscxx . . $ `external/glpk/glpmpl.h:1156:9`! |
| 1293 | ( MPLcxx . . $ MPL# *mpl, |
| 1294 | ELEMSETcxx . . $ ELEMSET# *X, /* destroyed */ |
| 1295 | ELEMSETcxx . . $ ELEMSET# *Y /* destroyed */ |
| 1296 | ) |
| 1297 | { ELEMSETcxx . . $ ELEMSET# *Z; |
| 1298 | MEMBERcxx . . $ MEMBER# *memx, *memy; |
| 1299 | TUPLEcxx . . $ TUPLE# *tuple, *temp; |
| 1300 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(X != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1301 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(X->type == A_NONEcxx . . $ `external/glpk/glpmpl.h:95:9`!); |
| 1302 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(X->dim > 0); |
| 1303 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(Y != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1304 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(Y->type == A_NONEcxx . . $ `external/glpk/glpmpl.h:95:9`!); |
| 1305 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(Y->dim > 0); |
| 1306 | Z = create_elemsetcxx . . $ `external/glpk/glpmpl.h:1070:9`!(mpl, X->dimcxx . . $ ARRAY#dim. + Y->dimcxx . . $ ARRAY#dim.); |
| 1307 | for (memx = X->headcxx . . $ ARRAY#head.; memx != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memx = memx->nextcxx . . $ MEMBER#next.) |
| 1308 | { for (memy = Y->headcxx . . $ ARRAY#head.; memy != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memy = memy->nextcxx . . $ MEMBER#next.) |
| 1309 | { tuple = copy_tuplecxx . . $ `external/glpk/glpmpl.h:1018:9`!(mpl, memx->tuplecxx . . $ MEMBER#tuple.); |
| 1310 | for (temp = memy->tuplecxx . . $ MEMBER#tuple.; temp != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; temp = temp->nextcxx . . $ TUPLE#next.) |
| 1311 | tuple = expand_tuplecxx . . $ `external/glpk/glpmpl.h:1003:9`!(mpl, tuple, copy_symbolcxx . . $ `external/glpk/glpmpl.h:949:9`!(mpl, |
| 1312 | temp->symcxx . . $ TUPLE#sym.)); |
| 1313 | add_tuplecxx . . $ `external/glpk/glpmpl.h:1082:9`!(mpl, Z, tuple); |
| 1314 | } |
| 1315 | } |
| 1316 | delete_elemsetcxx . . $ `external/glpk/glpmpl.h:1105:9`!(mpl, X); |
| 1317 | delete_elemsetcxx . . $ `external/glpk/glpmpl.h:1105:9`!(mpl, Y); |
| 1318 | return Z; |
| 1319 | } |
| 1320 | |
| 1321 | /**********************************************************************/ |
| 1322 | /* * * ELEMENTAL VARIABLES * * */ |
| 1323 | /**********************************************************************/ |
| 1324 | |
| 1325 | /* (there are no specific routines for elemental variables) */ |
| 1326 | |
| 1327 | /**********************************************************************/ |
| 1328 | /* * * LINEAR FORMS * * */ |
| 1329 | /**********************************************************************/ |
| 1330 | |
| 1331 | /*---------------------------------------------------------------------- |
| 1332 | -- constant_term - create constant term. |
| 1333 | -- |
| 1334 | -- This routine creates the linear form, which is a constant term. */ |
| 1335 | |
| 1336 | FORMULAcxx . . $ FORMULA# *constant_termcxx . . $ `external/glpk/glpmpl.h:1209:9`!(MPLcxx . . $ MPL# *mpl, double coef) |
| 1337 | { FORMULAcxx . . $ FORMULA# *form; |
| 1338 | if (coef == 0.0) |
| 1339 | form = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1340 | else |
| 1341 | { form = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(mpl->formulaecxx . . $ MPL#formulae., sizeof(FORMULAcxx . . $ FORMULA#)); |
| 1342 | form->coefcxx . . $ FORMULA#coef. = coef; |
| 1343 | form->varcxx . . $ FORMULA#var. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1344 | form->nextcxx . . $ FORMULA#next. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1345 | } |
| 1346 | return form; |
| 1347 | } |
| 1348 | |
| 1349 | /*---------------------------------------------------------------------- |
| 1350 | -- single_variable - create single variable. |
| 1351 | -- |
| 1352 | -- This routine creates the linear form, which is a single elemental |
| 1353 | -- variable. */ |
| 1354 | |
| 1355 | FORMULAcxx . . $ FORMULA# *single_variablecxx . . $ `external/glpk/glpmpl.h:1213:9`! |
| 1356 | ( MPLcxx . . $ MPL# *mpl, |
| 1357 | ELEMVARcxx . . $ ELEMVAR# *var /* referenced */ |
| 1358 | ) |
| 1359 | { FORMULAcxx . . $ FORMULA# *form; |
| 1360 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(var != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1361 | form = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(mpl->formulaecxx . . $ MPL#formulae., sizeof(FORMULAcxx . . $ FORMULA#)); |
| 1362 | form->coefcxx . . $ FORMULA#coef. = 1.0; |
| 1363 | form->varcxx . . $ FORMULA#var. = var; |
| 1364 | form->nextcxx . . $ FORMULA#next. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1365 | return form; |
| 1366 | } |
| 1367 | |
| 1368 | /*---------------------------------------------------------------------- |
| 1369 | -- copy_formula - make copy of linear form. |
| 1370 | -- |
| 1371 | -- This routine returns an exact copy of linear form. */ |
| 1372 | |
| 1373 | FORMULAcxx . . $ FORMULA# *copy_formulacxx . . $ `external/glpk/glpmpl.h:1220:9`! |
| 1374 | ( MPLcxx . . $ MPL# *mpl, |
| 1375 | FORMULAcxx . . $ FORMULA# *form /* not changed */ |
| 1376 | ) |
| 1377 | { FORMULAcxx . . $ FORMULA# *head, *tail; |
| 1378 | if (form == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1379 | head = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1380 | else |
| 1381 | { head = tail = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(mpl->formulaecxx . . $ MPL#formulae., sizeof(FORMULAcxx . . $ FORMULA#)); |
| 1382 | for (; form != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; form = form->nextcxx . . $ FORMULA#next.) |
| 1383 | { tail->coefcxx . . $ FORMULA#coef. = form->coefcxx . . $ FORMULA#coef.; |
| 1384 | tail->varcxx . . $ FORMULA#var. = form->varcxx . . $ FORMULA#var.; |
| 1385 | if (form->nextcxx . . $ FORMULA#next. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1386 | tail = (tail->nextcxx . . $ FORMULA#next. = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(mpl->formulaecxx . . $ MPL#formulae., sizeof(FORMULAcxx . . $ FORMULA#))); |
| 1387 | } |
| 1388 | tail->nextcxx . . $ FORMULA#next. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1389 | } |
| 1390 | return head; |
| 1391 | } |
| 1392 | |
| 1393 | /*---------------------------------------------------------------------- |
| 1394 | -- delete_formula - delete linear form. |
| 1395 | -- |
| 1396 | -- This routine deletes specified linear form. */ |
| 1397 | |
| 1398 | void delete_formulacxx . . $ `external/glpk/glpmpl.h:1227:9`! |
| 1399 | ( MPLcxx . . $ MPL# *mpl, |
| 1400 | FORMULAcxx . . $ FORMULA# *form /* destroyed */ |
| 1401 | ) |
| 1402 | { FORMULAcxx . . $ FORMULA# *temp; |
| 1403 | while (form != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1404 | { temp = form; |
| 1405 | form = form->nextcxx . . $ FORMULA#next.; |
| 1406 | dmp_free_atomcxx . . $ `external/glpk/glpdmp.h:66:9`!(mpl->formulaecxx . . $ MPL#formulae., temp, sizeof(FORMULAcxx . . $ FORMULA#)); |
| 1407 | } |
| 1408 | return; |
| 1409 | } |
| 1410 | |
| 1411 | /*---------------------------------------------------------------------- |
| 1412 | -- linear_comb - linear combination of two linear forms. |
| 1413 | -- |
| 1414 | -- This routine computes the linear combination: |
| 1415 | -- |
| 1416 | -- a * fx + b * fy, |
| 1417 | -- |
| 1418 | -- where a and b are numeric coefficients, fx and fy are linear forms |
| 1419 | -- (destroyed on exit). */ |
| 1420 | |
| 1421 | FORMULAcxx . . $ FORMULA# *linear_combcxx . . $ `external/glpk/glpmpl.h:1234:9`! |
| 1422 | ( MPLcxx . . $ MPL# *mpl, |
| 1423 | double a, FORMULAcxx . . $ FORMULA# *fx, /* destroyed */ |
| 1424 | double b, FORMULAcxx . . $ FORMULA# *fy /* destroyed */ |
| 1425 | ) |
| 1426 | { FORMULAcxx . . $ FORMULA# *form = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!, *term, *temp; |
| 1427 | double c0 = 0.0; |
| 1428 | for (term = fx; term != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; term = term->nextcxx . . $ FORMULA#next.) |
| 1429 | { if (term->varcxx . . $ FORMULA#var. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1430 | c0 = fp_addcxx . . $ `external/glpk/glpmpl.h:773:9`!(mpl, c0, fp_mulcxx . . $ `external/glpk/glpmpl.h:785:9`!(mpl, a, term->coefcxx . . $ FORMULA#coef.)); |
| 1431 | else |
| 1432 | term->varcxx . . $ FORMULA#var.->tempcxx . . $ ELEMVAR#temp. = |
| 1433 | fp_addcxx . . $ `external/glpk/glpmpl.h:773:9`!(mpl, term->varcxx . . $ FORMULA#var.->tempcxx . . $ ELEMVAR#temp., fp_mulcxx . . $ `external/glpk/glpmpl.h:785:9`!(mpl, a, term->coefcxx . . $ FORMULA#coef.)); |
| 1434 | } |
| 1435 | for (term = fy; term != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; term = term->nextcxx . . $ FORMULA#next.) |
| 1436 | { if (term->varcxx . . $ FORMULA#var. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1437 | c0 = fp_addcxx . . $ `external/glpk/glpmpl.h:773:9`!(mpl, c0, fp_mulcxx . . $ `external/glpk/glpmpl.h:785:9`!(mpl, b, term->coefcxx . . $ FORMULA#coef.)); |
| 1438 | else |
| 1439 | term->varcxx . . $ FORMULA#var.->tempcxx . . $ ELEMVAR#temp. = |
| 1440 | fp_addcxx . . $ `external/glpk/glpmpl.h:773:9`!(mpl, term->varcxx . . $ FORMULA#var.->tempcxx . . $ ELEMVAR#temp., fp_mulcxx . . $ `external/glpk/glpmpl.h:785:9`!(mpl, b, term->coefcxx . . $ FORMULA#coef.)); |
| 1441 | } |
| 1442 | for (term = fx; term != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; term = term->nextcxx . . $ FORMULA#next.) |
| 1443 | { if (term->varcxx . . $ FORMULA#var. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! && term->varcxx . . $ FORMULA#var.->tempcxx . . $ ELEMVAR#temp. != 0.0) |
| 1444 | { temp = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(mpl->formulaecxx . . $ MPL#formulae., sizeof(FORMULAcxx . . $ FORMULA#)); |
| 1445 | temp->coefcxx . . $ FORMULA#coef. = term->varcxx . . $ FORMULA#var.->tempcxx . . $ ELEMVAR#temp., temp->varcxx . . $ FORMULA#var. = term->varcxx . . $ FORMULA#var.; |
| 1446 | temp->nextcxx . . $ FORMULA#next. = form, form = temp; |
| 1447 | term->varcxx . . $ FORMULA#var.->tempcxx . . $ ELEMVAR#temp. = 0.0; |
| 1448 | } |
| 1449 | } |
| 1450 | for (term = fy; term != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; term = term->nextcxx . . $ FORMULA#next.) |
| 1451 | { if (term->varcxx . . $ FORMULA#var. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! && term->varcxx . . $ FORMULA#var.->tempcxx . . $ ELEMVAR#temp. != 0.0) |
| 1452 | { temp = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(mpl->formulaecxx . . $ MPL#formulae., sizeof(FORMULAcxx . . $ FORMULA#)); |
| 1453 | temp->coefcxx . . $ FORMULA#coef. = term->varcxx . . $ FORMULA#var.->tempcxx . . $ ELEMVAR#temp., temp->varcxx . . $ FORMULA#var. = term->varcxx . . $ FORMULA#var.; |
| 1454 | temp->nextcxx . . $ FORMULA#next. = form, form = temp; |
| 1455 | term->varcxx . . $ FORMULA#var.->tempcxx . . $ ELEMVAR#temp. = 0.0; |
| 1456 | } |
| 1457 | } |
| 1458 | if (c0 != 0.0) |
| 1459 | { temp = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(mpl->formulaecxx . . $ MPL#formulae., sizeof(FORMULAcxx . . $ FORMULA#)); |
| 1460 | temp->coefcxx . . $ FORMULA#coef. = c0, temp->varcxx . . $ FORMULA#var. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1461 | temp->nextcxx . . $ FORMULA#next. = form, form = temp; |
| 1462 | } |
| 1463 | delete_formulacxx . . $ `external/glpk/glpmpl.h:1227:9`!(mpl, fx); |
| 1464 | delete_formulacxx . . $ `external/glpk/glpmpl.h:1227:9`!(mpl, fy); |
| 1465 | return form; |
| 1466 | } |
| 1467 | |
| 1468 | /*---------------------------------------------------------------------- |
| 1469 | -- remove_constant - remove constant term from linear form. |
| 1470 | -- |
| 1471 | -- This routine removes constant term from linear form and stores its |
| 1472 | -- value to given location. */ |
| 1473 | |
| 1474 | FORMULAcxx . . $ FORMULA# *remove_constantcxx . . $ `external/glpk/glpmpl.h:1242:9`! |
| 1475 | ( MPLcxx . . $ MPL# *mpl, |
| 1476 | FORMULAcxx . . $ FORMULA# *form, /* destroyed */ |
| 1477 | double *coef /* modified */ |
| 1478 | ) |
| 1479 | { FORMULAcxx . . $ FORMULA# *head = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!, *temp; |
| 1480 | *coef = 0.0; |
| 1481 | while (form != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1482 | { temp = form; |
| 1483 | form = form->nextcxx . . $ FORMULA#next.; |
| 1484 | if (temp->varcxx . . $ FORMULA#var. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1485 | { /* constant term */ |
| 1486 | *coef = fp_addcxx . . $ `external/glpk/glpmpl.h:773:9`!(mpl, *coef, temp->coefcxx . . $ FORMULA#coef.); |
| 1487 | dmp_free_atomcxx . . $ `external/glpk/glpdmp.h:66:9`!(mpl->formulaecxx . . $ MPL#formulae., temp, sizeof(FORMULAcxx . . $ FORMULA#)); |
| 1488 | } |
| 1489 | else |
| 1490 | { /* linear term */ |
| 1491 | temp->nextcxx . . $ FORMULA#next. = head; |
| 1492 | head = temp; |
| 1493 | } |
| 1494 | } |
| 1495 | return head; |
| 1496 | } |
| 1497 | |
| 1498 | /*---------------------------------------------------------------------- |
| 1499 | -- reduce_terms - reduce identical terms in linear form. |
| 1500 | -- |
| 1501 | -- This routine reduces identical terms in specified linear form. */ |
| 1502 | |
| 1503 | FORMULAcxx . . $ FORMULA# *reduce_termscxx . . $ `external/glpk/glpmpl.h:1250:9`! |
| 1504 | ( MPLcxx . . $ MPL# *mpl, |
| 1505 | FORMULAcxx . . $ FORMULA# *form /* destroyed */ |
| 1506 | ) |
| 1507 | { FORMULAcxx . . $ FORMULA# *term, *next_term; |
| 1508 | double c0 = 0.0; |
| 1509 | for (term = form; term != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; term = term->nextcxx . . $ FORMULA#next.) |
| 1510 | { if (term->varcxx . . $ FORMULA#var. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1511 | c0 = fp_addcxx . . $ `external/glpk/glpmpl.h:773:9`!(mpl, c0, term->coefcxx . . $ FORMULA#coef.); |
| 1512 | else |
| 1513 | term->varcxx . . $ FORMULA#var.->tempcxx . . $ ELEMVAR#temp. = fp_addcxx . . $ `external/glpk/glpmpl.h:773:9`!(mpl, term->varcxx . . $ FORMULA#var.->tempcxx . . $ ELEMVAR#temp., term->coefcxx . . $ FORMULA#coef.); |
| 1514 | } |
| 1515 | next_term = form, form = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1516 | for (term = next_term; term != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; term = next_term) |
| 1517 | { next_term = term->nextcxx . . $ FORMULA#next.; |
| 1518 | if (term->varcxx . . $ FORMULA#var. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! && c0 != 0.0) |
| 1519 | { term->coefcxx . . $ FORMULA#coef. = c0, c0 = 0.0; |
| 1520 | term->nextcxx . . $ FORMULA#next. = form, form = term; |
| 1521 | } |
| 1522 | else if (term->varcxx . . $ FORMULA#var. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! && term->varcxx . . $ FORMULA#var.->tempcxx . . $ ELEMVAR#temp. != 0.0) |
| 1523 | { term->coefcxx . . $ FORMULA#coef. = term->varcxx . . $ FORMULA#var.->tempcxx . . $ ELEMVAR#temp., term->varcxx . . $ FORMULA#var.->tempcxx . . $ ELEMVAR#temp. = 0.0; |
| 1524 | term->nextcxx . . $ FORMULA#next. = form, form = term; |
| 1525 | } |
| 1526 | else |
| 1527 | dmp_free_atomcxx . . $ `external/glpk/glpdmp.h:66:9`!(mpl->formulaecxx . . $ MPL#formulae., term, sizeof(FORMULAcxx . . $ FORMULA#)); |
| 1528 | } |
| 1529 | return form; |
| 1530 | } |
| 1531 | |
| 1532 | /**********************************************************************/ |
| 1533 | /* * * ELEMENTAL CONSTRAINTS * * */ |
| 1534 | /**********************************************************************/ |
| 1535 | |
| 1536 | /* (there are no specific routines for elemental constraints) */ |
| 1537 | |
| 1538 | /**********************************************************************/ |
| 1539 | /* * * GENERIC VALUES * * */ |
| 1540 | /**********************************************************************/ |
| 1541 | |
| 1542 | /*---------------------------------------------------------------------- |
| 1543 | -- delete_value - delete generic value. |
| 1544 | -- |
| 1545 | -- This routine deletes specified generic value. |
| 1546 | -- |
| 1547 | -- NOTE: The generic value to be deleted must be valid. */ |
| 1548 | |
| 1549 | void delete_valuecxx . . $ `external/glpk/glpmpl.h:1314:9`! |
| 1550 | ( MPLcxx . . $ MPL# *mpl, |
| 1551 | int type, |
| 1552 | VALUEcxx . . $ VALUE# *value /* content destroyed */ |
| 1553 | ) |
| 1554 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(value != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1555 | switch (type) |
| 1556 | { case A_NONEcxx . . $ `external/glpk/glpmpl.h:95:9`!: |
| 1557 | value->nonecxx . . $ VALUE#none. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1558 | break; |
| 1559 | case A_NUMERICcxx . . $ `external/glpk/glpmpl.h:96:9`!: |
| 1560 | value->numcxx . . $ VALUE#num. = 0.0; |
| 1561 | break; |
| 1562 | case A_SYMBOLICcxx . . $ `external/glpk/glpmpl.h:102:9`!: |
| 1563 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, value->symcxx . . $ VALUE#sym.), value->symcxx . . $ VALUE#sym. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1564 | break; |
| 1565 | case A_LOGICALcxx . . $ `external/glpk/glpmpl.h:92:9`!: |
| 1566 | value->bitcxx . . $ VALUE#bit. = 0; |
| 1567 | break; |
| 1568 | case A_TUPLEcxx . . $ `external/glpk/glpmpl.h:104:9`!: |
| 1569 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, value->tuplecxx . . $ VALUE#tuple.), value->tuplecxx . . $ VALUE#tuple. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1570 | break; |
| 1571 | case A_ELEMSETcxx . . $ `external/glpk/glpmpl.h:84:9`!: |
| 1572 | delete_elemsetcxx . . $ `external/glpk/glpmpl.h:1105:9`!(mpl, value->setcxx . . $ VALUE#set.), value->setcxx . . $ VALUE#set. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1573 | break; |
| 1574 | case A_ELEMVARcxx . . $ `external/glpk/glpmpl.h:85:9`!: |
| 1575 | value->varcxx . . $ VALUE#var. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1576 | break; |
| 1577 | case A_FORMULAcxx . . $ `external/glpk/glpmpl.h:88:9`!: |
| 1578 | delete_formulacxx . . $ `external/glpk/glpmpl.h:1227:9`!(mpl, value->formcxx . . $ VALUE#form.), value->formcxx . . $ VALUE#form. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1579 | break; |
| 1580 | case A_ELEMCONcxx . . $ `external/glpk/glpmpl.h:83:9`!: |
| 1581 | value->concxx . . $ VALUE#con. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1582 | break; |
| 1583 | default: |
| 1584 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(type != type); |
| 1585 | } |
| 1586 | return; |
| 1587 | } |
| 1588 | |
| 1589 | /**********************************************************************/ |
| 1590 | /* * * SYMBOLICALLY INDEXED ARRAYS * * */ |
| 1591 | /**********************************************************************/ |
| 1592 | |
| 1593 | /*---------------------------------------------------------------------- |
| 1594 | -- create_array - create array. |
| 1595 | -- |
| 1596 | -- This routine creates an array of specified type and dimension. Being |
| 1597 | -- created the array is initially empty. |
| 1598 | -- |
| 1599 | -- The type indicator determines generic values, which can be assigned |
| 1600 | -- to the array members: |
| 1601 | -- |
| 1602 | -- A_NONE - none (members have no assigned values) |
| 1603 | -- A_NUMERIC - floating-point numbers |
| 1604 | -- A_SYMBOLIC - symbols |
| 1605 | -- A_ELEMSET - elemental sets |
| 1606 | -- A_ELEMVAR - elemental variables |
| 1607 | -- A_ELEMCON - elemental constraints |
| 1608 | -- |
| 1609 | -- The dimension may be 0, in which case the array consists of the only |
| 1610 | -- member (such arrays represent 0-dimensional objects). */ |
| 1611 | |
| 1612 | ARRAYcxx . . $ ARRAY# *create_arraycxx . . $ `external/glpk/glpmpl.h:1372:9`!(MPLcxx . . $ MPL# *mpl, int type, int dim) |
| 1613 | { ARRAYcxx . . $ ARRAY# *array; |
| 1614 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(type == A_NONEcxx . . $ `external/glpk/glpmpl.h:95:9`! || type == A_NUMERICcxx . . $ `external/glpk/glpmpl.h:96:9`! || |
| 1615 | type == A_SYMBOLICcxx . . $ `external/glpk/glpmpl.h:102:9`! || type == A_ELEMSETcxx . . $ `external/glpk/glpmpl.h:84:9`! || |
| 1616 | type == A_ELEMVARcxx . . $ `external/glpk/glpmpl.h:85:9`! || type == A_ELEMCONcxx . . $ `external/glpk/glpmpl.h:83:9`!); |
| 1617 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(dim >= 0); |
| 1618 | array = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(mpl->arrayscxx . . $ MPL#arrays., sizeof(ARRAYcxx . . $ ARRAY#)); |
| 1619 | array->typecxx . . $ ARRAY#type. = type; |
| 1620 | array->dimcxx . . $ ARRAY#dim. = dim; |
| 1621 | array->sizecxx . . $ ARRAY#size. = 0; |
| 1622 | array->headcxx . . $ ARRAY#head. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1623 | array->tailcxx . . $ ARRAY#tail. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1624 | array->treecxx . . $ ARRAY#tree. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1625 | array->prevcxx . . $ ARRAY#prev. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1626 | array->nextcxx . . $ ARRAY#next. = mpl->a_listcxx . . $ MPL#a_list.; |
| 1627 | /* include the array in the global array list */ |
| 1628 | if (array->nextcxx . . $ ARRAY#next. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) array->nextcxx . . $ ARRAY#next.->prevcxx . . $ ARRAY#prev. = array; |
| 1629 | mpl->a_listcxx . . $ MPL#a_list. = array; |
| 1630 | return array; |
| 1631 | } |
| 1632 | |
| 1633 | /*---------------------------------------------------------------------- |
| 1634 | -- find_member - find array member with given n-tuple. |
| 1635 | -- |
| 1636 | -- This routine finds an array member, which has given n-tuple. If the |
| 1637 | -- array is short, the linear search is used. Otherwise the routine |
| 1638 | -- autimatically creates the search tree (i.e. the array index) to find |
| 1639 | -- members for logarithmic time. */ |
| 1640 | |
| 1641 | static int compare_member_tuplescxx . . $ compare_member_tuples(bb450b5af0e1c138).(void *info, const void *key1, |
| 1642 | const void *key2) |
| 1643 | { /* this is an auxiliary routine used to compare keys, which are |
| 1644 | n-tuples assigned to array members */ |
| 1645 | return compare_tuplescxx . . $ `external/glpk/glpmpl.h:1025:9`!((MPLcxx . . $ MPL# *)info, (TUPLEcxx . . $ TUPLE# *)key1, (TUPLEcxx . . $ TUPLE# *)key2); |
| 1646 | } |
| 1647 | |
| 1648 | MEMBERcxx . . $ MEMBER# *find_membercxx . . $ `external/glpk/glpmpl.h:1376:9`! |
| 1649 | ( MPLcxx . . $ MPL# *mpl, |
| 1650 | ARRAYcxx . . $ ARRAY# *array, /* not changed */ |
| 1651 | TUPLEcxx . . $ TUPLE# *tuple /* not changed */ |
| 1652 | ) |
| 1653 | { MEMBERcxx . . $ MEMBER# *memb; |
| 1654 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(array != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1655 | /* the n-tuple must have the same dimension as the array */ |
| 1656 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(tuple_dimencxx . . $ `external/glpk/glpmpl.h:1011:9`!(mpl, tuple) == array->dim); |
| 1657 | /* if the array is large enough, create the search tree and index |
| 1658 | all existing members of the array */ |
| 1659 | if (array->sizecxx . . $ ARRAY#size. > 30 && array->treecxx . . $ ARRAY#tree. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1660 | { array->treecxx . . $ ARRAY#tree. = avl_create_treecxx . . $ `external/glpk/glpavl.h:80:9`!(compare_member_tuplescxx . . $ compare_member_tuples(bb450b5af0e1c138)., mpl); |
| 1661 | for (memb = array->headcxx . . $ ARRAY#head.; memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memb = memb->nextcxx . . $ MEMBER#next.) |
| 1662 | avl_set_node_linkcxx . . $ `external/glpk/glpavl.h:97:9`!(avl_insert_nodecxx . . $ `external/glpk/glpavl.h:89:9`!(array->treecxx . . $ ARRAY#tree., memb->tuplecxx . . $ MEMBER#tuple.), |
| 1663 | (void *)memb); |
| 1664 | } |
| 1665 | /* find a member, which has the given tuple */ |
| 1666 | if (array->treecxx . . $ ARRAY#tree. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1667 | { /* the search tree doesn't exist; use the linear search */ |
| 1668 | for (memb = array->headcxx . . $ ARRAY#head.; memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memb = memb->nextcxx . . $ MEMBER#next.) |
| 1669 | if (compare_tuplescxx . . $ `external/glpk/glpmpl.h:1025:9`!(mpl, memb->tuplecxx . . $ MEMBER#tuple., tuple) == 0) break; |
| 1670 | } |
| 1671 | else |
| 1672 | { /* the search tree exists; use the binary search */ |
| 1673 | AVLNODEcxx . . $ AVLNODE# *node; |
| 1674 | node = avl_find_nodecxx . . $ `external/glpk/glpavl.h:101:9`!(array->treecxx . . $ ARRAY#tree., tuple); |
| 1675 | memb = (MEMBERcxx . . $ MEMBER# *)(node == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! ? NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! : avl_get_node_linkcxx . . $ `external/glpk/glpavl.h:109:9`!(node)); |
| 1676 | } |
| 1677 | return memb; |
| 1678 | } |
| 1679 | |
| 1680 | /*---------------------------------------------------------------------- |
| 1681 | -- add_member - add new member to array. |
| 1682 | -- |
| 1683 | -- This routine creates a new member with given n-tuple and adds it to |
| 1684 | -- specified array. |
| 1685 | -- |
| 1686 | -- For the sake of efficiency this routine doesn't check whether the |
| 1687 | -- array already contains a member with the given n-tuple or not. Thus, |
| 1688 | -- if necessary, the calling program should use the routine find_member |
| 1689 | -- in order to be sure that the array contains no member with the same |
| 1690 | -- n-tuple, because members with duplicate n-tuples are not allowed. |
| 1691 | -- |
| 1692 | -- This routine assigns no generic value to the new member, because the |
| 1693 | -- calling program must do that. */ |
| 1694 | |
| 1695 | MEMBERcxx . . $ MEMBER# *add_membercxx . . $ `external/glpk/glpmpl.h:1384:9`! |
| 1696 | ( MPLcxx . . $ MPL# *mpl, |
| 1697 | ARRAYcxx . . $ ARRAY# *array, /* modified */ |
| 1698 | TUPLEcxx . . $ TUPLE# *tuple /* destroyed */ |
| 1699 | ) |
| 1700 | { MEMBERcxx . . $ MEMBER# *memb; |
| 1701 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(array != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1702 | /* the n-tuple must have the same dimension as the array */ |
| 1703 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(tuple_dimencxx . . $ `external/glpk/glpmpl.h:1011:9`!(mpl, tuple) == array->dim); |
| 1704 | /* create new member */ |
| 1705 | memb = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(mpl->memberscxx . . $ MPL#members., sizeof(MEMBERcxx . . $ MEMBER#)); |
| 1706 | memb->tuplecxx . . $ MEMBER#tuple. = tuple; |
| 1707 | memb->nextcxx . . $ MEMBER#next. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1708 | memsetcxx . . $ memset(d1de1e4fb215f1c6).(&memb->valuecxx . . $ MEMBER#value., '?', sizeof(VALUEcxx . . $ VALUE#)); |
| 1709 | /* and append it to the member list */ |
| 1710 | array->sizecxx . . $ ARRAY#size.++; |
| 1711 | if (array->headcxx . . $ ARRAY#head. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1712 | array->headcxx . . $ ARRAY#head. = memb; |
| 1713 | else |
| 1714 | array->tailcxx . . $ ARRAY#tail.->nextcxx . . $ MEMBER#next. = memb; |
| 1715 | array->tailcxx . . $ ARRAY#tail. = memb; |
| 1716 | /* if the search tree exists, index the new member */ |
| 1717 | if (array->treecxx . . $ ARRAY#tree. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1718 | avl_set_node_linkcxx . . $ `external/glpk/glpavl.h:97:9`!(avl_insert_nodecxx . . $ `external/glpk/glpavl.h:89:9`!(array->treecxx . . $ ARRAY#tree., memb->tuplecxx . . $ MEMBER#tuple.), |
| 1719 | (void *)memb); |
| 1720 | return memb; |
| 1721 | } |
| 1722 | |
| 1723 | /*---------------------------------------------------------------------- |
| 1724 | -- delete_array - delete array. |
| 1725 | -- |
| 1726 | -- This routine deletes specified array. |
| 1727 | -- |
| 1728 | -- Generic values assigned to the array members are not deleted by this |
| 1729 | -- routine. The calling program itself must delete all assigned generic |
| 1730 | -- values before deleting the array. */ |
| 1731 | |
| 1732 | void delete_arraycxx . . $ `external/glpk/glpmpl.h:1392:9`! |
| 1733 | ( MPLcxx . . $ MPL# *mpl, |
| 1734 | ARRAYcxx . . $ ARRAY# *array /* destroyed */ |
| 1735 | ) |
| 1736 | { MEMBERcxx . . $ MEMBER# *memb; |
| 1737 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(array != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1738 | /* delete all existing array members */ |
| 1739 | while (array->headcxx . . $ ARRAY#head. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1740 | { memb = array->headcxx . . $ ARRAY#head.; |
| 1741 | array->headcxx . . $ ARRAY#head. = memb->nextcxx . . $ MEMBER#next.; |
| 1742 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, memb->tuplecxx . . $ MEMBER#tuple.); |
| 1743 | dmp_free_atomcxx . . $ `external/glpk/glpdmp.h:66:9`!(mpl->memberscxx . . $ MPL#members., memb, sizeof(MEMBERcxx . . $ MEMBER#)); |
| 1744 | } |
| 1745 | /* if the search tree exists, also delete it */ |
| 1746 | if (array->treecxx . . $ ARRAY#tree. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) avl_delete_treecxx . . $ `external/glpk/glpavl.h:117:9`!(array->treecxx . . $ ARRAY#tree.); |
| 1747 | /* remove the array from the global array list */ |
| 1748 | if (array->prevcxx . . $ ARRAY#prev. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1749 | mpl->a_listcxx . . $ MPL#a_list. = array->nextcxx . . $ ARRAY#next.; |
| 1750 | else |
| 1751 | array->prevcxx . . $ ARRAY#prev.->nextcxx . . $ ARRAY#next. = array->nextcxx . . $ ARRAY#next.; |
| 1752 | if (array->nextcxx . . $ ARRAY#next. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1753 | ; |
| 1754 | else |
| 1755 | array->nextcxx . . $ ARRAY#next.->prevcxx . . $ ARRAY#prev. = array->prevcxx . . $ ARRAY#prev.; |
| 1756 | /* delete the array descriptor */ |
| 1757 | dmp_free_atomcxx . . $ `external/glpk/glpdmp.h:66:9`!(mpl->arrayscxx . . $ MPL#arrays., array, sizeof(ARRAYcxx . . $ ARRAY#)); |
| 1758 | return; |
| 1759 | } |
| 1760 | |
| 1761 | /**********************************************************************/ |
| 1762 | /* * * DOMAINS AND DUMMY INDICES * * */ |
| 1763 | /**********************************************************************/ |
| 1764 | |
| 1765 | /*---------------------------------------------------------------------- |
| 1766 | -- assign_dummy_index - assign new value to dummy index. |
| 1767 | -- |
| 1768 | -- This routine assigns new value to specified dummy index and, that is |
| 1769 | -- important, invalidates all temporary resultant values, which depends |
| 1770 | -- on that dummy index. */ |
| 1771 | |
| 1772 | void assign_dummy_indexcxx . . $ `external/glpk/glpmpl.h:1460:9`! |
| 1773 | ( MPLcxx . . $ MPL# *mpl, |
| 1774 | DOMAIN_SLOTcxx . . $ DOMAIN_SLOT# *slot, /* modified */ |
| 1775 | SYMBOLcxx . . $ SYMBOL# *value /* not changed */ |
| 1776 | ) |
| 1777 | { CODEcxx . . $ CODE# *leaf, *code; |
| 1778 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(slot != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1779 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(value != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1780 | /* delete the current value assigned to the dummy index */ |
| 1781 | if (slot->valuecxx . . $ DOMAIN_SLOT#value. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1782 | { /* if the current value and the new one are identical, actual |
| 1783 | assignment is not needed */ |
| 1784 | if (compare_symbolscxx . . $ `external/glpk/glpmpl.h:956:9`!(mpl, slot->valuecxx . . $ DOMAIN_SLOT#value., value) == 0) goto done; |
| 1785 | /* delete a symbol, which is the current value */ |
| 1786 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, slot->valuecxx . . $ DOMAIN_SLOT#value.), slot->valuecxx . . $ DOMAIN_SLOT#value. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1787 | } |
| 1788 | /* now walk through all the pseudo-codes with op = O_INDEX, which |
| 1789 | refer to the dummy index to be changed (these pseudo-codes are |
| 1790 | leaves in the forest of *all* expressions in the database) */ |
| 1791 | for (leaf = slot->listcxx . . $ DOMAIN_SLOT#list.; leaf != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; leaf = leaf->argcxx . . $ CODE#arg..indexcxx . . $ OPERANDS#index.. |
| 1792 | nextcxx . . $ OPERANDS#$anonymous_type_3#next.) |
| 1793 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(leaf->op == O_INDEXcxx . . $ `external/glpk/glpmpl.h:2077:9`!); |
| 1794 | /* invalidate all resultant values, which depend on the dummy |
| 1795 | index, walking from the current leaf toward the root of the |
| 1796 | corresponding expression tree */ |
| 1797 | for (code = leaf; code != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; code = code->upcxx . . $ CODE#up.) |
| 1798 | { if (code->validcxx . . $ CODE#valid.) |
| 1799 | { /* invalidate and delete resultant value */ |
| 1800 | code->validcxx . . $ CODE#valid. = 0; |
| 1801 | delete_valuecxx . . $ `external/glpk/glpmpl.h:1314:9`!(mpl, code->typecxx . . $ CODE#type., &code->valuecxx . . $ CODE#value.); |
| 1802 | } |
| 1803 | } |
| 1804 | } |
| 1805 | /* assign new value to the dummy index */ |
| 1806 | slot->valuecxx . . $ DOMAIN_SLOT#value. = copy_symbolcxx . . $ `external/glpk/glpmpl.h:949:9`!(mpl, value); |
| 1807 | done: return; |
| 1808 | } |
| 1809 | |
| 1810 | /*---------------------------------------------------------------------- |
| 1811 | -- update_dummy_indices - update current values of dummy indices. |
| 1812 | -- |
| 1813 | -- This routine assigns components of "backup" n-tuple to dummy indices |
| 1814 | -- of specified domain block. If no "backup" n-tuple is defined for the |
| 1815 | -- domain block, values of the dummy indices remain untouched. */ |
| 1816 | |
| 1817 | void update_dummy_indicescxx . . $ `external/glpk/glpmpl.h:1468:9`! |
| 1818 | ( MPLcxx . . $ MPL# *mpl, |
| 1819 | DOMAIN_BLOCKcxx . . $ DOMAIN_BLOCK# *block /* not changed */ |
| 1820 | ) |
| 1821 | { DOMAIN_SLOTcxx . . $ DOMAIN_SLOT# *slot; |
| 1822 | TUPLEcxx . . $ TUPLE# *temp; |
| 1823 | if (block->backupcxx . . $ DOMAIN_BLOCK#backup. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1824 | { for (slot = block->listcxx . . $ DOMAIN_BLOCK#list., temp = block->backupcxx . . $ DOMAIN_BLOCK#backup.; slot != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1825 | slot = slot->nextcxx . . $ DOMAIN_SLOT#next., temp = temp->nextcxx . . $ TUPLE#next.) |
| 1826 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(temp != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1827 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(temp->sym != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1828 | assign_dummy_indexcxx . . $ `external/glpk/glpmpl.h:1460:9`!(mpl, slot, temp->symcxx . . $ TUPLE#sym.); |
| 1829 | } |
| 1830 | } |
| 1831 | return; |
| 1832 | } |
| 1833 | |
| 1834 | /*---------------------------------------------------------------------- |
| 1835 | -- enter_domain_block - enter domain block. |
| 1836 | -- |
| 1837 | -- Let specified domain block have the form: |
| 1838 | -- |
| 1839 | -- { ..., (j1, j2, ..., jn) in J, ... } |
| 1840 | -- |
| 1841 | -- where j1, j2, ..., jn are dummy indices, J is a basic set. |
| 1842 | -- |
| 1843 | -- This routine does the following: |
| 1844 | -- |
| 1845 | -- 1. Checks if the given n-tuple is a member of the basic set J. Note |
| 1846 | -- that J being *out of the scope* of the domain block cannot depend |
| 1847 | -- on the dummy indices in the same and inner domain blocks, so it |
| 1848 | -- can be computed before the dummy indices are assigned new values. |
| 1849 | -- If this check fails, the routine returns with non-zero code. |
| 1850 | -- |
| 1851 | -- 2. Saves current values of the dummy indices j1, j2, ..., jn. |
| 1852 | -- |
| 1853 | -- 3. Assigns new values, which are components of the given n-tuple, to |
| 1854 | -- the dummy indices j1, j2, ..., jn. If dimension of the n-tuple is |
| 1855 | -- larger than n, its extra components n+1, n+2, ... are not used. |
| 1856 | -- |
| 1857 | -- 4. Calls the formal routine func which either enters the next domain |
| 1858 | -- block or evaluates some code within the domain scope. |
| 1859 | -- |
| 1860 | -- 5. Restores former values of the dummy indices j1, j2, ..., jn. |
| 1861 | -- |
| 1862 | -- Since current values assigned to the dummy indices on entry to this |
| 1863 | -- routine are restored on exit, the formal routine func is allowed to |
| 1864 | -- call this routine recursively. */ |
| 1865 | |
| 1866 | int enter_domain_blockcxx . . $ `external/glpk/glpmpl.h:1475:9`! |
| 1867 | ( MPLcxx . . $ MPL# *mpl, |
| 1868 | DOMAIN_BLOCKcxx . . $ DOMAIN_BLOCK# *block, /* not changed */ |
| 1869 | TUPLEcxx . . $ TUPLE# *tuple, /* not changed */ |
| 1870 | void *info, void (*func)(MPLcxx . . $ MPL# *mpl, void *info) |
| 1871 | ) |
| 1872 | { TUPLEcxx . . $ TUPLE# *backup; |
| 1873 | int ret = 0; |
| 1874 | /* check if the given n-tuple is a member of the basic set */ |
| 1875 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(block->code != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1876 | if (!is_membercxx . . $ `external/glpk/glpmpl.h:2230:9`!(mpl, block->codecxx . . $ DOMAIN_BLOCK#code., tuple)) |
| 1877 | { ret = 1; |
| 1878 | goto done; |
| 1879 | } |
| 1880 | /* save reference to "backup" n-tuple, which was used to assign |
| 1881 | current values of the dummy indices (it is sufficient to save |
| 1882 | reference, not value, because that n-tuple is defined in some |
| 1883 | outer level of recursion and therefore cannot be changed on |
| 1884 | this and deeper recursive calls) */ |
| 1885 | backup = block->backupcxx . . $ DOMAIN_BLOCK#backup.; |
| 1886 | /* set up new "backup" n-tuple, which defines new values of the |
| 1887 | dummy indices */ |
| 1888 | block->backupcxx . . $ DOMAIN_BLOCK#backup. = tuple; |
| 1889 | /* assign new values to the dummy indices */ |
| 1890 | update_dummy_indicescxx . . $ `external/glpk/glpmpl.h:1468:9`!(mpl, block); |
| 1891 | /* call the formal routine that does the rest part of the job */ |
| 1892 | func(mpl, info); |
| 1893 | /* restore reference to the former "backup" n-tuple */ |
| 1894 | block->backupcxx . . $ DOMAIN_BLOCK#backup. = backup; |
| 1895 | /* restore former values of the dummy indices; note that if the |
| 1896 | domain block just escaped has no other active instances which |
| 1897 | may exist due to recursion (it is indicated by a null pointer |
| 1898 | to the former n-tuple), former values of the dummy indices are |
| 1899 | undefined; therefore in this case the routine keeps currently |
| 1900 | assigned values of the dummy indices that involves keeping all |
| 1901 | dependent temporary results and thereby, if this domain block |
| 1902 | is not used recursively, allows improving efficiency */ |
| 1903 | update_dummy_indicescxx . . $ `external/glpk/glpmpl.h:1468:9`!(mpl, block); |
| 1904 | done: return ret; |
| 1905 | } |
| 1906 | |
| 1907 | /*---------------------------------------------------------------------- |
| 1908 | -- eval_within_domain - perform evaluation within domain scope. |
| 1909 | -- |
| 1910 | -- This routine assigns new values (symbols) to all dummy indices of |
| 1911 | -- specified domain and calls the formal routine func, which is used to |
| 1912 | -- evaluate some code in the domain scope. Each free dummy index in the |
| 1913 | -- domain is assigned a value specified in the corresponding component |
| 1914 | -- of given n-tuple. Non-free dummy indices are assigned values, which |
| 1915 | -- are computed by this routine. |
| 1916 | -- |
| 1917 | -- Number of components in the given n-tuple must be the same as number |
| 1918 | -- of free indices in the domain. |
| 1919 | -- |
| 1920 | -- If the given n-tuple is not a member of the domain set, the routine |
| 1921 | -- func is not called, and non-zero code is returned. |
| 1922 | -- |
| 1923 | -- For the sake of convenience it is allowed to specify domain as NULL |
| 1924 | -- (then n-tuple also must be 0-tuple, i.e. empty), in which case this |
| 1925 | -- routine just calls the routine func and returns zero. |
| 1926 | -- |
| 1927 | -- This routine allows recursive calls from the routine func providing |
| 1928 | -- correct values of dummy indices for each instance. |
| 1929 | -- |
| 1930 | -- NOTE: The n-tuple passed to this routine must not be changed by any |
| 1931 | -- other routines called from the formal routine func until this |
| 1932 | -- routine has returned. */ |
| 1933 | |
| 1934 | struct eval_domain_infocxx . . $ eval_domain_info# |
| 1935 | { /* working info used by the routine eval_within_domain */ |
| 1936 | DOMAINcxx . . $ `external/glpk/glpmpl.h:45:9`! *domaincxx . . $ eval_domain_info#domain.; |
| 1937 | /* domain, which has to be entered */ |
| 1938 | DOMAIN_BLOCKcxx . . $ DOMAIN_BLOCK# *blockcxx . . $ eval_domain_info#block.; |
| 1939 | /* domain block, which is currently processed */ |
| 1940 | TUPLEcxx . . $ TUPLE# *tuplecxx . . $ eval_domain_info#tuple.; |
| 1941 | /* tail of original n-tuple, whose components have to be assigned |
| 1942 | to free dummy indices in the current domain block */ |
| 1943 | void *infocxx . . $ eval_domain_info#info.; |
| 1944 | /* transit pointer passed to the formal routine func */ |
| 1945 | void (*funccxx . . $ eval_domain_info#func.)(MPLcxx . . $ MPL# *mpl, void *info); |
| 1946 | /* routine, which has to be executed in the domain scope */ |
| 1947 | int failurecxx . . $ eval_domain_info#failure.; |
| 1948 | /* this flag indicates that given n-tuple is not a member of the |
| 1949 | domain set */ |
| 1950 | }; |
| 1951 | |
| 1952 | static void eval_domain_funccxx . . $ eval_domain_func(55b428b8c674eeb1).(MPLcxx . . $ MPL# *mpl, void *_my_info) |
| 1953 | { /* this routine recursively enters into the domain scope and then |
| 1954 | calls the routine func */ |
| 1955 | struct eval_domain_infocxx . . $ eval_domain_info# *my_info = _my_info; |
| 1956 | if (my_info->blockcxx . . $ eval_domain_info#block. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1957 | { /* the current domain block to be entered exists */ |
| 1958 | DOMAIN_BLOCKcxx . . $ DOMAIN_BLOCK# *block; |
| 1959 | DOMAIN_SLOTcxx . . $ DOMAIN_SLOT# *slot; |
| 1960 | TUPLEcxx . . $ TUPLE# *tuple = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!, *temp = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1961 | /* save pointer to the current domain block */ |
| 1962 | block = my_info->blockcxx . . $ eval_domain_info#block.; |
| 1963 | /* and get ready to enter the next block (if it exists) */ |
| 1964 | my_info->blockcxx . . $ eval_domain_info#block. = block->nextcxx . . $ DOMAIN_BLOCK#next.; |
| 1965 | /* construct temporary n-tuple, whose components correspond to |
| 1966 | dummy indices (slots) of the current domain; components of |
| 1967 | the temporary n-tuple that correspond to free dummy indices |
| 1968 | are assigned references (not values!) to symbols specified |
| 1969 | in the corresponding components of the given n-tuple, while |
| 1970 | other components that correspond to non-free dummy indices |
| 1971 | are assigned symbolic values computed here */ |
| 1972 | for (slot = block->listcxx . . $ DOMAIN_BLOCK#list.; slot != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; slot = slot->nextcxx . . $ DOMAIN_SLOT#next.) |
| 1973 | { /* create component that corresponds to the current slot */ |
| 1974 | if (tuple == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1975 | tuple = temp = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(mpl->tuplescxx . . $ MPL#tuples., sizeof(TUPLEcxx . . $ TUPLE#)); |
| 1976 | else |
| 1977 | temp = (temp->nextcxx . . $ TUPLE#next. = dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(mpl->tuplescxx . . $ MPL#tuples., sizeof(TUPLEcxx . . $ TUPLE#))); |
| 1978 | if (slot->codecxx . . $ DOMAIN_SLOT#code. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 1979 | { /* dummy index is free; take reference to symbol, which |
| 1980 | is specified in the corresponding component of given |
| 1981 | n-tuple */ |
| 1982 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(my_info->tuple != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1983 | temp->symcxx . . $ TUPLE#sym. = my_info->tuplecxx . . $ eval_domain_info#tuple.->symcxx . . $ TUPLE#sym.; |
| 1984 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(temp->sym != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 1985 | my_info->tuplecxx . . $ eval_domain_info#tuple. = my_info->tuplecxx . . $ eval_domain_info#tuple.->nextcxx . . $ TUPLE#next.; |
| 1986 | } |
| 1987 | else |
| 1988 | { /* dummy index is non-free; compute symbolic value to be |
| 1989 | temporarily assigned to the dummy index */ |
| 1990 | temp->symcxx . . $ TUPLE#sym. = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, slot->codecxx . . $ DOMAIN_SLOT#code.); |
| 1991 | } |
| 1992 | } |
| 1993 | temp->nextcxx . . $ TUPLE#next. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 1994 | /* enter the current domain block */ |
| 1995 | if (enter_domain_blockcxx . . $ `external/glpk/glpmpl.h:1475:9`!(mpl, block, tuple, my_info, |
| 1996 | eval_domain_funccxx . . $ eval_domain_func(55b428b8c674eeb1).)) my_info->failurecxx . . $ eval_domain_info#failure. = 1; |
| 1997 | /* delete temporary n-tuple as well as symbols that correspond |
| 1998 | to non-free dummy indices (they were computed here) */ |
| 1999 | for (slot = block->listcxx . . $ DOMAIN_BLOCK#list.; slot != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; slot = slot->nextcxx . . $ DOMAIN_SLOT#next.) |
| 2000 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(tuple != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 2001 | temp = tuple; |
| 2002 | tuple = tuple->nextcxx . . $ TUPLE#next.; |
| 2003 | if (slot->codecxx . . $ DOMAIN_SLOT#code. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2004 | { /* dummy index is non-free; delete symbolic value */ |
| 2005 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, temp->symcxx . . $ TUPLE#sym.); |
| 2006 | } |
| 2007 | /* delete component that corresponds to the current slot */ |
| 2008 | dmp_free_atomcxx . . $ `external/glpk/glpdmp.h:66:9`!(mpl->tuplescxx . . $ MPL#tuples., temp, sizeof(TUPLEcxx . . $ TUPLE#)); |
| 2009 | } |
| 2010 | } |
| 2011 | else |
| 2012 | { /* there are no more domain blocks, i.e. we have reached the |
| 2013 | domain scope */ |
| 2014 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(my_info->tuple == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 2015 | /* check optional predicate specified for the domain */ |
| 2016 | if (my_info->domaincxx . . $ eval_domain_info#domain.->codecxx . . $ DOMAIN1#code. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! && !eval_logicalcxx . . $ `external/glpk/glpmpl.h:2218:9`!(mpl, |
| 2017 | my_info->domaincxx . . $ eval_domain_info#domain.->codecxx . . $ DOMAIN1#code.)) |
| 2018 | { /* the predicate is false */ |
| 2019 | my_info->failurecxx . . $ eval_domain_info#failure. = 2; |
| 2020 | } |
| 2021 | else |
| 2022 | { /* the predicate is true; do the job */ |
| 2023 | my_info->funccxx . . $ eval_domain_info#func.(mpl, my_info->infocxx . . $ eval_domain_info#info.); |
| 2024 | } |
| 2025 | } |
| 2026 | return; |
| 2027 | } |
| 2028 | |
| 2029 | int eval_within_domaincxx . . $ `external/glpk/glpmpl.h:1484:9`! |
| 2030 | ( MPLcxx . . $ MPL# *mpl, |
| 2031 | DOMAINcxx . . $ `external/glpk/glpmpl.h:45:9`! *domain, /* not changed */ |
| 2032 | TUPLEcxx . . $ TUPLE# *tuple, /* not changed */ |
| 2033 | void *info, void (*func)(MPLcxx . . $ MPL# *mpl, void *info) |
| 2034 | ) |
| 2035 | { /* this routine performs evaluation within domain scope */ |
| 2036 | struct eval_domain_infocxx . . $ eval_domain_info# _my_info, *my_info = &_my_info; |
| 2037 | if (domain == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2038 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(tuple == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 2039 | func(mpl, info); |
| 2040 | my_info->failurecxx . . $ eval_domain_info#failure. = 0; |
| 2041 | } |
| 2042 | else |
| 2043 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(tuple != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 2044 | my_info->domaincxx . . $ eval_domain_info#domain. = domain; |
| 2045 | my_info->blockcxx . . $ eval_domain_info#block. = domain->listcxx . . $ DOMAIN1#list.; |
| 2046 | my_info->tuplecxx . . $ eval_domain_info#tuple. = tuple; |
| 2047 | my_info->infocxx . . $ eval_domain_info#info. = info; |
| 2048 | my_info->funccxx . . $ eval_domain_info#func. = func; |
| 2049 | my_info->failurecxx . . $ eval_domain_info#failure. = 0; |
| 2050 | /* enter the very first domain block */ |
| 2051 | eval_domain_funccxx . . $ eval_domain_func(55b428b8c674eeb1).(mpl, my_info); |
| 2052 | } |
| 2053 | return my_info->failurecxx . . $ eval_domain_info#failure.; |
| 2054 | } |
| 2055 | |
| 2056 | /*---------------------------------------------------------------------- |
| 2057 | -- loop_within_domain - perform iterations within domain scope. |
| 2058 | -- |
| 2059 | -- This routine iteratively assigns new values (symbols) to the dummy |
| 2060 | -- indices of specified domain by enumerating all n-tuples, which are |
| 2061 | -- members of the domain set, and for every n-tuple it calls the formal |
| 2062 | -- routine func to evaluate some code within the domain scope. |
| 2063 | -- |
| 2064 | -- If the routine func returns non-zero, enumeration within the domain |
| 2065 | -- is prematurely terminated. |
| 2066 | -- |
| 2067 | -- For the sake of convenience it is allowed to specify domain as NULL, |
| 2068 | -- in which case this routine just calls the routine func only once and |
| 2069 | -- returns zero. |
| 2070 | -- |
| 2071 | -- This routine allows recursive calls from the routine func providing |
| 2072 | -- correct values of dummy indices for each instance. */ |
| 2073 | |
| 2074 | struct loop_domain_infocxx . . $ loop_domain_info# |
| 2075 | { /* working info used by the routine loop_within_domain */ |
| 2076 | DOMAINcxx . . $ `external/glpk/glpmpl.h:45:9`! *domaincxx . . $ loop_domain_info#domain.; |
| 2077 | /* domain, which has to be entered */ |
| 2078 | DOMAIN_BLOCKcxx . . $ DOMAIN_BLOCK# *blockcxx . . $ loop_domain_info#block.; |
| 2079 | /* domain block, which is currently processed */ |
| 2080 | int loopingcxx . . $ loop_domain_info#looping.; |
| 2081 | /* clearing this flag leads to terminating enumeration */ |
| 2082 | void *infocxx . . $ loop_domain_info#info.; |
| 2083 | /* transit pointer passed to the formal routine func */ |
| 2084 | int (*funccxx . . $ loop_domain_info#func.)(MPLcxx . . $ MPL# *mpl, void *info); |
| 2085 | /* routine, which needs to be executed in the domain scope */ |
| 2086 | }; |
| 2087 | |
| 2088 | static void loop_domain_funccxx . . $ loop_domain_func(55b428b8c674eeb1).(MPLcxx . . $ MPL# *mpl, void *_my_info) |
| 2089 | { /* this routine enumerates all n-tuples in the basic set of the |
| 2090 | current domain block, enters recursively into the domain scope |
| 2091 | for every n-tuple, and then calls the routine func */ |
| 2092 | struct loop_domain_infocxx . . $ loop_domain_info# *my_info = _my_info; |
| 2093 | if (my_info->blockcxx . . $ loop_domain_info#block. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2094 | { /* the current domain block to be entered exists */ |
| 2095 | DOMAIN_BLOCKcxx . . $ DOMAIN_BLOCK# *block; |
| 2096 | DOMAIN_SLOTcxx . . $ DOMAIN_SLOT# *slot; |
| 2097 | TUPLEcxx . . $ TUPLE# *bound; |
| 2098 | /* save pointer to the current domain block */ |
| 2099 | block = my_info->blockcxx . . $ loop_domain_info#block.; |
| 2100 | /* and get ready to enter the next block (if it exists) */ |
| 2101 | my_info->blockcxx . . $ loop_domain_info#block. = block->nextcxx . . $ DOMAIN_BLOCK#next.; |
| 2102 | /* compute symbolic values, at which non-free dummy indices of |
| 2103 | the current domain block are bound; since that values don't |
| 2104 | depend on free dummy indices of the current block, they can |
| 2105 | be computed once out of the enumeration loop */ |
| 2106 | bound = create_tuplecxx . . $ `external/glpk/glpmpl.h:999:9`!(mpl); |
| 2107 | for (slot = block->listcxx . . $ DOMAIN_BLOCK#list.; slot != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; slot = slot->nextcxx . . $ DOMAIN_SLOT#next.) |
| 2108 | { if (slot->codecxx . . $ DOMAIN_SLOT#code. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2109 | bound = expand_tuplecxx . . $ `external/glpk/glpmpl.h:1003:9`!(mpl, bound, eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, |
| 2110 | slot->codecxx . . $ DOMAIN_SLOT#code.)); |
| 2111 | } |
| 2112 | /* start enumeration */ |
| 2113 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(block->code != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 2114 | if (block->codecxx . . $ DOMAIN_BLOCK#code.->opcxx . . $ CODE#op. == O_DOTScxx . . $ `external/glpk/glpmpl.h:2150:9`!) |
| 2115 | { /* the basic set is "arithmetic", in which case it doesn't |
| 2116 | need to be computed explicitly */ |
| 2117 | TUPLEcxx . . $ TUPLE# *tuple; |
| 2118 | int n, j; |
| 2119 | double t0, tf, dt; |
| 2120 | /* compute "parameters" of the basic set */ |
| 2121 | t0 = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, block->codecxx . . $ DOMAIN_BLOCK#code.->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 2122 | tf = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, block->codecxx . . $ DOMAIN_BLOCK#code.->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.); |
| 2123 | if (block->codecxx . . $ DOMAIN_BLOCK#code.->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..zcxx . . $ OPERANDS#$anonymous_type_8#z. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2124 | dt = 1.0; |
| 2125 | else |
| 2126 | dt = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, block->codecxx . . $ DOMAIN_BLOCK#code.->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..zcxx . . $ OPERANDS#$anonymous_type_8#z.); |
| 2127 | /* determine cardinality of the basic set */ |
| 2128 | n = arelset_sizecxx . . $ `external/glpk/glpmpl.h:1112:9`!(mpl, t0, tf, dt); |
| 2129 | /* create dummy 1-tuple for members of the basic set */ |
| 2130 | tuple = expand_tuplecxx . . $ `external/glpk/glpmpl.h:1003:9`!(mpl, create_tuplecxx . . $ `external/glpk/glpmpl.h:999:9`!(mpl), |
| 2131 | create_symbol_numcxx . . $ `external/glpk/glpmpl.h:938:9`!(mpl, 0.0)); |
| 2132 | /* in case of "arithmetic" set there is exactly one dummy |
| 2133 | index, which cannot be non-free */ |
| 2134 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(bound == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 2135 | /* walk through 1-tuples of the basic set */ |
| 2136 | for (j = 1; j <= n && my_info->loopingcxx . . $ loop_domain_info#looping.; j++) |
| 2137 | { /* construct dummy 1-tuple for the current member */ |
| 2138 | tuple->symcxx . . $ TUPLE#sym.->numcxx . . $ SYMBOL#num. = arelset_membercxx . . $ `external/glpk/glpmpl.h:1116:9`!(mpl, t0, tf, dt, j); |
| 2139 | /* enter the current domain block */ |
| 2140 | enter_domain_blockcxx . . $ `external/glpk/glpmpl.h:1475:9`!(mpl, block, tuple, my_info, |
| 2141 | loop_domain_funccxx . . $ loop_domain_func(55b428b8c674eeb1).); |
| 2142 | } |
| 2143 | /* delete dummy 1-tuple */ |
| 2144 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, tuple); |
| 2145 | } |
| 2146 | else |
| 2147 | { /* the basic set is of general kind, in which case it needs |
| 2148 | to be explicitly computed */ |
| 2149 | ELEMSETcxx . . $ ELEMSET# *set; |
| 2150 | MEMBERcxx . . $ MEMBER# *memb; |
| 2151 | TUPLEcxx . . $ TUPLE# *temp1, *temp2; |
| 2152 | /* compute the basic set */ |
| 2153 | set = eval_elemsetcxx . . $ `external/glpk/glpmpl.h:2226:9`!(mpl, block->codecxx . . $ DOMAIN_BLOCK#code.); |
| 2154 | /* walk through all n-tuples of the basic set */ |
| 2155 | for (memb = set->headcxx . . $ ARRAY#head.; memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! && my_info->loopingcxx . . $ loop_domain_info#looping.; |
| 2156 | memb = memb->nextcxx . . $ MEMBER#next.) |
| 2157 | { /* all components of the current n-tuple that correspond |
| 2158 | to non-free dummy indices must be feasible; otherwise |
| 2159 | the n-tuple is not in the basic set */ |
| 2160 | temp1 = memb->tuplecxx . . $ MEMBER#tuple.; |
| 2161 | temp2 = bound; |
| 2162 | for (slot = block->listcxx . . $ DOMAIN_BLOCK#list.; slot != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; slot = slot->nextcxx . . $ DOMAIN_SLOT#next.) |
| 2163 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(temp1 != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 2164 | if (slot->codecxx . . $ DOMAIN_SLOT#code. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2165 | { /* non-free dummy index */ |
| 2166 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(temp2 != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 2167 | if (compare_symbolscxx . . $ `external/glpk/glpmpl.h:956:9`!(mpl, temp1->symcxx . . $ TUPLE#sym., temp2->symcxx . . $ TUPLE#sym.) |
| 2168 | != 0) |
| 2169 | { /* the n-tuple is not in the basic set */ |
| 2170 | goto skip; |
| 2171 | } |
| 2172 | temp2 = temp2->nextcxx . . $ TUPLE#next.; |
| 2173 | } |
| 2174 | temp1 = temp1->nextcxx . . $ TUPLE#next.; |
| 2175 | } |
| 2176 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(temp1 == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 2177 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(temp2 == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 2178 | /* enter the current domain block */ |
| 2179 | enter_domain_blockcxx . . $ `external/glpk/glpmpl.h:1475:9`!(mpl, block, memb->tuplecxx . . $ MEMBER#tuple., my_info, |
| 2180 | loop_domain_funccxx . . $ loop_domain_func(55b428b8c674eeb1).); |
| 2181 | skip: ; |
| 2182 | } |
| 2183 | /* delete the basic set */ |
| 2184 | delete_elemsetcxx . . $ `external/glpk/glpmpl.h:1105:9`!(mpl, set); |
| 2185 | } |
| 2186 | /* delete symbolic values binding non-free dummy indices */ |
| 2187 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, bound); |
| 2188 | /* restore pointer to the current domain block */ |
| 2189 | my_info->blockcxx . . $ loop_domain_info#block. = block; |
| 2190 | } |
| 2191 | else |
| 2192 | { /* there are no more domain blocks, i.e. we have reached the |
| 2193 | domain scope */ |
| 2194 | /* check optional predicate specified for the domain */ |
| 2195 | if (my_info->domaincxx . . $ loop_domain_info#domain.->codecxx . . $ DOMAIN1#code. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! && !eval_logicalcxx . . $ `external/glpk/glpmpl.h:2218:9`!(mpl, |
| 2196 | my_info->domaincxx . . $ loop_domain_info#domain.->codecxx . . $ DOMAIN1#code.)) |
| 2197 | { /* the predicate is false */ |
| 2198 | /* nop */; |
| 2199 | } |
| 2200 | else |
| 2201 | { /* the predicate is true; do the job */ |
| 2202 | my_info->loopingcxx . . $ loop_domain_info#looping. = !my_info->funccxx . . $ loop_domain_info#func.(mpl, my_info->infocxx . . $ loop_domain_info#info.); |
| 2203 | } |
| 2204 | } |
| 2205 | return; |
| 2206 | } |
| 2207 | |
| 2208 | void loop_within_domaincxx . . $ `external/glpk/glpmpl.h:1493:9`! |
| 2209 | ( MPLcxx . . $ MPL# *mpl, |
| 2210 | DOMAINcxx . . $ `external/glpk/glpmpl.h:45:9`! *domain, /* not changed */ |
| 2211 | void *info, int (*func)(MPLcxx . . $ MPL# *mpl, void *info) |
| 2212 | ) |
| 2213 | { /* this routine performs iterations within domain scope */ |
| 2214 | struct loop_domain_infocxx . . $ loop_domain_info# _my_info, *my_info = &_my_info; |
| 2215 | if (domain == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2216 | func(mpl, info); |
| 2217 | else |
| 2218 | { my_info->domaincxx . . $ loop_domain_info#domain. = domain; |
| 2219 | my_info->blockcxx . . $ loop_domain_info#block. = domain->listcxx . . $ DOMAIN1#list.; |
| 2220 | my_info->loopingcxx . . $ loop_domain_info#looping. = 1; |
| 2221 | my_info->infocxx . . $ loop_domain_info#info. = info; |
| 2222 | my_info->funccxx . . $ loop_domain_info#func. = func; |
| 2223 | /* enter the very first domain block */ |
| 2224 | loop_domain_funccxx . . $ loop_domain_func(55b428b8c674eeb1).(mpl, my_info); |
| 2225 | } |
| 2226 | return; |
| 2227 | } |
| 2228 | |
| 2229 | /*---------------------------------------------------------------------- |
| 2230 | -- out_of_domain - raise domain exception. |
| 2231 | -- |
| 2232 | -- This routine is called when a reference is made to a member of some |
| 2233 | -- model object, but its n-tuple is out of the object domain. */ |
| 2234 | |
| 2235 | void out_of_domaincxx . . $ `external/glpk/glpmpl.h:1501:9`! |
| 2236 | ( MPLcxx . . $ MPL# *mpl, |
| 2237 | char *name, /* not changed */ |
| 2238 | TUPLEcxx . . $ TUPLE# *tuple /* not changed */ |
| 2239 | ) |
| 2240 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(name != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 2241 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(tuple != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 2242 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%s%s out of domain", name, format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', |
| 2243 | tuple)); |
| 2244 | /* no return */ |
| 2245 | } |
| 2246 | |
| 2247 | /*---------------------------------------------------------------------- |
| 2248 | -- get_domain_tuple - obtain current n-tuple from domain. |
| 2249 | -- |
| 2250 | -- This routine constructs n-tuple, whose components are current values |
| 2251 | -- assigned to *free* dummy indices of specified domain. |
| 2252 | -- |
| 2253 | -- For the sake of convenience it is allowed to specify domain as NULL, |
| 2254 | -- in which case this routine returns 0-tuple. |
| 2255 | -- |
| 2256 | -- NOTE: This routine must not be called out of domain scope. */ |
| 2257 | |
| 2258 | TUPLEcxx . . $ TUPLE# *get_domain_tuplecxx . . $ `external/glpk/glpmpl.h:1509:9`! |
| 2259 | ( MPLcxx . . $ MPL# *mpl, |
| 2260 | DOMAINcxx . . $ `external/glpk/glpmpl.h:45:9`! *domain /* not changed */ |
| 2261 | ) |
| 2262 | { DOMAIN_BLOCKcxx . . $ DOMAIN_BLOCK# *block; |
| 2263 | DOMAIN_SLOTcxx . . $ DOMAIN_SLOT# *slot; |
| 2264 | TUPLEcxx . . $ TUPLE# *tuple; |
| 2265 | tuple = create_tuplecxx . . $ `external/glpk/glpmpl.h:999:9`!(mpl); |
| 2266 | if (domain != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2267 | { for (block = domain->listcxx . . $ DOMAIN1#list.; block != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; block = block->nextcxx . . $ DOMAIN_BLOCK#next.) |
| 2268 | { for (slot = block->listcxx . . $ DOMAIN_BLOCK#list.; slot != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; slot = slot->nextcxx . . $ DOMAIN_SLOT#next.) |
| 2269 | { if (slot->codecxx . . $ DOMAIN_SLOT#code. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2270 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(slot->value != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 2271 | tuple = expand_tuplecxx . . $ `external/glpk/glpmpl.h:1003:9`!(mpl, tuple, copy_symbolcxx . . $ `external/glpk/glpmpl.h:949:9`!(mpl, |
| 2272 | slot->valuecxx . . $ DOMAIN_SLOT#value.)); |
| 2273 | } |
| 2274 | } |
| 2275 | } |
| 2276 | } |
| 2277 | return tuple; |
| 2278 | } |
| 2279 | |
| 2280 | /*---------------------------------------------------------------------- |
| 2281 | -- clean_domain - clean domain. |
| 2282 | -- |
| 2283 | -- This routine cleans specified domain that assumes deleting all stuff |
| 2284 | -- dynamically allocated during the generation phase. */ |
| 2285 | |
| 2286 | void clean_domaincxx . . $ `external/glpk/glpmpl.h:1516:9`!(MPLcxx . . $ MPL# *mpl, DOMAINcxx . . $ `external/glpk/glpmpl.h:45:9`! *domain) |
| 2287 | { DOMAIN_BLOCKcxx . . $ DOMAIN_BLOCK# *block; |
| 2288 | DOMAIN_SLOTcxx . . $ DOMAIN_SLOT# *slot; |
| 2289 | /* if no domain is specified, do nothing */ |
| 2290 | if (domain == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) goto done; |
| 2291 | /* clean all domain blocks */ |
| 2292 | for (block = domain->listcxx . . $ DOMAIN1#list.; block != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; block = block->nextcxx . . $ DOMAIN_BLOCK#next.) |
| 2293 | { /* clean all domain slots */ |
| 2294 | for (slot = block->listcxx . . $ DOMAIN_BLOCK#list.; slot != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; slot = slot->nextcxx . . $ DOMAIN_SLOT#next.) |
| 2295 | { /* clean pseudo-code for computing bound value */ |
| 2296 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, slot->codecxx . . $ DOMAIN_SLOT#code.); |
| 2297 | /* delete symbolic value assigned to dummy index */ |
| 2298 | if (slot->valuecxx . . $ DOMAIN_SLOT#value. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2299 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, slot->valuecxx . . $ DOMAIN_SLOT#value.), slot->valuecxx . . $ DOMAIN_SLOT#value. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 2300 | } |
| 2301 | /* clean pseudo-code for computing basic set */ |
| 2302 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, block->codecxx . . $ DOMAIN_BLOCK#code.); |
| 2303 | } |
| 2304 | /* clean pseudo-code for computing domain predicate */ |
| 2305 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, domain->codecxx . . $ DOMAIN1#code.); |
| 2306 | done: return; |
| 2307 | } |
| 2308 | |
| 2309 | /**********************************************************************/ |
| 2310 | /* * * MODEL SETS * * */ |
| 2311 | /**********************************************************************/ |
| 2312 | |
| 2313 | /*---------------------------------------------------------------------- |
| 2314 | -- check_elem_set - check elemental set assigned to set member. |
| 2315 | -- |
| 2316 | -- This routine checks if given elemental set being assigned to member |
| 2317 | -- of specified model set satisfies to all restrictions. |
| 2318 | -- |
| 2319 | -- NOTE: This routine must not be called out of domain scope. */ |
| 2320 | |
| 2321 | void check_elem_setcxx . . $ `external/glpk/glpmpl.h:1574:9`! |
| 2322 | ( MPLcxx . . $ MPL# *mpl, |
| 2323 | SETcxx . . $ SET# *set, /* not changed */ |
| 2324 | TUPLEcxx . . $ TUPLE# *tuple, /* not changed */ |
| 2325 | ELEMSETcxx . . $ ELEMSET# *refer /* not changed */ |
| 2326 | ) |
| 2327 | { WITHINcxx . . $ WITHIN# *within; |
| 2328 | MEMBERcxx . . $ MEMBER# *memb; |
| 2329 | int eqno; |
| 2330 | /* elemental set must be within all specified supersets */ |
| 2331 | for (within = set->withincxx . . $ SET#within., eqno = 1; within != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; within = |
| 2332 | within->nextcxx . . $ WITHIN#next., eqno++) |
| 2333 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(within->code != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 2334 | for (memb = refer->headcxx . . $ ARRAY#head.; memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memb = memb->nextcxx . . $ MEMBER#next.) |
| 2335 | { if (!is_membercxx . . $ `external/glpk/glpmpl.h:2230:9`!(mpl, within->codecxx . . $ WITHIN#code., memb->tuplecxx . . $ MEMBER#tuple.)) |
| 2336 | { char buf[255+1]; |
| 2337 | strcpycxx . . $ strcpy(b7b3a83273496486).(buf, format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '(', memb->tuplecxx . . $ MEMBER#tuple.)); |
| 2338 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(strlen(buf) < sizeof(buf)); |
| 2339 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%s%s contains %s which not within specified " |
| 2340 | "set; see (%d)", set->namecxx . . $ SET#name., format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', |
| 2341 | tuple), buf, eqno); |
| 2342 | } |
| 2343 | } |
| 2344 | } |
| 2345 | return; |
| 2346 | } |
| 2347 | |
| 2348 | /*---------------------------------------------------------------------- |
| 2349 | -- take_member_set - obtain elemental set assigned to set member. |
| 2350 | -- |
| 2351 | -- This routine obtains a reference to elemental set assigned to given |
| 2352 | -- member of specified model set and returns it on exit. |
| 2353 | -- |
| 2354 | -- NOTE: This routine must not be called out of domain scope. */ |
| 2355 | |
| 2356 | ELEMSETcxx . . $ ELEMSET# *take_member_setcxx . . $ `external/glpk/glpmpl.h:1583:9`! /* returns reference, not value */ |
| 2357 | ( MPLcxx . . $ MPL# *mpl, |
| 2358 | SETcxx . . $ SET# *set, /* not changed */ |
| 2359 | TUPLEcxx . . $ TUPLE# *tuple /* not changed */ |
| 2360 | ) |
| 2361 | { MEMBERcxx . . $ MEMBER# *memb; |
| 2362 | ELEMSETcxx . . $ ELEMSET# *refer; |
| 2363 | /* find member in the set array */ |
| 2364 | memb = find_membercxx . . $ `external/glpk/glpmpl.h:1376:9`!(mpl, set->arraycxx . . $ SET#array., tuple); |
| 2365 | if (memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2366 | { /* member exists, so just take the reference */ |
| 2367 | refer = memb->valuecxx . . $ MEMBER#value..setcxx . . $ VALUE#set.; |
| 2368 | } |
| 2369 | else if (set->assigncxx . . $ SET#assign. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2370 | { /* compute value using assignment expression */ |
| 2371 | refer = eval_elemsetcxx . . $ `external/glpk/glpmpl.h:2226:9`!(mpl, set->assigncxx . . $ SET#assign.); |
| 2372 | add: /* check that the elemental set satisfies to all restrictions, |
| 2373 | assign it to new member, and add the member to the array */ |
| 2374 | check_elem_setcxx . . $ `external/glpk/glpmpl.h:1574:9`!(mpl, set, tuple, refer); |
| 2375 | memb = add_membercxx . . $ `external/glpk/glpmpl.h:1384:9`!(mpl, set->arraycxx . . $ SET#array., copy_tuplecxx . . $ `external/glpk/glpmpl.h:1018:9`!(mpl, tuple)); |
| 2376 | memb->valuecxx . . $ MEMBER#value..setcxx . . $ VALUE#set. = refer; |
| 2377 | } |
| 2378 | else if (set->optioncxx . . $ SET#option. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2379 | { /* compute default elemental set */ |
| 2380 | refer = eval_elemsetcxx . . $ `external/glpk/glpmpl.h:2226:9`!(mpl, set->optioncxx . . $ SET#option.); |
| 2381 | goto add; |
| 2382 | } |
| 2383 | else |
| 2384 | { /* no value (elemental set) is provided */ |
| 2385 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "no value for %s%s", set->namecxx . . $ SET#name., format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, |
| 2386 | '[', tuple)); |
| 2387 | } |
| 2388 | return refer; |
| 2389 | } |
| 2390 | |
| 2391 | /*---------------------------------------------------------------------- |
| 2392 | -- eval_member_set - evaluate elemental set assigned to set member. |
| 2393 | -- |
| 2394 | -- This routine evaluates a reference to elemental set assigned to given |
| 2395 | -- member of specified model set and returns it on exit. */ |
| 2396 | |
| 2397 | struct eval_set_infocxx . . $ eval_set_info# |
| 2398 | { /* working info used by the routine eval_member_set */ |
| 2399 | SETcxx . . $ SET# *setcxx . . $ eval_set_info#set.; |
| 2400 | /* model set */ |
| 2401 | TUPLEcxx . . $ TUPLE# *tuplecxx . . $ eval_set_info#tuple.; |
| 2402 | /* n-tuple, which defines set member */ |
| 2403 | MEMBERcxx . . $ MEMBER# *membcxx . . $ eval_set_info#memb.; |
| 2404 | /* normally this pointer is NULL; the routine uses this pointer |
| 2405 | to check data provided in the data section, in which case it |
| 2406 | points to a member currently checked; this check is performed |
| 2407 | automatically only once when a reference to any member occurs |
| 2408 | for the first time */ |
| 2409 | ELEMSETcxx . . $ ELEMSET# *refercxx . . $ eval_set_info#refer.; |
| 2410 | /* evaluated reference to elemental set */ |
| 2411 | }; |
| 2412 | |
| 2413 | static void eval_set_funccxx . . $ eval_set_func(55b428b8c674eeb1).(MPLcxx . . $ MPL# *mpl, void *_info) |
| 2414 | { /* this is auxiliary routine to work within domain scope */ |
| 2415 | struct eval_set_infocxx . . $ eval_set_info# *info = _info; |
| 2416 | if (info->membcxx . . $ eval_set_info#memb. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2417 | { /* checking call; check elemental set being assigned */ |
| 2418 | check_elem_setcxx . . $ `external/glpk/glpmpl.h:1574:9`!(mpl, info->setcxx . . $ eval_set_info#set., info->membcxx . . $ eval_set_info#memb.->tuplecxx . . $ MEMBER#tuple., |
| 2419 | info->membcxx . . $ eval_set_info#memb.->valuecxx . . $ MEMBER#value..setcxx . . $ VALUE#set.); |
| 2420 | } |
| 2421 | else |
| 2422 | { /* normal call; evaluate member, which has given n-tuple */ |
| 2423 | info->refercxx . . $ eval_set_info#refer. = take_member_setcxx . . $ `external/glpk/glpmpl.h:1583:9`!(mpl, info->setcxx . . $ eval_set_info#set., info->tuplecxx . . $ eval_set_info#tuple.); |
| 2424 | } |
| 2425 | return; |
| 2426 | } |
| 2427 | |
| 2428 | #if 1 /* 12/XII-2008 */ |
| 2429 | static void saturate_setcxx . . $ saturate_set(4b50f7a5eb0a6ab8).(MPLcxx . . $ MPL# *mpl, SETcxx . . $ SET# *set) |
| 2430 | { GADGETcxx . . $ GADGET# *gadget = set->gadgetcxx . . $ SET#gadget.; |
| 2431 | ELEMSETcxx . . $ ELEMSET# *data; |
| 2432 | MEMBERcxx . . $ MEMBER# *elem, *memb; |
| 2433 | TUPLEcxx . . $ TUPLE# *tuple, *work[20]; |
| 2434 | int i; |
| 2435 | xprintfcxx . . $ `external/glpk/glpenv.h:145:9`!("Generating %s...\n", set->namecxx . . $ SET#name.); |
| 2436 | eval_whole_setcxx . . $ `external/glpk/glpmpl.h:1599:9`!(mpl, gadget->setcxx . . $ GADGET#set.); |
| 2437 | /* gadget set must have exactly one member */ |
| 2438 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(gadget->set->array != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 2439 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(gadget->set->array->head != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 2440 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(gadget->set->array->head == gadget->set->array->tail); |
| 2441 | data = gadget->setcxx . . $ GADGET#set.->arraycxx . . $ SET#array.->headcxx . . $ ARRAY#head.->valuecxx . . $ MEMBER#value..setcxx . . $ VALUE#set.; |
| 2442 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(data->type == A_NONEcxx . . $ `external/glpk/glpmpl.h:95:9`!); |
| 2443 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(data->dim == gadget->set->dimen); |
| 2444 | /* walk thru all elements of the plain set */ |
| 2445 | for (elem = data->headcxx . . $ ARRAY#head.; elem != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; elem = elem->nextcxx . . $ MEMBER#next.) |
| 2446 | { /* create a copy of n-tuple */ |
| 2447 | tuple = copy_tuplecxx . . $ `external/glpk/glpmpl.h:1018:9`!(mpl, elem->tuplecxx . . $ MEMBER#tuple.); |
| 2448 | /* rearrange component of the n-tuple */ |
| 2449 | for (i = 0; i < gadget->setcxx . . $ GADGET#set.->dimencxx . . $ SET#dimen.; i++) |
| 2450 | work[i] = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 2451 | for (i = 0; tuple != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; tuple = tuple->nextcxx . . $ TUPLE#next.) |
| 2452 | work[gadget->indcxx . . $ GADGET#ind.[i++]-1] = tuple; |
| 2453 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(i == gadget->set->dimen); |
| 2454 | for (i = 0; i < gadget->setcxx . . $ GADGET#set.->dimencxx . . $ SET#dimen.; i++) |
| 2455 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(work[i] != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 2456 | work[i]->nextcxx . . $ TUPLE#next. = work[i+1]; |
| 2457 | } |
| 2458 | /* construct subscript list from first set->dim components */ |
| 2459 | if (set->dimcxx . . $ SET#dim. == 0) |
| 2460 | tuple = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 2461 | else |
| 2462 | tuple = work[0], work[set->dimcxx . . $ SET#dim.-1]->nextcxx . . $ TUPLE#next. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 2463 | /* find corresponding member of the set to be initialized */ |
| 2464 | memb = find_membercxx . . $ `external/glpk/glpmpl.h:1376:9`!(mpl, set->arraycxx . . $ SET#array., tuple); |
| 2465 | if (memb == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2466 | { /* not found; add new member to the set and assign it empty |
| 2467 | elemental set */ |
| 2468 | memb = add_membercxx . . $ `external/glpk/glpmpl.h:1384:9`!(mpl, set->arraycxx . . $ SET#array., tuple); |
| 2469 | memb->valuecxx . . $ MEMBER#value..setcxx . . $ VALUE#set. = create_elemsetcxx . . $ `external/glpk/glpmpl.h:1070:9`!(mpl, set->dimencxx . . $ SET#dimen.); |
| 2470 | } |
| 2471 | else |
| 2472 | { /* found; free subscript list */ |
| 2473 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, tuple); |
| 2474 | } |
| 2475 | /* construct new n-tuple from rest set->dimen components */ |
| 2476 | tuple = work[set->dimcxx . . $ SET#dim.]; |
| 2477 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(set->dim + set->dimen == gadget->set->dimen); |
| 2478 | work[gadget->setcxx . . $ GADGET#set.->dimencxx . . $ SET#dimen.-1]->nextcxx . . $ TUPLE#next. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 2479 | /* and add it to the elemental set assigned to the member |
| 2480 | (no check for duplicates is needed) */ |
| 2481 | add_tuplecxx . . $ `external/glpk/glpmpl.h:1082:9`!(mpl, memb->valuecxx . . $ MEMBER#value..setcxx . . $ VALUE#set., tuple); |
| 2482 | } |
| 2483 | /* the set has been saturated with data */ |
| 2484 | set->datacxx . . $ SET#data. = 1; |
| 2485 | return; |
| 2486 | } |
| 2487 | #endif |
| 2488 | |
| 2489 | ELEMSETcxx . . $ ELEMSET# *eval_member_setcxx . . $ `external/glpk/glpmpl.h:1591:9`! /* returns reference, not value */ |
| 2490 | ( MPLcxx . . $ MPL# *mpl, |
| 2491 | SETcxx . . $ SET# *set, /* not changed */ |
| 2492 | TUPLEcxx . . $ TUPLE# *tuple /* not changed */ |
| 2493 | ) |
| 2494 | { /* this routine evaluates set member */ |
| 2495 | struct eval_set_infocxx . . $ eval_set_info# _info, *info = &_info; |
| 2496 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(set->dim == tuple_dimencxx . . $ `external/glpk/glpmpl.h:1011:9`!(mpl, tuple)); |
| 2497 | info->setcxx . . $ eval_set_info#set. = set; |
| 2498 | info->tuplecxx . . $ eval_set_info#tuple. = tuple; |
| 2499 | #if 1 /* 12/XII-2008 */ |
| 2500 | if (set->gadgetcxx . . $ SET#gadget. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! && set->datacxx . . $ SET#data. == 0) |
| 2501 | { /* initialize the set with data from a plain set */ |
| 2502 | saturate_setcxx . . $ saturate_set(4b50f7a5eb0a6ab8).(mpl, set); |
| 2503 | } |
| 2504 | #endif |
| 2505 | if (set->datacxx . . $ SET#data. == 1) |
| 2506 | { /* check data, which are provided in the data section, but not |
| 2507 | checked yet */ |
| 2508 | /* save pointer to the last array member; note that during the |
| 2509 | check new members may be added beyond the last member due to |
| 2510 | references to the same parameter from default expression as |
| 2511 | well as from expressions that define restricting supersets; |
| 2512 | however, values assigned to the new members will be checked |
| 2513 | by other routine, so we don't need to check them here */ |
| 2514 | MEMBERcxx . . $ MEMBER# *tail = set->arraycxx . . $ SET#array.->tailcxx . . $ ARRAY#tail.; |
| 2515 | /* change the data status to prevent infinite recursive loop |
| 2516 | due to references to the same set during the check */ |
| 2517 | set->datacxx . . $ SET#data. = 2; |
| 2518 | /* check elemental sets assigned to array members in the data |
| 2519 | section until the marked member has been reached */ |
| 2520 | for (info->membcxx . . $ eval_set_info#memb. = set->arraycxx . . $ SET#array.->headcxx . . $ ARRAY#head.; info->membcxx . . $ eval_set_info#memb. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 2521 | info->membcxx . . $ eval_set_info#memb. = info->membcxx . . $ eval_set_info#memb.->nextcxx . . $ MEMBER#next.) |
| 2522 | { if (eval_within_domaincxx . . $ `external/glpk/glpmpl.h:1484:9`!(mpl, set->domaincxx . . $ SET#domain., info->membcxx . . $ eval_set_info#memb.->tuplecxx . . $ MEMBER#tuple., |
| 2523 | info, eval_set_funccxx . . $ eval_set_func(55b428b8c674eeb1).)) |
| 2524 | out_of_domaincxx . . $ `external/glpk/glpmpl.h:1501:9`!(mpl, set->namecxx . . $ SET#name., info->membcxx . . $ eval_set_info#memb.->tuplecxx . . $ MEMBER#tuple.); |
| 2525 | if (info->membcxx . . $ eval_set_info#memb. == tail) break; |
| 2526 | } |
| 2527 | /* the check has been finished */ |
| 2528 | } |
| 2529 | /* evaluate member, which has given n-tuple */ |
| 2530 | info->membcxx . . $ eval_set_info#memb. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 2531 | if (eval_within_domaincxx . . $ `external/glpk/glpmpl.h:1484:9`!(mpl, info->setcxx . . $ eval_set_info#set.->domaincxx . . $ SET#domain., info->tuplecxx . . $ eval_set_info#tuple., info, |
| 2532 | eval_set_funccxx . . $ eval_set_func(55b428b8c674eeb1).)) |
| 2533 | out_of_domaincxx . . $ `external/glpk/glpmpl.h:1501:9`!(mpl, set->namecxx . . $ SET#name., info->tuplecxx . . $ eval_set_info#tuple.); |
| 2534 | /* bring evaluated reference to the calling program */ |
| 2535 | return info->refercxx . . $ eval_set_info#refer.; |
| 2536 | } |
| 2537 | |
| 2538 | /*---------------------------------------------------------------------- |
| 2539 | -- eval_whole_set - evaluate model set over entire domain. |
| 2540 | -- |
| 2541 | -- This routine evaluates all members of specified model set over entire |
| 2542 | -- domain. */ |
| 2543 | |
| 2544 | static int whole_set_funccxx . . $ whole_set_func(3bbfabe35f227878).(MPLcxx . . $ MPL# *mpl, void *info) |
| 2545 | { /* this is auxiliary routine to work within domain scope */ |
| 2546 | SETcxx . . $ SET# *set = (SETcxx . . $ SET# *)info; |
| 2547 | TUPLEcxx . . $ TUPLE# *tuple = get_domain_tuplecxx . . $ `external/glpk/glpmpl.h:1509:9`!(mpl, set->domaincxx . . $ SET#domain.); |
| 2548 | eval_member_setcxx . . $ `external/glpk/glpmpl.h:1591:9`!(mpl, set, tuple); |
| 2549 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, tuple); |
| 2550 | return 0; |
| 2551 | } |
| 2552 | |
| 2553 | void eval_whole_setcxx . . $ `external/glpk/glpmpl.h:1599:9`!(MPLcxx . . $ MPL# *mpl, SETcxx . . $ SET# *set) |
| 2554 | { loop_within_domaincxx . . $ `external/glpk/glpmpl.h:1493:9`!(mpl, set->domaincxx . . $ SET#domain., set, whole_set_funccxx . . $ whole_set_func(3bbfabe35f227878).); |
| 2555 | return; |
| 2556 | } |
| 2557 | |
| 2558 | /*---------------------------------------------------------------------- |
| 2559 | -- clean set - clean model set. |
| 2560 | -- |
| 2561 | -- This routine cleans specified model set that assumes deleting all |
| 2562 | -- stuff dynamically allocated during the generation phase. */ |
| 2563 | |
| 2564 | void clean_setcxx . . $ `external/glpk/glpmpl.h:1603:9`!(MPLcxx . . $ MPL# *mpl, SETcxx . . $ SET# *set) |
| 2565 | { WITHINcxx . . $ WITHIN# *within; |
| 2566 | MEMBERcxx . . $ MEMBER# *memb; |
| 2567 | /* clean subscript domain */ |
| 2568 | clean_domaincxx . . $ `external/glpk/glpmpl.h:1516:9`!(mpl, set->domaincxx . . $ SET#domain.); |
| 2569 | /* clean pseudo-code for computing supersets */ |
| 2570 | for (within = set->withincxx . . $ SET#within.; within != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; within = within->nextcxx . . $ WITHIN#next.) |
| 2571 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, within->codecxx . . $ WITHIN#code.); |
| 2572 | /* clean pseudo-code for computing assigned value */ |
| 2573 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, set->assigncxx . . $ SET#assign.); |
| 2574 | /* clean pseudo-code for computing default value */ |
| 2575 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, set->optioncxx . . $ SET#option.); |
| 2576 | /* reset data status flag */ |
| 2577 | set->datacxx . . $ SET#data. = 0; |
| 2578 | /* delete content array */ |
| 2579 | for (memb = set->arraycxx . . $ SET#array.->headcxx . . $ ARRAY#head.; memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memb = memb->nextcxx . . $ MEMBER#next.) |
| 2580 | delete_valuecxx . . $ `external/glpk/glpmpl.h:1314:9`!(mpl, set->arraycxx . . $ SET#array.->typecxx . . $ ARRAY#type., &memb->valuecxx . . $ MEMBER#value.); |
| 2581 | delete_arraycxx . . $ `external/glpk/glpmpl.h:1392:9`!(mpl, set->arraycxx . . $ SET#array.), set->arraycxx . . $ SET#array. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 2582 | return; |
| 2583 | } |
| 2584 | |
| 2585 | /**********************************************************************/ |
| 2586 | /* * * MODEL PARAMETERS * * */ |
| 2587 | /**********************************************************************/ |
| 2588 | |
| 2589 | /*---------------------------------------------------------------------- |
| 2590 | -- check_value_num - check numeric value assigned to parameter member. |
| 2591 | -- |
| 2592 | -- This routine checks if numeric value being assigned to some member |
| 2593 | -- of specified numeric model parameter satisfies to all restrictions. |
| 2594 | -- |
| 2595 | -- NOTE: This routine must not be called out of domain scope. */ |
| 2596 | |
| 2597 | void check_value_numcxx . . $ `external/glpk/glpmpl.h:1667:9`! |
| 2598 | ( MPLcxx . . $ MPL# *mpl, |
| 2599 | PARAMETERcxx . . $ PARAMETER# *par, /* not changed */ |
| 2600 | TUPLEcxx . . $ TUPLE# *tuple, /* not changed */ |
| 2601 | double value |
| 2602 | ) |
| 2603 | { CONDITIONcxx . . $ CONDITION# *cond; |
| 2604 | WITHINcxx . . $ WITHIN# *in; |
| 2605 | int eqno; |
| 2606 | /* the value must satisfy to the parameter type */ |
| 2607 | switch (par->typecxx . . $ PARAMETER#type.) |
| 2608 | { case A_NUMERICcxx . . $ `external/glpk/glpmpl.h:96:9`!: |
| 2609 | break; |
| 2610 | case A_INTEGERcxx . . $ `external/glpk/glpmpl.h:91:9`!: |
| 2611 | if (value != floorcxx . . $ floor(447c67c6676f75c3).(value)) |
| 2612 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%s%s = %.*g not integer", par->namecxx . . $ PARAMETER#name., |
| 2613 | format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', tuple), DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, value); |
| 2614 | break; |
| 2615 | case A_BINARYcxx . . $ `external/glpk/glpmpl.h:79:9`!: |
| 2616 | if (!(value == 0.0 || value == 1.0)) |
| 2617 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%s%s = %.*g not binary", par->namecxx . . $ PARAMETER#name., |
| 2618 | format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', tuple), DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, value); |
| 2619 | break; |
| 2620 | default: |
| 2621 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(par != par); |
| 2622 | } |
| 2623 | /* the value must satisfy to all specified conditions */ |
| 2624 | for (cond = par->condcxx . . $ PARAMETER#cond., eqno = 1; cond != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; cond = cond->nextcxx . . $ CONDITION#next., |
| 2625 | eqno++) |
| 2626 | { double bound; |
| 2627 | char *rho; |
| 2628 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(cond->code != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 2629 | bound = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, cond->codecxx . . $ CONDITION#code.); |
| 2630 | switch (cond->rhocxx . . $ CONDITION#rho.) |
| 2631 | { case O_LTcxx . . $ `external/glpk/glpmpl.h:2129:9`!: |
| 2632 | if (!(value < bound)) |
| 2633 | { rho = "<"; |
| 2634 | err: mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%s%s = %.*g not %s %.*g; see (%d)", |
| 2635 | par->namecxx . . $ PARAMETER#name., format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', tuple), DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, |
| 2636 | value, rho, DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, bound, eqno); |
| 2637 | } |
| 2638 | break; |
| 2639 | case O_LEcxx . . $ `external/glpk/glpmpl.h:2130:9`!: |
| 2640 | if (!(value <= bound)) { rho = "<="; goto err; } |
| 2641 | break; |
| 2642 | case O_EQcxx . . $ `external/glpk/glpmpl.h:2131:9`!: |
| 2643 | if (!(value == bound)) { rho = "="; goto err; } |
| 2644 | break; |
| 2645 | case O_GEcxx . . $ `external/glpk/glpmpl.h:2132:9`!: |
| 2646 | if (!(value >= bound)) { rho = ">="; goto err; } |
| 2647 | break; |
| 2648 | case O_GTcxx . . $ `external/glpk/glpmpl.h:2133:9`!: |
| 2649 | if (!(value > bound)) { rho = ">"; goto err; } |
| 2650 | break; |
| 2651 | case O_NEcxx . . $ `external/glpk/glpmpl.h:2134:9`!: |
| 2652 | if (!(value != bound)) { rho = "<>"; goto err; } |
| 2653 | break; |
| 2654 | default: |
| 2655 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(cond != cond); |
| 2656 | } |
| 2657 | } |
| 2658 | /* the value must be in all specified supersets */ |
| 2659 | for (in = par->incxx . . $ PARAMETER#in., eqno = 1; in != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; in = in->nextcxx . . $ WITHIN#next., eqno++) |
| 2660 | { TUPLEcxx . . $ TUPLE# *dummy; |
| 2661 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(in->code != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 2662 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(in->code->dim == 1); |
| 2663 | dummy = expand_tuplecxx . . $ `external/glpk/glpmpl.h:1003:9`!(mpl, create_tuplecxx . . $ `external/glpk/glpmpl.h:999:9`!(mpl), |
| 2664 | create_symbol_numcxx . . $ `external/glpk/glpmpl.h:938:9`!(mpl, value)); |
| 2665 | if (!is_membercxx . . $ `external/glpk/glpmpl.h:2230:9`!(mpl, in->codecxx . . $ WITHIN#code., dummy)) |
| 2666 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%s%s = %.*g not in specified set; see (%d)", |
| 2667 | par->namecxx . . $ PARAMETER#name., format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', tuple), DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, |
| 2668 | value, eqno); |
| 2669 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, dummy); |
| 2670 | } |
| 2671 | return; |
| 2672 | } |
| 2673 | |
| 2674 | /*---------------------------------------------------------------------- |
| 2675 | -- take_member_num - obtain num. value assigned to parameter member. |
| 2676 | -- |
| 2677 | -- This routine obtains a numeric value assigned to member of specified |
| 2678 | -- numeric model parameter and returns it on exit. |
| 2679 | -- |
| 2680 | -- NOTE: This routine must not be called out of domain scope. */ |
| 2681 | |
| 2682 | double take_member_numcxx . . $ `external/glpk/glpmpl.h:1676:9`! |
| 2683 | ( MPLcxx . . $ MPL# *mpl, |
| 2684 | PARAMETERcxx . . $ PARAMETER# *par, /* not changed */ |
| 2685 | TUPLEcxx . . $ TUPLE# *tuple /* not changed */ |
| 2686 | ) |
| 2687 | { MEMBERcxx . . $ MEMBER# *memb; |
| 2688 | double value; |
| 2689 | /* find member in the parameter array */ |
| 2690 | memb = find_membercxx . . $ `external/glpk/glpmpl.h:1376:9`!(mpl, par->arraycxx . . $ PARAMETER#array., tuple); |
| 2691 | if (memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2692 | { /* member exists, so just take its value */ |
| 2693 | value = memb->valuecxx . . $ MEMBER#value..numcxx . . $ VALUE#num.; |
| 2694 | } |
| 2695 | else if (par->assigncxx . . $ PARAMETER#assign. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2696 | { /* compute value using assignment expression */ |
| 2697 | value = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, par->assigncxx . . $ PARAMETER#assign.); |
| 2698 | add: /* check that the value satisfies to all restrictions, assign |
| 2699 | it to new member, and add the member to the array */ |
| 2700 | check_value_numcxx . . $ `external/glpk/glpmpl.h:1667:9`!(mpl, par, tuple, value); |
| 2701 | memb = add_membercxx . . $ `external/glpk/glpmpl.h:1384:9`!(mpl, par->arraycxx . . $ PARAMETER#array., copy_tuplecxx . . $ `external/glpk/glpmpl.h:1018:9`!(mpl, tuple)); |
| 2702 | memb->valuecxx . . $ MEMBER#value..numcxx . . $ VALUE#num. = value; |
| 2703 | } |
| 2704 | else if (par->optioncxx . . $ PARAMETER#option. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2705 | { /* compute default value */ |
| 2706 | value = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, par->optioncxx . . $ PARAMETER#option.); |
| 2707 | goto add; |
| 2708 | } |
| 2709 | else if (par->defvalcxx . . $ PARAMETER#defval. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2710 | { /* take default value provided in the data section */ |
| 2711 | if (par->defvalcxx . . $ PARAMETER#defval.->strcxx . . $ SYMBOL#str. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2712 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "cannot convert %s to floating-point number", |
| 2713 | format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, par->defvalcxx . . $ PARAMETER#defval.)); |
| 2714 | value = par->defvalcxx . . $ PARAMETER#defval.->numcxx . . $ SYMBOL#num.; |
| 2715 | goto add; |
| 2716 | } |
| 2717 | else |
| 2718 | { /* no value is provided */ |
| 2719 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "no value for %s%s", par->namecxx . . $ PARAMETER#name., format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, |
| 2720 | '[', tuple)); |
| 2721 | } |
| 2722 | return value; |
| 2723 | } |
| 2724 | |
| 2725 | /*---------------------------------------------------------------------- |
| 2726 | -- eval_member_num - evaluate num. value assigned to parameter member. |
| 2727 | -- |
| 2728 | -- This routine evaluates a numeric value assigned to given member of |
| 2729 | -- specified numeric model parameter and returns it on exit. */ |
| 2730 | |
| 2731 | struct eval_num_infocxx . . $ eval_num_info# |
| 2732 | { /* working info used by the routine eval_member_num */ |
| 2733 | PARAMETERcxx . . $ PARAMETER# *parcxx . . $ eval_num_info#par.; |
| 2734 | /* model parameter */ |
| 2735 | TUPLEcxx . . $ TUPLE# *tuplecxx . . $ eval_num_info#tuple.; |
| 2736 | /* n-tuple, which defines parameter member */ |
| 2737 | MEMBERcxx . . $ MEMBER# *membcxx . . $ eval_num_info#memb.; |
| 2738 | /* normally this pointer is NULL; the routine uses this pointer |
| 2739 | to check data provided in the data section, in which case it |
| 2740 | points to a member currently checked; this check is performed |
| 2741 | automatically only once when a reference to any member occurs |
| 2742 | for the first time */ |
| 2743 | double valuecxx . . $ eval_num_info#value.; |
| 2744 | /* evaluated numeric value */ |
| 2745 | }; |
| 2746 | |
| 2747 | static void eval_num_funccxx . . $ eval_num_func(55b428b8c674eeb1).(MPLcxx . . $ MPL# *mpl, void *_info) |
| 2748 | { /* this is auxiliary routine to work within domain scope */ |
| 2749 | struct eval_num_infocxx . . $ eval_num_info# *info = _info; |
| 2750 | if (info->membcxx . . $ eval_num_info#memb. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2751 | { /* checking call; check numeric value being assigned */ |
| 2752 | check_value_numcxx . . $ `external/glpk/glpmpl.h:1667:9`!(mpl, info->parcxx . . $ eval_num_info#par., info->membcxx . . $ eval_num_info#memb.->tuplecxx . . $ MEMBER#tuple., |
| 2753 | info->membcxx . . $ eval_num_info#memb.->valuecxx . . $ MEMBER#value..numcxx . . $ VALUE#num.); |
| 2754 | } |
| 2755 | else |
| 2756 | { /* normal call; evaluate member, which has given n-tuple */ |
| 2757 | info->valuecxx . . $ eval_num_info#value. = take_member_numcxx . . $ `external/glpk/glpmpl.h:1676:9`!(mpl, info->parcxx . . $ eval_num_info#par., info->tuplecxx . . $ eval_num_info#tuple.); |
| 2758 | } |
| 2759 | return; |
| 2760 | } |
| 2761 | |
| 2762 | double eval_member_numcxx . . $ `external/glpk/glpmpl.h:1684:9`! |
| 2763 | ( MPLcxx . . $ MPL# *mpl, |
| 2764 | PARAMETERcxx . . $ PARAMETER# *par, /* not changed */ |
| 2765 | TUPLEcxx . . $ TUPLE# *tuple /* not changed */ |
| 2766 | ) |
| 2767 | { /* this routine evaluates numeric parameter member */ |
| 2768 | struct eval_num_infocxx . . $ eval_num_info# _info, *info = &_info; |
| 2769 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(par->type == A_NUMERICcxx . . $ `external/glpk/glpmpl.h:96:9`! || par->type == A_INTEGERcxx . . $ `external/glpk/glpmpl.h:91:9`! || |
| 2770 | par->type == A_BINARYcxx . . $ `external/glpk/glpmpl.h:79:9`!); |
| 2771 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(par->dim == tuple_dimencxx . . $ `external/glpk/glpmpl.h:1011:9`!(mpl, tuple)); |
| 2772 | info->parcxx . . $ eval_num_info#par. = par; |
| 2773 | info->tuplecxx . . $ eval_num_info#tuple. = tuple; |
| 2774 | if (par->datacxx . . $ PARAMETER#data. == 1) |
| 2775 | { /* check data, which are provided in the data section, but not |
| 2776 | checked yet */ |
| 2777 | /* save pointer to the last array member; note that during the |
| 2778 | check new members may be added beyond the last member due to |
| 2779 | references to the same parameter from default expression as |
| 2780 | well as from expressions that define restricting conditions; |
| 2781 | however, values assigned to the new members will be checked |
| 2782 | by other routine, so we don't need to check them here */ |
| 2783 | MEMBERcxx . . $ MEMBER# *tail = par->arraycxx . . $ PARAMETER#array.->tailcxx . . $ ARRAY#tail.; |
| 2784 | /* change the data status to prevent infinite recursive loop |
| 2785 | due to references to the same parameter during the check */ |
| 2786 | par->datacxx . . $ PARAMETER#data. = 2; |
| 2787 | /* check values assigned to array members in the data section |
| 2788 | until the marked member has been reached */ |
| 2789 | for (info->membcxx . . $ eval_num_info#memb. = par->arraycxx . . $ PARAMETER#array.->headcxx . . $ ARRAY#head.; info->membcxx . . $ eval_num_info#memb. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 2790 | info->membcxx . . $ eval_num_info#memb. = info->membcxx . . $ eval_num_info#memb.->nextcxx . . $ MEMBER#next.) |
| 2791 | { if (eval_within_domaincxx . . $ `external/glpk/glpmpl.h:1484:9`!(mpl, par->domaincxx . . $ PARAMETER#domain., info->membcxx . . $ eval_num_info#memb.->tuplecxx . . $ MEMBER#tuple., |
| 2792 | info, eval_num_funccxx . . $ eval_num_func(55b428b8c674eeb1).)) |
| 2793 | out_of_domaincxx . . $ `external/glpk/glpmpl.h:1501:9`!(mpl, par->namecxx . . $ PARAMETER#name., info->membcxx . . $ eval_num_info#memb.->tuplecxx . . $ MEMBER#tuple.); |
| 2794 | if (info->membcxx . . $ eval_num_info#memb. == tail) break; |
| 2795 | } |
| 2796 | /* the check has been finished */ |
| 2797 | } |
| 2798 | /* evaluate member, which has given n-tuple */ |
| 2799 | info->membcxx . . $ eval_num_info#memb. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 2800 | if (eval_within_domaincxx . . $ `external/glpk/glpmpl.h:1484:9`!(mpl, info->parcxx . . $ eval_num_info#par.->domaincxx . . $ PARAMETER#domain., info->tuplecxx . . $ eval_num_info#tuple., info, |
| 2801 | eval_num_funccxx . . $ eval_num_func(55b428b8c674eeb1).)) |
| 2802 | out_of_domaincxx . . $ `external/glpk/glpmpl.h:1501:9`!(mpl, par->namecxx . . $ PARAMETER#name., info->tuplecxx . . $ eval_num_info#tuple.); |
| 2803 | /* bring evaluated value to the calling program */ |
| 2804 | return info->valuecxx . . $ eval_num_info#value.; |
| 2805 | } |
| 2806 | |
| 2807 | /*---------------------------------------------------------------------- |
| 2808 | -- check_value_sym - check symbolic value assigned to parameter member. |
| 2809 | -- |
| 2810 | -- This routine checks if symbolic value being assigned to some member |
| 2811 | -- of specified symbolic model parameter satisfies to all restrictions. |
| 2812 | -- |
| 2813 | -- NOTE: This routine must not be called out of domain scope. */ |
| 2814 | |
| 2815 | void check_value_symcxx . . $ `external/glpk/glpmpl.h:1692:9`! |
| 2816 | ( MPLcxx . . $ MPL# *mpl, |
| 2817 | PARAMETERcxx . . $ PARAMETER# *par, /* not changed */ |
| 2818 | TUPLEcxx . . $ TUPLE# *tuple, /* not changed */ |
| 2819 | SYMBOLcxx . . $ SYMBOL# *value /* not changed */ |
| 2820 | ) |
| 2821 | { CONDITIONcxx . . $ CONDITION# *cond; |
| 2822 | WITHINcxx . . $ WITHIN# *in; |
| 2823 | int eqno; |
| 2824 | /* the value must satisfy to all specified conditions */ |
| 2825 | for (cond = par->condcxx . . $ PARAMETER#cond., eqno = 1; cond != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; cond = cond->nextcxx . . $ CONDITION#next., |
| 2826 | eqno++) |
| 2827 | { SYMBOLcxx . . $ SYMBOL# *bound; |
| 2828 | char buf[255+1]; |
| 2829 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(cond->code != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 2830 | bound = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, cond->codecxx . . $ CONDITION#code.); |
| 2831 | switch (cond->rhocxx . . $ CONDITION#rho.) |
| 2832 | { |
| 2833 | #if 1 /* 13/VIII-2008 */ |
| 2834 | case O_LTcxx . . $ `external/glpk/glpmpl.h:2129:9`!: |
| 2835 | if (!(compare_symbolscxx . . $ `external/glpk/glpmpl.h:956:9`!(mpl, value, bound) < 0)) |
| 2836 | { strcpycxx . . $ strcpy(b7b3a83273496486).(buf, format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, bound)); |
| 2837 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(strlen(buf) < sizeof(buf)); |
| 2838 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%s%s = %s not < %s", |
| 2839 | par->namecxx . . $ PARAMETER#name., format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', tuple), |
| 2840 | format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, value), buf, eqno); |
| 2841 | } |
| 2842 | break; |
| 2843 | case O_LEcxx . . $ `external/glpk/glpmpl.h:2130:9`!: |
| 2844 | if (!(compare_symbolscxx . . $ `external/glpk/glpmpl.h:956:9`!(mpl, value, bound) <= 0)) |
| 2845 | { strcpycxx . . $ strcpy(b7b3a83273496486).(buf, format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, bound)); |
| 2846 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(strlen(buf) < sizeof(buf)); |
| 2847 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%s%s = %s not <= %s", |
| 2848 | par->namecxx . . $ PARAMETER#name., format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', tuple), |
| 2849 | format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, value), buf, eqno); |
| 2850 | } |
| 2851 | break; |
| 2852 | #endif |
| 2853 | case O_EQcxx . . $ `external/glpk/glpmpl.h:2131:9`!: |
| 2854 | if (!(compare_symbolscxx . . $ `external/glpk/glpmpl.h:956:9`!(mpl, value, bound) == 0)) |
| 2855 | { strcpycxx . . $ strcpy(b7b3a83273496486).(buf, format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, bound)); |
| 2856 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(strlen(buf) < sizeof(buf)); |
| 2857 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%s%s = %s not = %s", |
| 2858 | par->namecxx . . $ PARAMETER#name., format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', tuple), |
| 2859 | format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, value), buf, eqno); |
| 2860 | } |
| 2861 | break; |
| 2862 | #if 1 /* 13/VIII-2008 */ |
| 2863 | case O_GEcxx . . $ `external/glpk/glpmpl.h:2132:9`!: |
| 2864 | if (!(compare_symbolscxx . . $ `external/glpk/glpmpl.h:956:9`!(mpl, value, bound) >= 0)) |
| 2865 | { strcpycxx . . $ strcpy(b7b3a83273496486).(buf, format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, bound)); |
| 2866 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(strlen(buf) < sizeof(buf)); |
| 2867 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%s%s = %s not >= %s", |
| 2868 | par->namecxx . . $ PARAMETER#name., format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', tuple), |
| 2869 | format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, value), buf, eqno); |
| 2870 | } |
| 2871 | break; |
| 2872 | case O_GTcxx . . $ `external/glpk/glpmpl.h:2133:9`!: |
| 2873 | if (!(compare_symbolscxx . . $ `external/glpk/glpmpl.h:956:9`!(mpl, value, bound) > 0)) |
| 2874 | { strcpycxx . . $ strcpy(b7b3a83273496486).(buf, format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, bound)); |
| 2875 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(strlen(buf) < sizeof(buf)); |
| 2876 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%s%s = %s not > %s", |
| 2877 | par->namecxx . . $ PARAMETER#name., format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', tuple), |
| 2878 | format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, value), buf, eqno); |
| 2879 | } |
| 2880 | break; |
| 2881 | #endif |
| 2882 | case O_NEcxx . . $ `external/glpk/glpmpl.h:2134:9`!: |
| 2883 | if (!(compare_symbolscxx . . $ `external/glpk/glpmpl.h:956:9`!(mpl, value, bound) != 0)) |
| 2884 | { strcpycxx . . $ strcpy(b7b3a83273496486).(buf, format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, bound)); |
| 2885 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(strlen(buf) < sizeof(buf)); |
| 2886 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%s%s = %s not <> %s", |
| 2887 | par->namecxx . . $ PARAMETER#name., format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', tuple), |
| 2888 | format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, value), buf, eqno); |
| 2889 | } |
| 2890 | break; |
| 2891 | default: |
| 2892 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(cond != cond); |
| 2893 | } |
| 2894 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, bound); |
| 2895 | } |
| 2896 | /* the value must be in all specified supersets */ |
| 2897 | for (in = par->incxx . . $ PARAMETER#in., eqno = 1; in != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; in = in->nextcxx . . $ WITHIN#next., eqno++) |
| 2898 | { TUPLEcxx . . $ TUPLE# *dummy; |
| 2899 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(in->code != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 2900 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(in->code->dim == 1); |
| 2901 | dummy = expand_tuplecxx . . $ `external/glpk/glpmpl.h:1003:9`!(mpl, create_tuplecxx . . $ `external/glpk/glpmpl.h:999:9`!(mpl), copy_symbolcxx . . $ `external/glpk/glpmpl.h:949:9`!(mpl, |
| 2902 | value)); |
| 2903 | if (!is_membercxx . . $ `external/glpk/glpmpl.h:2230:9`!(mpl, in->codecxx . . $ WITHIN#code., dummy)) |
| 2904 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%s%s = %s not in specified set; see (%d)", |
| 2905 | par->namecxx . . $ PARAMETER#name., format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', tuple), |
| 2906 | format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, value), eqno); |
| 2907 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, dummy); |
| 2908 | } |
| 2909 | return; |
| 2910 | } |
| 2911 | |
| 2912 | /*---------------------------------------------------------------------- |
| 2913 | -- take_member_sym - obtain symb. value assigned to parameter member. |
| 2914 | -- |
| 2915 | -- This routine obtains a symbolic value assigned to member of specified |
| 2916 | -- symbolic model parameter and returns it on exit. |
| 2917 | -- |
| 2918 | -- NOTE: This routine must not be called out of domain scope. */ |
| 2919 | |
| 2920 | SYMBOLcxx . . $ SYMBOL# *take_member_symcxx . . $ `external/glpk/glpmpl.h:1701:9`! /* returns value, not reference */ |
| 2921 | ( MPLcxx . . $ MPL# *mpl, |
| 2922 | PARAMETERcxx . . $ PARAMETER# *par, /* not changed */ |
| 2923 | TUPLEcxx . . $ TUPLE# *tuple /* not changed */ |
| 2924 | ) |
| 2925 | { MEMBERcxx . . $ MEMBER# *memb; |
| 2926 | SYMBOLcxx . . $ SYMBOL# *value; |
| 2927 | /* find member in the parameter array */ |
| 2928 | memb = find_membercxx . . $ `external/glpk/glpmpl.h:1376:9`!(mpl, par->arraycxx . . $ PARAMETER#array., tuple); |
| 2929 | if (memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2930 | { /* member exists, so just take its value */ |
| 2931 | value = copy_symbolcxx . . $ `external/glpk/glpmpl.h:949:9`!(mpl, memb->valuecxx . . $ MEMBER#value..symcxx . . $ VALUE#sym.); |
| 2932 | } |
| 2933 | else if (par->assigncxx . . $ PARAMETER#assign. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2934 | { /* compute value using assignment expression */ |
| 2935 | value = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, par->assigncxx . . $ PARAMETER#assign.); |
| 2936 | add: /* check that the value satisfies to all restrictions, assign |
| 2937 | it to new member, and add the member to the array */ |
| 2938 | check_value_symcxx . . $ `external/glpk/glpmpl.h:1692:9`!(mpl, par, tuple, value); |
| 2939 | memb = add_membercxx . . $ `external/glpk/glpmpl.h:1384:9`!(mpl, par->arraycxx . . $ PARAMETER#array., copy_tuplecxx . . $ `external/glpk/glpmpl.h:1018:9`!(mpl, tuple)); |
| 2940 | memb->valuecxx . . $ MEMBER#value..symcxx . . $ VALUE#sym. = copy_symbolcxx . . $ `external/glpk/glpmpl.h:949:9`!(mpl, value); |
| 2941 | } |
| 2942 | else if (par->optioncxx . . $ PARAMETER#option. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2943 | { /* compute default value */ |
| 2944 | value = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, par->optioncxx . . $ PARAMETER#option.); |
| 2945 | goto add; |
| 2946 | } |
| 2947 | else if (par->defvalcxx . . $ PARAMETER#defval. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2948 | { /* take default value provided in the data section */ |
| 2949 | value = copy_symbolcxx . . $ `external/glpk/glpmpl.h:949:9`!(mpl, par->defvalcxx . . $ PARAMETER#defval.); |
| 2950 | goto add; |
| 2951 | } |
| 2952 | else |
| 2953 | { /* no value is provided */ |
| 2954 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "no value for %s%s", par->namecxx . . $ PARAMETER#name., format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, |
| 2955 | '[', tuple)); |
| 2956 | } |
| 2957 | return value; |
| 2958 | } |
| 2959 | |
| 2960 | /*---------------------------------------------------------------------- |
| 2961 | -- eval_member_sym - evaluate symb. value assigned to parameter member. |
| 2962 | -- |
| 2963 | -- This routine evaluates a symbolic value assigned to given member of |
| 2964 | -- specified symbolic model parameter and returns it on exit. */ |
| 2965 | |
| 2966 | struct eval_sym_infocxx . . $ eval_sym_info# |
| 2967 | { /* working info used by the routine eval_member_sym */ |
| 2968 | PARAMETERcxx . . $ PARAMETER# *parcxx . . $ eval_sym_info#par.; |
| 2969 | /* model parameter */ |
| 2970 | TUPLEcxx . . $ TUPLE# *tuplecxx . . $ eval_sym_info#tuple.; |
| 2971 | /* n-tuple, which defines parameter member */ |
| 2972 | MEMBERcxx . . $ MEMBER# *membcxx . . $ eval_sym_info#memb.; |
| 2973 | /* normally this pointer is NULL; the routine uses this pointer |
| 2974 | to check data provided in the data section, in which case it |
| 2975 | points to a member currently checked; this check is performed |
| 2976 | automatically only once when a reference to any member occurs |
| 2977 | for the first time */ |
| 2978 | SYMBOLcxx . . $ SYMBOL# *valuecxx . . $ eval_sym_info#value.; |
| 2979 | /* evaluated symbolic value */ |
| 2980 | }; |
| 2981 | |
| 2982 | static void eval_sym_funccxx . . $ eval_sym_func(55b428b8c674eeb1).(MPLcxx . . $ MPL# *mpl, void *_info) |
| 2983 | { /* this is auxiliary routine to work within domain scope */ |
| 2984 | struct eval_sym_infocxx . . $ eval_sym_info# *info = _info; |
| 2985 | if (info->membcxx . . $ eval_sym_info#memb. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 2986 | { /* checking call; check symbolic value being assigned */ |
| 2987 | check_value_symcxx . . $ `external/glpk/glpmpl.h:1692:9`!(mpl, info->parcxx . . $ eval_sym_info#par., info->membcxx . . $ eval_sym_info#memb.->tuplecxx . . $ MEMBER#tuple., |
| 2988 | info->membcxx . . $ eval_sym_info#memb.->valuecxx . . $ MEMBER#value..symcxx . . $ VALUE#sym.); |
| 2989 | } |
| 2990 | else |
| 2991 | { /* normal call; evaluate member, which has given n-tuple */ |
| 2992 | info->valuecxx . . $ eval_sym_info#value. = take_member_symcxx . . $ `external/glpk/glpmpl.h:1701:9`!(mpl, info->parcxx . . $ eval_sym_info#par., info->tuplecxx . . $ eval_sym_info#tuple.); |
| 2993 | } |
| 2994 | return; |
| 2995 | } |
| 2996 | |
| 2997 | SYMBOLcxx . . $ SYMBOL# *eval_member_symcxx . . $ `external/glpk/glpmpl.h:1709:9`! /* returns value, not reference */ |
| 2998 | ( MPLcxx . . $ MPL# *mpl, |
| 2999 | PARAMETERcxx . . $ PARAMETER# *par, /* not changed */ |
| 3000 | TUPLEcxx . . $ TUPLE# *tuple /* not changed */ |
| 3001 | ) |
| 3002 | { /* this routine evaluates symbolic parameter member */ |
| 3003 | struct eval_sym_infocxx . . $ eval_sym_info# _info, *info = &_info; |
| 3004 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(par->type == A_SYMBOLICcxx . . $ `external/glpk/glpmpl.h:102:9`!); |
| 3005 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(par->dim == tuple_dimencxx . . $ `external/glpk/glpmpl.h:1011:9`!(mpl, tuple)); |
| 3006 | info->parcxx . . $ eval_sym_info#par. = par; |
| 3007 | info->tuplecxx . . $ eval_sym_info#tuple. = tuple; |
| 3008 | if (par->datacxx . . $ PARAMETER#data. == 1) |
| 3009 | { /* check data, which are provided in the data section, but not |
| 3010 | checked yet */ |
| 3011 | /* save pointer to the last array member; note that during the |
| 3012 | check new members may be added beyond the last member due to |
| 3013 | references to the same parameter from default expression as |
| 3014 | well as from expressions that define restricting conditions; |
| 3015 | however, values assigned to the new members will be checked |
| 3016 | by other routine, so we don't need to check them here */ |
| 3017 | MEMBERcxx . . $ MEMBER# *tail = par->arraycxx . . $ PARAMETER#array.->tailcxx . . $ ARRAY#tail.; |
| 3018 | /* change the data status to prevent infinite recursive loop |
| 3019 | due to references to the same parameter during the check */ |
| 3020 | par->datacxx . . $ PARAMETER#data. = 2; |
| 3021 | /* check values assigned to array members in the data section |
| 3022 | until the marked member has been reached */ |
| 3023 | for (info->membcxx . . $ eval_sym_info#memb. = par->arraycxx . . $ PARAMETER#array.->headcxx . . $ ARRAY#head.; info->membcxx . . $ eval_sym_info#memb. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 3024 | info->membcxx . . $ eval_sym_info#memb. = info->membcxx . . $ eval_sym_info#memb.->nextcxx . . $ MEMBER#next.) |
| 3025 | { if (eval_within_domaincxx . . $ `external/glpk/glpmpl.h:1484:9`!(mpl, par->domaincxx . . $ PARAMETER#domain., info->membcxx . . $ eval_sym_info#memb.->tuplecxx . . $ MEMBER#tuple., |
| 3026 | info, eval_sym_funccxx . . $ eval_sym_func(55b428b8c674eeb1).)) |
| 3027 | out_of_domaincxx . . $ `external/glpk/glpmpl.h:1501:9`!(mpl, par->namecxx . . $ PARAMETER#name., info->membcxx . . $ eval_sym_info#memb.->tuplecxx . . $ MEMBER#tuple.); |
| 3028 | if (info->membcxx . . $ eval_sym_info#memb. == tail) break; |
| 3029 | } |
| 3030 | /* the check has been finished */ |
| 3031 | } |
| 3032 | /* evaluate member, which has given n-tuple */ |
| 3033 | info->membcxx . . $ eval_sym_info#memb. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 3034 | if (eval_within_domaincxx . . $ `external/glpk/glpmpl.h:1484:9`!(mpl, info->parcxx . . $ eval_sym_info#par.->domaincxx . . $ PARAMETER#domain., info->tuplecxx . . $ eval_sym_info#tuple., info, |
| 3035 | eval_sym_funccxx . . $ eval_sym_func(55b428b8c674eeb1).)) |
| 3036 | out_of_domaincxx . . $ `external/glpk/glpmpl.h:1501:9`!(mpl, par->namecxx . . $ PARAMETER#name., info->tuplecxx . . $ eval_sym_info#tuple.); |
| 3037 | /* bring evaluated value to the calling program */ |
| 3038 | return info->valuecxx . . $ eval_sym_info#value.; |
| 3039 | } |
| 3040 | |
| 3041 | /*---------------------------------------------------------------------- |
| 3042 | -- eval_whole_par - evaluate model parameter over entire domain. |
| 3043 | -- |
| 3044 | -- This routine evaluates all members of specified model parameter over |
| 3045 | -- entire domain. */ |
| 3046 | |
| 3047 | static int whole_par_funccxx . . $ whole_par_func(3bbfabe35f227878).(MPLcxx . . $ MPL# *mpl, void *info) |
| 3048 | { /* this is auxiliary routine to work within domain scope */ |
| 3049 | PARAMETERcxx . . $ PARAMETER# *par = (PARAMETERcxx . . $ PARAMETER# *)info; |
| 3050 | TUPLEcxx . . $ TUPLE# *tuple = get_domain_tuplecxx . . $ `external/glpk/glpmpl.h:1509:9`!(mpl, par->domaincxx . . $ PARAMETER#domain.); |
| 3051 | switch (par->typecxx . . $ PARAMETER#type.) |
| 3052 | { case A_NUMERICcxx . . $ `external/glpk/glpmpl.h:96:9`!: |
| 3053 | case A_INTEGERcxx . . $ `external/glpk/glpmpl.h:91:9`!: |
| 3054 | case A_BINARYcxx . . $ `external/glpk/glpmpl.h:79:9`!: |
| 3055 | eval_member_numcxx . . $ `external/glpk/glpmpl.h:1684:9`!(mpl, par, tuple); |
| 3056 | break; |
| 3057 | case A_SYMBOLICcxx . . $ `external/glpk/glpmpl.h:102:9`!: |
| 3058 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, eval_member_symcxx . . $ `external/glpk/glpmpl.h:1709:9`!(mpl, par, tuple)); |
| 3059 | break; |
| 3060 | default: |
| 3061 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(par != par); |
| 3062 | } |
| 3063 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, tuple); |
| 3064 | return 0; |
| 3065 | } |
| 3066 | |
| 3067 | void eval_whole_parcxx . . $ `external/glpk/glpmpl.h:1717:9`!(MPLcxx . . $ MPL# *mpl, PARAMETERcxx . . $ PARAMETER# *par) |
| 3068 | { loop_within_domaincxx . . $ `external/glpk/glpmpl.h:1493:9`!(mpl, par->domaincxx . . $ PARAMETER#domain., par, whole_par_funccxx . . $ whole_par_func(3bbfabe35f227878).); |
| 3069 | return; |
| 3070 | } |
| 3071 | |
| 3072 | /*---------------------------------------------------------------------- |
| 3073 | -- clean_parameter - clean model parameter. |
| 3074 | -- |
| 3075 | -- This routine cleans specified model parameter that assumes deleting |
| 3076 | -- all stuff dynamically allocated during the generation phase. */ |
| 3077 | |
| 3078 | void clean_parametercxx . . $ `external/glpk/glpmpl.h:1721:9`!(MPLcxx . . $ MPL# *mpl, PARAMETERcxx . . $ PARAMETER# *par) |
| 3079 | { CONDITIONcxx . . $ CONDITION# *cond; |
| 3080 | WITHINcxx . . $ WITHIN# *in; |
| 3081 | MEMBERcxx . . $ MEMBER# *memb; |
| 3082 | /* clean subscript domain */ |
| 3083 | clean_domaincxx . . $ `external/glpk/glpmpl.h:1516:9`!(mpl, par->domaincxx . . $ PARAMETER#domain.); |
| 3084 | /* clean pseudo-code for computing restricting conditions */ |
| 3085 | for (cond = par->condcxx . . $ PARAMETER#cond.; cond != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; cond = cond->nextcxx . . $ CONDITION#next.) |
| 3086 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, cond->codecxx . . $ CONDITION#code.); |
| 3087 | /* clean pseudo-code for computing restricting supersets */ |
| 3088 | for (in = par->incxx . . $ PARAMETER#in.; in != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; in = in->nextcxx . . $ WITHIN#next.) |
| 3089 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, in->codecxx . . $ WITHIN#code.); |
| 3090 | /* clean pseudo-code for computing assigned value */ |
| 3091 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, par->assigncxx . . $ PARAMETER#assign.); |
| 3092 | /* clean pseudo-code for computing default value */ |
| 3093 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, par->optioncxx . . $ PARAMETER#option.); |
| 3094 | /* reset data status flag */ |
| 3095 | par->datacxx . . $ PARAMETER#data. = 0; |
| 3096 | /* delete default symbolic value */ |
| 3097 | if (par->defvalcxx . . $ PARAMETER#defval. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 3098 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, par->defvalcxx . . $ PARAMETER#defval.), par->defvalcxx . . $ PARAMETER#defval. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 3099 | /* delete content array */ |
| 3100 | for (memb = par->arraycxx . . $ PARAMETER#array.->headcxx . . $ ARRAY#head.; memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memb = memb->nextcxx . . $ MEMBER#next.) |
| 3101 | delete_valuecxx . . $ `external/glpk/glpmpl.h:1314:9`!(mpl, par->arraycxx . . $ PARAMETER#array.->typecxx . . $ ARRAY#type., &memb->valuecxx . . $ MEMBER#value.); |
| 3102 | delete_arraycxx . . $ `external/glpk/glpmpl.h:1392:9`!(mpl, par->arraycxx . . $ PARAMETER#array.), par->arraycxx . . $ PARAMETER#array. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 3103 | return; |
| 3104 | } |
| 3105 | |
| 3106 | /**********************************************************************/ |
| 3107 | /* * * MODEL VARIABLES * * */ |
| 3108 | /**********************************************************************/ |
| 3109 | |
| 3110 | /*---------------------------------------------------------------------- |
| 3111 | -- take_member_var - obtain reference to elemental variable. |
| 3112 | -- |
| 3113 | -- This routine obtains a reference to elemental variable assigned to |
| 3114 | -- given member of specified model variable and returns it on exit. If |
| 3115 | -- necessary, new elemental variable is created. |
| 3116 | -- |
| 3117 | -- NOTE: This routine must not be called out of domain scope. */ |
| 3118 | |
| 3119 | ELEMVARcxx . . $ ELEMVAR# *take_member_varcxx . . $ `external/glpk/glpmpl.h:1757:9`! /* returns reference */ |
| 3120 | ( MPLcxx . . $ MPL# *mpl, |
| 3121 | VARIABLEcxx . . $ VARIABLE# *var, /* not changed */ |
| 3122 | TUPLEcxx . . $ TUPLE# *tuple /* not changed */ |
| 3123 | ) |
| 3124 | { MEMBERcxx . . $ MEMBER# *memb; |
| 3125 | ELEMVARcxx . . $ ELEMVAR# *refer; |
| 3126 | /* find member in the variable array */ |
| 3127 | memb = find_membercxx . . $ `external/glpk/glpmpl.h:1376:9`!(mpl, var->arraycxx . . $ VARIABLE#array., tuple); |
| 3128 | if (memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 3129 | { /* member exists, so just take the reference */ |
| 3130 | refer = memb->valuecxx . . $ MEMBER#value..varcxx . . $ VALUE#var.; |
| 3131 | } |
| 3132 | else |
| 3133 | { /* member is referenced for the first time and therefore does |
| 3134 | not exist; create new elemental variable, assign it to new |
| 3135 | member, and add the member to the variable array */ |
| 3136 | memb = add_membercxx . . $ `external/glpk/glpmpl.h:1384:9`!(mpl, var->arraycxx . . $ VARIABLE#array., copy_tuplecxx . . $ `external/glpk/glpmpl.h:1018:9`!(mpl, tuple)); |
| 3137 | refer = (memb->valuecxx . . $ MEMBER#value..varcxx . . $ VALUE#var. = |
| 3138 | dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(mpl->elemvarscxx . . $ MPL#elemvars., sizeof(ELEMVARcxx . . $ ELEMVAR#))); |
| 3139 | refer->jcxx . . $ ELEMVAR#j. = 0; |
| 3140 | refer->varcxx . . $ ELEMVAR#var. = var; |
| 3141 | refer->membcxx . . $ ELEMVAR#memb. = memb; |
| 3142 | /* compute lower bound */ |
| 3143 | if (var->lbndcxx . . $ VARIABLE#lbnd. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 3144 | refer->lbndcxx . . $ ELEMVAR#lbnd. = 0.0; |
| 3145 | else |
| 3146 | refer->lbndcxx . . $ ELEMVAR#lbnd. = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, var->lbndcxx . . $ VARIABLE#lbnd.); |
| 3147 | /* compute upper bound */ |
| 3148 | if (var->ubndcxx . . $ VARIABLE#ubnd. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 3149 | refer->ubndcxx . . $ ELEMVAR#ubnd. = 0.0; |
| 3150 | else if (var->ubndcxx . . $ VARIABLE#ubnd. == var->lbndcxx . . $ VARIABLE#lbnd.) |
| 3151 | refer->ubndcxx . . $ ELEMVAR#ubnd. = refer->lbndcxx . . $ ELEMVAR#lbnd.; |
| 3152 | else |
| 3153 | refer->ubndcxx . . $ ELEMVAR#ubnd. = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, var->ubndcxx . . $ VARIABLE#ubnd.); |
| 3154 | /* nullify working quantity */ |
| 3155 | refer->tempcxx . . $ ELEMVAR#temp. = 0.0; |
| 3156 | #if 1 /* 15/V-2010 */ |
| 3157 | /* solution has not been obtained by the solver yet */ |
| 3158 | refer->statcxx . . $ ELEMVAR#stat. = 0; |
| 3159 | refer->primcxx . . $ ELEMVAR#prim. = refer->dualcxx . . $ ELEMVAR#dual. = 0.0; |
| 3160 | #endif |
| 3161 | } |
| 3162 | return refer; |
| 3163 | } |
| 3164 | |
| 3165 | /*---------------------------------------------------------------------- |
| 3166 | -- eval_member_var - evaluate reference to elemental variable. |
| 3167 | -- |
| 3168 | -- This routine evaluates a reference to elemental variable assigned to |
| 3169 | -- member of specified model variable and returns it on exit. */ |
| 3170 | |
| 3171 | struct eval_var_infocxx . . $ eval_var_info# |
| 3172 | { /* working info used by the routine eval_member_var */ |
| 3173 | VARIABLEcxx . . $ VARIABLE# *varcxx . . $ eval_var_info#var.; |
| 3174 | /* model variable */ |
| 3175 | TUPLEcxx . . $ TUPLE# *tuplecxx . . $ eval_var_info#tuple.; |
| 3176 | /* n-tuple, which defines variable member */ |
| 3177 | ELEMVARcxx . . $ ELEMVAR# *refercxx . . $ eval_var_info#refer.; |
| 3178 | /* evaluated reference to elemental variable */ |
| 3179 | }; |
| 3180 | |
| 3181 | static void eval_var_funccxx . . $ eval_var_func(55b428b8c674eeb1).(MPLcxx . . $ MPL# *mpl, void *_info) |
| 3182 | { /* this is auxiliary routine to work within domain scope */ |
| 3183 | struct eval_var_infocxx . . $ eval_var_info# *info = _info; |
| 3184 | info->refercxx . . $ eval_var_info#refer. = take_member_varcxx . . $ `external/glpk/glpmpl.h:1757:9`!(mpl, info->varcxx . . $ eval_var_info#var., info->tuplecxx . . $ eval_var_info#tuple.); |
| 3185 | return; |
| 3186 | } |
| 3187 | |
| 3188 | ELEMVARcxx . . $ ELEMVAR# *eval_member_varcxx . . $ `external/glpk/glpmpl.h:1765:9`! /* returns reference */ |
| 3189 | ( MPLcxx . . $ MPL# *mpl, |
| 3190 | VARIABLEcxx . . $ VARIABLE# *var, /* not changed */ |
| 3191 | TUPLEcxx . . $ TUPLE# *tuple /* not changed */ |
| 3192 | ) |
| 3193 | { /* this routine evaluates variable member */ |
| 3194 | struct eval_var_infocxx . . $ eval_var_info# _info, *info = &_info; |
| 3195 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(var->dim == tuple_dimencxx . . $ `external/glpk/glpmpl.h:1011:9`!(mpl, tuple)); |
| 3196 | info->varcxx . . $ eval_var_info#var. = var; |
| 3197 | info->tuplecxx . . $ eval_var_info#tuple. = tuple; |
| 3198 | /* evaluate member, which has given n-tuple */ |
| 3199 | if (eval_within_domaincxx . . $ `external/glpk/glpmpl.h:1484:9`!(mpl, info->varcxx . . $ eval_var_info#var.->domaincxx . . $ VARIABLE#domain., info->tuplecxx . . $ eval_var_info#tuple., info, |
| 3200 | eval_var_funccxx . . $ eval_var_func(55b428b8c674eeb1).)) |
| 3201 | out_of_domaincxx . . $ `external/glpk/glpmpl.h:1501:9`!(mpl, var->namecxx . . $ VARIABLE#name., info->tuplecxx . . $ eval_var_info#tuple.); |
| 3202 | /* bring evaluated reference to the calling program */ |
| 3203 | return info->refercxx . . $ eval_var_info#refer.; |
| 3204 | } |
| 3205 | |
| 3206 | /*---------------------------------------------------------------------- |
| 3207 | -- eval_whole_var - evaluate model variable over entire domain. |
| 3208 | -- |
| 3209 | -- This routine evaluates all members of specified model variable over |
| 3210 | -- entire domain. */ |
| 3211 | |
| 3212 | static int whole_var_funccxx . . $ whole_var_func(3bbfabe35f227878).(MPLcxx . . $ MPL# *mpl, void *info) |
| 3213 | { /* this is auxiliary routine to work within domain scope */ |
| 3214 | VARIABLEcxx . . $ VARIABLE# *var = (VARIABLEcxx . . $ VARIABLE# *)info; |
| 3215 | TUPLEcxx . . $ TUPLE# *tuple = get_domain_tuplecxx . . $ `external/glpk/glpmpl.h:1509:9`!(mpl, var->domaincxx . . $ VARIABLE#domain.); |
| 3216 | eval_member_varcxx . . $ `external/glpk/glpmpl.h:1765:9`!(mpl, var, tuple); |
| 3217 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, tuple); |
| 3218 | return 0; |
| 3219 | } |
| 3220 | |
| 3221 | void eval_whole_varcxx . . $ `external/glpk/glpmpl.h:1773:9`!(MPLcxx . . $ MPL# *mpl, VARIABLEcxx . . $ VARIABLE# *var) |
| 3222 | { loop_within_domaincxx . . $ `external/glpk/glpmpl.h:1493:9`!(mpl, var->domaincxx . . $ VARIABLE#domain., var, whole_var_funccxx . . $ whole_var_func(3bbfabe35f227878).); |
| 3223 | return; |
| 3224 | } |
| 3225 | |
| 3226 | /*---------------------------------------------------------------------- |
| 3227 | -- clean_variable - clean model variable. |
| 3228 | -- |
| 3229 | -- This routine cleans specified model variable that assumes deleting |
| 3230 | -- all stuff dynamically allocated during the generation phase. */ |
| 3231 | |
| 3232 | void clean_variablecxx . . $ `external/glpk/glpmpl.h:1777:9`!(MPLcxx . . $ MPL# *mpl, VARIABLEcxx . . $ VARIABLE# *var) |
| 3233 | { MEMBERcxx . . $ MEMBER# *memb; |
| 3234 | /* clean subscript domain */ |
| 3235 | clean_domaincxx . . $ `external/glpk/glpmpl.h:1516:9`!(mpl, var->domaincxx . . $ VARIABLE#domain.); |
| 3236 | /* clean code for computing lower bound */ |
| 3237 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, var->lbndcxx . . $ VARIABLE#lbnd.); |
| 3238 | /* clean code for computing upper bound */ |
| 3239 | if (var->ubndcxx . . $ VARIABLE#ubnd. != var->lbndcxx . . $ VARIABLE#lbnd.) clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, var->ubndcxx . . $ VARIABLE#ubnd.); |
| 3240 | /* delete content array */ |
| 3241 | for (memb = var->arraycxx . . $ VARIABLE#array.->headcxx . . $ ARRAY#head.; memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memb = memb->nextcxx . . $ MEMBER#next.) |
| 3242 | dmp_free_atomcxx . . $ `external/glpk/glpdmp.h:66:9`!(mpl->elemvarscxx . . $ MPL#elemvars., memb->valuecxx . . $ MEMBER#value..varcxx . . $ VALUE#var., sizeof(ELEMVARcxx . . $ ELEMVAR#)); |
| 3243 | delete_arraycxx . . $ `external/glpk/glpmpl.h:1392:9`!(mpl, var->arraycxx . . $ VARIABLE#array.), var->arraycxx . . $ VARIABLE#array. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 3244 | return; |
| 3245 | } |
| 3246 | |
| 3247 | /**********************************************************************/ |
| 3248 | /* * * MODEL CONSTRAINTS AND OBJECTIVES * * */ |
| 3249 | /**********************************************************************/ |
| 3250 | |
| 3251 | /*---------------------------------------------------------------------- |
| 3252 | -- take_member_con - obtain reference to elemental constraint. |
| 3253 | -- |
| 3254 | -- This routine obtains a reference to elemental constraint assigned |
| 3255 | -- to given member of specified model constraint and returns it on exit. |
| 3256 | -- If necessary, new elemental constraint is created. |
| 3257 | -- |
| 3258 | -- NOTE: This routine must not be called out of domain scope. */ |
| 3259 | |
| 3260 | ELEMCONcxx . . $ ELEMCON# *take_member_concxx . . $ `external/glpk/glpmpl.h:1815:9`! /* returns reference */ |
| 3261 | ( MPLcxx . . $ MPL# *mpl, |
| 3262 | CONSTRAINTcxx . . $ CONSTRAINT# *con, /* not changed */ |
| 3263 | TUPLEcxx . . $ TUPLE# *tuple /* not changed */ |
| 3264 | ) |
| 3265 | { MEMBERcxx . . $ MEMBER# *memb; |
| 3266 | ELEMCONcxx . . $ ELEMCON# *refer; |
| 3267 | /* find member in the constraint array */ |
| 3268 | memb = find_membercxx . . $ `external/glpk/glpmpl.h:1376:9`!(mpl, con->arraycxx . . $ CONSTRAINT#array., tuple); |
| 3269 | if (memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 3270 | { /* member exists, so just take the reference */ |
| 3271 | refer = memb->valuecxx . . $ MEMBER#value..concxx . . $ VALUE#con.; |
| 3272 | } |
| 3273 | else |
| 3274 | { /* member is referenced for the first time and therefore does |
| 3275 | not exist; create new elemental constraint, assign it to new |
| 3276 | member, and add the member to the constraint array */ |
| 3277 | memb = add_membercxx . . $ `external/glpk/glpmpl.h:1384:9`!(mpl, con->arraycxx . . $ CONSTRAINT#array., copy_tuplecxx . . $ `external/glpk/glpmpl.h:1018:9`!(mpl, tuple)); |
| 3278 | refer = (memb->valuecxx . . $ MEMBER#value..concxx . . $ VALUE#con. = |
| 3279 | dmp_get_atomcxx . . $ `external/glpk/glpdmp.h:62:9`!(mpl->elemconscxx . . $ MPL#elemcons., sizeof(ELEMCONcxx . . $ ELEMCON#))); |
| 3280 | refer->icxx . . $ ELEMCON#i. = 0; |
| 3281 | refer->concxx . . $ ELEMCON#con. = con; |
| 3282 | refer->membcxx . . $ ELEMCON#memb. = memb; |
| 3283 | /* compute linear form */ |
| 3284 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(con->code != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 3285 | refer->formcxx . . $ ELEMCON#form. = eval_formulacxx . . $ `external/glpk/glpmpl.h:2234:9`!(mpl, con->codecxx . . $ CONSTRAINT#code.); |
| 3286 | /* compute lower and upper bounds */ |
| 3287 | if (con->lbndcxx . . $ CONSTRAINT#lbnd. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! && con->ubndcxx . . $ CONSTRAINT#ubnd. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 3288 | { /* objective has no bounds */ |
| 3289 | double temp; |
| 3290 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(con->type == A_MINIMIZEcxx . . $ `external/glpk/glpmpl.h:94:9`! || con->type == A_MAXIMIZEcxx . . $ `external/glpk/glpmpl.h:93:9`!); |
| 3291 | /* carry the constant term to the right-hand side */ |
| 3292 | refer->formcxx . . $ ELEMCON#form. = remove_constantcxx . . $ `external/glpk/glpmpl.h:1242:9`!(mpl, refer->formcxx . . $ ELEMCON#form., &temp); |
| 3293 | refer->lbndcxx . . $ ELEMCON#lbnd. = refer->ubndcxx . . $ ELEMCON#ubnd. = - temp; |
| 3294 | } |
| 3295 | else if (con->lbndcxx . . $ CONSTRAINT#lbnd. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! && con->ubndcxx . . $ CONSTRAINT#ubnd. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 3296 | { /* constraint a * x + b >= c * y + d is transformed to the |
| 3297 | standard form a * x - c * y >= d - b */ |
| 3298 | double temp; |
| 3299 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(con->type == A_CONSTRAINTcxx . . $ `external/glpk/glpmpl.h:81:9`!); |
| 3300 | refer->formcxx . . $ ELEMCON#form. = linear_combcxx . . $ `external/glpk/glpmpl.h:1234:9`!(mpl, |
| 3301 | +1.0, refer->formcxx . . $ ELEMCON#form., |
| 3302 | -1.0, eval_formulacxx . . $ `external/glpk/glpmpl.h:2234:9`!(mpl, con->lbndcxx . . $ CONSTRAINT#lbnd.)); |
| 3303 | refer->formcxx . . $ ELEMCON#form. = remove_constantcxx . . $ `external/glpk/glpmpl.h:1242:9`!(mpl, refer->formcxx . . $ ELEMCON#form., &temp); |
| 3304 | refer->lbndcxx . . $ ELEMCON#lbnd. = - temp; |
| 3305 | refer->ubndcxx . . $ ELEMCON#ubnd. = 0.0; |
| 3306 | } |
| 3307 | else if (con->lbndcxx . . $ CONSTRAINT#lbnd. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! && con->ubndcxx . . $ CONSTRAINT#ubnd. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 3308 | { /* constraint a * x + b <= c * y + d is transformed to the |
| 3309 | standard form a * x - c * y <= d - b */ |
| 3310 | double temp; |
| 3311 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(con->type == A_CONSTRAINTcxx . . $ `external/glpk/glpmpl.h:81:9`!); |
| 3312 | refer->formcxx . . $ ELEMCON#form. = linear_combcxx . . $ `external/glpk/glpmpl.h:1234:9`!(mpl, |
| 3313 | +1.0, refer->formcxx . . $ ELEMCON#form., |
| 3314 | -1.0, eval_formulacxx . . $ `external/glpk/glpmpl.h:2234:9`!(mpl, con->ubndcxx . . $ CONSTRAINT#ubnd.)); |
| 3315 | refer->formcxx . . $ ELEMCON#form. = remove_constantcxx . . $ `external/glpk/glpmpl.h:1242:9`!(mpl, refer->formcxx . . $ ELEMCON#form., &temp); |
| 3316 | refer->lbndcxx . . $ ELEMCON#lbnd. = 0.0; |
| 3317 | refer->ubndcxx . . $ ELEMCON#ubnd. = - temp; |
| 3318 | } |
| 3319 | else if (con->lbndcxx . . $ CONSTRAINT#lbnd. == con->ubndcxx . . $ CONSTRAINT#ubnd.) |
| 3320 | { /* constraint a * x + b = c * y + d is transformed to the |
| 3321 | standard form a * x - c * y = d - b */ |
| 3322 | double temp; |
| 3323 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(con->type == A_CONSTRAINTcxx . . $ `external/glpk/glpmpl.h:81:9`!); |
| 3324 | refer->formcxx . . $ ELEMCON#form. = linear_combcxx . . $ `external/glpk/glpmpl.h:1234:9`!(mpl, |
| 3325 | +1.0, refer->formcxx . . $ ELEMCON#form., |
| 3326 | -1.0, eval_formulacxx . . $ `external/glpk/glpmpl.h:2234:9`!(mpl, con->lbndcxx . . $ CONSTRAINT#lbnd.)); |
| 3327 | refer->formcxx . . $ ELEMCON#form. = remove_constantcxx . . $ `external/glpk/glpmpl.h:1242:9`!(mpl, refer->formcxx . . $ ELEMCON#form., &temp); |
| 3328 | refer->lbndcxx . . $ ELEMCON#lbnd. = refer->ubndcxx . . $ ELEMCON#ubnd. = - temp; |
| 3329 | } |
| 3330 | else |
| 3331 | { /* ranged constraint c <= a * x + b <= d is transformed to |
| 3332 | the standard form c - b <= a * x <= d - b */ |
| 3333 | double temp, temp1, temp2; |
| 3334 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(con->type == A_CONSTRAINTcxx . . $ `external/glpk/glpmpl.h:81:9`!); |
| 3335 | refer->formcxx . . $ ELEMCON#form. = remove_constantcxx . . $ `external/glpk/glpmpl.h:1242:9`!(mpl, refer->formcxx . . $ ELEMCON#form., &temp); |
| 3336 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(remove_constantcxx . . $ `external/glpk/glpmpl.h:1242:9`!(mpl, eval_formulacxx . . $ `external/glpk/glpmpl.h:2234:9`!(mpl, con->lbnd), |
| 3337 | &temp1) == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 3338 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(remove_constantcxx . . $ `external/glpk/glpmpl.h:1242:9`!(mpl, eval_formulacxx . . $ `external/glpk/glpmpl.h:2234:9`!(mpl, con->ubnd), |
| 3339 | &temp2) == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 3340 | refer->lbndcxx . . $ ELEMCON#lbnd. = fp_subcxx . . $ `external/glpk/glpmpl.h:777:9`!(mpl, temp1, temp); |
| 3341 | refer->ubndcxx . . $ ELEMCON#ubnd. = fp_subcxx . . $ `external/glpk/glpmpl.h:777:9`!(mpl, temp2, temp); |
| 3342 | } |
| 3343 | #if 1 /* 15/V-2010 */ |
| 3344 | /* solution has not been obtained by the solver yet */ |
| 3345 | refer->statcxx . . $ ELEMCON#stat. = 0; |
| 3346 | refer->primcxx . . $ ELEMCON#prim. = refer->dualcxx . . $ ELEMCON#dual. = 0.0; |
| 3347 | #endif |
| 3348 | } |
| 3349 | return refer; |
| 3350 | } |
| 3351 | |
| 3352 | /*---------------------------------------------------------------------- |
| 3353 | -- eval_member_con - evaluate reference to elemental constraint. |
| 3354 | -- |
| 3355 | -- This routine evaluates a reference to elemental constraint assigned |
| 3356 | -- to member of specified model constraint and returns it on exit. */ |
| 3357 | |
| 3358 | struct eval_con_infocxx . . $ eval_con_info# |
| 3359 | { /* working info used by the routine eval_member_con */ |
| 3360 | CONSTRAINTcxx . . $ CONSTRAINT# *concxx . . $ eval_con_info#con.; |
| 3361 | /* model constraint */ |
| 3362 | TUPLEcxx . . $ TUPLE# *tuplecxx . . $ eval_con_info#tuple.; |
| 3363 | /* n-tuple, which defines constraint member */ |
| 3364 | ELEMCONcxx . . $ ELEMCON# *refercxx . . $ eval_con_info#refer.; |
| 3365 | /* evaluated reference to elemental constraint */ |
| 3366 | }; |
| 3367 | |
| 3368 | static void eval_con_funccxx . . $ eval_con_func(55b428b8c674eeb1).(MPLcxx . . $ MPL# *mpl, void *_info) |
| 3369 | { /* this is auxiliary routine to work within domain scope */ |
| 3370 | struct eval_con_infocxx . . $ eval_con_info# *info = _info; |
| 3371 | info->refercxx . . $ eval_con_info#refer. = take_member_concxx . . $ `external/glpk/glpmpl.h:1815:9`!(mpl, info->concxx . . $ eval_con_info#con., info->tuplecxx . . $ eval_con_info#tuple.); |
| 3372 | return; |
| 3373 | } |
| 3374 | |
| 3375 | ELEMCONcxx . . $ ELEMCON# *eval_member_concxx . . $ `external/glpk/glpmpl.h:1823:9`! /* returns reference */ |
| 3376 | ( MPLcxx . . $ MPL# *mpl, |
| 3377 | CONSTRAINTcxx . . $ CONSTRAINT# *con, /* not changed */ |
| 3378 | TUPLEcxx . . $ TUPLE# *tuple /* not changed */ |
| 3379 | ) |
| 3380 | { /* this routine evaluates constraint member */ |
| 3381 | struct eval_con_infocxx . . $ eval_con_info# _info, *info = &_info; |
| 3382 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(con->dim == tuple_dimencxx . . $ `external/glpk/glpmpl.h:1011:9`!(mpl, tuple)); |
| 3383 | info->concxx . . $ eval_con_info#con. = con; |
| 3384 | info->tuplecxx . . $ eval_con_info#tuple. = tuple; |
| 3385 | /* evaluate member, which has given n-tuple */ |
| 3386 | if (eval_within_domaincxx . . $ `external/glpk/glpmpl.h:1484:9`!(mpl, info->concxx . . $ eval_con_info#con.->domaincxx . . $ CONSTRAINT#domain., info->tuplecxx . . $ eval_con_info#tuple., info, |
| 3387 | eval_con_funccxx . . $ eval_con_func(55b428b8c674eeb1).)) |
| 3388 | out_of_domaincxx . . $ `external/glpk/glpmpl.h:1501:9`!(mpl, con->namecxx . . $ CONSTRAINT#name., info->tuplecxx . . $ eval_con_info#tuple.); |
| 3389 | /* bring evaluated reference to the calling program */ |
| 3390 | return info->refercxx . . $ eval_con_info#refer.; |
| 3391 | } |
| 3392 | |
| 3393 | /*---------------------------------------------------------------------- |
| 3394 | -- eval_whole_con - evaluate model constraint over entire domain. |
| 3395 | -- |
| 3396 | -- This routine evaluates all members of specified model constraint over |
| 3397 | -- entire domain. */ |
| 3398 | |
| 3399 | static int whole_con_funccxx . . $ whole_con_func(3bbfabe35f227878).(MPLcxx . . $ MPL# *mpl, void *info) |
| 3400 | { /* this is auxiliary routine to work within domain scope */ |
| 3401 | CONSTRAINTcxx . . $ CONSTRAINT# *con = (CONSTRAINTcxx . . $ CONSTRAINT# *)info; |
| 3402 | TUPLEcxx . . $ TUPLE# *tuple = get_domain_tuplecxx . . $ `external/glpk/glpmpl.h:1509:9`!(mpl, con->domaincxx . . $ CONSTRAINT#domain.); |
| 3403 | eval_member_concxx . . $ `external/glpk/glpmpl.h:1823:9`!(mpl, con, tuple); |
| 3404 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, tuple); |
| 3405 | return 0; |
| 3406 | } |
| 3407 | |
| 3408 | void eval_whole_concxx . . $ `external/glpk/glpmpl.h:1831:9`!(MPLcxx . . $ MPL# *mpl, CONSTRAINTcxx . . $ CONSTRAINT# *con) |
| 3409 | { loop_within_domaincxx . . $ `external/glpk/glpmpl.h:1493:9`!(mpl, con->domaincxx . . $ CONSTRAINT#domain., con, whole_con_funccxx . . $ whole_con_func(3bbfabe35f227878).); |
| 3410 | return; |
| 3411 | } |
| 3412 | |
| 3413 | /*---------------------------------------------------------------------- |
| 3414 | -- clean_constraint - clean model constraint. |
| 3415 | -- |
| 3416 | -- This routine cleans specified model constraint that assumes deleting |
| 3417 | -- all stuff dynamically allocated during the generation phase. */ |
| 3418 | |
| 3419 | void clean_constraintcxx . . $ `external/glpk/glpmpl.h:1835:9`!(MPLcxx . . $ MPL# *mpl, CONSTRAINTcxx . . $ CONSTRAINT# *con) |
| 3420 | { MEMBERcxx . . $ MEMBER# *memb; |
| 3421 | /* clean subscript domain */ |
| 3422 | clean_domaincxx . . $ `external/glpk/glpmpl.h:1516:9`!(mpl, con->domaincxx . . $ CONSTRAINT#domain.); |
| 3423 | /* clean code for computing main linear form */ |
| 3424 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, con->codecxx . . $ CONSTRAINT#code.); |
| 3425 | /* clean code for computing lower bound */ |
| 3426 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, con->lbndcxx . . $ CONSTRAINT#lbnd.); |
| 3427 | /* clean code for computing upper bound */ |
| 3428 | if (con->ubndcxx . . $ CONSTRAINT#ubnd. != con->lbndcxx . . $ CONSTRAINT#lbnd.) clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, con->ubndcxx . . $ CONSTRAINT#ubnd.); |
| 3429 | /* delete content array */ |
| 3430 | for (memb = con->arraycxx . . $ CONSTRAINT#array.->headcxx . . $ ARRAY#head.; memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memb = memb->nextcxx . . $ MEMBER#next.) |
| 3431 | { delete_formulacxx . . $ `external/glpk/glpmpl.h:1227:9`!(mpl, memb->valuecxx . . $ MEMBER#value..concxx . . $ VALUE#con.->formcxx . . $ ELEMCON#form.); |
| 3432 | dmp_free_atomcxx . . $ `external/glpk/glpdmp.h:66:9`!(mpl->elemconscxx . . $ MPL#elemcons., memb->valuecxx . . $ MEMBER#value..concxx . . $ VALUE#con., sizeof(ELEMCONcxx . . $ ELEMCON#)); |
| 3433 | } |
| 3434 | delete_arraycxx . . $ `external/glpk/glpmpl.h:1392:9`!(mpl, con->arraycxx . . $ CONSTRAINT#array.), con->arraycxx . . $ CONSTRAINT#array. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 3435 | return; |
| 3436 | } |
| 3437 | |
| 3438 | /**********************************************************************/ |
| 3439 | /* * * PSEUDO-CODE * * */ |
| 3440 | /**********************************************************************/ |
| 3441 | |
| 3442 | /*---------------------------------------------------------------------- |
| 3443 | -- eval_numeric - evaluate pseudo-code to determine numeric value. |
| 3444 | -- |
| 3445 | -- This routine evaluates specified pseudo-code to determine resultant |
| 3446 | -- numeric value, which is returned on exit. */ |
| 3447 | |
| 3448 | struct iter_num_infocxx . . $ iter_num_info# |
| 3449 | { /* working info used by the routine iter_num_func */ |
| 3450 | CODEcxx . . $ CODE# *codecxx . . $ iter_num_info#code.; |
| 3451 | /* pseudo-code for iterated operation to be performed */ |
| 3452 | double valuecxx . . $ iter_num_info#value.; |
| 3453 | /* resultant value */ |
| 3454 | }; |
| 3455 | |
| 3456 | static int iter_num_funccxx . . $ iter_num_func(3bbfabe35f227878).(MPLcxx . . $ MPL# *mpl, void *_info) |
| 3457 | { /* this is auxiliary routine used to perform iterated operation |
| 3458 | on numeric "integrand" within domain scope */ |
| 3459 | struct iter_num_infocxx . . $ iter_num_info# *info = _info; |
| 3460 | double temp; |
| 3461 | temp = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, info->codecxx . . $ iter_num_info#code.->argcxx . . $ CODE#arg..loopcxx . . $ OPERANDS#loop..xcxx . . $ OPERANDS#$anonymous_type_9#x.); |
| 3462 | switch (info->codecxx . . $ iter_num_info#code.->opcxx . . $ CODE#op.) |
| 3463 | { case O_SUMcxx . . $ `external/glpk/glpmpl.h:2157:9`!: |
| 3464 | /* summation over domain */ |
| 3465 | info->valuecxx . . $ iter_num_info#value. = fp_addcxx . . $ `external/glpk/glpmpl.h:773:9`!(mpl, info->valuecxx . . $ iter_num_info#value., temp); |
| 3466 | break; |
| 3467 | case O_PRODcxx . . $ `external/glpk/glpmpl.h:2158:9`!: |
| 3468 | /* multiplication over domain */ |
| 3469 | info->valuecxx . . $ iter_num_info#value. = fp_mulcxx . . $ `external/glpk/glpmpl.h:785:9`!(mpl, info->valuecxx . . $ iter_num_info#value., temp); |
| 3470 | break; |
| 3471 | case O_MINIMUMcxx . . $ `external/glpk/glpmpl.h:2159:9`!: |
| 3472 | /* minimum over domain */ |
| 3473 | if (info->valuecxx . . $ iter_num_info#value. > temp) info->valuecxx . . $ iter_num_info#value. = temp; |
| 3474 | break; |
| 3475 | case O_MAXIMUMcxx . . $ `external/glpk/glpmpl.h:2160:9`!: |
| 3476 | /* maximum over domain */ |
| 3477 | if (info->valuecxx . . $ iter_num_info#value. < temp) info->valuecxx . . $ iter_num_info#value. = temp; |
| 3478 | break; |
| 3479 | default: |
| 3480 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(info != info); |
| 3481 | } |
| 3482 | return 0; |
| 3483 | } |
| 3484 | |
| 3485 | double eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(MPLcxx . . $ MPL# *mpl, CODEcxx . . $ CODE# *code) |
| 3486 | { double value; |
| 3487 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 3488 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->type == A_NUMERICcxx . . $ `external/glpk/glpmpl.h:96:9`!); |
| 3489 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->dim == 0); |
| 3490 | /* if the operation has a side effect, invalidate and delete the |
| 3491 | resultant value */ |
| 3492 | if (code->vflagcxx . . $ CODE#vflag. && code->validcxx . . $ CODE#valid.) |
| 3493 | { code->validcxx . . $ CODE#valid. = 0; |
| 3494 | delete_valuecxx . . $ `external/glpk/glpmpl.h:1314:9`!(mpl, code->typecxx . . $ CODE#type., &code->valuecxx . . $ CODE#value.); |
| 3495 | } |
| 3496 | /* if resultant value is valid, no evaluation is needed */ |
| 3497 | if (code->validcxx . . $ CODE#valid.) |
| 3498 | { value = code->valuecxx . . $ CODE#value..numcxx . . $ VALUE#num.; |
| 3499 | goto done; |
| 3500 | } |
| 3501 | /* evaluate pseudo-code recursively */ |
| 3502 | switch (code->opcxx . . $ CODE#op.) |
| 3503 | { case O_NUMBERcxx . . $ `external/glpk/glpmpl.h:2075:9`!: |
| 3504 | /* take floating-point number */ |
| 3505 | value = code->argcxx . . $ CODE#arg..numcxx . . $ OPERANDS#num.; |
| 3506 | break; |
| 3507 | case O_MEMNUMcxx . . $ `external/glpk/glpmpl.h:2078:9`!: |
| 3508 | /* take member of numeric parameter */ |
| 3509 | { TUPLEcxx . . $ TUPLE# *tuple; |
| 3510 | ARG_LISTcxx . . $ ARG_LIST# *e; |
| 3511 | tuple = create_tuplecxx . . $ `external/glpk/glpmpl.h:999:9`!(mpl); |
| 3512 | for (e = code->argcxx . . $ CODE#arg..parcxx . . $ OPERANDS#par..listcxx . . $ OPERANDS#$anonymous_type_4#list.; e != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; e = e->nextcxx . . $ ARG_LIST#next.) |
| 3513 | tuple = expand_tuplecxx . . $ `external/glpk/glpmpl.h:1003:9`!(mpl, tuple, eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, |
| 3514 | e->xcxx . . $ ARG_LIST#x.)); |
| 3515 | value = eval_member_numcxx . . $ `external/glpk/glpmpl.h:1684:9`!(mpl, code->argcxx . . $ CODE#arg..parcxx . . $ OPERANDS#par..parcxx . . $ OPERANDS#$anonymous_type_4#par., tuple); |
| 3516 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, tuple); |
| 3517 | } |
| 3518 | break; |
| 3519 | case O_MEMVARcxx . . $ `external/glpk/glpmpl.h:2081:9`!: |
| 3520 | /* take computed value of elemental variable */ |
| 3521 | { TUPLEcxx . . $ TUPLE# *tuple; |
| 3522 | ARG_LISTcxx . . $ ARG_LIST# *e; |
| 3523 | #if 1 /* 15/V-2010 */ |
| 3524 | ELEMVARcxx . . $ ELEMVAR# *var; |
| 3525 | #endif |
| 3526 | tuple = create_tuplecxx . . $ `external/glpk/glpmpl.h:999:9`!(mpl); |
| 3527 | for (e = code->argcxx . . $ CODE#arg..varcxx . . $ OPERANDS#var..listcxx . . $ OPERANDS#$anonymous_type_6#list.; e != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; e = e->nextcxx . . $ ARG_LIST#next.) |
| 3528 | tuple = expand_tuplecxx . . $ `external/glpk/glpmpl.h:1003:9`!(mpl, tuple, eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, |
| 3529 | e->xcxx . . $ ARG_LIST#x.)); |
| 3530 | #if 0 /* 15/V-2010 */ |
| 3531 | value = eval_member_var(mpl, code->arg.var.var, tuple) |
| 3532 | ->value; |
| 3533 | #else |
| 3534 | var = eval_member_varcxx . . $ `external/glpk/glpmpl.h:1765:9`!(mpl, code->argcxx . . $ CODE#arg..varcxx . . $ OPERANDS#var..varcxx . . $ OPERANDS#$anonymous_type_6#var., tuple); |
| 3535 | switch (code->argcxx . . $ CODE#arg..varcxx . . $ OPERANDS#var..suffcxx . . $ OPERANDS#$anonymous_type_6#suff.) |
| 3536 | { case DOT_LBcxx . . $ `external/glpk/glpmpl.h:2019:9`!: |
| 3537 | if (var->varcxx . . $ ELEMVAR#var.->lbndcxx . . $ VARIABLE#lbnd. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 3538 | value = -DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!; |
| 3539 | else |
| 3540 | value = var->lbndcxx . . $ ELEMVAR#lbnd.; |
| 3541 | break; |
| 3542 | case DOT_UBcxx . . $ `external/glpk/glpmpl.h:2020:9`!: |
| 3543 | if (var->varcxx . . $ ELEMVAR#var.->ubndcxx . . $ VARIABLE#ubnd. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 3544 | value = +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!; |
| 3545 | else |
| 3546 | value = var->ubndcxx . . $ ELEMVAR#ubnd.; |
| 3547 | break; |
| 3548 | case DOT_STATUScxx . . $ `external/glpk/glpmpl.h:2021:9`!: |
| 3549 | value = var->statcxx . . $ ELEMVAR#stat.; |
| 3550 | break; |
| 3551 | case DOT_VALcxx . . $ `external/glpk/glpmpl.h:2022:9`!: |
| 3552 | value = var->primcxx . . $ ELEMVAR#prim.; |
| 3553 | break; |
| 3554 | case DOT_DUALcxx . . $ `external/glpk/glpmpl.h:2023:9`!: |
| 3555 | value = var->dualcxx . . $ ELEMVAR#dual.; |
| 3556 | break; |
| 3557 | default: |
| 3558 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code != code); |
| 3559 | } |
| 3560 | #endif |
| 3561 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, tuple); |
| 3562 | } |
| 3563 | break; |
| 3564 | #if 1 /* 15/V-2010 */ |
| 3565 | case O_MEMCONcxx . . $ `external/glpk/glpmpl.h:2082:9`!: |
| 3566 | /* take computed value of elemental constraint */ |
| 3567 | { TUPLEcxx . . $ TUPLE# *tuple; |
| 3568 | ARG_LISTcxx . . $ ARG_LIST# *e; |
| 3569 | ELEMCONcxx . . $ ELEMCON# *con; |
| 3570 | tuple = create_tuplecxx . . $ `external/glpk/glpmpl.h:999:9`!(mpl); |
| 3571 | for (e = code->argcxx . . $ CODE#arg..concxx . . $ OPERANDS#con..listcxx . . $ OPERANDS#$anonymous_type_7#list.; e != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; e = e->nextcxx . . $ ARG_LIST#next.) |
| 3572 | tuple = expand_tuplecxx . . $ `external/glpk/glpmpl.h:1003:9`!(mpl, tuple, eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, |
| 3573 | e->xcxx . . $ ARG_LIST#x.)); |
| 3574 | con = eval_member_concxx . . $ `external/glpk/glpmpl.h:1823:9`!(mpl, code->argcxx . . $ CODE#arg..concxx . . $ OPERANDS#con..concxx . . $ OPERANDS#$anonymous_type_7#con., tuple); |
| 3575 | switch (code->argcxx . . $ CODE#arg..concxx . . $ OPERANDS#con..suffcxx . . $ OPERANDS#$anonymous_type_7#suff.) |
| 3576 | { case DOT_LBcxx . . $ `external/glpk/glpmpl.h:2019:9`!: |
| 3577 | if (con->concxx . . $ ELEMCON#con.->lbndcxx . . $ CONSTRAINT#lbnd. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 3578 | value = -DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!; |
| 3579 | else |
| 3580 | value = con->lbndcxx . . $ ELEMCON#lbnd.; |
| 3581 | break; |
| 3582 | case DOT_UBcxx . . $ `external/glpk/glpmpl.h:2020:9`!: |
| 3583 | if (con->concxx . . $ ELEMCON#con.->ubndcxx . . $ CONSTRAINT#ubnd. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 3584 | value = +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!; |
| 3585 | else |
| 3586 | value = con->ubndcxx . . $ ELEMCON#ubnd.; |
| 3587 | break; |
| 3588 | case DOT_STATUScxx . . $ `external/glpk/glpmpl.h:2021:9`!: |
| 3589 | value = con->statcxx . . $ ELEMCON#stat.; |
| 3590 | break; |
| 3591 | case DOT_VALcxx . . $ `external/glpk/glpmpl.h:2022:9`!: |
| 3592 | value = con->primcxx . . $ ELEMCON#prim.; |
| 3593 | break; |
| 3594 | case DOT_DUALcxx . . $ `external/glpk/glpmpl.h:2023:9`!: |
| 3595 | value = con->dualcxx . . $ ELEMCON#dual.; |
| 3596 | break; |
| 3597 | default: |
| 3598 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code != code); |
| 3599 | } |
| 3600 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, tuple); |
| 3601 | } |
| 3602 | break; |
| 3603 | #endif |
| 3604 | case O_IRAND224cxx . . $ `external/glpk/glpmpl.h:2087:9`!: |
| 3605 | /* pseudo-random in [0, 2^24-1] */ |
| 3606 | value = fp_irand224cxx . . $ `external/glpk/glpmpl.h:849:9`!(mpl); |
| 3607 | break; |
| 3608 | case O_UNIFORM01cxx . . $ `external/glpk/glpmpl.h:2088:9`!: |
| 3609 | /* pseudo-random in [0, 1) */ |
| 3610 | value = fp_uniform01cxx . . $ `external/glpk/glpmpl.h:853:9`!(mpl); |
| 3611 | break; |
| 3612 | case O_NORMAL01cxx . . $ `external/glpk/glpmpl.h:2089:9`!: |
| 3613 | /* gaussian random, mu = 0, sigma = 1 */ |
| 3614 | value = fp_normal01cxx . . $ `external/glpk/glpmpl.h:861:9`!(mpl); |
| 3615 | break; |
| 3616 | case O_GMTIMEcxx . . $ `external/glpk/glpmpl.h:2090:9`!: |
| 3617 | /* current calendar time */ |
| 3618 | value = fn_gmtimecxx . . $ `external/glpk/glpmpl.h:873:9`!(mpl); |
| 3619 | break; |
| 3620 | case O_CVTNUMcxx . . $ `external/glpk/glpmpl.h:2092:9`!: |
| 3621 | /* conversion to numeric */ |
| 3622 | { SYMBOLcxx . . $ SYMBOL# *sym; |
| 3623 | sym = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 3624 | #if 0 /* 23/XI-2008 */ |
| 3625 | if (sym->str != NULL) |
| 3626 | mpl_error(mpl, "cannot convert %s to floating-point numbe" |
| 3627 | "r", format_symbol(mpl, sym)); |
| 3628 | value = sym->num; |
| 3629 | #else |
| 3630 | if (sym->strcxx . . $ SYMBOL#str. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 3631 | value = sym->numcxx . . $ SYMBOL#num.; |
| 3632 | else |
| 3633 | { if (str2numcxx . . $ `external/glpk/glplib.h:85:9`!(sym->strcxx . . $ SYMBOL#str., &value)) |
| 3634 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "cannot convert %s to floating-point nu" |
| 3635 | "mber", format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, sym)); |
| 3636 | } |
| 3637 | #endif |
| 3638 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym); |
| 3639 | } |
| 3640 | break; |
| 3641 | case O_PLUScxx . . $ `external/glpk/glpmpl.h:2097:9`!: |
| 3642 | /* unary plus */ |
| 3643 | value = + eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 3644 | break; |
| 3645 | case O_MINUScxx . . $ `external/glpk/glpmpl.h:2098:9`!: |
| 3646 | /* unary minus */ |
| 3647 | value = - eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 3648 | break; |
| 3649 | case O_ABScxx . . $ `external/glpk/glpmpl.h:2100:9`!: |
| 3650 | /* absolute value */ |
| 3651 | value = fabscxx . . $ fabs(447c67c6676f75c3).(eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.)); |
| 3652 | break; |
| 3653 | case O_CEILcxx . . $ `external/glpk/glpmpl.h:2101:9`!: |
| 3654 | /* round upward ("ceiling of x") */ |
| 3655 | value = ceilcxx . . $ ceil(447c67c6676f75c3).(eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.)); |
| 3656 | break; |
| 3657 | case O_FLOORcxx . . $ `external/glpk/glpmpl.h:2102:9`!: |
| 3658 | /* round downward ("floor of x") */ |
| 3659 | value = floorcxx . . $ floor(447c67c6676f75c3).(eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.)); |
| 3660 | break; |
| 3661 | case O_EXPcxx . . $ `external/glpk/glpmpl.h:2103:9`!: |
| 3662 | /* base-e exponential */ |
| 3663 | value = fp_expcxx . . $ `external/glpk/glpmpl.h:805:9`!(mpl, eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.)); |
| 3664 | break; |
| 3665 | case O_LOGcxx . . $ `external/glpk/glpmpl.h:2104:9`!: |
| 3666 | /* natural logarithm */ |
| 3667 | value = fp_logcxx . . $ `external/glpk/glpmpl.h:809:9`!(mpl, eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.)); |
| 3668 | break; |
| 3669 | case O_LOG10cxx . . $ `external/glpk/glpmpl.h:2105:9`!: |
| 3670 | /* common (decimal) logarithm */ |
| 3671 | value = fp_log10cxx . . $ `external/glpk/glpmpl.h:813:9`!(mpl, eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.)); |
| 3672 | break; |
| 3673 | case O_SQRTcxx . . $ `external/glpk/glpmpl.h:2106:9`!: |
| 3674 | /* square root */ |
| 3675 | value = fp_sqrtcxx . . $ `external/glpk/glpmpl.h:817:9`!(mpl, eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.)); |
| 3676 | break; |
| 3677 | case O_SINcxx . . $ `external/glpk/glpmpl.h:2107:9`!: |
| 3678 | /* trigonometric sine */ |
| 3679 | value = fp_sincxx . . $ `external/glpk/glpmpl.h:821:9`!(mpl, eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.)); |
| 3680 | break; |
| 3681 | case O_COScxx . . $ `external/glpk/glpmpl.h:2108:9`!: |
| 3682 | /* trigonometric cosine */ |
| 3683 | value = fp_coscxx . . $ `external/glpk/glpmpl.h:825:9`!(mpl, eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.)); |
| 3684 | break; |
| 3685 | case O_ATANcxx . . $ `external/glpk/glpmpl.h:2109:9`!: |
| 3686 | /* trigonometric arctangent (one argument) */ |
| 3687 | value = fp_atancxx . . $ `external/glpk/glpmpl.h:829:9`!(mpl, eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.)); |
| 3688 | break; |
| 3689 | case O_ATAN2cxx . . $ `external/glpk/glpmpl.h:2123:9`!: |
| 3690 | /* trigonometric arctangent (two arguments) */ |
| 3691 | value = fp_atan2cxx . . $ `external/glpk/glpmpl.h:833:9`!(mpl, |
| 3692 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 3693 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 3694 | break; |
| 3695 | case O_ROUNDcxx . . $ `external/glpk/glpmpl.h:2110:9`!: |
| 3696 | /* round to nearest integer */ |
| 3697 | value = fp_roundcxx . . $ `external/glpk/glpmpl.h:837:9`!(mpl, |
| 3698 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), 0.0); |
| 3699 | break; |
| 3700 | case O_ROUND2cxx . . $ `external/glpk/glpmpl.h:2124:9`!: |
| 3701 | /* round to n fractional digits */ |
| 3702 | value = fp_roundcxx . . $ `external/glpk/glpmpl.h:837:9`!(mpl, |
| 3703 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 3704 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 3705 | break; |
| 3706 | case O_TRUNCcxx . . $ `external/glpk/glpmpl.h:2111:9`!: |
| 3707 | /* truncate to nearest integer */ |
| 3708 | value = fp_trunccxx . . $ `external/glpk/glpmpl.h:841:9`!(mpl, |
| 3709 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), 0.0); |
| 3710 | break; |
| 3711 | case O_TRUNC2cxx . . $ `external/glpk/glpmpl.h:2125:9`!: |
| 3712 | /* truncate to n fractional digits */ |
| 3713 | value = fp_trunccxx . . $ `external/glpk/glpmpl.h:841:9`!(mpl, |
| 3714 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 3715 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 3716 | break; |
| 3717 | case O_ADDcxx . . $ `external/glpk/glpmpl.h:2115:9`!: |
| 3718 | /* addition */ |
| 3719 | value = fp_addcxx . . $ `external/glpk/glpmpl.h:773:9`!(mpl, |
| 3720 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 3721 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 3722 | break; |
| 3723 | case O_SUBcxx . . $ `external/glpk/glpmpl.h:2116:9`!: |
| 3724 | /* subtraction */ |
| 3725 | value = fp_subcxx . . $ `external/glpk/glpmpl.h:777:9`!(mpl, |
| 3726 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 3727 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 3728 | break; |
| 3729 | case O_LESScxx . . $ `external/glpk/glpmpl.h:2117:9`!: |
| 3730 | /* non-negative subtraction */ |
| 3731 | value = fp_lesscxx . . $ `external/glpk/glpmpl.h:781:9`!(mpl, |
| 3732 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 3733 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 3734 | break; |
| 3735 | case O_MULcxx . . $ `external/glpk/glpmpl.h:2118:9`!: |
| 3736 | /* multiplication */ |
| 3737 | value = fp_mulcxx . . $ `external/glpk/glpmpl.h:785:9`!(mpl, |
| 3738 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 3739 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 3740 | break; |
| 3741 | case O_DIVcxx . . $ `external/glpk/glpmpl.h:2119:9`!: |
| 3742 | /* division */ |
| 3743 | value = fp_divcxx . . $ `external/glpk/glpmpl.h:789:9`!(mpl, |
| 3744 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 3745 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 3746 | break; |
| 3747 | case O_IDIVcxx . . $ `external/glpk/glpmpl.h:2120:9`!: |
| 3748 | /* quotient of exact division */ |
| 3749 | value = fp_idivcxx . . $ `external/glpk/glpmpl.h:793:9`!(mpl, |
| 3750 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 3751 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 3752 | break; |
| 3753 | case O_MODcxx . . $ `external/glpk/glpmpl.h:2121:9`!: |
| 3754 | /* remainder of exact division */ |
| 3755 | value = fp_modcxx . . $ `external/glpk/glpmpl.h:797:9`!(mpl, |
| 3756 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 3757 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 3758 | break; |
| 3759 | case O_POWERcxx . . $ `external/glpk/glpmpl.h:2122:9`!: |
| 3760 | /* exponentiation (raise to power) */ |
| 3761 | value = fp_powercxx . . $ `external/glpk/glpmpl.h:801:9`!(mpl, |
| 3762 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 3763 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 3764 | break; |
| 3765 | case O_UNIFORMcxx . . $ `external/glpk/glpmpl.h:2126:9`!: |
| 3766 | /* pseudo-random in [a, b) */ |
| 3767 | value = fp_uniformcxx . . $ `external/glpk/glpmpl.h:857:9`!(mpl, |
| 3768 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 3769 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 3770 | break; |
| 3771 | case O_NORMALcxx . . $ `external/glpk/glpmpl.h:2127:9`!: |
| 3772 | /* gaussian random, given mu and sigma */ |
| 3773 | value = fp_normalcxx . . $ `external/glpk/glpmpl.h:865:9`!(mpl, |
| 3774 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 3775 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 3776 | break; |
| 3777 | case O_CARDcxx . . $ `external/glpk/glpmpl.h:2112:9`!: |
| 3778 | { ELEMSETcxx . . $ ELEMSET# *set; |
| 3779 | set = eval_elemsetcxx . . $ `external/glpk/glpmpl.h:2226:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 3780 | value = set->sizecxx . . $ ARRAY#size.; |
| 3781 | delete_arraycxx . . $ `external/glpk/glpmpl.h:1392:9`!(mpl, set); |
| 3782 | } |
| 3783 | break; |
| 3784 | case O_LENGTHcxx . . $ `external/glpk/glpmpl.h:2113:9`!: |
| 3785 | { SYMBOLcxx . . $ SYMBOL# *sym; |
| 3786 | char str[MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!+1]; |
| 3787 | sym = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 3788 | if (sym->strcxx . . $ SYMBOL#str. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 3789 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(str, "%.*g", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, sym->numcxx . . $ SYMBOL#num.); |
| 3790 | else |
| 3791 | fetch_stringcxx . . $ `external/glpk/glpmpl.h:911:9`!(mpl, sym->strcxx . . $ SYMBOL#str., str); |
| 3792 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym); |
| 3793 | value = strlencxx . . $ strlen(751346f8406fd082).(str); |
| 3794 | } |
| 3795 | break; |
| 3796 | case O_STR2TIMEcxx . . $ `external/glpk/glpmpl.h:2147:9`!: |
| 3797 | { SYMBOLcxx . . $ SYMBOL# *sym; |
| 3798 | char str[MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!+1], fmt[MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!+1]; |
| 3799 | sym = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 3800 | if (sym->strcxx . . $ SYMBOL#str. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 3801 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(str, "%.*g", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, sym->numcxx . . $ SYMBOL#num.); |
| 3802 | else |
| 3803 | fetch_stringcxx . . $ `external/glpk/glpmpl.h:911:9`!(mpl, sym->strcxx . . $ SYMBOL#str., str); |
| 3804 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym); |
| 3805 | sym = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.); |
| 3806 | if (sym->strcxx . . $ SYMBOL#str. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 3807 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(fmt, "%.*g", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, sym->numcxx . . $ SYMBOL#num.); |
| 3808 | else |
| 3809 | fetch_stringcxx . . $ `external/glpk/glpmpl.h:911:9`!(mpl, sym->strcxx . . $ SYMBOL#str., fmt); |
| 3810 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym); |
| 3811 | value = fn_str2timecxx . . $ `external/glpk/glpmpl.h:877:9`!(mpl, str, fmt); |
| 3812 | } |
| 3813 | break; |
| 3814 | case O_FORKcxx . . $ `external/glpk/glpmpl.h:2151:9`!: |
| 3815 | /* if-then-else */ |
| 3816 | if (eval_logicalcxx . . $ `external/glpk/glpmpl.h:2218:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.)) |
| 3817 | value = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.); |
| 3818 | else if (code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..zcxx . . $ OPERANDS#$anonymous_type_8#z. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 3819 | value = 0.0; |
| 3820 | else |
| 3821 | value = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..zcxx . . $ OPERANDS#$anonymous_type_8#z.); |
| 3822 | break; |
| 3823 | case O_MINcxx . . $ `external/glpk/glpmpl.h:2154:9`!: |
| 3824 | /* minimal value (n-ary) */ |
| 3825 | { ARG_LISTcxx . . $ ARG_LIST# *e; |
| 3826 | double temp; |
| 3827 | value = +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!; |
| 3828 | for (e = code->argcxx . . $ CODE#arg..listcxx . . $ OPERANDS#list.; e != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; e = e->nextcxx . . $ ARG_LIST#next.) |
| 3829 | { temp = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, e->xcxx . . $ ARG_LIST#x.); |
| 3830 | if (value > temp) value = temp; |
| 3831 | } |
| 3832 | } |
| 3833 | break; |
| 3834 | case O_MAXcxx . . $ `external/glpk/glpmpl.h:2155:9`!: |
| 3835 | /* maximal value (n-ary) */ |
| 3836 | { ARG_LISTcxx . . $ ARG_LIST# *e; |
| 3837 | double temp; |
| 3838 | value = -DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!; |
| 3839 | for (e = code->argcxx . . $ CODE#arg..listcxx . . $ OPERANDS#list.; e != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; e = e->nextcxx . . $ ARG_LIST#next.) |
| 3840 | { temp = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, e->xcxx . . $ ARG_LIST#x.); |
| 3841 | if (value < temp) value = temp; |
| 3842 | } |
| 3843 | } |
| 3844 | break; |
| 3845 | case O_SUMcxx . . $ `external/glpk/glpmpl.h:2157:9`!: |
| 3846 | /* summation over domain */ |
| 3847 | { struct iter_num_infocxx . . $ iter_num_info# _info, *info = &_info; |
| 3848 | info->codecxx . . $ iter_num_info#code. = code; |
| 3849 | info->valuecxx . . $ iter_num_info#value. = 0.0; |
| 3850 | loop_within_domaincxx . . $ `external/glpk/glpmpl.h:1493:9`!(mpl, code->argcxx . . $ CODE#arg..loopcxx . . $ OPERANDS#loop..domaincxx . . $ OPERANDS#$anonymous_type_9#domain., info, |
| 3851 | iter_num_funccxx . . $ iter_num_func(3bbfabe35f227878).); |
| 3852 | value = info->valuecxx . . $ iter_num_info#value.; |
| 3853 | } |
| 3854 | break; |
| 3855 | case O_PRODcxx . . $ `external/glpk/glpmpl.h:2158:9`!: |
| 3856 | /* multiplication over domain */ |
| 3857 | { struct iter_num_infocxx . . $ iter_num_info# _info, *info = &_info; |
| 3858 | info->codecxx . . $ iter_num_info#code. = code; |
| 3859 | info->valuecxx . . $ iter_num_info#value. = 1.0; |
| 3860 | loop_within_domaincxx . . $ `external/glpk/glpmpl.h:1493:9`!(mpl, code->argcxx . . $ CODE#arg..loopcxx . . $ OPERANDS#loop..domaincxx . . $ OPERANDS#$anonymous_type_9#domain., info, |
| 3861 | iter_num_funccxx . . $ iter_num_func(3bbfabe35f227878).); |
| 3862 | value = info->valuecxx . . $ iter_num_info#value.; |
| 3863 | } |
| 3864 | break; |
| 3865 | case O_MINIMUMcxx . . $ `external/glpk/glpmpl.h:2159:9`!: |
| 3866 | /* minimum over domain */ |
| 3867 | { struct iter_num_infocxx . . $ iter_num_info# _info, *info = &_info; |
| 3868 | info->codecxx . . $ iter_num_info#code. = code; |
| 3869 | info->valuecxx . . $ iter_num_info#value. = +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!; |
| 3870 | loop_within_domaincxx . . $ `external/glpk/glpmpl.h:1493:9`!(mpl, code->argcxx . . $ CODE#arg..loopcxx . . $ OPERANDS#loop..domaincxx . . $ OPERANDS#$anonymous_type_9#domain., info, |
| 3871 | iter_num_funccxx . . $ iter_num_func(3bbfabe35f227878).); |
| 3872 | if (info->valuecxx . . $ iter_num_info#value. == +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!) |
| 3873 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "min{} over empty set; result undefined"); |
| 3874 | value = info->valuecxx . . $ iter_num_info#value.; |
| 3875 | } |
| 3876 | break; |
| 3877 | case O_MAXIMUMcxx . . $ `external/glpk/glpmpl.h:2160:9`!: |
| 3878 | /* maximum over domain */ |
| 3879 | { struct iter_num_infocxx . . $ iter_num_info# _info, *info = &_info; |
| 3880 | info->codecxx . . $ iter_num_info#code. = code; |
| 3881 | info->valuecxx . . $ iter_num_info#value. = -DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!; |
| 3882 | loop_within_domaincxx . . $ `external/glpk/glpmpl.h:1493:9`!(mpl, code->argcxx . . $ CODE#arg..loopcxx . . $ OPERANDS#loop..domaincxx . . $ OPERANDS#$anonymous_type_9#domain., info, |
| 3883 | iter_num_funccxx . . $ iter_num_func(3bbfabe35f227878).); |
| 3884 | if (info->valuecxx . . $ iter_num_info#value. == -DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`!) |
| 3885 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "max{} over empty set; result undefined"); |
| 3886 | value = info->valuecxx . . $ iter_num_info#value.; |
| 3887 | } |
| 3888 | break; |
| 3889 | default: |
| 3890 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code != code); |
| 3891 | } |
| 3892 | /* save resultant value */ |
| 3893 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(!code->valid); |
| 3894 | code->validcxx . . $ CODE#valid. = 1; |
| 3895 | code->valuecxx . . $ CODE#value..numcxx . . $ VALUE#num. = value; |
| 3896 | done: return value; |
| 3897 | } |
| 3898 | |
| 3899 | /*---------------------------------------------------------------------- |
| 3900 | -- eval_symbolic - evaluate pseudo-code to determine symbolic value. |
| 3901 | -- |
| 3902 | -- This routine evaluates specified pseudo-code to determine resultant |
| 3903 | -- symbolic value, which is returned on exit. */ |
| 3904 | |
| 3905 | SYMBOLcxx . . $ SYMBOL# *eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(MPLcxx . . $ MPL# *mpl, CODEcxx . . $ CODE# *code) |
| 3906 | { SYMBOLcxx . . $ SYMBOL# *value; |
| 3907 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 3908 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->type == A_SYMBOLICcxx . . $ `external/glpk/glpmpl.h:102:9`!); |
| 3909 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->dim == 0); |
| 3910 | /* if the operation has a side effect, invalidate and delete the |
| 3911 | resultant value */ |
| 3912 | if (code->vflagcxx . . $ CODE#vflag. && code->validcxx . . $ CODE#valid.) |
| 3913 | { code->validcxx . . $ CODE#valid. = 0; |
| 3914 | delete_valuecxx . . $ `external/glpk/glpmpl.h:1314:9`!(mpl, code->typecxx . . $ CODE#type., &code->valuecxx . . $ CODE#value.); |
| 3915 | } |
| 3916 | /* if resultant value is valid, no evaluation is needed */ |
| 3917 | if (code->validcxx . . $ CODE#valid.) |
| 3918 | { value = copy_symbolcxx . . $ `external/glpk/glpmpl.h:949:9`!(mpl, code->valuecxx . . $ CODE#value..symcxx . . $ VALUE#sym.); |
| 3919 | goto done; |
| 3920 | } |
| 3921 | /* evaluate pseudo-code recursively */ |
| 3922 | switch (code->opcxx . . $ CODE#op.) |
| 3923 | { case O_STRINGcxx . . $ `external/glpk/glpmpl.h:2076:9`!: |
| 3924 | /* take character string */ |
| 3925 | value = create_symbol_strcxx . . $ `external/glpk/glpmpl.h:942:9`!(mpl, create_stringcxx . . $ `external/glpk/glpmpl.h:889:9`!(mpl, |
| 3926 | code->argcxx . . $ CODE#arg..strcxx . . $ OPERANDS#str.)); |
| 3927 | break; |
| 3928 | case O_INDEXcxx . . $ `external/glpk/glpmpl.h:2077:9`!: |
| 3929 | /* take dummy index */ |
| 3930 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->arg.index.slot->value != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 3931 | value = copy_symbolcxx . . $ `external/glpk/glpmpl.h:949:9`!(mpl, code->argcxx . . $ CODE#arg..indexcxx . . $ OPERANDS#index..slotcxx . . $ OPERANDS#$anonymous_type_3#slot.->valuecxx . . $ DOMAIN_SLOT#value.); |
| 3932 | break; |
| 3933 | case O_MEMSYMcxx . . $ `external/glpk/glpmpl.h:2079:9`!: |
| 3934 | /* take member of symbolic parameter */ |
| 3935 | { TUPLEcxx . . $ TUPLE# *tuple; |
| 3936 | ARG_LISTcxx . . $ ARG_LIST# *e; |
| 3937 | tuple = create_tuplecxx . . $ `external/glpk/glpmpl.h:999:9`!(mpl); |
| 3938 | for (e = code->argcxx . . $ CODE#arg..parcxx . . $ OPERANDS#par..listcxx . . $ OPERANDS#$anonymous_type_4#list.; e != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; e = e->nextcxx . . $ ARG_LIST#next.) |
| 3939 | tuple = expand_tuplecxx . . $ `external/glpk/glpmpl.h:1003:9`!(mpl, tuple, eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, |
| 3940 | e->xcxx . . $ ARG_LIST#x.)); |
| 3941 | value = eval_member_symcxx . . $ `external/glpk/glpmpl.h:1709:9`!(mpl, code->argcxx . . $ CODE#arg..parcxx . . $ OPERANDS#par..parcxx . . $ OPERANDS#$anonymous_type_4#par., tuple); |
| 3942 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, tuple); |
| 3943 | } |
| 3944 | break; |
| 3945 | case O_CVTSYMcxx . . $ `external/glpk/glpmpl.h:2093:9`!: |
| 3946 | /* conversion to symbolic */ |
| 3947 | value = create_symbol_numcxx . . $ `external/glpk/glpmpl.h:938:9`!(mpl, eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, |
| 3948 | code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.)); |
| 3949 | break; |
| 3950 | case O_CONCATcxx . . $ `external/glpk/glpmpl.h:2128:9`!: |
| 3951 | /* concatenation */ |
| 3952 | value = concat_symbolscxx . . $ `external/glpk/glpmpl.h:978:9`!(mpl, |
| 3953 | eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 3954 | eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 3955 | break; |
| 3956 | case O_FORKcxx . . $ `external/glpk/glpmpl.h:2151:9`!: |
| 3957 | /* if-then-else */ |
| 3958 | if (eval_logicalcxx . . $ `external/glpk/glpmpl.h:2218:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.)) |
| 3959 | value = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.); |
| 3960 | else if (code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..zcxx . . $ OPERANDS#$anonymous_type_8#z. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 3961 | value = create_symbol_numcxx . . $ `external/glpk/glpmpl.h:938:9`!(mpl, 0.0); |
| 3962 | else |
| 3963 | value = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..zcxx . . $ OPERANDS#$anonymous_type_8#z.); |
| 3964 | break; |
| 3965 | case O_SUBSTRcxx . . $ `external/glpk/glpmpl.h:2146:9`!: |
| 3966 | case O_SUBSTR3cxx . . $ `external/glpk/glpmpl.h:2152:9`!: |
| 3967 | { double pos, len; |
| 3968 | char str[MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!+1]; |
| 3969 | value = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 3970 | if (value->strcxx . . $ SYMBOL#str. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 3971 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(str, "%.*g", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, value->numcxx . . $ SYMBOL#num.); |
| 3972 | else |
| 3973 | fetch_stringcxx . . $ `external/glpk/glpmpl.h:911:9`!(mpl, value->strcxx . . $ SYMBOL#str., str); |
| 3974 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, value); |
| 3975 | if (code->opcxx . . $ CODE#op. == O_SUBSTRcxx . . $ `external/glpk/glpmpl.h:2146:9`!) |
| 3976 | { pos = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.); |
| 3977 | if (pos != floorcxx . . $ floor(447c67c6676f75c3).(pos)) |
| 3978 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "substr('...', %.*g); non-integer secon" |
| 3979 | "d argument", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, pos); |
| 3980 | if (pos < 1 || pos > strlencxx . . $ strlen(751346f8406fd082).(str) + 1) |
| 3981 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "substr('...', %.*g); substring out of " |
| 3982 | "range", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, pos); |
| 3983 | } |
| 3984 | else |
| 3985 | { pos = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.); |
| 3986 | len = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..zcxx . . $ OPERANDS#$anonymous_type_8#z.); |
| 3987 | if (pos != floorcxx . . $ floor(447c67c6676f75c3).(pos) || len != floorcxx . . $ floor(447c67c6676f75c3).(len)) |
| 3988 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "substr('...', %.*g, %.*g); non-integer" |
| 3989 | " second and/or third argument", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, pos, |
| 3990 | DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, len); |
| 3991 | if (pos < 1 || len < 0 || pos + len > strlencxx . . $ strlen(751346f8406fd082).(str) + 1) |
| 3992 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "substr('...', %.*g, %.*g); substring o" |
| 3993 | "ut of range", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, pos, DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, len); |
| 3994 | str[(int)pos + (int)len - 1] = '\0'; |
| 3995 | } |
| 3996 | value = create_symbol_strcxx . . $ `external/glpk/glpmpl.h:942:9`!(mpl, create_stringcxx . . $ `external/glpk/glpmpl.h:889:9`!(mpl, str + |
| 3997 | (int)pos - 1)); |
| 3998 | } |
| 3999 | break; |
| 4000 | case O_TIME2STRcxx . . $ `external/glpk/glpmpl.h:2148:9`!: |
| 4001 | { double num; |
| 4002 | SYMBOLcxx . . $ SYMBOL# *sym; |
| 4003 | char str[MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!+1], fmt[MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!+1]; |
| 4004 | num = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 4005 | sym = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.); |
| 4006 | if (sym->strcxx . . $ SYMBOL#str. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 4007 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(fmt, "%.*g", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, sym->numcxx . . $ SYMBOL#num.); |
| 4008 | else |
| 4009 | fetch_stringcxx . . $ `external/glpk/glpmpl.h:911:9`!(mpl, sym->strcxx . . $ SYMBOL#str., fmt); |
| 4010 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym); |
| 4011 | fn_time2strcxx . . $ `external/glpk/glpmpl.h:881:9`!(mpl, str, num, fmt); |
| 4012 | value = create_symbol_strcxx . . $ `external/glpk/glpmpl.h:942:9`!(mpl, create_stringcxx . . $ `external/glpk/glpmpl.h:889:9`!(mpl, str)); |
| 4013 | } |
| 4014 | break; |
| 4015 | default: |
| 4016 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code != code); |
| 4017 | } |
| 4018 | /* save resultant value */ |
| 4019 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(!code->valid); |
| 4020 | code->validcxx . . $ CODE#valid. = 1; |
| 4021 | code->valuecxx . . $ CODE#value..symcxx . . $ VALUE#sym. = copy_symbolcxx . . $ `external/glpk/glpmpl.h:949:9`!(mpl, value); |
| 4022 | done: return value; |
| 4023 | } |
| 4024 | |
| 4025 | /*---------------------------------------------------------------------- |
| 4026 | -- eval_logical - evaluate pseudo-code to determine logical value. |
| 4027 | -- |
| 4028 | -- This routine evaluates specified pseudo-code to determine resultant |
| 4029 | -- logical value, which is returned on exit. */ |
| 4030 | |
| 4031 | struct iter_log_infocxx . . $ iter_log_info# |
| 4032 | { /* working info used by the routine iter_log_func */ |
| 4033 | CODEcxx . . $ CODE# *codecxx . . $ iter_log_info#code.; |
| 4034 | /* pseudo-code for iterated operation to be performed */ |
| 4035 | int valuecxx . . $ iter_log_info#value.; |
| 4036 | /* resultant value */ |
| 4037 | }; |
| 4038 | |
| 4039 | static int iter_log_funccxx . . $ iter_log_func(3bbfabe35f227878).(MPLcxx . . $ MPL# *mpl, void *_info) |
| 4040 | { /* this is auxiliary routine used to perform iterated operation |
| 4041 | on logical "integrand" within domain scope */ |
| 4042 | struct iter_log_infocxx . . $ iter_log_info# *info = _info; |
| 4043 | int ret = 0; |
| 4044 | switch (info->codecxx . . $ iter_log_info#code.->opcxx . . $ CODE#op.) |
| 4045 | { case O_FORALLcxx . . $ `external/glpk/glpmpl.h:2161:9`!: |
| 4046 | /* conjunction over domain */ |
| 4047 | info->valuecxx . . $ iter_log_info#value. &= eval_logicalcxx . . $ `external/glpk/glpmpl.h:2218:9`!(mpl, info->codecxx . . $ iter_log_info#code.->argcxx . . $ CODE#arg..loopcxx . . $ OPERANDS#loop..xcxx . . $ OPERANDS#$anonymous_type_9#x.); |
| 4048 | if (!info->valuecxx . . $ iter_log_info#value.) ret = 1; |
| 4049 | break; |
| 4050 | case O_EXISTScxx . . $ `external/glpk/glpmpl.h:2162:9`!: |
| 4051 | /* disjunction over domain */ |
| 4052 | info->valuecxx . . $ iter_log_info#value. |= eval_logicalcxx . . $ `external/glpk/glpmpl.h:2218:9`!(mpl, info->codecxx . . $ iter_log_info#code.->argcxx . . $ CODE#arg..loopcxx . . $ OPERANDS#loop..xcxx . . $ OPERANDS#$anonymous_type_9#x.); |
| 4053 | if (info->valuecxx . . $ iter_log_info#value.) ret = 1; |
| 4054 | break; |
| 4055 | default: |
| 4056 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(info != info); |
| 4057 | } |
| 4058 | return ret; |
| 4059 | } |
| 4060 | |
| 4061 | int eval_logicalcxx . . $ `external/glpk/glpmpl.h:2218:9`!(MPLcxx . . $ MPL# *mpl, CODEcxx . . $ CODE# *code) |
| 4062 | { int value; |
| 4063 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->type == A_LOGICALcxx . . $ `external/glpk/glpmpl.h:92:9`!); |
| 4064 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->dim == 0); |
| 4065 | /* if the operation has a side effect, invalidate and delete the |
| 4066 | resultant value */ |
| 4067 | if (code->vflagcxx . . $ CODE#vflag. && code->validcxx . . $ CODE#valid.) |
| 4068 | { code->validcxx . . $ CODE#valid. = 0; |
| 4069 | delete_valuecxx . . $ `external/glpk/glpmpl.h:1314:9`!(mpl, code->typecxx . . $ CODE#type., &code->valuecxx . . $ CODE#value.); |
| 4070 | } |
| 4071 | /* if resultant value is valid, no evaluation is needed */ |
| 4072 | if (code->validcxx . . $ CODE#valid.) |
| 4073 | { value = code->valuecxx . . $ CODE#value..bitcxx . . $ VALUE#bit.; |
| 4074 | goto done; |
| 4075 | } |
| 4076 | /* evaluate pseudo-code recursively */ |
| 4077 | switch (code->opcxx . . $ CODE#op.) |
| 4078 | { case O_CVTLOGcxx . . $ `external/glpk/glpmpl.h:2094:9`!: |
| 4079 | /* conversion to logical */ |
| 4080 | value = (eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.) != 0.0); |
| 4081 | break; |
| 4082 | case O_NOTcxx . . $ `external/glpk/glpmpl.h:2099:9`!: |
| 4083 | /* negation (logical "not") */ |
| 4084 | value = !eval_logicalcxx . . $ `external/glpk/glpmpl.h:2218:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 4085 | break; |
| 4086 | case O_LTcxx . . $ `external/glpk/glpmpl.h:2129:9`!: |
| 4087 | /* comparison on 'less than' */ |
| 4088 | #if 0 /* 02/VIII-2008 */ |
| 4089 | value = (eval_numeric(mpl, code->arg.arg.x) < |
| 4090 | eval_numeric(mpl, code->arg.arg.y)); |
| 4091 | #else |
| 4092 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->arg.arg.x != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 4093 | if (code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.->typecxx . . $ CODE#type. == A_NUMERICcxx . . $ `external/glpk/glpmpl.h:96:9`!) |
| 4094 | value = (eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.) < |
| 4095 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 4096 | else |
| 4097 | { SYMBOLcxx . . $ SYMBOL# *sym1 = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 4098 | SYMBOLcxx . . $ SYMBOL# *sym2 = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.); |
| 4099 | value = (compare_symbolscxx . . $ `external/glpk/glpmpl.h:956:9`!(mpl, sym1, sym2) < 0); |
| 4100 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym1); |
| 4101 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym2); |
| 4102 | } |
| 4103 | #endif |
| 4104 | break; |
| 4105 | case O_LEcxx . . $ `external/glpk/glpmpl.h:2130:9`!: |
| 4106 | /* comparison on 'not greater than' */ |
| 4107 | #if 0 /* 02/VIII-2008 */ |
| 4108 | value = (eval_numeric(mpl, code->arg.arg.x) <= |
| 4109 | eval_numeric(mpl, code->arg.arg.y)); |
| 4110 | #else |
| 4111 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->arg.arg.x != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 4112 | if (code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.->typecxx . . $ CODE#type. == A_NUMERICcxx . . $ `external/glpk/glpmpl.h:96:9`!) |
| 4113 | value = (eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.) <= |
| 4114 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 4115 | else |
| 4116 | { SYMBOLcxx . . $ SYMBOL# *sym1 = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 4117 | SYMBOLcxx . . $ SYMBOL# *sym2 = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.); |
| 4118 | value = (compare_symbolscxx . . $ `external/glpk/glpmpl.h:956:9`!(mpl, sym1, sym2) <= 0); |
| 4119 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym1); |
| 4120 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym2); |
| 4121 | } |
| 4122 | #endif |
| 4123 | break; |
| 4124 | case O_EQcxx . . $ `external/glpk/glpmpl.h:2131:9`!: |
| 4125 | /* comparison on 'equal to' */ |
| 4126 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->arg.arg.x != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 4127 | if (code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.->typecxx . . $ CODE#type. == A_NUMERICcxx . . $ `external/glpk/glpmpl.h:96:9`!) |
| 4128 | value = (eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.) == |
| 4129 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 4130 | else |
| 4131 | { SYMBOLcxx . . $ SYMBOL# *sym1 = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 4132 | SYMBOLcxx . . $ SYMBOL# *sym2 = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.); |
| 4133 | value = (compare_symbolscxx . . $ `external/glpk/glpmpl.h:956:9`!(mpl, sym1, sym2) == 0); |
| 4134 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym1); |
| 4135 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym2); |
| 4136 | } |
| 4137 | break; |
| 4138 | case O_GEcxx . . $ `external/glpk/glpmpl.h:2132:9`!: |
| 4139 | /* comparison on 'not less than' */ |
| 4140 | #if 0 /* 02/VIII-2008 */ |
| 4141 | value = (eval_numeric(mpl, code->arg.arg.x) >= |
| 4142 | eval_numeric(mpl, code->arg.arg.y)); |
| 4143 | #else |
| 4144 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->arg.arg.x != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 4145 | if (code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.->typecxx . . $ CODE#type. == A_NUMERICcxx . . $ `external/glpk/glpmpl.h:96:9`!) |
| 4146 | value = (eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.) >= |
| 4147 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 4148 | else |
| 4149 | { SYMBOLcxx . . $ SYMBOL# *sym1 = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 4150 | SYMBOLcxx . . $ SYMBOL# *sym2 = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.); |
| 4151 | value = (compare_symbolscxx . . $ `external/glpk/glpmpl.h:956:9`!(mpl, sym1, sym2) >= 0); |
| 4152 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym1); |
| 4153 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym2); |
| 4154 | } |
| 4155 | #endif |
| 4156 | break; |
| 4157 | case O_GTcxx . . $ `external/glpk/glpmpl.h:2133:9`!: |
| 4158 | /* comparison on 'greater than' */ |
| 4159 | #if 0 /* 02/VIII-2008 */ |
| 4160 | value = (eval_numeric(mpl, code->arg.arg.x) > |
| 4161 | eval_numeric(mpl, code->arg.arg.y)); |
| 4162 | #else |
| 4163 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->arg.arg.x != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 4164 | if (code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.->typecxx . . $ CODE#type. == A_NUMERICcxx . . $ `external/glpk/glpmpl.h:96:9`!) |
| 4165 | value = (eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.) > |
| 4166 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 4167 | else |
| 4168 | { SYMBOLcxx . . $ SYMBOL# *sym1 = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 4169 | SYMBOLcxx . . $ SYMBOL# *sym2 = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.); |
| 4170 | value = (compare_symbolscxx . . $ `external/glpk/glpmpl.h:956:9`!(mpl, sym1, sym2) > 0); |
| 4171 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym1); |
| 4172 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym2); |
| 4173 | } |
| 4174 | #endif |
| 4175 | break; |
| 4176 | case O_NEcxx . . $ `external/glpk/glpmpl.h:2134:9`!: |
| 4177 | /* comparison on 'not equal to' */ |
| 4178 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->arg.arg.x != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 4179 | if (code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.->typecxx . . $ CODE#type. == A_NUMERICcxx . . $ `external/glpk/glpmpl.h:96:9`!) |
| 4180 | value = (eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.) != |
| 4181 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 4182 | else |
| 4183 | { SYMBOLcxx . . $ SYMBOL# *sym1 = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 4184 | SYMBOLcxx . . $ SYMBOL# *sym2 = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.); |
| 4185 | value = (compare_symbolscxx . . $ `external/glpk/glpmpl.h:956:9`!(mpl, sym1, sym2) != 0); |
| 4186 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym1); |
| 4187 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym2); |
| 4188 | } |
| 4189 | break; |
| 4190 | case O_ANDcxx . . $ `external/glpk/glpmpl.h:2135:9`!: |
| 4191 | /* conjunction (logical "and") */ |
| 4192 | value = eval_logicalcxx . . $ `external/glpk/glpmpl.h:2218:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.) && |
| 4193 | eval_logicalcxx . . $ `external/glpk/glpmpl.h:2218:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.); |
| 4194 | break; |
| 4195 | case O_ORcxx . . $ `external/glpk/glpmpl.h:2136:9`!: |
| 4196 | /* disjunction (logical "or") */ |
| 4197 | value = eval_logicalcxx . . $ `external/glpk/glpmpl.h:2218:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.) || |
| 4198 | eval_logicalcxx . . $ `external/glpk/glpmpl.h:2218:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.); |
| 4199 | break; |
| 4200 | case O_INcxx . . $ `external/glpk/glpmpl.h:2142:9`!: |
| 4201 | /* test on 'x in Y' */ |
| 4202 | { TUPLEcxx . . $ TUPLE# *tuple; |
| 4203 | tuple = eval_tuplecxx . . $ `external/glpk/glpmpl.h:2222:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 4204 | value = is_membercxx . . $ `external/glpk/glpmpl.h:2230:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y., tuple); |
| 4205 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, tuple); |
| 4206 | } |
| 4207 | break; |
| 4208 | case O_NOTINcxx . . $ `external/glpk/glpmpl.h:2143:9`!: |
| 4209 | /* test on 'x not in Y' */ |
| 4210 | { TUPLEcxx . . $ TUPLE# *tuple; |
| 4211 | tuple = eval_tuplecxx . . $ `external/glpk/glpmpl.h:2222:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 4212 | value = !is_membercxx . . $ `external/glpk/glpmpl.h:2230:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y., tuple); |
| 4213 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, tuple); |
| 4214 | } |
| 4215 | break; |
| 4216 | case O_WITHINcxx . . $ `external/glpk/glpmpl.h:2144:9`!: |
| 4217 | /* test on 'X within Y' */ |
| 4218 | { ELEMSETcxx . . $ ELEMSET# *set; |
| 4219 | MEMBERcxx . . $ MEMBER# *memb; |
| 4220 | set = eval_elemsetcxx . . $ `external/glpk/glpmpl.h:2226:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 4221 | value = 1; |
| 4222 | for (memb = set->headcxx . . $ ARRAY#head.; memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memb = memb->nextcxx . . $ MEMBER#next.) |
| 4223 | { if (!is_membercxx . . $ `external/glpk/glpmpl.h:2230:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y., memb->tuplecxx . . $ MEMBER#tuple.)) |
| 4224 | { value = 0; |
| 4225 | break; |
| 4226 | } |
| 4227 | } |
| 4228 | delete_elemsetcxx . . $ `external/glpk/glpmpl.h:1105:9`!(mpl, set); |
| 4229 | } |
| 4230 | break; |
| 4231 | case O_NOTWITHINcxx . . $ `external/glpk/glpmpl.h:2145:9`!: |
| 4232 | /* test on 'X not within Y' */ |
| 4233 | { ELEMSETcxx . . $ ELEMSET# *set; |
| 4234 | MEMBERcxx . . $ MEMBER# *memb; |
| 4235 | set = eval_elemsetcxx . . $ `external/glpk/glpmpl.h:2226:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 4236 | value = 1; |
| 4237 | for (memb = set->headcxx . . $ ARRAY#head.; memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memb = memb->nextcxx . . $ MEMBER#next.) |
| 4238 | { if (is_membercxx . . $ `external/glpk/glpmpl.h:2230:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y., memb->tuplecxx . . $ MEMBER#tuple.)) |
| 4239 | { value = 0; |
| 4240 | break; |
| 4241 | } |
| 4242 | } |
| 4243 | delete_elemsetcxx . . $ `external/glpk/glpmpl.h:1105:9`!(mpl, set); |
| 4244 | } |
| 4245 | break; |
| 4246 | case O_FORALLcxx . . $ `external/glpk/glpmpl.h:2161:9`!: |
| 4247 | /* conjunction (A-quantification) */ |
| 4248 | { struct iter_log_infocxx . . $ iter_log_info# _info, *info = &_info; |
| 4249 | info->codecxx . . $ iter_log_info#code. = code; |
| 4250 | info->valuecxx . . $ iter_log_info#value. = 1; |
| 4251 | loop_within_domaincxx . . $ `external/glpk/glpmpl.h:1493:9`!(mpl, code->argcxx . . $ CODE#arg..loopcxx . . $ OPERANDS#loop..domaincxx . . $ OPERANDS#$anonymous_type_9#domain., info, |
| 4252 | iter_log_funccxx . . $ iter_log_func(3bbfabe35f227878).); |
| 4253 | value = info->valuecxx . . $ iter_log_info#value.; |
| 4254 | } |
| 4255 | break; |
| 4256 | case O_EXISTScxx . . $ `external/glpk/glpmpl.h:2162:9`!: |
| 4257 | /* disjunction (E-quantification) */ |
| 4258 | { struct iter_log_infocxx . . $ iter_log_info# _info, *info = &_info; |
| 4259 | info->codecxx . . $ iter_log_info#code. = code; |
| 4260 | info->valuecxx . . $ iter_log_info#value. = 0; |
| 4261 | loop_within_domaincxx . . $ `external/glpk/glpmpl.h:1493:9`!(mpl, code->argcxx . . $ CODE#arg..loopcxx . . $ OPERANDS#loop..domaincxx . . $ OPERANDS#$anonymous_type_9#domain., info, |
| 4262 | iter_log_funccxx . . $ iter_log_func(3bbfabe35f227878).); |
| 4263 | value = info->valuecxx . . $ iter_log_info#value.; |
| 4264 | } |
| 4265 | break; |
| 4266 | default: |
| 4267 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code != code); |
| 4268 | } |
| 4269 | /* save resultant value */ |
| 4270 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(!code->valid); |
| 4271 | code->validcxx . . $ CODE#valid. = 1; |
| 4272 | code->valuecxx . . $ CODE#value..bitcxx . . $ VALUE#bit. = value; |
| 4273 | done: return value; |
| 4274 | } |
| 4275 | |
| 4276 | /*---------------------------------------------------------------------- |
| 4277 | -- eval_tuple - evaluate pseudo-code to construct n-tuple. |
| 4278 | -- |
| 4279 | -- This routine evaluates specified pseudo-code to construct resultant |
| 4280 | -- n-tuple, which is returned on exit. */ |
| 4281 | |
| 4282 | TUPLEcxx . . $ TUPLE# *eval_tuplecxx . . $ `external/glpk/glpmpl.h:2222:9`!(MPLcxx . . $ MPL# *mpl, CODEcxx . . $ CODE# *code) |
| 4283 | { TUPLEcxx . . $ TUPLE# *value; |
| 4284 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 4285 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->type == A_TUPLEcxx . . $ `external/glpk/glpmpl.h:104:9`!); |
| 4286 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->dim > 0); |
| 4287 | /* if the operation has a side effect, invalidate and delete the |
| 4288 | resultant value */ |
| 4289 | if (code->vflagcxx . . $ CODE#vflag. && code->validcxx . . $ CODE#valid.) |
| 4290 | { code->validcxx . . $ CODE#valid. = 0; |
| 4291 | delete_valuecxx . . $ `external/glpk/glpmpl.h:1314:9`!(mpl, code->typecxx . . $ CODE#type., &code->valuecxx . . $ CODE#value.); |
| 4292 | } |
| 4293 | /* if resultant value is valid, no evaluation is needed */ |
| 4294 | if (code->validcxx . . $ CODE#valid.) |
| 4295 | { value = copy_tuplecxx . . $ `external/glpk/glpmpl.h:1018:9`!(mpl, code->valuecxx . . $ CODE#value..tuplecxx . . $ VALUE#tuple.); |
| 4296 | goto done; |
| 4297 | } |
| 4298 | /* evaluate pseudo-code recursively */ |
| 4299 | switch (code->opcxx . . $ CODE#op.) |
| 4300 | { case O_TUPLEcxx . . $ `external/glpk/glpmpl.h:2083:9`!: |
| 4301 | /* make n-tuple */ |
| 4302 | { ARG_LISTcxx . . $ ARG_LIST# *e; |
| 4303 | value = create_tuplecxx . . $ `external/glpk/glpmpl.h:999:9`!(mpl); |
| 4304 | for (e = code->argcxx . . $ CODE#arg..listcxx . . $ OPERANDS#list.; e != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; e = e->nextcxx . . $ ARG_LIST#next.) |
| 4305 | value = expand_tuplecxx . . $ `external/glpk/glpmpl.h:1003:9`!(mpl, value, eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, |
| 4306 | e->xcxx . . $ ARG_LIST#x.)); |
| 4307 | } |
| 4308 | break; |
| 4309 | case O_CVTTUPcxx . . $ `external/glpk/glpmpl.h:2095:9`!: |
| 4310 | /* convert to 1-tuple */ |
| 4311 | value = expand_tuplecxx . . $ `external/glpk/glpmpl.h:1003:9`!(mpl, create_tuplecxx . . $ `external/glpk/glpmpl.h:999:9`!(mpl), |
| 4312 | eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.)); |
| 4313 | break; |
| 4314 | default: |
| 4315 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code != code); |
| 4316 | } |
| 4317 | /* save resultant value */ |
| 4318 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(!code->valid); |
| 4319 | code->validcxx . . $ CODE#valid. = 1; |
| 4320 | code->valuecxx . . $ CODE#value..tuplecxx . . $ VALUE#tuple. = copy_tuplecxx . . $ `external/glpk/glpmpl.h:1018:9`!(mpl, value); |
| 4321 | done: return value; |
| 4322 | } |
| 4323 | |
| 4324 | /*---------------------------------------------------------------------- |
| 4325 | -- eval_elemset - evaluate pseudo-code to construct elemental set. |
| 4326 | -- |
| 4327 | -- This routine evaluates specified pseudo-code to construct resultant |
| 4328 | -- elemental set, which is returned on exit. */ |
| 4329 | |
| 4330 | struct iter_set_infocxx . . $ iter_set_info# |
| 4331 | { /* working info used by the routine iter_set_func */ |
| 4332 | CODEcxx . . $ CODE# *codecxx . . $ iter_set_info#code.; |
| 4333 | /* pseudo-code for iterated operation to be performed */ |
| 4334 | ELEMSETcxx . . $ ELEMSET# *valuecxx . . $ iter_set_info#value.; |
| 4335 | /* resultant value */ |
| 4336 | }; |
| 4337 | |
| 4338 | static int iter_set_funccxx . . $ iter_set_func(3bbfabe35f227878).(MPLcxx . . $ MPL# *mpl, void *_info) |
| 4339 | { /* this is auxiliary routine used to perform iterated operation |
| 4340 | on n-tuple "integrand" within domain scope */ |
| 4341 | struct iter_set_infocxx . . $ iter_set_info# *info = _info; |
| 4342 | TUPLEcxx . . $ TUPLE# *tuple; |
| 4343 | switch (info->codecxx . . $ iter_set_info#code.->opcxx . . $ CODE#op.) |
| 4344 | { case O_SETOFcxx . . $ `external/glpk/glpmpl.h:2163:9`!: |
| 4345 | /* compute next n-tuple and add it to the set; in this case |
| 4346 | duplicate n-tuples are silently ignored */ |
| 4347 | tuple = eval_tuplecxx . . $ `external/glpk/glpmpl.h:2222:9`!(mpl, info->codecxx . . $ iter_set_info#code.->argcxx . . $ CODE#arg..loopcxx . . $ OPERANDS#loop..xcxx . . $ OPERANDS#$anonymous_type_9#x.); |
| 4348 | if (find_tuplecxx . . $ `external/glpk/glpmpl.h:1074:9`!(mpl, info->valuecxx . . $ iter_set_info#value., tuple) == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 4349 | add_tuplecxx . . $ `external/glpk/glpmpl.h:1082:9`!(mpl, info->valuecxx . . $ iter_set_info#value., tuple); |
| 4350 | else |
| 4351 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, tuple); |
| 4352 | break; |
| 4353 | case O_BUILDcxx . . $ `external/glpk/glpmpl.h:2164:9`!: |
| 4354 | /* construct next n-tuple using current values assigned to |
| 4355 | *free* dummy indices as its components and add it to the |
| 4356 | set; in this case duplicate n-tuples cannot appear */ |
| 4357 | add_tuplecxx . . $ `external/glpk/glpmpl.h:1082:9`!(mpl, info->valuecxx . . $ iter_set_info#value., get_domain_tuplecxx . . $ `external/glpk/glpmpl.h:1509:9`!(mpl, |
| 4358 | info->codecxx . . $ iter_set_info#code.->argcxx . . $ CODE#arg..loopcxx . . $ OPERANDS#loop..domaincxx . . $ OPERANDS#$anonymous_type_9#domain.)); |
| 4359 | break; |
| 4360 | default: |
| 4361 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(info != info); |
| 4362 | } |
| 4363 | return 0; |
| 4364 | } |
| 4365 | |
| 4366 | ELEMSETcxx . . $ ELEMSET# *eval_elemsetcxx . . $ `external/glpk/glpmpl.h:2226:9`!(MPLcxx . . $ MPL# *mpl, CODEcxx . . $ CODE# *code) |
| 4367 | { ELEMSETcxx . . $ ELEMSET# *value; |
| 4368 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 4369 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->type == A_ELEMSETcxx . . $ `external/glpk/glpmpl.h:84:9`!); |
| 4370 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->dim > 0); |
| 4371 | /* if the operation has a side effect, invalidate and delete the |
| 4372 | resultant value */ |
| 4373 | if (code->vflagcxx . . $ CODE#vflag. && code->validcxx . . $ CODE#valid.) |
| 4374 | { code->validcxx . . $ CODE#valid. = 0; |
| 4375 | delete_valuecxx . . $ `external/glpk/glpmpl.h:1314:9`!(mpl, code->typecxx . . $ CODE#type., &code->valuecxx . . $ CODE#value.); |
| 4376 | } |
| 4377 | /* if resultant value is valid, no evaluation is needed */ |
| 4378 | if (code->validcxx . . $ CODE#valid.) |
| 4379 | { value = copy_elemsetcxx . . $ `external/glpk/glpmpl.h:1098:9`!(mpl, code->valuecxx . . $ CODE#value..setcxx . . $ VALUE#set.); |
| 4380 | goto done; |
| 4381 | } |
| 4382 | /* evaluate pseudo-code recursively */ |
| 4383 | switch (code->opcxx . . $ CODE#op.) |
| 4384 | { case O_MEMSETcxx . . $ `external/glpk/glpmpl.h:2080:9`!: |
| 4385 | /* take member of set */ |
| 4386 | { TUPLEcxx . . $ TUPLE# *tuple; |
| 4387 | ARG_LISTcxx . . $ ARG_LIST# *e; |
| 4388 | tuple = create_tuplecxx . . $ `external/glpk/glpmpl.h:999:9`!(mpl); |
| 4389 | for (e = code->argcxx . . $ CODE#arg..setcxx . . $ OPERANDS#set..listcxx . . $ OPERANDS#$anonymous_type_5#list.; e != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; e = e->nextcxx . . $ ARG_LIST#next.) |
| 4390 | tuple = expand_tuplecxx . . $ `external/glpk/glpmpl.h:1003:9`!(mpl, tuple, eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, |
| 4391 | e->xcxx . . $ ARG_LIST#x.)); |
| 4392 | value = copy_elemsetcxx . . $ `external/glpk/glpmpl.h:1098:9`!(mpl, |
| 4393 | eval_member_setcxx . . $ `external/glpk/glpmpl.h:1591:9`!(mpl, code->argcxx . . $ CODE#arg..setcxx . . $ OPERANDS#set..setcxx . . $ OPERANDS#$anonymous_type_5#set., tuple)); |
| 4394 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, tuple); |
| 4395 | } |
| 4396 | break; |
| 4397 | case O_MAKEcxx . . $ `external/glpk/glpmpl.h:2084:9`!: |
| 4398 | /* make elemental set of n-tuples */ |
| 4399 | { ARG_LISTcxx . . $ ARG_LIST# *e; |
| 4400 | value = create_elemsetcxx . . $ `external/glpk/glpmpl.h:1070:9`!(mpl, code->dimcxx . . $ CODE#dim.); |
| 4401 | for (e = code->argcxx . . $ CODE#arg..listcxx . . $ OPERANDS#list.; e != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; e = e->nextcxx . . $ ARG_LIST#next.) |
| 4402 | check_then_addcxx . . $ `external/glpk/glpmpl.h:1090:9`!(mpl, value, eval_tuplecxx . . $ `external/glpk/glpmpl.h:2222:9`!(mpl, e->xcxx . . $ ARG_LIST#x.)); |
| 4403 | } |
| 4404 | break; |
| 4405 | case O_UNIONcxx . . $ `external/glpk/glpmpl.h:2137:9`!: |
| 4406 | /* union of two elemental sets */ |
| 4407 | value = set_unioncxx . . $ `external/glpk/glpmpl.h:1124:9`!(mpl, |
| 4408 | eval_elemsetcxx . . $ `external/glpk/glpmpl.h:2226:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 4409 | eval_elemsetcxx . . $ `external/glpk/glpmpl.h:2226:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 4410 | break; |
| 4411 | case O_DIFFcxx . . $ `external/glpk/glpmpl.h:2138:9`!: |
| 4412 | /* difference between two elemental sets */ |
| 4413 | value = set_diffcxx . . $ `external/glpk/glpmpl.h:1132:9`!(mpl, |
| 4414 | eval_elemsetcxx . . $ `external/glpk/glpmpl.h:2226:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 4415 | eval_elemsetcxx . . $ `external/glpk/glpmpl.h:2226:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 4416 | break; |
| 4417 | case O_SYMDIFFcxx . . $ `external/glpk/glpmpl.h:2139:9`!: |
| 4418 | /* symmetric difference between two elemental sets */ |
| 4419 | value = set_symdiffcxx . . $ `external/glpk/glpmpl.h:1140:9`!(mpl, |
| 4420 | eval_elemsetcxx . . $ `external/glpk/glpmpl.h:2226:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 4421 | eval_elemsetcxx . . $ `external/glpk/glpmpl.h:2226:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 4422 | break; |
| 4423 | case O_INTERcxx . . $ `external/glpk/glpmpl.h:2140:9`!: |
| 4424 | /* intersection of two elemental sets */ |
| 4425 | value = set_intercxx . . $ `external/glpk/glpmpl.h:1148:9`!(mpl, |
| 4426 | eval_elemsetcxx . . $ `external/glpk/glpmpl.h:2226:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 4427 | eval_elemsetcxx . . $ `external/glpk/glpmpl.h:2226:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 4428 | break; |
| 4429 | case O_CROSScxx . . $ `external/glpk/glpmpl.h:2141:9`!: |
| 4430 | /* cross (Cartesian) product of two elemental sets */ |
| 4431 | value = set_crosscxx . . $ `external/glpk/glpmpl.h:1156:9`!(mpl, |
| 4432 | eval_elemsetcxx . . $ `external/glpk/glpmpl.h:2226:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 4433 | eval_elemsetcxx . . $ `external/glpk/glpmpl.h:2226:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 4434 | break; |
| 4435 | case O_DOTScxx . . $ `external/glpk/glpmpl.h:2150:9`!: |
| 4436 | /* build "arithmetic" elemental set */ |
| 4437 | value = create_arelsetcxx . . $ `external/glpk/glpmpl.h:1120:9`!(mpl, |
| 4438 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 4439 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.), |
| 4440 | code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..zcxx . . $ OPERANDS#$anonymous_type_8#z. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! ? 1.0 : eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, |
| 4441 | code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..zcxx . . $ OPERANDS#$anonymous_type_8#z.)); |
| 4442 | break; |
| 4443 | case O_FORKcxx . . $ `external/glpk/glpmpl.h:2151:9`!: |
| 4444 | /* if-then-else */ |
| 4445 | if (eval_logicalcxx . . $ `external/glpk/glpmpl.h:2218:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.)) |
| 4446 | value = eval_elemsetcxx . . $ `external/glpk/glpmpl.h:2226:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.); |
| 4447 | else |
| 4448 | value = eval_elemsetcxx . . $ `external/glpk/glpmpl.h:2226:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..zcxx . . $ OPERANDS#$anonymous_type_8#z.); |
| 4449 | break; |
| 4450 | case O_SETOFcxx . . $ `external/glpk/glpmpl.h:2163:9`!: |
| 4451 | /* compute elemental set */ |
| 4452 | { struct iter_set_infocxx . . $ iter_set_info# _info, *info = &_info; |
| 4453 | info->codecxx . . $ iter_set_info#code. = code; |
| 4454 | info->valuecxx . . $ iter_set_info#value. = create_elemsetcxx . . $ `external/glpk/glpmpl.h:1070:9`!(mpl, code->dimcxx . . $ CODE#dim.); |
| 4455 | loop_within_domaincxx . . $ `external/glpk/glpmpl.h:1493:9`!(mpl, code->argcxx . . $ CODE#arg..loopcxx . . $ OPERANDS#loop..domaincxx . . $ OPERANDS#$anonymous_type_9#domain., info, |
| 4456 | iter_set_funccxx . . $ iter_set_func(3bbfabe35f227878).); |
| 4457 | value = info->valuecxx . . $ iter_set_info#value.; |
| 4458 | } |
| 4459 | break; |
| 4460 | case O_BUILDcxx . . $ `external/glpk/glpmpl.h:2164:9`!: |
| 4461 | /* build elemental set identical to domain set */ |
| 4462 | { struct iter_set_infocxx . . $ iter_set_info# _info, *info = &_info; |
| 4463 | info->codecxx . . $ iter_set_info#code. = code; |
| 4464 | info->valuecxx . . $ iter_set_info#value. = create_elemsetcxx . . $ `external/glpk/glpmpl.h:1070:9`!(mpl, code->dimcxx . . $ CODE#dim.); |
| 4465 | loop_within_domaincxx . . $ `external/glpk/glpmpl.h:1493:9`!(mpl, code->argcxx . . $ CODE#arg..loopcxx . . $ OPERANDS#loop..domaincxx . . $ OPERANDS#$anonymous_type_9#domain., info, |
| 4466 | iter_set_funccxx . . $ iter_set_func(3bbfabe35f227878).); |
| 4467 | value = info->valuecxx . . $ iter_set_info#value.; |
| 4468 | } |
| 4469 | break; |
| 4470 | default: |
| 4471 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code != code); |
| 4472 | } |
| 4473 | /* save resultant value */ |
| 4474 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(!code->valid); |
| 4475 | code->validcxx . . $ CODE#valid. = 1; |
| 4476 | code->valuecxx . . $ CODE#value..setcxx . . $ VALUE#set. = copy_elemsetcxx . . $ `external/glpk/glpmpl.h:1098:9`!(mpl, value); |
| 4477 | done: return value; |
| 4478 | } |
| 4479 | |
| 4480 | /*---------------------------------------------------------------------- |
| 4481 | -- is_member - check if n-tuple is in set specified by pseudo-code. |
| 4482 | -- |
| 4483 | -- This routine checks if given n-tuple is a member of elemental set |
| 4484 | -- specified in the form of pseudo-code (i.e. by expression). |
| 4485 | -- |
| 4486 | -- The n-tuple may have more components that dimension of the elemental |
| 4487 | -- set, in which case the extra components are ignored. */ |
| 4488 | |
| 4489 | static void null_funccxx . . $ null_func(55b428b8c674eeb1).(MPLcxx . . $ MPL# *mpl, void *info) |
| 4490 | { /* this is dummy routine used to enter the domain scope */ |
| 4491 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(mpl == mpl); |
| 4492 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(info == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 4493 | return; |
| 4494 | } |
| 4495 | |
| 4496 | int is_membercxx . . $ `external/glpk/glpmpl.h:2230:9`!(MPLcxx . . $ MPL# *mpl, CODEcxx . . $ CODE# *code, TUPLEcxx . . $ TUPLE# *tuple) |
| 4497 | { int value; |
| 4498 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 4499 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->type == A_ELEMSETcxx . . $ `external/glpk/glpmpl.h:84:9`!); |
| 4500 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->dim > 0); |
| 4501 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(tuple != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 4502 | switch (code->opcxx . . $ CODE#op.) |
| 4503 | { case O_MEMSETcxx . . $ `external/glpk/glpmpl.h:2080:9`!: |
| 4504 | /* check if given n-tuple is member of elemental set, which |
| 4505 | is assigned to member of model set */ |
| 4506 | { ARG_LISTcxx . . $ ARG_LIST# *e; |
| 4507 | TUPLEcxx . . $ TUPLE# *temp; |
| 4508 | ELEMSETcxx . . $ ELEMSET# *set; |
| 4509 | /* evaluate reference to elemental set */ |
| 4510 | temp = create_tuplecxx . . $ `external/glpk/glpmpl.h:999:9`!(mpl); |
| 4511 | for (e = code->argcxx . . $ CODE#arg..setcxx . . $ OPERANDS#set..listcxx . . $ OPERANDS#$anonymous_type_5#list.; e != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; e = e->nextcxx . . $ ARG_LIST#next.) |
| 4512 | temp = expand_tuplecxx . . $ `external/glpk/glpmpl.h:1003:9`!(mpl, temp, eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, |
| 4513 | e->xcxx . . $ ARG_LIST#x.)); |
| 4514 | set = eval_member_setcxx . . $ `external/glpk/glpmpl.h:1591:9`!(mpl, code->argcxx . . $ CODE#arg..setcxx . . $ OPERANDS#set..setcxx . . $ OPERANDS#$anonymous_type_5#set., temp); |
| 4515 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, temp); |
| 4516 | /* check if the n-tuple is contained in the set array */ |
| 4517 | temp = build_subtuplecxx . . $ `external/glpk/glpmpl.h:1033:9`!(mpl, tuple, set->dimcxx . . $ ARRAY#dim.); |
| 4518 | value = (find_tuplecxx . . $ `external/glpk/glpmpl.h:1074:9`!(mpl, set, temp) != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 4519 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, temp); |
| 4520 | } |
| 4521 | break; |
| 4522 | case O_MAKEcxx . . $ `external/glpk/glpmpl.h:2084:9`!: |
| 4523 | /* check if given n-tuple is member of literal set */ |
| 4524 | { ARG_LISTcxx . . $ ARG_LIST# *e; |
| 4525 | TUPLEcxx . . $ TUPLE# *temp, *that; |
| 4526 | value = 0; |
| 4527 | temp = build_subtuplecxx . . $ `external/glpk/glpmpl.h:1033:9`!(mpl, tuple, code->dimcxx . . $ CODE#dim.); |
| 4528 | for (e = code->argcxx . . $ CODE#arg..listcxx . . $ OPERANDS#list.; e != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; e = e->nextcxx . . $ ARG_LIST#next.) |
| 4529 | { that = eval_tuplecxx . . $ `external/glpk/glpmpl.h:2222:9`!(mpl, e->xcxx . . $ ARG_LIST#x.); |
| 4530 | value = (compare_tuplescxx . . $ `external/glpk/glpmpl.h:1025:9`!(mpl, temp, that) == 0); |
| 4531 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, that); |
| 4532 | if (value) break; |
| 4533 | } |
| 4534 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, temp); |
| 4535 | } |
| 4536 | break; |
| 4537 | case O_UNIONcxx . . $ `external/glpk/glpmpl.h:2137:9`!: |
| 4538 | value = is_membercxx . . $ `external/glpk/glpmpl.h:2230:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x., tuple) || |
| 4539 | is_membercxx . . $ `external/glpk/glpmpl.h:2230:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y., tuple); |
| 4540 | break; |
| 4541 | case O_DIFFcxx . . $ `external/glpk/glpmpl.h:2138:9`!: |
| 4542 | value = is_membercxx . . $ `external/glpk/glpmpl.h:2230:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x., tuple) && |
| 4543 | !is_membercxx . . $ `external/glpk/glpmpl.h:2230:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y., tuple); |
| 4544 | break; |
| 4545 | case O_SYMDIFFcxx . . $ `external/glpk/glpmpl.h:2139:9`!: |
| 4546 | { int in1 = is_membercxx . . $ `external/glpk/glpmpl.h:2230:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x., tuple); |
| 4547 | int in2 = is_membercxx . . $ `external/glpk/glpmpl.h:2230:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y., tuple); |
| 4548 | value = (in1 && !in2) || (!in1 && in2); |
| 4549 | } |
| 4550 | break; |
| 4551 | case O_INTERcxx . . $ `external/glpk/glpmpl.h:2140:9`!: |
| 4552 | value = is_membercxx . . $ `external/glpk/glpmpl.h:2230:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x., tuple) && |
| 4553 | is_membercxx . . $ `external/glpk/glpmpl.h:2230:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y., tuple); |
| 4554 | break; |
| 4555 | case O_CROSScxx . . $ `external/glpk/glpmpl.h:2141:9`!: |
| 4556 | { int j; |
| 4557 | value = is_membercxx . . $ `external/glpk/glpmpl.h:2230:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x., tuple); |
| 4558 | if (value) |
| 4559 | { for (j = 1; j <= code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.->dimcxx . . $ CODE#dim.; j++) |
| 4560 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(tuple != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 4561 | tuple = tuple->nextcxx . . $ TUPLE#next.; |
| 4562 | } |
| 4563 | value = is_membercxx . . $ `external/glpk/glpmpl.h:2230:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y., tuple); |
| 4564 | } |
| 4565 | } |
| 4566 | break; |
| 4567 | case O_DOTScxx . . $ `external/glpk/glpmpl.h:2150:9`!: |
| 4568 | /* check if given 1-tuple is member of "arithmetic" set */ |
| 4569 | { int j; |
| 4570 | double x, t0, tf, dt; |
| 4571 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->dim == 1); |
| 4572 | /* compute "parameters" of the "arithmetic" set */ |
| 4573 | t0 = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 4574 | tf = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.); |
| 4575 | if (code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..zcxx . . $ OPERANDS#$anonymous_type_8#z. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 4576 | dt = 1.0; |
| 4577 | else |
| 4578 | dt = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..zcxx . . $ OPERANDS#$anonymous_type_8#z.); |
| 4579 | /* make sure the parameters are correct */ |
| 4580 | arelset_sizecxx . . $ `external/glpk/glpmpl.h:1112:9`!(mpl, t0, tf, dt); |
| 4581 | /* if component of 1-tuple is symbolic, not numeric, the |
| 4582 | 1-tuple cannot be member of "arithmetic" set */ |
| 4583 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(tuple->sym != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 4584 | if (tuple->symcxx . . $ TUPLE#sym.->strcxx . . $ SYMBOL#str. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 4585 | { value = 0; |
| 4586 | break; |
| 4587 | } |
| 4588 | /* determine numeric value of the component */ |
| 4589 | x = tuple->symcxx . . $ TUPLE#sym.->numcxx . . $ SYMBOL#num.; |
| 4590 | /* if the component value is out of the set range, the |
| 4591 | 1-tuple is not in the set */ |
| 4592 | if (dt > 0.0 && !(t0 <= x && x <= tf) || |
| 4593 | dt < 0.0 && !(tf <= x && x <= t0)) |
| 4594 | { value = 0; |
| 4595 | break; |
| 4596 | } |
| 4597 | /* estimate ordinal number of the 1-tuple in the set */ |
| 4598 | j = (int)(((x - t0) / dt) + 0.5) + 1; |
| 4599 | /* perform the main check */ |
| 4600 | value = (arelset_membercxx . . $ `external/glpk/glpmpl.h:1116:9`!(mpl, t0, tf, dt, j) == x); |
| 4601 | } |
| 4602 | break; |
| 4603 | case O_FORKcxx . . $ `external/glpk/glpmpl.h:2151:9`!: |
| 4604 | /* check if given n-tuple is member of conditional set */ |
| 4605 | if (eval_logicalcxx . . $ `external/glpk/glpmpl.h:2218:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.)) |
| 4606 | value = is_membercxx . . $ `external/glpk/glpmpl.h:2230:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y., tuple); |
| 4607 | else |
| 4608 | value = is_membercxx . . $ `external/glpk/glpmpl.h:2230:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..zcxx . . $ OPERANDS#$anonymous_type_8#z., tuple); |
| 4609 | break; |
| 4610 | case O_SETOFcxx . . $ `external/glpk/glpmpl.h:2163:9`!: |
| 4611 | /* check if given n-tuple is member of computed set */ |
| 4612 | /* it is not clear how to efficiently perform the check not |
| 4613 | computing the entire elemental set :+( */ |
| 4614 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "implementation restriction; in/within setof{} n" |
| 4615 | "ot allowed"); |
| 4616 | break; |
| 4617 | case O_BUILDcxx . . $ `external/glpk/glpmpl.h:2164:9`!: |
| 4618 | /* check if given n-tuple is member of domain set */ |
| 4619 | { TUPLEcxx . . $ TUPLE# *temp; |
| 4620 | temp = build_subtuplecxx . . $ `external/glpk/glpmpl.h:1033:9`!(mpl, tuple, code->dimcxx . . $ CODE#dim.); |
| 4621 | /* try to enter the domain scope; if it is successful, |
| 4622 | the n-tuple is in the domain set */ |
| 4623 | value = (eval_within_domaincxx . . $ `external/glpk/glpmpl.h:1484:9`!(mpl, code->argcxx . . $ CODE#arg..loopcxx . . $ OPERANDS#loop..domaincxx . . $ OPERANDS#$anonymous_type_9#domain., |
| 4624 | temp, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!, null_funccxx . . $ null_func(55b428b8c674eeb1).) == 0); |
| 4625 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, temp); |
| 4626 | } |
| 4627 | break; |
| 4628 | default: |
| 4629 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code != code); |
| 4630 | } |
| 4631 | return value; |
| 4632 | } |
| 4633 | |
| 4634 | /*---------------------------------------------------------------------- |
| 4635 | -- eval_formula - evaluate pseudo-code to construct linear form. |
| 4636 | -- |
| 4637 | -- This routine evaluates specified pseudo-code to construct resultant |
| 4638 | -- linear form, which is returned on exit. */ |
| 4639 | |
| 4640 | struct iter_form_infocxx . . $ iter_form_info# |
| 4641 | { /* working info used by the routine iter_form_func */ |
| 4642 | CODEcxx . . $ CODE# *codecxx . . $ iter_form_info#code.; |
| 4643 | /* pseudo-code for iterated operation to be performed */ |
| 4644 | FORMULAcxx . . $ FORMULA# *valuecxx . . $ iter_form_info#value.; |
| 4645 | /* resultant value */ |
| 4646 | FORMULAcxx . . $ FORMULA# *tailcxx . . $ iter_form_info#tail.; |
| 4647 | /* pointer to the last term */ |
| 4648 | }; |
| 4649 | |
| 4650 | static int iter_form_funccxx . . $ iter_form_func(3bbfabe35f227878).(MPLcxx . . $ MPL# *mpl, void *_info) |
| 4651 | { /* this is auxiliary routine used to perform iterated operation |
| 4652 | on linear form "integrand" within domain scope */ |
| 4653 | struct iter_form_infocxx . . $ iter_form_info# *info = _info; |
| 4654 | switch (info->codecxx . . $ iter_form_info#code.->opcxx . . $ CODE#op.) |
| 4655 | { case O_SUMcxx . . $ `external/glpk/glpmpl.h:2157:9`!: |
| 4656 | /* summation over domain */ |
| 4657 | #if 0 |
| 4658 | info->value = |
| 4659 | linear_comb(mpl, |
| 4660 | +1.0, info->value, |
| 4661 | +1.0, eval_formula(mpl, info->code->arg.loop.x)); |
| 4662 | #else |
| 4663 | /* the routine linear_comb needs to look through all terms |
| 4664 | of both linear forms to reduce identical terms, so using |
| 4665 | it here is not a good idea (for example, evaluation of |
| 4666 | sum{i in 1..n} x[i] required quadratic time); the better |
| 4667 | idea is to gather all terms of the integrand in one list |
| 4668 | and reduce identical terms only once after all terms of |
| 4669 | the resultant linear form have been evaluated */ |
| 4670 | { FORMULAcxx . . $ FORMULA# *form, *term; |
| 4671 | form = eval_formulacxx . . $ `external/glpk/glpmpl.h:2234:9`!(mpl, info->codecxx . . $ iter_form_info#code.->argcxx . . $ CODE#arg..loopcxx . . $ OPERANDS#loop..xcxx . . $ OPERANDS#$anonymous_type_9#x.); |
| 4672 | if (info->valuecxx . . $ iter_form_info#value. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 4673 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(info->tail == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 4674 | info->valuecxx . . $ iter_form_info#value. = form; |
| 4675 | } |
| 4676 | else |
| 4677 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(info->tail != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 4678 | info->tailcxx . . $ iter_form_info#tail.->nextcxx . . $ FORMULA#next. = form; |
| 4679 | } |
| 4680 | for (term = form; term != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; term = term->nextcxx . . $ FORMULA#next.) |
| 4681 | info->tailcxx . . $ iter_form_info#tail. = term; |
| 4682 | } |
| 4683 | #endif |
| 4684 | break; |
| 4685 | default: |
| 4686 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(info != info); |
| 4687 | } |
| 4688 | return 0; |
| 4689 | } |
| 4690 | |
| 4691 | FORMULAcxx . . $ FORMULA# *eval_formulacxx . . $ `external/glpk/glpmpl.h:2234:9`!(MPLcxx . . $ MPL# *mpl, CODEcxx . . $ CODE# *code) |
| 4692 | { FORMULAcxx . . $ FORMULA# *value; |
| 4693 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 4694 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->type == A_FORMULAcxx . . $ `external/glpk/glpmpl.h:88:9`!); |
| 4695 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->dim == 0); |
| 4696 | /* if the operation has a side effect, invalidate and delete the |
| 4697 | resultant value */ |
| 4698 | if (code->vflagcxx . . $ CODE#vflag. && code->validcxx . . $ CODE#valid.) |
| 4699 | { code->validcxx . . $ CODE#valid. = 0; |
| 4700 | delete_valuecxx . . $ `external/glpk/glpmpl.h:1314:9`!(mpl, code->typecxx . . $ CODE#type., &code->valuecxx . . $ CODE#value.); |
| 4701 | } |
| 4702 | /* if resultant value is valid, no evaluation is needed */ |
| 4703 | if (code->validcxx . . $ CODE#valid.) |
| 4704 | { value = copy_formulacxx . . $ `external/glpk/glpmpl.h:1220:9`!(mpl, code->valuecxx . . $ CODE#value..formcxx . . $ VALUE#form.); |
| 4705 | goto done; |
| 4706 | } |
| 4707 | /* evaluate pseudo-code recursively */ |
| 4708 | switch (code->opcxx . . $ CODE#op.) |
| 4709 | { case O_MEMVARcxx . . $ `external/glpk/glpmpl.h:2081:9`!: |
| 4710 | /* take member of variable */ |
| 4711 | { TUPLEcxx . . $ TUPLE# *tuple; |
| 4712 | ARG_LISTcxx . . $ ARG_LIST# *e; |
| 4713 | tuple = create_tuplecxx . . $ `external/glpk/glpmpl.h:999:9`!(mpl); |
| 4714 | for (e = code->argcxx . . $ CODE#arg..varcxx . . $ OPERANDS#var..listcxx . . $ OPERANDS#$anonymous_type_6#list.; e != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; e = e->nextcxx . . $ ARG_LIST#next.) |
| 4715 | tuple = expand_tuplecxx . . $ `external/glpk/glpmpl.h:1003:9`!(mpl, tuple, eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, |
| 4716 | e->xcxx . . $ ARG_LIST#x.)); |
| 4717 | #if 1 /* 15/V-2010 */ |
| 4718 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->arg.var.suff == DOT_NONEcxx . . $ `external/glpk/glpmpl.h:2018:9`!); |
| 4719 | #endif |
| 4720 | value = single_variablecxx . . $ `external/glpk/glpmpl.h:1213:9`!(mpl, |
| 4721 | eval_member_varcxx . . $ `external/glpk/glpmpl.h:1765:9`!(mpl, code->argcxx . . $ CODE#arg..varcxx . . $ OPERANDS#var..varcxx . . $ OPERANDS#$anonymous_type_6#var., tuple)); |
| 4722 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, tuple); |
| 4723 | } |
| 4724 | break; |
| 4725 | case O_CVTLFMcxx . . $ `external/glpk/glpmpl.h:2096:9`!: |
| 4726 | /* convert to linear form */ |
| 4727 | value = constant_termcxx . . $ `external/glpk/glpmpl.h:1209:9`!(mpl, eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, |
| 4728 | code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.)); |
| 4729 | break; |
| 4730 | case O_PLUScxx . . $ `external/glpk/glpmpl.h:2097:9`!: |
| 4731 | /* unary plus */ |
| 4732 | value = linear_combcxx . . $ `external/glpk/glpmpl.h:1234:9`!(mpl, |
| 4733 | 0.0, constant_termcxx . . $ `external/glpk/glpmpl.h:1209:9`!(mpl, 0.0), |
| 4734 | +1.0, eval_formulacxx . . $ `external/glpk/glpmpl.h:2234:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.)); |
| 4735 | break; |
| 4736 | case O_MINUScxx . . $ `external/glpk/glpmpl.h:2098:9`!: |
| 4737 | /* unary minus */ |
| 4738 | value = linear_combcxx . . $ `external/glpk/glpmpl.h:1234:9`!(mpl, |
| 4739 | 0.0, constant_termcxx . . $ `external/glpk/glpmpl.h:1209:9`!(mpl, 0.0), |
| 4740 | -1.0, eval_formulacxx . . $ `external/glpk/glpmpl.h:2234:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.)); |
| 4741 | break; |
| 4742 | case O_ADDcxx . . $ `external/glpk/glpmpl.h:2115:9`!: |
| 4743 | /* addition */ |
| 4744 | value = linear_combcxx . . $ `external/glpk/glpmpl.h:1234:9`!(mpl, |
| 4745 | +1.0, eval_formulacxx . . $ `external/glpk/glpmpl.h:2234:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 4746 | +1.0, eval_formulacxx . . $ `external/glpk/glpmpl.h:2234:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 4747 | break; |
| 4748 | case O_SUBcxx . . $ `external/glpk/glpmpl.h:2116:9`!: |
| 4749 | /* subtraction */ |
| 4750 | value = linear_combcxx . . $ `external/glpk/glpmpl.h:1234:9`!(mpl, |
| 4751 | +1.0, eval_formulacxx . . $ `external/glpk/glpmpl.h:2234:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 4752 | -1.0, eval_formulacxx . . $ `external/glpk/glpmpl.h:2234:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)); |
| 4753 | break; |
| 4754 | case O_MULcxx . . $ `external/glpk/glpmpl.h:2118:9`!: |
| 4755 | /* multiplication */ |
| 4756 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->arg.arg.x != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 4757 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->arg.arg.y != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 4758 | if (code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.->typecxx . . $ CODE#type. == A_NUMERICcxx . . $ `external/glpk/glpmpl.h:96:9`!) |
| 4759 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->arg.arg.y->type == A_FORMULAcxx . . $ `external/glpk/glpmpl.h:88:9`!); |
| 4760 | value = linear_combcxx . . $ `external/glpk/glpmpl.h:1234:9`!(mpl, |
| 4761 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 4762 | eval_formulacxx . . $ `external/glpk/glpmpl.h:2234:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.), |
| 4763 | 0.0, constant_termcxx . . $ `external/glpk/glpmpl.h:1209:9`!(mpl, 0.0)); |
| 4764 | } |
| 4765 | else |
| 4766 | { xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->arg.arg.x->type == A_FORMULAcxx . . $ `external/glpk/glpmpl.h:88:9`!); |
| 4767 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->arg.arg.y->type == A_NUMERICcxx . . $ `external/glpk/glpmpl.h:96:9`!); |
| 4768 | value = linear_combcxx . . $ `external/glpk/glpmpl.h:1234:9`!(mpl, |
| 4769 | eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.), |
| 4770 | eval_formulacxx . . $ `external/glpk/glpmpl.h:2234:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 4771 | 0.0, constant_termcxx . . $ `external/glpk/glpmpl.h:1209:9`!(mpl, 0.0)); |
| 4772 | } |
| 4773 | break; |
| 4774 | case O_DIVcxx . . $ `external/glpk/glpmpl.h:2119:9`!: |
| 4775 | /* division */ |
| 4776 | value = linear_combcxx . . $ `external/glpk/glpmpl.h:1234:9`!(mpl, |
| 4777 | fp_divcxx . . $ `external/glpk/glpmpl.h:789:9`!(mpl, 1.0, eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.)), |
| 4778 | eval_formulacxx . . $ `external/glpk/glpmpl.h:2234:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.), |
| 4779 | 0.0, constant_termcxx . . $ `external/glpk/glpmpl.h:1209:9`!(mpl, 0.0)); |
| 4780 | break; |
| 4781 | case O_FORKcxx . . $ `external/glpk/glpmpl.h:2151:9`!: |
| 4782 | /* if-then-else */ |
| 4783 | if (eval_logicalcxx . . $ `external/glpk/glpmpl.h:2218:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.)) |
| 4784 | value = eval_formulacxx . . $ `external/glpk/glpmpl.h:2234:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.); |
| 4785 | else if (code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..zcxx . . $ OPERANDS#$anonymous_type_8#z. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 4786 | value = constant_termcxx . . $ `external/glpk/glpmpl.h:1209:9`!(mpl, 0.0); |
| 4787 | else |
| 4788 | value = eval_formulacxx . . $ `external/glpk/glpmpl.h:2234:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..zcxx . . $ OPERANDS#$anonymous_type_8#z.); |
| 4789 | break; |
| 4790 | case O_SUMcxx . . $ `external/glpk/glpmpl.h:2157:9`!: |
| 4791 | /* summation over domain */ |
| 4792 | { struct iter_form_infocxx . . $ iter_form_info# _info, *info = &_info; |
| 4793 | info->codecxx . . $ iter_form_info#code. = code; |
| 4794 | info->valuecxx . . $ iter_form_info#value. = constant_termcxx . . $ `external/glpk/glpmpl.h:1209:9`!(mpl, 0.0); |
| 4795 | info->tailcxx . . $ iter_form_info#tail. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 4796 | loop_within_domaincxx . . $ `external/glpk/glpmpl.h:1493:9`!(mpl, code->argcxx . . $ CODE#arg..loopcxx . . $ OPERANDS#loop..domaincxx . . $ OPERANDS#$anonymous_type_9#domain., info, |
| 4797 | iter_form_funccxx . . $ iter_form_func(3bbfabe35f227878).); |
| 4798 | value = reduce_termscxx . . $ `external/glpk/glpmpl.h:1250:9`!(mpl, info->valuecxx . . $ iter_form_info#value.); |
| 4799 | } |
| 4800 | break; |
| 4801 | default: |
| 4802 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code != code); |
| 4803 | } |
| 4804 | /* save resultant value */ |
| 4805 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(!code->valid); |
| 4806 | code->validcxx . . $ CODE#valid. = 1; |
| 4807 | code->valuecxx . . $ CODE#value..formcxx . . $ VALUE#form. = copy_formulacxx . . $ `external/glpk/glpmpl.h:1220:9`!(mpl, value); |
| 4808 | done: return value; |
| 4809 | } |
| 4810 | |
| 4811 | /*---------------------------------------------------------------------- |
| 4812 | -- clean_code - clean pseudo-code. |
| 4813 | -- |
| 4814 | -- This routine recursively cleans specified pseudo-code that assumes |
| 4815 | -- deleting all temporary resultant values. */ |
| 4816 | |
| 4817 | void clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(MPLcxx . . $ MPL# *mpl, CODEcxx . . $ CODE# *code) |
| 4818 | { ARG_LISTcxx . . $ ARG_LIST# *e; |
| 4819 | /* if no pseudo-code is specified, do nothing */ |
| 4820 | if (code == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) goto done; |
| 4821 | /* if resultant value is valid (exists), delete it */ |
| 4822 | if (code->validcxx . . $ CODE#valid.) |
| 4823 | { code->validcxx . . $ CODE#valid. = 0; |
| 4824 | delete_valuecxx . . $ `external/glpk/glpmpl.h:1314:9`!(mpl, code->typecxx . . $ CODE#type., &code->valuecxx . . $ CODE#value.); |
| 4825 | } |
| 4826 | /* recursively clean pseudo-code for operands */ |
| 4827 | switch (code->opcxx . . $ CODE#op.) |
| 4828 | { case O_NUMBERcxx . . $ `external/glpk/glpmpl.h:2075:9`!: |
| 4829 | case O_STRINGcxx . . $ `external/glpk/glpmpl.h:2076:9`!: |
| 4830 | case O_INDEXcxx . . $ `external/glpk/glpmpl.h:2077:9`!: |
| 4831 | break; |
| 4832 | case O_MEMNUMcxx . . $ `external/glpk/glpmpl.h:2078:9`!: |
| 4833 | case O_MEMSYMcxx . . $ `external/glpk/glpmpl.h:2079:9`!: |
| 4834 | for (e = code->argcxx . . $ CODE#arg..parcxx . . $ OPERANDS#par..listcxx . . $ OPERANDS#$anonymous_type_4#list.; e != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; e = e->nextcxx . . $ ARG_LIST#next.) |
| 4835 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, e->xcxx . . $ ARG_LIST#x.); |
| 4836 | break; |
| 4837 | case O_MEMSETcxx . . $ `external/glpk/glpmpl.h:2080:9`!: |
| 4838 | for (e = code->argcxx . . $ CODE#arg..setcxx . . $ OPERANDS#set..listcxx . . $ OPERANDS#$anonymous_type_5#list.; e != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; e = e->nextcxx . . $ ARG_LIST#next.) |
| 4839 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, e->xcxx . . $ ARG_LIST#x.); |
| 4840 | break; |
| 4841 | case O_MEMVARcxx . . $ `external/glpk/glpmpl.h:2081:9`!: |
| 4842 | for (e = code->argcxx . . $ CODE#arg..varcxx . . $ OPERANDS#var..listcxx . . $ OPERANDS#$anonymous_type_6#list.; e != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; e = e->nextcxx . . $ ARG_LIST#next.) |
| 4843 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, e->xcxx . . $ ARG_LIST#x.); |
| 4844 | break; |
| 4845 | #if 1 /* 15/V-2010 */ |
| 4846 | case O_MEMCONcxx . . $ `external/glpk/glpmpl.h:2082:9`!: |
| 4847 | for (e = code->argcxx . . $ CODE#arg..concxx . . $ OPERANDS#con..listcxx . . $ OPERANDS#$anonymous_type_7#list.; e != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; e = e->nextcxx . . $ ARG_LIST#next.) |
| 4848 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, e->xcxx . . $ ARG_LIST#x.); |
| 4849 | break; |
| 4850 | #endif |
| 4851 | case O_TUPLEcxx . . $ `external/glpk/glpmpl.h:2083:9`!: |
| 4852 | case O_MAKEcxx . . $ `external/glpk/glpmpl.h:2084:9`!: |
| 4853 | for (e = code->argcxx . . $ CODE#arg..listcxx . . $ OPERANDS#list.; e != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; e = e->nextcxx . . $ ARG_LIST#next.) |
| 4854 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, e->xcxx . . $ ARG_LIST#x.); |
| 4855 | break; |
| 4856 | case O_SLICEcxx . . $ `external/glpk/glpmpl.h:2085:9`!: |
| 4857 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code != code); |
| 4858 | case O_IRAND224cxx . . $ `external/glpk/glpmpl.h:2087:9`!: |
| 4859 | case O_UNIFORM01cxx . . $ `external/glpk/glpmpl.h:2088:9`!: |
| 4860 | case O_NORMAL01cxx . . $ `external/glpk/glpmpl.h:2089:9`!: |
| 4861 | case O_GMTIMEcxx . . $ `external/glpk/glpmpl.h:2090:9`!: |
| 4862 | break; |
| 4863 | case O_CVTNUMcxx . . $ `external/glpk/glpmpl.h:2092:9`!: |
| 4864 | case O_CVTSYMcxx . . $ `external/glpk/glpmpl.h:2093:9`!: |
| 4865 | case O_CVTLOGcxx . . $ `external/glpk/glpmpl.h:2094:9`!: |
| 4866 | case O_CVTTUPcxx . . $ `external/glpk/glpmpl.h:2095:9`!: |
| 4867 | case O_CVTLFMcxx . . $ `external/glpk/glpmpl.h:2096:9`!: |
| 4868 | case O_PLUScxx . . $ `external/glpk/glpmpl.h:2097:9`!: |
| 4869 | case O_MINUScxx . . $ `external/glpk/glpmpl.h:2098:9`!: |
| 4870 | case O_NOTcxx . . $ `external/glpk/glpmpl.h:2099:9`!: |
| 4871 | case O_ABScxx . . $ `external/glpk/glpmpl.h:2100:9`!: |
| 4872 | case O_CEILcxx . . $ `external/glpk/glpmpl.h:2101:9`!: |
| 4873 | case O_FLOORcxx . . $ `external/glpk/glpmpl.h:2102:9`!: |
| 4874 | case O_EXPcxx . . $ `external/glpk/glpmpl.h:2103:9`!: |
| 4875 | case O_LOGcxx . . $ `external/glpk/glpmpl.h:2104:9`!: |
| 4876 | case O_LOG10cxx . . $ `external/glpk/glpmpl.h:2105:9`!: |
| 4877 | case O_SQRTcxx . . $ `external/glpk/glpmpl.h:2106:9`!: |
| 4878 | case O_SINcxx . . $ `external/glpk/glpmpl.h:2107:9`!: |
| 4879 | case O_COScxx . . $ `external/glpk/glpmpl.h:2108:9`!: |
| 4880 | case O_ATANcxx . . $ `external/glpk/glpmpl.h:2109:9`!: |
| 4881 | case O_ROUNDcxx . . $ `external/glpk/glpmpl.h:2110:9`!: |
| 4882 | case O_TRUNCcxx . . $ `external/glpk/glpmpl.h:2111:9`!: |
| 4883 | case O_CARDcxx . . $ `external/glpk/glpmpl.h:2112:9`!: |
| 4884 | case O_LENGTHcxx . . $ `external/glpk/glpmpl.h:2113:9`!: |
| 4885 | /* unary operation */ |
| 4886 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 4887 | break; |
| 4888 | case O_ADDcxx . . $ `external/glpk/glpmpl.h:2115:9`!: |
| 4889 | case O_SUBcxx . . $ `external/glpk/glpmpl.h:2116:9`!: |
| 4890 | case O_LESScxx . . $ `external/glpk/glpmpl.h:2117:9`!: |
| 4891 | case O_MULcxx . . $ `external/glpk/glpmpl.h:2118:9`!: |
| 4892 | case O_DIVcxx . . $ `external/glpk/glpmpl.h:2119:9`!: |
| 4893 | case O_IDIVcxx . . $ `external/glpk/glpmpl.h:2120:9`!: |
| 4894 | case O_MODcxx . . $ `external/glpk/glpmpl.h:2121:9`!: |
| 4895 | case O_POWERcxx . . $ `external/glpk/glpmpl.h:2122:9`!: |
| 4896 | case O_ATAN2cxx . . $ `external/glpk/glpmpl.h:2123:9`!: |
| 4897 | case O_ROUND2cxx . . $ `external/glpk/glpmpl.h:2124:9`!: |
| 4898 | case O_TRUNC2cxx . . $ `external/glpk/glpmpl.h:2125:9`!: |
| 4899 | case O_UNIFORMcxx . . $ `external/glpk/glpmpl.h:2126:9`!: |
| 4900 | case O_NORMALcxx . . $ `external/glpk/glpmpl.h:2127:9`!: |
| 4901 | case O_CONCATcxx . . $ `external/glpk/glpmpl.h:2128:9`!: |
| 4902 | case O_LTcxx . . $ `external/glpk/glpmpl.h:2129:9`!: |
| 4903 | case O_LEcxx . . $ `external/glpk/glpmpl.h:2130:9`!: |
| 4904 | case O_EQcxx . . $ `external/glpk/glpmpl.h:2131:9`!: |
| 4905 | case O_GEcxx . . $ `external/glpk/glpmpl.h:2132:9`!: |
| 4906 | case O_GTcxx . . $ `external/glpk/glpmpl.h:2133:9`!: |
| 4907 | case O_NEcxx . . $ `external/glpk/glpmpl.h:2134:9`!: |
| 4908 | case O_ANDcxx . . $ `external/glpk/glpmpl.h:2135:9`!: |
| 4909 | case O_ORcxx . . $ `external/glpk/glpmpl.h:2136:9`!: |
| 4910 | case O_UNIONcxx . . $ `external/glpk/glpmpl.h:2137:9`!: |
| 4911 | case O_DIFFcxx . . $ `external/glpk/glpmpl.h:2138:9`!: |
| 4912 | case O_SYMDIFFcxx . . $ `external/glpk/glpmpl.h:2139:9`!: |
| 4913 | case O_INTERcxx . . $ `external/glpk/glpmpl.h:2140:9`!: |
| 4914 | case O_CROSScxx . . $ `external/glpk/glpmpl.h:2141:9`!: |
| 4915 | case O_INcxx . . $ `external/glpk/glpmpl.h:2142:9`!: |
| 4916 | case O_NOTINcxx . . $ `external/glpk/glpmpl.h:2143:9`!: |
| 4917 | case O_WITHINcxx . . $ `external/glpk/glpmpl.h:2144:9`!: |
| 4918 | case O_NOTWITHINcxx . . $ `external/glpk/glpmpl.h:2145:9`!: |
| 4919 | case O_SUBSTRcxx . . $ `external/glpk/glpmpl.h:2146:9`!: |
| 4920 | case O_STR2TIMEcxx . . $ `external/glpk/glpmpl.h:2147:9`!: |
| 4921 | case O_TIME2STRcxx . . $ `external/glpk/glpmpl.h:2148:9`!: |
| 4922 | /* binary operation */ |
| 4923 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 4924 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.); |
| 4925 | break; |
| 4926 | case O_DOTScxx . . $ `external/glpk/glpmpl.h:2150:9`!: |
| 4927 | case O_FORKcxx . . $ `external/glpk/glpmpl.h:2151:9`!: |
| 4928 | case O_SUBSTR3cxx . . $ `external/glpk/glpmpl.h:2152:9`!: |
| 4929 | /* ternary operation */ |
| 4930 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..xcxx . . $ OPERANDS#$anonymous_type_8#x.); |
| 4931 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..ycxx . . $ OPERANDS#$anonymous_type_8#y.); |
| 4932 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, code->argcxx . . $ CODE#arg..argcxx . . $ OPERANDS#arg..zcxx . . $ OPERANDS#$anonymous_type_8#z.); |
| 4933 | break; |
| 4934 | case O_MINcxx . . $ `external/glpk/glpmpl.h:2154:9`!: |
| 4935 | case O_MAXcxx . . $ `external/glpk/glpmpl.h:2155:9`!: |
| 4936 | /* n-ary operation */ |
| 4937 | for (e = code->argcxx . . $ CODE#arg..listcxx . . $ OPERANDS#list.; e != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; e = e->nextcxx . . $ ARG_LIST#next.) |
| 4938 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, e->xcxx . . $ ARG_LIST#x.); |
| 4939 | break; |
| 4940 | case O_SUMcxx . . $ `external/glpk/glpmpl.h:2157:9`!: |
| 4941 | case O_PRODcxx . . $ `external/glpk/glpmpl.h:2158:9`!: |
| 4942 | case O_MINIMUMcxx . . $ `external/glpk/glpmpl.h:2159:9`!: |
| 4943 | case O_MAXIMUMcxx . . $ `external/glpk/glpmpl.h:2160:9`!: |
| 4944 | case O_FORALLcxx . . $ `external/glpk/glpmpl.h:2161:9`!: |
| 4945 | case O_EXISTScxx . . $ `external/glpk/glpmpl.h:2162:9`!: |
| 4946 | case O_SETOFcxx . . $ `external/glpk/glpmpl.h:2163:9`!: |
| 4947 | case O_BUILDcxx . . $ `external/glpk/glpmpl.h:2164:9`!: |
| 4948 | /* iterated operation */ |
| 4949 | clean_domaincxx . . $ `external/glpk/glpmpl.h:1516:9`!(mpl, code->argcxx . . $ CODE#arg..loopcxx . . $ OPERANDS#loop..domaincxx . . $ OPERANDS#$anonymous_type_9#domain.); |
| 4950 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, code->argcxx . . $ CODE#arg..loopcxx . . $ OPERANDS#loop..xcxx . . $ OPERANDS#$anonymous_type_9#x.); |
| 4951 | break; |
| 4952 | default: |
| 4953 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->op != code->op); |
| 4954 | } |
| 4955 | done: return; |
| 4956 | } |
| 4957 | |
| 4958 | #if 1 /* 11/II-2008 */ |
| 4959 | /**********************************************************************/ |
| 4960 | /* * * DATA TABLES * * */ |
| 4961 | /**********************************************************************/ |
| 4962 | |
| 4963 | int mpl_tab_num_argscxx . . $ `external/glpk/glpmpl.h:1934:9`!(TABDCAcxx . . $ TABDCA# *dca) |
| 4964 | { /* returns the number of arguments */ |
| 4965 | return dca->nacxx . . $ TABDCA#na.; |
| 4966 | } |
| 4967 | |
| 4968 | const char *mpl_tab_get_argcxx . . $ `external/glpk/glpmpl.h:1937:9`!(TABDCAcxx . . $ TABDCA# *dca, int k) |
| 4969 | { /* returns pointer to k-th argument */ |
| 4970 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(1 <= k && k <= dca->na); |
| 4971 | return dca->argcxx . . $ TABDCA#arg.[k]; |
| 4972 | } |
| 4973 | |
| 4974 | int mpl_tab_num_fldscxx . . $ `external/glpk/glpmpl.h:1940:9`!(TABDCAcxx . . $ TABDCA# *dca) |
| 4975 | { /* returns the number of fields */ |
| 4976 | return dca->nfcxx . . $ TABDCA#nf.; |
| 4977 | } |
| 4978 | |
| 4979 | const char *mpl_tab_get_namecxx . . $ `external/glpk/glpmpl.h:1943:9`!(TABDCAcxx . . $ TABDCA# *dca, int k) |
| 4980 | { /* returns pointer to name of k-th field */ |
| 4981 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(1 <= k && k <= dca->nf); |
| 4982 | return dca->namecxx . . $ TABDCA#name.[k]; |
| 4983 | } |
| 4984 | |
| 4985 | int mpl_tab_get_typecxx . . $ `external/glpk/glpmpl.h:1946:9`!(TABDCAcxx . . $ TABDCA# *dca, int k) |
| 4986 | { /* returns type of k-th field */ |
| 4987 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(1 <= k && k <= dca->nf); |
| 4988 | return dca->typecxx . . $ TABDCA#type.[k]; |
| 4989 | } |
| 4990 | |
| 4991 | double mpl_tab_get_numcxx . . $ `external/glpk/glpmpl.h:1949:9`!(TABDCAcxx . . $ TABDCA# *dca, int k) |
| 4992 | { /* returns numeric value of k-th field */ |
| 4993 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(1 <= k && k <= dca->nf); |
| 4994 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(dca->type[k] == 'N'); |
| 4995 | return dca->numcxx . . $ TABDCA#num.[k]; |
| 4996 | } |
| 4997 | |
| 4998 | const char *mpl_tab_get_strcxx . . $ `external/glpk/glpmpl.h:1952:9`!(TABDCAcxx . . $ TABDCA# *dca, int k) |
| 4999 | { /* returns pointer to string value of k-th field */ |
| 5000 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(1 <= k && k <= dca->nf); |
| 5001 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(dca->type[k] == 'S'); |
| 5002 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(dca->str[k] != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 5003 | return dca->strcxx . . $ TABDCA#str.[k]; |
| 5004 | } |
| 5005 | |
| 5006 | void mpl_tab_set_numcxx . . $ `external/glpk/glpmpl.h:1955:9`!(TABDCAcxx . . $ TABDCA# *dca, int k, double num) |
| 5007 | { /* assign numeric value to k-th field */ |
| 5008 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(1 <= k && k <= dca->nf); |
| 5009 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(dca->type[k] == '?'); |
| 5010 | dca->typecxx . . $ TABDCA#type.[k] = 'N'; |
| 5011 | dca->numcxx . . $ TABDCA#num.[k] = num; |
| 5012 | return; |
| 5013 | } |
| 5014 | |
| 5015 | void mpl_tab_set_strcxx . . $ `external/glpk/glpmpl.h:1958:9`!(TABDCAcxx . . $ TABDCA# *dca, int k, const char *str) |
| 5016 | { /* assign string value to k-th field */ |
| 5017 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(1 <= k && k <= dca->nf); |
| 5018 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(dca->type[k] == '?'); |
| 5019 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(strlen(str) <= MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!); |
| 5020 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(dca->str[k] != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 5021 | dca->typecxx . . $ TABDCA#type.[k] = 'S'; |
| 5022 | strcpycxx . . $ strcpy(b7b3a83273496486).(dca->strcxx . . $ TABDCA#str.[k], str); |
| 5023 | return; |
| 5024 | } |
| 5025 | |
| 5026 | static int write_funccxx . . $ write_func(3bbfabe35f227878).(MPLcxx . . $ MPL# *mpl, void *info) |
| 5027 | { /* this is auxiliary routine to work within domain scope */ |
| 5028 | TABLEcxx . . $ TABLE# *tab = info; |
| 5029 | TABDCAcxx . . $ TABDCA# *dca = mpl->dcacxx . . $ MPL#dca.; |
| 5030 | TABOUTcxx . . $ TABOUT# *out; |
| 5031 | SYMBOLcxx . . $ SYMBOL# *sym; |
| 5032 | int k; |
| 5033 | char buf[MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!+1]; |
| 5034 | /* evaluate field values */ |
| 5035 | k = 0; |
| 5036 | for (out = tab->ucxx . . $ TABLE#u..outcxx . . $ TABLE#$anonymous_type_0#out..listcxx . . $ TABLE#$anonymous_type_0#$anonymous_type_2#list.; out != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; out = out->nextcxx . . $ TABOUT#next.) |
| 5037 | { k++; |
| 5038 | switch (out->codecxx . . $ TABOUT#code.->typecxx . . $ CODE#type.) |
| 5039 | { case A_NUMERICcxx . . $ `external/glpk/glpmpl.h:96:9`!: |
| 5040 | dca->typecxx . . $ TABDCA#type.[k] = 'N'; |
| 5041 | dca->numcxx . . $ TABDCA#num.[k] = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, out->codecxx . . $ TABOUT#code.); |
| 5042 | dca->strcxx . . $ TABDCA#str.[k][0] = '\0'; |
| 5043 | break; |
| 5044 | case A_SYMBOLICcxx . . $ `external/glpk/glpmpl.h:102:9`!: |
| 5045 | sym = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, out->codecxx . . $ TABOUT#code.); |
| 5046 | if (sym->strcxx . . $ SYMBOL#str. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5047 | { dca->typecxx . . $ TABDCA#type.[k] = 'N'; |
| 5048 | dca->numcxx . . $ TABDCA#num.[k] = sym->numcxx . . $ SYMBOL#num.; |
| 5049 | dca->strcxx . . $ TABDCA#str.[k][0] = '\0'; |
| 5050 | } |
| 5051 | else |
| 5052 | { dca->typecxx . . $ TABDCA#type.[k] = 'S'; |
| 5053 | dca->numcxx . . $ TABDCA#num.[k] = 0.0; |
| 5054 | fetch_stringcxx . . $ `external/glpk/glpmpl.h:911:9`!(mpl, sym->strcxx . . $ SYMBOL#str., buf); |
| 5055 | strcpycxx . . $ strcpy(b7b3a83273496486).(dca->strcxx . . $ TABDCA#str.[k], buf); |
| 5056 | } |
| 5057 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym); |
| 5058 | break; |
| 5059 | default: |
| 5060 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(out != out); |
| 5061 | } |
| 5062 | } |
| 5063 | /* write record to output table */ |
| 5064 | mpl_tab_drv_writecxx . . $ `external/glpk/glpmpl.h:1967:9`!(mpl); |
| 5065 | return 0; |
| 5066 | } |
| 5067 | |
| 5068 | void execute_tablecxx . . $ `external/glpk/glpmpl.h:2355:9`!(MPLcxx . . $ MPL# *mpl, TABLEcxx . . $ TABLE# *tab) |
| 5069 | { /* execute table statement */ |
| 5070 | TABARGcxx . . $ TABARG# *arg; |
| 5071 | TABFLDcxx . . $ TABFLD# *fld; |
| 5072 | TABINcxx . . $ TABIN# *in; |
| 5073 | TABOUTcxx . . $ TABOUT# *out; |
| 5074 | TABDCAcxx . . $ TABDCA# *dca; |
| 5075 | SETcxx . . $ SET# *set; |
| 5076 | int k; |
| 5077 | char buf[MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!+1]; |
| 5078 | /* allocate table driver communication area */ |
| 5079 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(mpl->dca == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 5080 | mpl->dcacxx . . $ MPL#dca. = dca = xmalloccxx . . $ `external/glpk/glpenv.h:167:9`!(sizeof(TABDCAcxx . . $ TABDCA#)); |
| 5081 | dca->idcxx . . $ TABDCA#id. = 0; |
| 5082 | dca->linkcxx . . $ TABDCA#link. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 5083 | dca->nacxx . . $ TABDCA#na. = 0; |
| 5084 | dca->argcxx . . $ TABDCA#arg. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 5085 | dca->nfcxx . . $ TABDCA#nf. = 0; |
| 5086 | dca->namecxx . . $ TABDCA#name. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 5087 | dca->typecxx . . $ TABDCA#type. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 5088 | dca->numcxx . . $ TABDCA#num. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 5089 | dca->strcxx . . $ TABDCA#str. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 5090 | /* allocate arguments */ |
| 5091 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(dca->na == 0); |
| 5092 | for (arg = tab->argcxx . . $ TABLE#arg.; arg != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; arg = arg->nextcxx . . $ TABARG#next.) |
| 5093 | dca->nacxx . . $ TABDCA#na.++; |
| 5094 | dca->argcxx . . $ TABDCA#arg. = xcalloccxx . . $ `external/glpk/glpenv.h:171:9`!(1+dca->nacxx . . $ TABDCA#na., sizeof(char *)); |
| 5095 | #if 1 /* 28/IX-2008 */ |
| 5096 | for (k = 1; k <= dca->nacxx . . $ TABDCA#na.; k++) dca->argcxx . . $ TABDCA#arg.[k] = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 5097 | #endif |
| 5098 | /* evaluate argument values */ |
| 5099 | k = 0; |
| 5100 | for (arg = tab->argcxx . . $ TABLE#arg.; arg != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; arg = arg->nextcxx . . $ TABARG#next.) |
| 5101 | { SYMBOLcxx . . $ SYMBOL# *sym; |
| 5102 | k++; |
| 5103 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(arg->code->type == A_SYMBOLICcxx . . $ `external/glpk/glpmpl.h:102:9`!); |
| 5104 | sym = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, arg->codecxx . . $ TABARG#code.); |
| 5105 | if (sym->strcxx . . $ SYMBOL#str. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5106 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(buf, "%.*g", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, sym->numcxx . . $ SYMBOL#num.); |
| 5107 | else |
| 5108 | fetch_stringcxx . . $ `external/glpk/glpmpl.h:911:9`!(mpl, sym->strcxx . . $ SYMBOL#str., buf); |
| 5109 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym); |
| 5110 | dca->argcxx . . $ TABDCA#arg.[k] = xmalloccxx . . $ `external/glpk/glpenv.h:167:9`!(strlencxx . . $ strlen(751346f8406fd082).(buf)+1); |
| 5111 | strcpycxx . . $ strcpy(b7b3a83273496486).(dca->argcxx . . $ TABDCA#arg.[k], buf); |
| 5112 | } |
| 5113 | /* perform table input/output */ |
| 5114 | switch (tab->typecxx . . $ TABLE#type.) |
| 5115 | { case A_INPUTcxx . . $ `external/glpk/glpmpl.h:90:9`!: goto read_table; |
| 5116 | case A_OUTPUTcxx . . $ `external/glpk/glpmpl.h:97:9`!: goto write_table; |
| 5117 | default: xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(tab != tab); |
| 5118 | } |
| 5119 | read_table: |
| 5120 | /* read data from input table */ |
| 5121 | /* add the only member to the control set and assign it empty |
| 5122 | elemental set */ |
| 5123 | set = tab->ucxx . . $ TABLE#u..incxx . . $ TABLE#$anonymous_type_0#in..setcxx . . $ TABLE#$anonymous_type_0#$anonymous_type_1#set.; |
| 5124 | if (set != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5125 | { if (set->datacxx . . $ SET#data.) |
| 5126 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%s already provided with data", set->namecxx . . $ SET#name.); |
| 5127 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(set->array->head == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 5128 | add_membercxx . . $ `external/glpk/glpmpl.h:1384:9`!(mpl, set->arraycxx . . $ SET#array., NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!)->valuecxx . . $ MEMBER#value..setcxx . . $ VALUE#set. = |
| 5129 | create_elemsetcxx . . $ `external/glpk/glpmpl.h:1070:9`!(mpl, set->dimencxx . . $ SET#dimen.); |
| 5130 | set->datacxx . . $ SET#data. = 1; |
| 5131 | } |
| 5132 | /* check parameters specified in the input list */ |
| 5133 | for (in = tab->ucxx . . $ TABLE#u..incxx . . $ TABLE#$anonymous_type_0#in..listcxx . . $ TABLE#$anonymous_type_0#$anonymous_type_1#list.; in != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; in = in->nextcxx . . $ TABIN#next.) |
| 5134 | { if (in->parcxx . . $ TABIN#par.->datacxx . . $ PARAMETER#data.) |
| 5135 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%s already provided with data", in->parcxx . . $ TABIN#par.->namecxx . . $ PARAMETER#name.); |
| 5136 | in->parcxx . . $ TABIN#par.->datacxx . . $ PARAMETER#data. = 1; |
| 5137 | } |
| 5138 | /* allocate and initialize fields */ |
| 5139 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(dca->nf == 0); |
| 5140 | for (fld = tab->ucxx . . $ TABLE#u..incxx . . $ TABLE#$anonymous_type_0#in..fldcxx . . $ TABLE#$anonymous_type_0#$anonymous_type_1#fld.; fld != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; fld = fld->nextcxx . . $ TABFLD#next.) |
| 5141 | dca->nfcxx . . $ TABDCA#nf.++; |
| 5142 | for (in = tab->ucxx . . $ TABLE#u..incxx . . $ TABLE#$anonymous_type_0#in..listcxx . . $ TABLE#$anonymous_type_0#$anonymous_type_1#list.; in != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; in = in->nextcxx . . $ TABIN#next.) |
| 5143 | dca->nfcxx . . $ TABDCA#nf.++; |
| 5144 | dca->namecxx . . $ TABDCA#name. = xcalloccxx . . $ `external/glpk/glpenv.h:171:9`!(1+dca->nfcxx . . $ TABDCA#nf., sizeof(char *)); |
| 5145 | dca->typecxx . . $ TABDCA#type. = xcalloccxx . . $ `external/glpk/glpenv.h:171:9`!(1+dca->nfcxx . . $ TABDCA#nf., sizeof(int)); |
| 5146 | dca->numcxx . . $ TABDCA#num. = xcalloccxx . . $ `external/glpk/glpenv.h:171:9`!(1+dca->nfcxx . . $ TABDCA#nf., sizeof(double)); |
| 5147 | dca->strcxx . . $ TABDCA#str. = xcalloccxx . . $ `external/glpk/glpenv.h:171:9`!(1+dca->nfcxx . . $ TABDCA#nf., sizeof(char *)); |
| 5148 | k = 0; |
| 5149 | for (fld = tab->ucxx . . $ TABLE#u..incxx . . $ TABLE#$anonymous_type_0#in..fldcxx . . $ TABLE#$anonymous_type_0#$anonymous_type_1#fld.; fld != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; fld = fld->nextcxx . . $ TABFLD#next.) |
| 5150 | { k++; |
| 5151 | dca->namecxx . . $ TABDCA#name.[k] = fld->namecxx . . $ TABFLD#name.; |
| 5152 | dca->typecxx . . $ TABDCA#type.[k] = '?'; |
| 5153 | dca->numcxx . . $ TABDCA#num.[k] = 0.0; |
| 5154 | dca->strcxx . . $ TABDCA#str.[k] = xmalloccxx . . $ `external/glpk/glpenv.h:167:9`!(MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!+1); |
| 5155 | dca->strcxx . . $ TABDCA#str.[k][0] = '\0'; |
| 5156 | } |
| 5157 | for (in = tab->ucxx . . $ TABLE#u..incxx . . $ TABLE#$anonymous_type_0#in..listcxx . . $ TABLE#$anonymous_type_0#$anonymous_type_1#list.; in != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; in = in->nextcxx . . $ TABIN#next.) |
| 5158 | { k++; |
| 5159 | dca->namecxx . . $ TABDCA#name.[k] = in->namecxx . . $ TABIN#name.; |
| 5160 | dca->typecxx . . $ TABDCA#type.[k] = '?'; |
| 5161 | dca->numcxx . . $ TABDCA#num.[k] = 0.0; |
| 5162 | dca->strcxx . . $ TABDCA#str.[k] = xmalloccxx . . $ `external/glpk/glpenv.h:167:9`!(MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!+1); |
| 5163 | dca->strcxx . . $ TABDCA#str.[k][0] = '\0'; |
| 5164 | } |
| 5165 | /* open input table */ |
| 5166 | mpl_tab_drv_opencxx . . $ `external/glpk/glpmpl.h:1961:9`!(mpl, 'R'); |
| 5167 | /* read and process records */ |
| 5168 | for (;;) |
| 5169 | { TUPLEcxx . . $ TUPLE# *tup; |
| 5170 | /* reset field types */ |
| 5171 | for (k = 1; k <= dca->nfcxx . . $ TABDCA#nf.; k++) |
| 5172 | dca->typecxx . . $ TABDCA#type.[k] = '?'; |
| 5173 | /* read next record */ |
| 5174 | if (mpl_tab_drv_readcxx . . $ `external/glpk/glpmpl.h:1964:9`!(mpl)) break; |
| 5175 | /* all fields must be set by the driver */ |
| 5176 | for (k = 1; k <= dca->nfcxx . . $ TABDCA#nf.; k++) |
| 5177 | { if (dca->typecxx . . $ TABDCA#type.[k] == '?') |
| 5178 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "field %s missing in input table", |
| 5179 | dca->namecxx . . $ TABDCA#name.[k]); |
| 5180 | } |
| 5181 | /* construct n-tuple */ |
| 5182 | tup = create_tuplecxx . . $ `external/glpk/glpmpl.h:999:9`!(mpl); |
| 5183 | k = 0; |
| 5184 | for (fld = tab->ucxx . . $ TABLE#u..incxx . . $ TABLE#$anonymous_type_0#in..fldcxx . . $ TABLE#$anonymous_type_0#$anonymous_type_1#fld.; fld != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; fld = fld->nextcxx . . $ TABFLD#next.) |
| 5185 | { k++; |
| 5186 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(k <= dca->nf); |
| 5187 | switch (dca->typecxx . . $ TABDCA#type.[k]) |
| 5188 | { case 'N': |
| 5189 | tup = expand_tuplecxx . . $ `external/glpk/glpmpl.h:1003:9`!(mpl, tup, create_symbol_numcxx . . $ `external/glpk/glpmpl.h:938:9`!(mpl, |
| 5190 | dca->numcxx . . $ TABDCA#num.[k])); |
| 5191 | break; |
| 5192 | case 'S': |
| 5193 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(strlen(dca->str[k]) <= MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!); |
| 5194 | tup = expand_tuplecxx . . $ `external/glpk/glpmpl.h:1003:9`!(mpl, tup, create_symbol_strcxx . . $ `external/glpk/glpmpl.h:942:9`!(mpl, |
| 5195 | create_stringcxx . . $ `external/glpk/glpmpl.h:889:9`!(mpl, dca->strcxx . . $ TABDCA#str.[k]))); |
| 5196 | break; |
| 5197 | default: |
| 5198 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(dca != dca); |
| 5199 | } |
| 5200 | } |
| 5201 | /* add n-tuple just read to the control set */ |
| 5202 | if (tab->ucxx . . $ TABLE#u..incxx . . $ TABLE#$anonymous_type_0#in..setcxx . . $ TABLE#$anonymous_type_0#$anonymous_type_1#set. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5203 | check_then_addcxx . . $ `external/glpk/glpmpl.h:1090:9`!(mpl, tab->ucxx . . $ TABLE#u..incxx . . $ TABLE#$anonymous_type_0#in..setcxx . . $ TABLE#$anonymous_type_0#$anonymous_type_1#set.->arraycxx . . $ SET#array.->headcxx . . $ ARRAY#head.->valuecxx . . $ MEMBER#value..setcxx . . $ VALUE#set., |
| 5204 | copy_tuplecxx . . $ `external/glpk/glpmpl.h:1018:9`!(mpl, tup)); |
| 5205 | /* assign values to the parameters in the input list */ |
| 5206 | for (in = tab->ucxx . . $ TABLE#u..incxx . . $ TABLE#$anonymous_type_0#in..listcxx . . $ TABLE#$anonymous_type_0#$anonymous_type_1#list.; in != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; in = in->nextcxx . . $ TABIN#next.) |
| 5207 | { MEMBERcxx . . $ MEMBER# *memb; |
| 5208 | k++; |
| 5209 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(k <= dca->nf); |
| 5210 | /* there must be no member with the same n-tuple */ |
| 5211 | if (find_membercxx . . $ `external/glpk/glpmpl.h:1376:9`!(mpl, in->parcxx . . $ TABIN#par.->arraycxx . . $ PARAMETER#array., tup) != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5212 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%s%s already defined", in->parcxx . . $ TABIN#par.->namecxx . . $ PARAMETER#name., |
| 5213 | format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', tup)); |
| 5214 | /* create new parameter member with given n-tuple */ |
| 5215 | memb = add_membercxx . . $ `external/glpk/glpmpl.h:1384:9`!(mpl, in->parcxx . . $ TABIN#par.->arraycxx . . $ PARAMETER#array., copy_tuplecxx . . $ `external/glpk/glpmpl.h:1018:9`!(mpl, tup)) |
| 5216 | ; |
| 5217 | /* assign value to the parameter member */ |
| 5218 | switch (in->parcxx . . $ TABIN#par.->typecxx . . $ PARAMETER#type.) |
| 5219 | { case A_NUMERICcxx . . $ `external/glpk/glpmpl.h:96:9`!: |
| 5220 | case A_INTEGERcxx . . $ `external/glpk/glpmpl.h:91:9`!: |
| 5221 | case A_BINARYcxx . . $ `external/glpk/glpmpl.h:79:9`!: |
| 5222 | if (dca->typecxx . . $ TABDCA#type.[k] != 'N') |
| 5223 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "%s requires numeric data", |
| 5224 | in->parcxx . . $ TABIN#par.->namecxx . . $ PARAMETER#name.); |
| 5225 | memb->valuecxx . . $ MEMBER#value..numcxx . . $ VALUE#num. = dca->numcxx . . $ TABDCA#num.[k]; |
| 5226 | break; |
| 5227 | case A_SYMBOLICcxx . . $ `external/glpk/glpmpl.h:102:9`!: |
| 5228 | switch (dca->typecxx . . $ TABDCA#type.[k]) |
| 5229 | { case 'N': |
| 5230 | memb->valuecxx . . $ MEMBER#value..symcxx . . $ VALUE#sym. = create_symbol_numcxx . . $ `external/glpk/glpmpl.h:938:9`!(mpl, |
| 5231 | dca->numcxx . . $ TABDCA#num.[k]); |
| 5232 | break; |
| 5233 | case 'S': |
| 5234 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(strlen(dca->str[k]) <= MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!); |
| 5235 | memb->valuecxx . . $ MEMBER#value..symcxx . . $ VALUE#sym. = create_symbol_strcxx . . $ `external/glpk/glpmpl.h:942:9`!(mpl, |
| 5236 | create_stringcxx . . $ `external/glpk/glpmpl.h:889:9`!(mpl,dca->strcxx . . $ TABDCA#str.[k])); |
| 5237 | break; |
| 5238 | default: |
| 5239 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(dca != dca); |
| 5240 | } |
| 5241 | break; |
| 5242 | default: |
| 5243 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(in != in); |
| 5244 | } |
| 5245 | } |
| 5246 | /* n-tuple is no more needed */ |
| 5247 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, tup); |
| 5248 | } |
| 5249 | /* close input table */ |
| 5250 | mpl_tab_drv_closecxx . . $ `external/glpk/glpmpl.h:1970:9`!(mpl); |
| 5251 | goto done; |
| 5252 | write_table: |
| 5253 | /* write data to output table */ |
| 5254 | /* allocate and initialize fields */ |
| 5255 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(dca->nf == 0); |
| 5256 | for (out = tab->ucxx . . $ TABLE#u..outcxx . . $ TABLE#$anonymous_type_0#out..listcxx . . $ TABLE#$anonymous_type_0#$anonymous_type_2#list.; out != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; out = out->nextcxx . . $ TABOUT#next.) |
| 5257 | dca->nfcxx . . $ TABDCA#nf.++; |
| 5258 | dca->namecxx . . $ TABDCA#name. = xcalloccxx . . $ `external/glpk/glpenv.h:171:9`!(1+dca->nfcxx . . $ TABDCA#nf., sizeof(char *)); |
| 5259 | dca->typecxx . . $ TABDCA#type. = xcalloccxx . . $ `external/glpk/glpenv.h:171:9`!(1+dca->nfcxx . . $ TABDCA#nf., sizeof(int)); |
| 5260 | dca->numcxx . . $ TABDCA#num. = xcalloccxx . . $ `external/glpk/glpenv.h:171:9`!(1+dca->nfcxx . . $ TABDCA#nf., sizeof(double)); |
| 5261 | dca->strcxx . . $ TABDCA#str. = xcalloccxx . . $ `external/glpk/glpenv.h:171:9`!(1+dca->nfcxx . . $ TABDCA#nf., sizeof(char *)); |
| 5262 | k = 0; |
| 5263 | for (out = tab->ucxx . . $ TABLE#u..outcxx . . $ TABLE#$anonymous_type_0#out..listcxx . . $ TABLE#$anonymous_type_0#$anonymous_type_2#list.; out != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; out = out->nextcxx . . $ TABOUT#next.) |
| 5264 | { k++; |
| 5265 | dca->namecxx . . $ TABDCA#name.[k] = out->namecxx . . $ TABOUT#name.; |
| 5266 | dca->typecxx . . $ TABDCA#type.[k] = '?'; |
| 5267 | dca->numcxx . . $ TABDCA#num.[k] = 0.0; |
| 5268 | dca->strcxx . . $ TABDCA#str.[k] = xmalloccxx . . $ `external/glpk/glpenv.h:167:9`!(MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!+1); |
| 5269 | dca->strcxx . . $ TABDCA#str.[k][0] = '\0'; |
| 5270 | } |
| 5271 | /* open output table */ |
| 5272 | mpl_tab_drv_opencxx . . $ `external/glpk/glpmpl.h:1961:9`!(mpl, 'W'); |
| 5273 | /* evaluate fields and write records */ |
| 5274 | loop_within_domaincxx . . $ `external/glpk/glpmpl.h:1493:9`!(mpl, tab->ucxx . . $ TABLE#u..outcxx . . $ TABLE#$anonymous_type_0#out..domaincxx . . $ TABLE#$anonymous_type_0#$anonymous_type_2#domain., tab, write_funccxx . . $ write_func(3bbfabe35f227878).); |
| 5275 | /* close output table */ |
| 5276 | mpl_tab_drv_closecxx . . $ `external/glpk/glpmpl.h:1970:9`!(mpl); |
| 5277 | done: /* free table driver communication area */ |
| 5278 | free_dcacxx . . $ `external/glpk/glpmpl.h:2359:9`!(mpl); |
| 5279 | return; |
| 5280 | } |
| 5281 | |
| 5282 | void free_dcacxx . . $ `external/glpk/glpmpl.h:2359:9`!(MPLcxx . . $ MPL# *mpl) |
| 5283 | { /* free table driver communucation area */ |
| 5284 | TABDCAcxx . . $ TABDCA# *dca = mpl->dcacxx . . $ MPL#dca.; |
| 5285 | int k; |
| 5286 | if (dca != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5287 | { if (dca->linkcxx . . $ TABDCA#link. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5288 | mpl_tab_drv_closecxx . . $ `external/glpk/glpmpl.h:1970:9`!(mpl); |
| 5289 | if (dca->argcxx . . $ TABDCA#arg. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5290 | { for (k = 1; k <= dca->nacxx . . $ TABDCA#na.; k++) |
| 5291 | #if 1 /* 28/IX-2008 */ |
| 5292 | if (dca->argcxx . . $ TABDCA#arg.[k] != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5293 | #endif |
| 5294 | xfreecxx . . $ `external/glpk/glpenv.h:175:9`!(dca->argcxx . . $ TABDCA#arg.[k]); |
| 5295 | xfreecxx . . $ `external/glpk/glpenv.h:175:9`!(dca->argcxx . . $ TABDCA#arg.); |
| 5296 | } |
| 5297 | if (dca->namecxx . . $ TABDCA#name. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) xfreecxx . . $ `external/glpk/glpenv.h:175:9`!(dca->namecxx . . $ TABDCA#name.); |
| 5298 | if (dca->typecxx . . $ TABDCA#type. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) xfreecxx . . $ `external/glpk/glpenv.h:175:9`!(dca->typecxx . . $ TABDCA#type.); |
| 5299 | if (dca->numcxx . . $ TABDCA#num. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) xfreecxx . . $ `external/glpk/glpenv.h:175:9`!(dca->numcxx . . $ TABDCA#num.); |
| 5300 | if (dca->strcxx . . $ TABDCA#str. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5301 | { for (k = 1; k <= dca->nfcxx . . $ TABDCA#nf.; k++) |
| 5302 | xfreecxx . . $ `external/glpk/glpenv.h:175:9`!(dca->strcxx . . $ TABDCA#str.[k]); |
| 5303 | xfreecxx . . $ `external/glpk/glpenv.h:175:9`!(dca->strcxx . . $ TABDCA#str.); |
| 5304 | } |
| 5305 | xfreecxx . . $ `external/glpk/glpenv.h:175:9`!(dca), mpl->dcacxx . . $ MPL#dca. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 5306 | } |
| 5307 | return; |
| 5308 | } |
| 5309 | |
| 5310 | void clean_tablecxx . . $ `external/glpk/glpmpl.h:2363:9`!(MPLcxx . . $ MPL# *mpl, TABLEcxx . . $ TABLE# *tab) |
| 5311 | { /* clean table statement */ |
| 5312 | TABARGcxx . . $ TABARG# *arg; |
| 5313 | TABOUTcxx . . $ TABOUT# *out; |
| 5314 | /* clean string list */ |
| 5315 | for (arg = tab->argcxx . . $ TABLE#arg.; arg != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; arg = arg->nextcxx . . $ TABARG#next.) |
| 5316 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, arg->codecxx . . $ TABARG#code.); |
| 5317 | switch (tab->typecxx . . $ TABLE#type.) |
| 5318 | { case A_INPUTcxx . . $ `external/glpk/glpmpl.h:90:9`!: |
| 5319 | break; |
| 5320 | case A_OUTPUTcxx . . $ `external/glpk/glpmpl.h:97:9`!: |
| 5321 | /* clean subscript domain */ |
| 5322 | clean_domaincxx . . $ `external/glpk/glpmpl.h:1516:9`!(mpl, tab->ucxx . . $ TABLE#u..outcxx . . $ TABLE#$anonymous_type_0#out..domaincxx . . $ TABLE#$anonymous_type_0#$anonymous_type_2#domain.); |
| 5323 | /* clean output list */ |
| 5324 | for (out = tab->ucxx . . $ TABLE#u..outcxx . . $ TABLE#$anonymous_type_0#out..listcxx . . $ TABLE#$anonymous_type_0#$anonymous_type_2#list.; out != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; out = out->nextcxx . . $ TABOUT#next.) |
| 5325 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, out->codecxx . . $ TABOUT#code.); |
| 5326 | break; |
| 5327 | default: |
| 5328 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(tab != tab); |
| 5329 | } |
| 5330 | return; |
| 5331 | } |
| 5332 | #endif |
| 5333 | |
| 5334 | /**********************************************************************/ |
| 5335 | /* * * MODEL STATEMENTS * * */ |
| 5336 | /**********************************************************************/ |
| 5337 | |
| 5338 | /*---------------------------------------------------------------------- |
| 5339 | -- execute_check - execute check statement. |
| 5340 | -- |
| 5341 | -- This routine executes specified check statement. */ |
| 5342 | |
| 5343 | static int check_funccxx . . $ check_func(3bbfabe35f227878).(MPLcxx . . $ MPL# *mpl, void *info) |
| 5344 | { /* this is auxiliary routine to work within domain scope */ |
| 5345 | CHECKcxx . . $ CHECK# *chk = (CHECKcxx . . $ CHECK# *)info; |
| 5346 | if (!eval_logicalcxx . . $ `external/glpk/glpmpl.h:2218:9`!(mpl, chk->codecxx . . $ CHECK#code.)) |
| 5347 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "check%s failed", format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', |
| 5348 | get_domain_tuplecxx . . $ `external/glpk/glpmpl.h:1509:9`!(mpl, chk->domaincxx . . $ CHECK#domain.))); |
| 5349 | return 0; |
| 5350 | } |
| 5351 | |
| 5352 | void execute_checkcxx . . $ `external/glpk/glpmpl.h:2367:9`!(MPLcxx . . $ MPL# *mpl, CHECKcxx . . $ CHECK# *chk) |
| 5353 | { loop_within_domaincxx . . $ `external/glpk/glpmpl.h:1493:9`!(mpl, chk->domaincxx . . $ CHECK#domain., chk, check_funccxx . . $ check_func(3bbfabe35f227878).); |
| 5354 | return; |
| 5355 | } |
| 5356 | |
| 5357 | /*---------------------------------------------------------------------- |
| 5358 | -- clean_check - clean check statement. |
| 5359 | -- |
| 5360 | -- This routine cleans specified check statement that assumes deleting |
| 5361 | -- all stuff dynamically allocated on generating/postsolving phase. */ |
| 5362 | |
| 5363 | void clean_checkcxx . . $ `external/glpk/glpmpl.h:2371:9`!(MPLcxx . . $ MPL# *mpl, CHECKcxx . . $ CHECK# *chk) |
| 5364 | { /* clean subscript domain */ |
| 5365 | clean_domaincxx . . $ `external/glpk/glpmpl.h:1516:9`!(mpl, chk->domaincxx . . $ CHECK#domain.); |
| 5366 | /* clean pseudo-code for computing predicate */ |
| 5367 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, chk->codecxx . . $ CHECK#code.); |
| 5368 | return; |
| 5369 | } |
| 5370 | |
| 5371 | /*---------------------------------------------------------------------- |
| 5372 | -- execute_display - execute display statement. |
| 5373 | -- |
| 5374 | -- This routine executes specified display statement. */ |
| 5375 | |
| 5376 | static void display_setcxx . . $ display_set(836f49a9bae7d3a1).(MPLcxx . . $ MPL# *mpl, SETcxx . . $ SET# *set, MEMBERcxx . . $ MEMBER# *memb) |
| 5377 | { /* display member of model set */ |
| 5378 | ELEMSETcxx . . $ ELEMSET# *s = memb->valuecxx . . $ MEMBER#value..setcxx . . $ VALUE#set.; |
| 5379 | MEMBERcxx . . $ MEMBER# *m; |
| 5380 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%s%s%s\n", set->namecxx . . $ SET#name., |
| 5381 | format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', memb->tuplecxx . . $ MEMBER#tuple.), |
| 5382 | s->headcxx . . $ ARRAY#head. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! ? " is empty" : ":"); |
| 5383 | for (m = s->headcxx . . $ ARRAY#head.; m != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; m = m->nextcxx . . $ MEMBER#next.) |
| 5384 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, " %s\n", format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '(', m->tuplecxx . . $ MEMBER#tuple.)); |
| 5385 | return; |
| 5386 | } |
| 5387 | |
| 5388 | static void display_parcxx . . $ display_par(ea025f2847950b93).(MPLcxx . . $ MPL# *mpl, PARAMETERcxx . . $ PARAMETER# *par, MEMBERcxx . . $ MEMBER# *memb) |
| 5389 | { /* display member of model parameter */ |
| 5390 | switch (par->typecxx . . $ PARAMETER#type.) |
| 5391 | { case A_NUMERICcxx . . $ `external/glpk/glpmpl.h:96:9`!: |
| 5392 | case A_INTEGERcxx . . $ `external/glpk/glpmpl.h:91:9`!: |
| 5393 | case A_BINARYcxx . . $ `external/glpk/glpmpl.h:79:9`!: |
| 5394 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%s%s = %.*g\n", par->namecxx . . $ PARAMETER#name., |
| 5395 | format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', memb->tuplecxx . . $ MEMBER#tuple.), |
| 5396 | DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, memb->valuecxx . . $ MEMBER#value..numcxx . . $ VALUE#num.); |
| 5397 | break; |
| 5398 | case A_SYMBOLICcxx . . $ `external/glpk/glpmpl.h:102:9`!: |
| 5399 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%s%s = %s\n", par->namecxx . . $ PARAMETER#name., |
| 5400 | format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', memb->tuplecxx . . $ MEMBER#tuple.), |
| 5401 | format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, memb->valuecxx . . $ MEMBER#value..symcxx . . $ VALUE#sym.)); |
| 5402 | break; |
| 5403 | default: |
| 5404 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(par != par); |
| 5405 | } |
| 5406 | return; |
| 5407 | } |
| 5408 | |
| 5409 | #if 1 /* 15/V-2010 */ |
| 5410 | static void display_varcxx . . $ display_var(91eb8f71ba25ee50).(MPLcxx . . $ MPL# *mpl, VARIABLEcxx . . $ VARIABLE# *var, MEMBERcxx . . $ MEMBER# *memb, |
| 5411 | int suff) |
| 5412 | { /* display member of model variable */ |
| 5413 | if (suff == DOT_NONEcxx . . $ `external/glpk/glpmpl.h:2018:9`! || suff == DOT_VALcxx . . $ `external/glpk/glpmpl.h:2022:9`!) |
| 5414 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%s%s.val = %.*g\n", var->namecxx . . $ VARIABLE#name., |
| 5415 | format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', memb->tuplecxx . . $ MEMBER#tuple.), DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, |
| 5416 | memb->valuecxx . . $ MEMBER#value..varcxx . . $ VALUE#var.->primcxx . . $ ELEMVAR#prim.); |
| 5417 | else if (suff == DOT_LBcxx . . $ `external/glpk/glpmpl.h:2019:9`!) |
| 5418 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%s%s.lb = %.*g\n", var->namecxx . . $ VARIABLE#name., |
| 5419 | format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', memb->tuplecxx . . $ MEMBER#tuple.), DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, |
| 5420 | memb->valuecxx . . $ MEMBER#value..varcxx . . $ VALUE#var.->varcxx . . $ ELEMVAR#var.->lbndcxx . . $ VARIABLE#lbnd. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! ? -DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`! : |
| 5421 | memb->valuecxx . . $ MEMBER#value..varcxx . . $ VALUE#var.->lbndcxx . . $ ELEMVAR#lbnd.); |
| 5422 | else if (suff == DOT_UBcxx . . $ `external/glpk/glpmpl.h:2020:9`!) |
| 5423 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%s%s.ub = %.*g\n", var->namecxx . . $ VARIABLE#name., |
| 5424 | format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', memb->tuplecxx . . $ MEMBER#tuple.), DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, |
| 5425 | memb->valuecxx . . $ MEMBER#value..varcxx . . $ VALUE#var.->varcxx . . $ ELEMVAR#var.->ubndcxx . . $ VARIABLE#ubnd. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! ? +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`! : |
| 5426 | memb->valuecxx . . $ MEMBER#value..varcxx . . $ VALUE#var.->ubndcxx . . $ ELEMVAR#ubnd.); |
| 5427 | else if (suff == DOT_STATUScxx . . $ `external/glpk/glpmpl.h:2021:9`!) |
| 5428 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%s%s.status = %d\n", var->namecxx . . $ VARIABLE#name., format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`! |
| 5429 | (mpl, '[', memb->tuplecxx . . $ MEMBER#tuple.), memb->valuecxx . . $ MEMBER#value..varcxx . . $ VALUE#var.->statcxx . . $ ELEMVAR#stat.); |
| 5430 | else if (suff == DOT_DUALcxx . . $ `external/glpk/glpmpl.h:2023:9`!) |
| 5431 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%s%s.dual = %.*g\n", var->namecxx . . $ VARIABLE#name., |
| 5432 | format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', memb->tuplecxx . . $ MEMBER#tuple.), DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, |
| 5433 | memb->valuecxx . . $ MEMBER#value..varcxx . . $ VALUE#var.->dualcxx . . $ ELEMVAR#dual.); |
| 5434 | else |
| 5435 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(suff != suff); |
| 5436 | return; |
| 5437 | } |
| 5438 | #endif |
| 5439 | |
| 5440 | #if 1 /* 15/V-2010 */ |
| 5441 | static void display_concxx . . $ display_con(de845c59ad00c7c1).(MPLcxx . . $ MPL# *mpl, CONSTRAINTcxx . . $ CONSTRAINT# *con, MEMBERcxx . . $ MEMBER# *memb, |
| 5442 | int suff) |
| 5443 | { /* display member of model constraint */ |
| 5444 | if (suff == DOT_NONEcxx . . $ `external/glpk/glpmpl.h:2018:9`! || suff == DOT_VALcxx . . $ `external/glpk/glpmpl.h:2022:9`!) |
| 5445 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%s%s.val = %.*g\n", con->namecxx . . $ CONSTRAINT#name., |
| 5446 | format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', memb->tuplecxx . . $ MEMBER#tuple.), DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, |
| 5447 | memb->valuecxx . . $ MEMBER#value..concxx . . $ VALUE#con.->primcxx . . $ ELEMCON#prim.); |
| 5448 | else if (suff == DOT_LBcxx . . $ `external/glpk/glpmpl.h:2019:9`!) |
| 5449 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%s%s.lb = %.*g\n", con->namecxx . . $ CONSTRAINT#name., |
| 5450 | format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', memb->tuplecxx . . $ MEMBER#tuple.), DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, |
| 5451 | memb->valuecxx . . $ MEMBER#value..concxx . . $ VALUE#con.->concxx . . $ ELEMCON#con.->lbndcxx . . $ CONSTRAINT#lbnd. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! ? -DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`! : |
| 5452 | memb->valuecxx . . $ MEMBER#value..concxx . . $ VALUE#con.->lbndcxx . . $ ELEMCON#lbnd.); |
| 5453 | else if (suff == DOT_UBcxx . . $ `external/glpk/glpmpl.h:2020:9`!) |
| 5454 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%s%s.ub = %.*g\n", con->namecxx . . $ CONSTRAINT#name., |
| 5455 | format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', memb->tuplecxx . . $ MEMBER#tuple.), DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, |
| 5456 | memb->valuecxx . . $ MEMBER#value..concxx . . $ VALUE#con.->concxx . . $ ELEMCON#con.->ubndcxx . . $ CONSTRAINT#ubnd. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! ? +DBL_MAXcxx . . $ `<external>/18143172452841944454/float.h:105:9`! : |
| 5457 | memb->valuecxx . . $ MEMBER#value..concxx . . $ VALUE#con.->ubndcxx . . $ ELEMCON#ubnd.); |
| 5458 | else if (suff == DOT_STATUScxx . . $ `external/glpk/glpmpl.h:2021:9`!) |
| 5459 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%s%s.status = %d\n", con->namecxx . . $ CONSTRAINT#name., format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`! |
| 5460 | (mpl, '[', memb->tuplecxx . . $ MEMBER#tuple.), memb->valuecxx . . $ MEMBER#value..concxx . . $ VALUE#con.->statcxx . . $ ELEMCON#stat.); |
| 5461 | else if (suff == DOT_DUALcxx . . $ `external/glpk/glpmpl.h:2023:9`!) |
| 5462 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%s%s.dual = %.*g\n", con->namecxx . . $ CONSTRAINT#name., |
| 5463 | format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', memb->tuplecxx . . $ MEMBER#tuple.), DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, |
| 5464 | memb->valuecxx . . $ MEMBER#value..concxx . . $ VALUE#con.->dualcxx . . $ ELEMCON#dual.); |
| 5465 | else |
| 5466 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(suff != suff); |
| 5467 | return; |
| 5468 | } |
| 5469 | #endif |
| 5470 | |
| 5471 | static void display_membcxx . . $ display_memb(2a6d50d687e6a219).(MPLcxx . . $ MPL# *mpl, CODEcxx . . $ CODE# *code) |
| 5472 | { /* display member specified by pseudo-code */ |
| 5473 | MEMBERcxx . . $ MEMBER# memb; |
| 5474 | ARG_LISTcxx . . $ ARG_LIST# *e; |
| 5475 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code->op == O_MEMNUMcxx . . $ `external/glpk/glpmpl.h:2078:9`! || code->op == O_MEMSYMcxx . . $ `external/glpk/glpmpl.h:2079:9`! |
| 5476 | || code->op == O_MEMSETcxx . . $ `external/glpk/glpmpl.h:2080:9`! || code->op == O_MEMVARcxx . . $ `external/glpk/glpmpl.h:2081:9`! |
| 5477 | || code->op == O_MEMCONcxx . . $ `external/glpk/glpmpl.h:2082:9`!); |
| 5478 | memb.tuplecxx . . $ MEMBER#tuple. = create_tuplecxx . . $ `external/glpk/glpmpl.h:999:9`!(mpl); |
| 5479 | for (e = code->argcxx . . $ CODE#arg..parcxx . . $ OPERANDS#par..listcxx . . $ OPERANDS#$anonymous_type_4#list.; e != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; e = e->nextcxx . . $ ARG_LIST#next.) |
| 5480 | memb.tuplecxx . . $ MEMBER#tuple. = expand_tuplecxx . . $ `external/glpk/glpmpl.h:1003:9`!(mpl, memb.tuplecxx . . $ MEMBER#tuple., eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, |
| 5481 | e->xcxx . . $ ARG_LIST#x.)); |
| 5482 | switch (code->opcxx . . $ CODE#op.) |
| 5483 | { case O_MEMNUMcxx . . $ `external/glpk/glpmpl.h:2078:9`!: |
| 5484 | memb.valuecxx . . $ MEMBER#value..numcxx . . $ VALUE#num. = eval_member_numcxx . . $ `external/glpk/glpmpl.h:1684:9`!(mpl, code->argcxx . . $ CODE#arg..parcxx . . $ OPERANDS#par..parcxx . . $ OPERANDS#$anonymous_type_4#par., |
| 5485 | memb.tuplecxx . . $ MEMBER#tuple.); |
| 5486 | display_parcxx . . $ display_par(ea025f2847950b93).(mpl, code->argcxx . . $ CODE#arg..parcxx . . $ OPERANDS#par..parcxx . . $ OPERANDS#$anonymous_type_4#par., &memb); |
| 5487 | break; |
| 5488 | case O_MEMSYMcxx . . $ `external/glpk/glpmpl.h:2079:9`!: |
| 5489 | memb.valuecxx . . $ MEMBER#value..symcxx . . $ VALUE#sym. = eval_member_symcxx . . $ `external/glpk/glpmpl.h:1709:9`!(mpl, code->argcxx . . $ CODE#arg..parcxx . . $ OPERANDS#par..parcxx . . $ OPERANDS#$anonymous_type_4#par., |
| 5490 | memb.tuplecxx . . $ MEMBER#tuple.); |
| 5491 | display_parcxx . . $ display_par(ea025f2847950b93).(mpl, code->argcxx . . $ CODE#arg..parcxx . . $ OPERANDS#par..parcxx . . $ OPERANDS#$anonymous_type_4#par., &memb); |
| 5492 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, memb.valuecxx . . $ MEMBER#value..symcxx . . $ VALUE#sym.); |
| 5493 | break; |
| 5494 | case O_MEMSETcxx . . $ `external/glpk/glpmpl.h:2080:9`!: |
| 5495 | memb.valuecxx . . $ MEMBER#value..setcxx . . $ VALUE#set. = eval_member_setcxx . . $ `external/glpk/glpmpl.h:1591:9`!(mpl, code->argcxx . . $ CODE#arg..setcxx . . $ OPERANDS#set..setcxx . . $ OPERANDS#$anonymous_type_5#set., |
| 5496 | memb.tuplecxx . . $ MEMBER#tuple.); |
| 5497 | display_setcxx . . $ display_set(836f49a9bae7d3a1).(mpl, code->argcxx . . $ CODE#arg..setcxx . . $ OPERANDS#set..setcxx . . $ OPERANDS#$anonymous_type_5#set., &memb); |
| 5498 | break; |
| 5499 | case O_MEMVARcxx . . $ `external/glpk/glpmpl.h:2081:9`!: |
| 5500 | memb.valuecxx . . $ MEMBER#value..varcxx . . $ VALUE#var. = eval_member_varcxx . . $ `external/glpk/glpmpl.h:1765:9`!(mpl, code->argcxx . . $ CODE#arg..varcxx . . $ OPERANDS#var..varcxx . . $ OPERANDS#$anonymous_type_6#var., |
| 5501 | memb.tuplecxx . . $ MEMBER#tuple.); |
| 5502 | display_varcxx . . $ display_var(91eb8f71ba25ee50). |
| 5503 | (mpl, code->argcxx . . $ CODE#arg..varcxx . . $ OPERANDS#var..varcxx . . $ OPERANDS#$anonymous_type_6#var., &memb, code->argcxx . . $ CODE#arg..varcxx . . $ OPERANDS#var..suffcxx . . $ OPERANDS#$anonymous_type_6#suff.); |
| 5504 | break; |
| 5505 | case O_MEMCONcxx . . $ `external/glpk/glpmpl.h:2082:9`!: |
| 5506 | memb.valuecxx . . $ MEMBER#value..concxx . . $ VALUE#con. = eval_member_concxx . . $ `external/glpk/glpmpl.h:1823:9`!(mpl, code->argcxx . . $ CODE#arg..concxx . . $ OPERANDS#con..concxx . . $ OPERANDS#$anonymous_type_7#con., |
| 5507 | memb.tuplecxx . . $ MEMBER#tuple.); |
| 5508 | display_concxx . . $ display_con(de845c59ad00c7c1). |
| 5509 | (mpl, code->argcxx . . $ CODE#arg..concxx . . $ OPERANDS#con..concxx . . $ OPERANDS#$anonymous_type_7#con., &memb, code->argcxx . . $ CODE#arg..concxx . . $ OPERANDS#con..suffcxx . . $ OPERANDS#$anonymous_type_7#suff.); |
| 5510 | break; |
| 5511 | default: |
| 5512 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code != code); |
| 5513 | } |
| 5514 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, memb.tuplecxx . . $ MEMBER#tuple.); |
| 5515 | return; |
| 5516 | } |
| 5517 | |
| 5518 | static void display_codecxx . . $ display_code(2a6d50d687e6a219).(MPLcxx . . $ MPL# *mpl, CODEcxx . . $ CODE# *code) |
| 5519 | { /* display value of expression */ |
| 5520 | switch (code->typecxx . . $ CODE#type.) |
| 5521 | { case A_NUMERICcxx . . $ `external/glpk/glpmpl.h:96:9`!: |
| 5522 | /* numeric value */ |
| 5523 | { double num; |
| 5524 | num = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, code); |
| 5525 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%.*g\n", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, num); |
| 5526 | } |
| 5527 | break; |
| 5528 | case A_SYMBOLICcxx . . $ `external/glpk/glpmpl.h:102:9`!: |
| 5529 | /* symbolic value */ |
| 5530 | { SYMBOLcxx . . $ SYMBOL# *sym; |
| 5531 | sym = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, code); |
| 5532 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%s\n", format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, sym)); |
| 5533 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym); |
| 5534 | } |
| 5535 | break; |
| 5536 | case A_LOGICALcxx . . $ `external/glpk/glpmpl.h:92:9`!: |
| 5537 | /* logical value */ |
| 5538 | { int bit; |
| 5539 | bit = eval_logicalcxx . . $ `external/glpk/glpmpl.h:2218:9`!(mpl, code); |
| 5540 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%s\n", bit ? "true" : "false"); |
| 5541 | } |
| 5542 | break; |
| 5543 | case A_TUPLEcxx . . $ `external/glpk/glpmpl.h:104:9`!: |
| 5544 | /* n-tuple */ |
| 5545 | { TUPLEcxx . . $ TUPLE# *tuple; |
| 5546 | tuple = eval_tuplecxx . . $ `external/glpk/glpmpl.h:2222:9`!(mpl, code); |
| 5547 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%s\n", format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '(', tuple)); |
| 5548 | delete_tuplecxx . . $ `external/glpk/glpmpl.h:1041:9`!(mpl, tuple); |
| 5549 | } |
| 5550 | break; |
| 5551 | case A_ELEMSETcxx . . $ `external/glpk/glpmpl.h:84:9`!: |
| 5552 | /* elemental set */ |
| 5553 | { ELEMSETcxx . . $ ELEMSET# *set; |
| 5554 | MEMBERcxx . . $ MEMBER# *memb; |
| 5555 | set = eval_elemsetcxx . . $ `external/glpk/glpmpl.h:2226:9`!(mpl, code); |
| 5556 | if (set->headcxx . . $ ARRAY#head. == 0) |
| 5557 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "set is empty\n"); |
| 5558 | for (memb = set->headcxx . . $ ARRAY#head.; memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memb = memb->nextcxx . . $ MEMBER#next.) |
| 5559 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, " %s\n", format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '(', |
| 5560 | memb->tuplecxx . . $ MEMBER#tuple.)); |
| 5561 | delete_elemsetcxx . . $ `external/glpk/glpmpl.h:1105:9`!(mpl, set); |
| 5562 | } |
| 5563 | break; |
| 5564 | case A_FORMULAcxx . . $ `external/glpk/glpmpl.h:88:9`!: |
| 5565 | /* linear form */ |
| 5566 | { FORMULAcxx . . $ FORMULA# *form, *term; |
| 5567 | form = eval_formulacxx . . $ `external/glpk/glpmpl.h:2234:9`!(mpl, code); |
| 5568 | if (form == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5569 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "linear form is empty\n"); |
| 5570 | for (term = form; term != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; term = term->nextcxx . . $ FORMULA#next.) |
| 5571 | { if (term->varcxx . . $ FORMULA#var. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5572 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, " %.*g\n", term->coefcxx . . $ FORMULA#coef.); |
| 5573 | else |
| 5574 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, " %.*g %s%s\n", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, |
| 5575 | term->coefcxx . . $ FORMULA#coef., term->varcxx . . $ FORMULA#var.->varcxx . . $ ELEMVAR#var.->namecxx . . $ VARIABLE#name., |
| 5576 | format_tuplecxx . . $ `external/glpk/glpmpl.h:1048:9`!(mpl, '[', term->varcxx . . $ FORMULA#var.->membcxx . . $ ELEMVAR#memb.->tuplecxx . . $ MEMBER#tuple.)); |
| 5577 | } |
| 5578 | delete_formulacxx . . $ `external/glpk/glpmpl.h:1227:9`!(mpl, form); |
| 5579 | } |
| 5580 | break; |
| 5581 | default: |
| 5582 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(code != code); |
| 5583 | } |
| 5584 | return; |
| 5585 | } |
| 5586 | |
| 5587 | static int display_funccxx . . $ display_func(3bbfabe35f227878).(MPLcxx . . $ MPL# *mpl, void *info) |
| 5588 | { /* this is auxiliary routine to work within domain scope */ |
| 5589 | DISPLAYcxx . . $ DISPLAY# *dpy = (DISPLAYcxx . . $ DISPLAY# *)info; |
| 5590 | DISPLAY1cxx . . $ DISPLAY1# *entry; |
| 5591 | for (entry = dpy->listcxx . . $ DISPLAY#list.; entry != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; entry = entry->nextcxx . . $ DISPLAY1#next.) |
| 5592 | { if (entry->typecxx . . $ DISPLAY1#type. == A_INDEXcxx . . $ `external/glpk/glpmpl.h:89:9`!) |
| 5593 | { /* dummy index */ |
| 5594 | DOMAIN_SLOTcxx . . $ DOMAIN_SLOT# *slot = entry->ucxx . . $ DISPLAY1#u..slotcxx . . $ DISPLAY1#$anonymous_type_10#slot.; |
| 5595 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%s = %s\n", slot->namecxx . . $ DOMAIN_SLOT#name., |
| 5596 | format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, slot->valuecxx . . $ DOMAIN_SLOT#value.)); |
| 5597 | } |
| 5598 | else if (entry->typecxx . . $ DISPLAY1#type. == A_SETcxx . . $ `external/glpk/glpmpl.h:100:9`!) |
| 5599 | { /* model set */ |
| 5600 | SETcxx . . $ SET# *set = entry->ucxx . . $ DISPLAY1#u..setcxx . . $ DISPLAY1#$anonymous_type_10#set.; |
| 5601 | MEMBERcxx . . $ MEMBER# *memb; |
| 5602 | if (set->assigncxx . . $ SET#assign. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5603 | { /* the set has assignment expression; evaluate all its |
| 5604 | members over entire domain */ |
| 5605 | eval_whole_setcxx . . $ `external/glpk/glpmpl.h:1599:9`!(mpl, set); |
| 5606 | } |
| 5607 | else |
| 5608 | { /* the set has no assignment expression; refer to its |
| 5609 | any existing member ignoring resultant value to check |
| 5610 | the data provided the data section */ |
| 5611 | #if 1 /* 12/XII-2008 */ |
| 5612 | if (set->gadgetcxx . . $ SET#gadget. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! && set->datacxx . . $ SET#data. == 0) |
| 5613 | { /* initialize the set with data from a plain set */ |
| 5614 | saturate_setcxx . . $ saturate_set(4b50f7a5eb0a6ab8).(mpl, set); |
| 5615 | } |
| 5616 | #endif |
| 5617 | if (set->arraycxx . . $ SET#array.->headcxx . . $ ARRAY#head. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5618 | eval_member_setcxx . . $ `external/glpk/glpmpl.h:1591:9`!(mpl, set, set->arraycxx . . $ SET#array.->headcxx . . $ ARRAY#head.->tuplecxx . . $ MEMBER#tuple.); |
| 5619 | } |
| 5620 | /* display all members of the set array */ |
| 5621 | if (set->arraycxx . . $ SET#array.->headcxx . . $ ARRAY#head. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5622 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%s has empty content\n", set->namecxx . . $ SET#name.); |
| 5623 | for (memb = set->arraycxx . . $ SET#array.->headcxx . . $ ARRAY#head.; memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memb = |
| 5624 | memb->nextcxx . . $ MEMBER#next.) display_setcxx . . $ display_set(836f49a9bae7d3a1).(mpl, set, memb); |
| 5625 | } |
| 5626 | else if (entry->typecxx . . $ DISPLAY1#type. == A_PARAMETERcxx . . $ `external/glpk/glpmpl.h:98:9`!) |
| 5627 | { /* model parameter */ |
| 5628 | PARAMETERcxx . . $ PARAMETER# *par = entry->ucxx . . $ DISPLAY1#u..parcxx . . $ DISPLAY1#$anonymous_type_10#par.; |
| 5629 | MEMBERcxx . . $ MEMBER# *memb; |
| 5630 | if (par->assigncxx . . $ PARAMETER#assign. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5631 | { /* the parameter has an assignment expression; evaluate |
| 5632 | all its member over entire domain */ |
| 5633 | eval_whole_parcxx . . $ `external/glpk/glpmpl.h:1717:9`!(mpl, par); |
| 5634 | } |
| 5635 | else |
| 5636 | { /* the parameter has no assignment expression; refer to |
| 5637 | its any existing member ignoring resultant value to |
| 5638 | check the data provided in the data section */ |
| 5639 | if (par->arraycxx . . $ PARAMETER#array.->headcxx . . $ ARRAY#head. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5640 | { if (par->typecxx . . $ PARAMETER#type. != A_SYMBOLICcxx . . $ `external/glpk/glpmpl.h:102:9`!) |
| 5641 | eval_member_numcxx . . $ `external/glpk/glpmpl.h:1684:9`!(mpl, par, par->arraycxx . . $ PARAMETER#array.->headcxx . . $ ARRAY#head.->tuplecxx . . $ MEMBER#tuple.); |
| 5642 | else |
| 5643 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, eval_member_symcxx . . $ `external/glpk/glpmpl.h:1709:9`!(mpl, par, |
| 5644 | par->arraycxx . . $ PARAMETER#array.->headcxx . . $ ARRAY#head.->tuplecxx . . $ MEMBER#tuple.)); |
| 5645 | } |
| 5646 | } |
| 5647 | /* display all members of the parameter array */ |
| 5648 | if (par->arraycxx . . $ PARAMETER#array.->headcxx . . $ ARRAY#head. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5649 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%s has empty content\n", par->namecxx . . $ PARAMETER#name.); |
| 5650 | for (memb = par->arraycxx . . $ PARAMETER#array.->headcxx . . $ ARRAY#head.; memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memb = |
| 5651 | memb->nextcxx . . $ MEMBER#next.) display_parcxx . . $ display_par(ea025f2847950b93).(mpl, par, memb); |
| 5652 | } |
| 5653 | else if (entry->typecxx . . $ DISPLAY1#type. == A_VARIABLEcxx . . $ `external/glpk/glpmpl.h:105:9`!) |
| 5654 | { /* model variable */ |
| 5655 | VARIABLEcxx . . $ VARIABLE# *var = entry->ucxx . . $ DISPLAY1#u..varcxx . . $ DISPLAY1#$anonymous_type_10#var.; |
| 5656 | MEMBERcxx . . $ MEMBER# *memb; |
| 5657 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(mpl->flag_p); |
| 5658 | /* display all members of the variable array */ |
| 5659 | if (var->arraycxx . . $ VARIABLE#array.->headcxx . . $ ARRAY#head. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5660 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%s has empty content\n", var->namecxx . . $ VARIABLE#name.); |
| 5661 | for (memb = var->arraycxx . . $ VARIABLE#array.->headcxx . . $ ARRAY#head.; memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memb = |
| 5662 | memb->nextcxx . . $ MEMBER#next.) display_varcxx . . $ display_var(91eb8f71ba25ee50).(mpl, var, memb, DOT_NONEcxx . . $ `external/glpk/glpmpl.h:2018:9`!); |
| 5663 | } |
| 5664 | else if (entry->typecxx . . $ DISPLAY1#type. == A_CONSTRAINTcxx . . $ `external/glpk/glpmpl.h:81:9`!) |
| 5665 | { /* model constraint */ |
| 5666 | CONSTRAINTcxx . . $ CONSTRAINT# *con = entry->ucxx . . $ DISPLAY1#u..concxx . . $ DISPLAY1#$anonymous_type_10#con.; |
| 5667 | MEMBERcxx . . $ MEMBER# *memb; |
| 5668 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(mpl->flag_p); |
| 5669 | /* display all members of the constraint array */ |
| 5670 | if (con->arraycxx . . $ CONSTRAINT#array.->headcxx . . $ ARRAY#head. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5671 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "%s has empty content\n", con->namecxx . . $ CONSTRAINT#name.); |
| 5672 | for (memb = con->arraycxx . . $ CONSTRAINT#array.->headcxx . . $ ARRAY#head.; memb != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; memb = |
| 5673 | memb->nextcxx . . $ MEMBER#next.) display_concxx . . $ display_con(de845c59ad00c7c1).(mpl, con, memb, DOT_NONEcxx . . $ `external/glpk/glpmpl.h:2018:9`!); |
| 5674 | } |
| 5675 | else if (entry->typecxx . . $ DISPLAY1#type. == A_EXPRESSIONcxx . . $ `external/glpk/glpmpl.h:86:9`!) |
| 5676 | { /* expression */ |
| 5677 | CODEcxx . . $ CODE# *code = entry->ucxx . . $ DISPLAY1#u..codecxx . . $ DISPLAY1#$anonymous_type_10#code.; |
| 5678 | if (code->opcxx . . $ CODE#op. == O_MEMNUMcxx . . $ `external/glpk/glpmpl.h:2078:9`! || code->opcxx . . $ CODE#op. == O_MEMSYMcxx . . $ `external/glpk/glpmpl.h:2079:9`! || |
| 5679 | code->opcxx . . $ CODE#op. == O_MEMSETcxx . . $ `external/glpk/glpmpl.h:2080:9`! || code->opcxx . . $ CODE#op. == O_MEMVARcxx . . $ `external/glpk/glpmpl.h:2081:9`! || |
| 5680 | code->opcxx . . $ CODE#op. == O_MEMCONcxx . . $ `external/glpk/glpmpl.h:2082:9`!) |
| 5681 | display_membcxx . . $ display_memb(2a6d50d687e6a219).(mpl, code); |
| 5682 | else |
| 5683 | display_codecxx . . $ display_code(2a6d50d687e6a219).(mpl, code); |
| 5684 | } |
| 5685 | else |
| 5686 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(entry != entry); |
| 5687 | } |
| 5688 | return 0; |
| 5689 | } |
| 5690 | |
| 5691 | void execute_displaycxx . . $ `external/glpk/glpmpl.h:2375:9`!(MPLcxx . . $ MPL# *mpl, DISPLAYcxx . . $ DISPLAY# *dpy) |
| 5692 | { loop_within_domaincxx . . $ `external/glpk/glpmpl.h:1493:9`!(mpl, dpy->domaincxx . . $ DISPLAY#domain., dpy, display_funccxx . . $ display_func(3bbfabe35f227878).); |
| 5693 | return; |
| 5694 | } |
| 5695 | |
| 5696 | /*---------------------------------------------------------------------- |
| 5697 | -- clean_display - clean display statement. |
| 5698 | -- |
| 5699 | -- This routine cleans specified display statement that assumes deleting |
| 5700 | -- all stuff dynamically allocated on generating/postsolving phase. */ |
| 5701 | |
| 5702 | void clean_displaycxx . . $ `external/glpk/glpmpl.h:2379:9`!(MPLcxx . . $ MPL# *mpl, DISPLAYcxx . . $ DISPLAY# *dpy) |
| 5703 | { DISPLAY1cxx . . $ DISPLAY1# *d; |
| 5704 | #if 0 /* 15/V-2010 */ |
| 5705 | ARG_LIST *e; |
| 5706 | #endif |
| 5707 | /* clean subscript domain */ |
| 5708 | clean_domaincxx . . $ `external/glpk/glpmpl.h:1516:9`!(mpl, dpy->domaincxx . . $ DISPLAY#domain.); |
| 5709 | /* clean display list */ |
| 5710 | for (d = dpy->listcxx . . $ DISPLAY#list.; d != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; d = d->nextcxx . . $ DISPLAY1#next.) |
| 5711 | { /* clean pseudo-code for computing expression */ |
| 5712 | if (d->typecxx . . $ DISPLAY1#type. == A_EXPRESSIONcxx . . $ `external/glpk/glpmpl.h:86:9`!) |
| 5713 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, d->ucxx . . $ DISPLAY1#u..codecxx . . $ DISPLAY1#$anonymous_type_10#code.); |
| 5714 | #if 0 /* 15/V-2010 */ |
| 5715 | /* clean pseudo-code for computing subscripts */ |
| 5716 | for (e = d->list; e != NULL; e = e->next) |
| 5717 | clean_code(mpl, e->x); |
| 5718 | #endif |
| 5719 | } |
| 5720 | return; |
| 5721 | } |
| 5722 | |
| 5723 | /*---------------------------------------------------------------------- |
| 5724 | -- execute_printf - execute printf statement. |
| 5725 | -- |
| 5726 | -- This routine executes specified printf statement. */ |
| 5727 | |
| 5728 | #if 1 /* 14/VII-2006 */ |
| 5729 | static void print_charcxx . . $ print_char(e014ada434cacc95).(MPLcxx . . $ MPL# *mpl, int c) |
| 5730 | { if (mpl->prt_fpcxx . . $ MPL#prt_fp. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5731 | write_charcxx . . $ `external/glpk/glpmpl.h:2451:9`!(mpl, c); |
| 5732 | else |
| 5733 | xfputccxx . . $ `external/glpk/glpenv.h:205:9`!(c, mpl->prt_fpcxx . . $ MPL#prt_fp.); |
| 5734 | return; |
| 5735 | } |
| 5736 | |
| 5737 | static void print_textcxx . . $ print_text(c35465dc85856397).(MPLcxx . . $ MPL# *mpl, char *fmt, ...) |
| 5738 | { va_listcxx . . $ va_list# arg; |
| 5739 | char buf[OUTBUF_SIZEcxx . . $ `external/glpk/glpmpl.h:115:9`!], *c; |
| 5740 | va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`!(arg, fmt); |
| 5741 | vsprintfcxx . . $ vsprintf(d8921982374e5df0).(buf, fmt, arg); |
| 5742 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(strlen(buf) < sizeof(buf)); |
| 5743 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(arg); |
| 5744 | for (c = buf; *c != '\0'; c++) print_charcxx . . $ print_char(e014ada434cacc95).(mpl, *c); |
| 5745 | return; |
| 5746 | } |
| 5747 | #endif |
| 5748 | |
| 5749 | static int printf_funccxx . . $ printf_func(3bbfabe35f227878).(MPLcxx . . $ MPL# *mpl, void *info) |
| 5750 | { /* this is auxiliary routine to work within domain scope */ |
| 5751 | PRINTFcxx . . $ PRINTF# *prt = (PRINTFcxx . . $ PRINTF# *)info; |
| 5752 | PRINTF1cxx . . $ PRINTF1# *entry; |
| 5753 | SYMBOLcxx . . $ SYMBOL# *sym; |
| 5754 | char fmt[MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!+1], *c, *from, save; |
| 5755 | /* evaluate format control string */ |
| 5756 | sym = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, prt->fmtcxx . . $ PRINTF#fmt.); |
| 5757 | if (sym->strcxx . . $ SYMBOL#str. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5758 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(fmt, "%.*g", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, sym->numcxx . . $ SYMBOL#num.); |
| 5759 | else |
| 5760 | fetch_stringcxx . . $ `external/glpk/glpmpl.h:911:9`!(mpl, sym->strcxx . . $ SYMBOL#str., fmt); |
| 5761 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym); |
| 5762 | /* scan format control string and perform formatting output */ |
| 5763 | entry = prt->listcxx . . $ PRINTF#list.; |
| 5764 | for (c = fmt; *c != '\0'; c++) |
| 5765 | { if (*c == '%') |
| 5766 | { /* scan format specifier */ |
| 5767 | from = c++; |
| 5768 | if (*c == '%') |
| 5769 | { print_charcxx . . $ print_char(e014ada434cacc95).(mpl, '%'); |
| 5770 | continue; |
| 5771 | } |
| 5772 | if (entry == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) break; |
| 5773 | /* scan optional flags */ |
| 5774 | while (*c == '-' || *c == '+' || *c == ' ' || *c == '#' || |
| 5775 | *c == '0') c++; |
| 5776 | /* scan optional minimum field width */ |
| 5777 | while (isdigitcxx . . $ `<external>/17904084882347303253/ctype.h:192:10`!((unsigned char)*c)) c++; |
| 5778 | /* scan optional precision */ |
| 5779 | if (*c == '.') |
| 5780 | { c++; |
| 5781 | while (isdigitcxx . . $ `<external>/17904084882347303253/ctype.h:192:10`!((unsigned char)*c)) c++; |
| 5782 | } |
| 5783 | /* scan conversion specifier and perform formatting */ |
| 5784 | save = *(c+1), *(c+1) = '\0'; |
| 5785 | if (*c == 'd' || *c == 'i' || *c == 'e' || *c == 'E' || |
| 5786 | *c == 'f' || *c == 'F' || *c == 'g' || *c == 'G') |
| 5787 | { /* the specifier requires numeric value */ |
| 5788 | double value; |
| 5789 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(entry != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 5790 | switch (entry->codecxx . . $ PRINTF1#code.->typecxx . . $ CODE#type.) |
| 5791 | { case A_NUMERICcxx . . $ `external/glpk/glpmpl.h:96:9`!: |
| 5792 | value = eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, entry->codecxx . . $ PRINTF1#code.); |
| 5793 | break; |
| 5794 | case A_SYMBOLICcxx . . $ `external/glpk/glpmpl.h:102:9`!: |
| 5795 | sym = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, entry->codecxx . . $ PRINTF1#code.); |
| 5796 | if (sym->strcxx . . $ SYMBOL#str. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5797 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "cannot convert %s to floating-point" |
| 5798 | " number", format_symbolcxx . . $ `external/glpk/glpmpl.h:971:9`!(mpl, sym)); |
| 5799 | value = sym->numcxx . . $ SYMBOL#num.; |
| 5800 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym); |
| 5801 | break; |
| 5802 | case A_LOGICALcxx . . $ `external/glpk/glpmpl.h:92:9`!: |
| 5803 | if (eval_logicalcxx . . $ `external/glpk/glpmpl.h:2218:9`!(mpl, entry->codecxx . . $ PRINTF1#code.)) |
| 5804 | value = 1.0; |
| 5805 | else |
| 5806 | value = 0.0; |
| 5807 | break; |
| 5808 | default: |
| 5809 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(entry != entry); |
| 5810 | } |
| 5811 | if (*c == 'd' || *c == 'i') |
| 5812 | { double int_max = (double)INT_MAXcxx . . $ `<external>/67164224788392828/limits.h:120:9`!; |
| 5813 | if (!(-int_max <= value && value <= +int_max)) |
| 5814 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "cannot convert %.*g to integer", |
| 5815 | DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, value); |
| 5816 | print_textcxx . . $ print_text(c35465dc85856397).(mpl, from, (int)floorcxx . . $ floor(447c67c6676f75c3).(value + 0.5)); |
| 5817 | } |
| 5818 | else |
| 5819 | print_textcxx . . $ print_text(c35465dc85856397).(mpl, from, value); |
| 5820 | } |
| 5821 | else if (*c == 's') |
| 5822 | { /* the specifier requires symbolic value */ |
| 5823 | char value[MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!+1]; |
| 5824 | switch (entry->codecxx . . $ PRINTF1#code.->typecxx . . $ CODE#type.) |
| 5825 | { case A_NUMERICcxx . . $ `external/glpk/glpmpl.h:96:9`!: |
| 5826 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(value, "%.*g", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, eval_numericcxx . . $ `external/glpk/glpmpl.h:2210:9`!(mpl, |
| 5827 | entry->codecxx . . $ PRINTF1#code.)); |
| 5828 | break; |
| 5829 | case A_LOGICALcxx . . $ `external/glpk/glpmpl.h:92:9`!: |
| 5830 | if (eval_logicalcxx . . $ `external/glpk/glpmpl.h:2218:9`!(mpl, entry->codecxx . . $ PRINTF1#code.)) |
| 5831 | strcpycxx . . $ strcpy(b7b3a83273496486).(value, "T"); |
| 5832 | else |
| 5833 | strcpycxx . . $ strcpy(b7b3a83273496486).(value, "F"); |
| 5834 | break; |
| 5835 | case A_SYMBOLICcxx . . $ `external/glpk/glpmpl.h:102:9`!: |
| 5836 | sym = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, entry->codecxx . . $ PRINTF1#code.); |
| 5837 | if (sym->strcxx . . $ SYMBOL#str. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5838 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(value, "%.*g", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, sym->numcxx . . $ SYMBOL#num.); |
| 5839 | else |
| 5840 | fetch_stringcxx . . $ `external/glpk/glpmpl.h:911:9`!(mpl, sym->strcxx . . $ SYMBOL#str., value); |
| 5841 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym); |
| 5842 | break; |
| 5843 | default: |
| 5844 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(entry != entry); |
| 5845 | } |
| 5846 | print_textcxx . . $ print_text(c35465dc85856397).(mpl, from, value); |
| 5847 | } |
| 5848 | else |
| 5849 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "format specifier missing or invalid"); |
| 5850 | *(c+1) = save; |
| 5851 | entry = entry->nextcxx . . $ PRINTF1#next.; |
| 5852 | } |
| 5853 | else if (*c == '\\') |
| 5854 | { /* write some control character */ |
| 5855 | c++; |
| 5856 | if (*c == 't') |
| 5857 | print_charcxx . . $ print_char(e014ada434cacc95).(mpl, '\t'); |
| 5858 | else if (*c == 'n') |
| 5859 | print_charcxx . . $ print_char(e014ada434cacc95).(mpl, '\n'); |
| 5860 | else |
| 5861 | print_charcxx . . $ print_char(e014ada434cacc95).(mpl, *c); |
| 5862 | } |
| 5863 | else |
| 5864 | { /* write character without formatting */ |
| 5865 | print_charcxx . . $ print_char(e014ada434cacc95).(mpl, *c); |
| 5866 | } |
| 5867 | } |
| 5868 | return 0; |
| 5869 | } |
| 5870 | |
| 5871 | #if 0 /* 14/VII-2006 */ |
| 5872 | void execute_printf(MPL *mpl, PRINTF *prt) |
| 5873 | { loop_within_domain(mpl, prt->domain, prt, printf_func); |
| 5874 | return; |
| 5875 | } |
| 5876 | #else |
| 5877 | void execute_printfcxx . . $ `external/glpk/glpmpl.h:2383:9`!(MPLcxx . . $ MPL# *mpl, PRINTFcxx . . $ PRINTF# *prt) |
| 5878 | { if (prt->fnamecxx . . $ PRINTF#fname. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5879 | { /* switch to the standard output */ |
| 5880 | if (mpl->prt_fpcxx . . $ MPL#prt_fp. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5881 | { xfclosecxx . . $ `external/glpk/glpenv.h:211:9`!(mpl->prt_fpcxx . . $ MPL#prt_fp.), mpl->prt_fpcxx . . $ MPL#prt_fp. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 5882 | xfreecxx . . $ `external/glpk/glpenv.h:175:9`!(mpl->prt_filecxx . . $ MPL#prt_file.), mpl->prt_filecxx . . $ MPL#prt_file. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 5883 | } |
| 5884 | } |
| 5885 | else |
| 5886 | { /* evaluate file name string */ |
| 5887 | SYMBOLcxx . . $ SYMBOL# *sym; |
| 5888 | char fname[MAX_LENGTHcxx . . $ `external/glpk/glpmpl.h:107:9`!+1]; |
| 5889 | sym = eval_symboliccxx . . $ `external/glpk/glpmpl.h:2214:9`!(mpl, prt->fnamecxx . . $ PRINTF#fname.); |
| 5890 | if (sym->strcxx . . $ SYMBOL#str. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5891 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(fname, "%.*g", DBL_DIGcxx . . $ `<external>/18143172452841944454/float.h:54:9`!, sym->numcxx . . $ SYMBOL#num.); |
| 5892 | else |
| 5893 | fetch_stringcxx . . $ `external/glpk/glpmpl.h:911:9`!(mpl, sym->strcxx . . $ SYMBOL#str., fname); |
| 5894 | delete_symbolcxx . . $ `external/glpk/glpmpl.h:964:9`!(mpl, sym); |
| 5895 | /* close the current print file, if necessary */ |
| 5896 | if (mpl->prt_fpcxx . . $ MPL#prt_fp. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`! && |
| 5897 | (!prt->appcxx . . $ PRINTF#app. || strcmpcxx . . $ strcmp(5ae29d726ae57f88).(mpl->prt_filecxx . . $ MPL#prt_file., fname) != 0)) |
| 5898 | { xfclosecxx . . $ `external/glpk/glpenv.h:211:9`!(mpl->prt_fpcxx . . $ MPL#prt_fp.), mpl->prt_fpcxx . . $ MPL#prt_fp. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 5899 | xfreecxx . . $ `external/glpk/glpenv.h:175:9`!(mpl->prt_filecxx . . $ MPL#prt_file.), mpl->prt_filecxx . . $ MPL#prt_file. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; |
| 5900 | } |
| 5901 | /* open the specified print file, if necessary */ |
| 5902 | if (mpl->prt_fpcxx . . $ MPL#prt_fp. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5903 | { mpl->prt_fpcxx . . $ MPL#prt_fp. = xfopencxx . . $ `external/glpk/glpenv.h:193:9`!(fname, prt->appcxx . . $ PRINTF#app. ? "a" : "w"); |
| 5904 | if (mpl->prt_fpcxx . . $ MPL#prt_fp. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5905 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "unable to open `%s' for writing - %s", |
| 5906 | fname, xerrmsgcxx . . $ `external/glpk/glpenv.h:190:9`!()); |
| 5907 | mpl->prt_filecxx . . $ MPL#prt_file. = xmalloccxx . . $ `external/glpk/glpenv.h:167:9`!(strlencxx . . $ strlen(751346f8406fd082).(fname)+1); |
| 5908 | strcpycxx . . $ strcpy(b7b3a83273496486).(mpl->prt_filecxx . . $ MPL#prt_file., fname); |
| 5909 | } |
| 5910 | } |
| 5911 | loop_within_domaincxx . . $ `external/glpk/glpmpl.h:1493:9`!(mpl, prt->domaincxx . . $ PRINTF#domain., prt, printf_funccxx . . $ printf_func(3bbfabe35f227878).); |
| 5912 | if (mpl->prt_fpcxx . . $ MPL#prt_fp. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!) |
| 5913 | { xfflushcxx . . $ `external/glpk/glpenv.h:208:9`!(mpl->prt_fpcxx . . $ MPL#prt_fp.); |
| 5914 | if (xferrorcxx . . $ `external/glpk/glpenv.h:196:9`!(mpl->prt_fpcxx . . $ MPL#prt_fp.)) |
| 5915 | mpl_errorcxx . . $ `external/glpk/glpmpl.h:2481:9`!(mpl, "writing error to `%s' - %s", mpl->prt_filecxx . . $ MPL#prt_file., |
| 5916 | xerrmsgcxx . . $ `external/glpk/glpenv.h:190:9`!()); |
| 5917 | } |
| 5918 | return; |
| 5919 | } |
| 5920 | #endif |
| 5921 | |
| 5922 | /*---------------------------------------------------------------------- |
| 5923 | -- clean_printf - clean printf statement. |
| 5924 | -- |
| 5925 | -- This routine cleans specified printf statement that assumes deleting |
| 5926 | -- all stuff dynamically allocated on generating/postsolving phase. */ |
| 5927 | |
| 5928 | void clean_printfcxx . . $ `external/glpk/glpmpl.h:2387:9`!(MPLcxx . . $ MPL# *mpl, PRINTFcxx . . $ PRINTF# *prt) |
| 5929 | { PRINTF1cxx . . $ PRINTF1# *p; |
| 5930 | /* clean subscript domain */ |
| 5931 | clean_domaincxx . . $ `external/glpk/glpmpl.h:1516:9`!(mpl, prt->domaincxx . . $ PRINTF#domain.); |
| 5932 | /* clean pseudo-code for computing format string */ |
| 5933 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, prt->fmtcxx . . $ PRINTF#fmt.); |
| 5934 | /* clean printf list */ |
| 5935 | for (p = prt->listcxx . . $ PRINTF#list.; p != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; p = p->nextcxx . . $ PRINTF1#next.) |
| 5936 | { /* clean pseudo-code for computing value to be printed */ |
| 5937 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, p->codecxx . . $ PRINTF1#code.); |
| 5938 | } |
| 5939 | #if 1 /* 14/VII-2006 */ |
| 5940 | /* clean pseudo-code for computing file name string */ |
| 5941 | clean_codecxx . . $ `external/glpk/glpmpl.h:2238:9`!(mpl, prt->fnamecxx . . $ PRINTF#fname.); |
| 5942 | #endif |
| 5943 | return; |
| 5944 | } |
| 5945 | |
| 5946 | /*---------------------------------------------------------------------- |
| 5947 | -- execute_for - execute for statement. |
| 5948 | -- |
| 5949 | -- This routine executes specified for statement. */ |
| 5950 | |
| 5951 | static int for_funccxx . . $ for_func(3bbfabe35f227878).(MPLcxx . . $ MPL# *mpl, void *info) |
| 5952 | { /* this is auxiliary routine to work within domain scope */ |
| 5953 | FORcxx . . $ FOR# *fur = (FORcxx . . $ FOR# *)info; |
| 5954 | STATEMENTcxx . . $ STATEMENT# *stmt, *save; |
| 5955 | save = mpl->stmtcxx . . $ MPL#stmt.; |
| 5956 | for (stmt = fur->listcxx . . $ FOR#list.; stmt != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; stmt = stmt->nextcxx . . $ STATEMENT#next.) |
| 5957 | execute_statementcxx . . $ `external/glpk/glpmpl.h:2399:9`!(mpl, stmt); |
| 5958 | mpl->stmtcxx . . $ MPL#stmt. = save; |
| 5959 | return 0; |
| 5960 | } |
| 5961 | |
| 5962 | void execute_forcxx . . $ `external/glpk/glpmpl.h:2391:9`!(MPLcxx . . $ MPL# *mpl, FORcxx . . $ FOR# *fur) |
| 5963 | { loop_within_domaincxx . . $ `external/glpk/glpmpl.h:1493:9`!(mpl, fur->domaincxx . . $ FOR#domain., fur, for_funccxx . . $ for_func(3bbfabe35f227878).); |
| 5964 | return; |
| 5965 | } |
| 5966 | |
| 5967 | /*---------------------------------------------------------------------- |
| 5968 | -- clean_for - clean for statement. |
| 5969 | -- |
| 5970 | -- This routine cleans specified for statement that assumes deleting all |
| 5971 | -- stuff dynamically allocated on generating/postsolving phase. */ |
| 5972 | |
| 5973 | void clean_forcxx . . $ `external/glpk/glpmpl.h:2395:9`!(MPLcxx . . $ MPL# *mpl, FORcxx . . $ FOR# *fur) |
| 5974 | { STATEMENTcxx . . $ STATEMENT# *stmt; |
| 5975 | /* clean subscript domain */ |
| 5976 | clean_domaincxx . . $ `external/glpk/glpmpl.h:1516:9`!(mpl, fur->domaincxx . . $ FOR#domain.); |
| 5977 | /* clean all sub-statements */ |
| 5978 | for (stmt = fur->listcxx . . $ FOR#list.; stmt != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!; stmt = stmt->nextcxx . . $ STATEMENT#next.) |
| 5979 | clean_statementcxx . . $ `external/glpk/glpmpl.h:2403:9`!(mpl, stmt); |
| 5980 | return; |
| 5981 | } |
| 5982 | |
| 5983 | /*---------------------------------------------------------------------- |
| 5984 | -- execute_statement - execute specified model statement. |
| 5985 | -- |
| 5986 | -- This routine executes specified model statement. */ |
| 5987 | |
| 5988 | void execute_statementcxx . . $ `external/glpk/glpmpl.h:2399:9`!(MPLcxx . . $ MPL# *mpl, STATEMENTcxx . . $ STATEMENT# *stmt) |
| 5989 | { mpl->stmtcxx . . $ MPL#stmt. = stmt; |
| 5990 | switch (stmt->typecxx . . $ STATEMENT#type.) |
| 5991 | { case A_SETcxx . . $ `external/glpk/glpmpl.h:100:9`!: |
| 5992 | case A_PARAMETERcxx . . $ `external/glpk/glpmpl.h:98:9`!: |
| 5993 | case A_VARIABLEcxx . . $ `external/glpk/glpmpl.h:105:9`!: |
| 5994 | break; |
| 5995 | case A_CONSTRAINTcxx . . $ `external/glpk/glpmpl.h:81:9`!: |
| 5996 | xprintfcxx . . $ `external/glpk/glpenv.h:145:9`!("Generating %s...\n", stmt->ucxx . . $ STATEMENT#u..concxx . . $ STATEMENT#$anonymous_type_11#con.->namecxx . . $ CONSTRAINT#name.); |
| 5997 | eval_whole_concxx . . $ `external/glpk/glpmpl.h:1831:9`!(mpl, stmt->ucxx . . $ STATEMENT#u..concxx . . $ STATEMENT#$anonymous_type_11#con.); |
| 5998 | break; |
| 5999 | case A_TABLEcxx . . $ `external/glpk/glpmpl.h:103:9`!: |
| 6000 | switch (stmt->ucxx . . $ STATEMENT#u..tabcxx . . $ STATEMENT#$anonymous_type_11#tab.->typecxx . . $ TABLE#type.) |
| 6001 | { case A_INPUTcxx . . $ `external/glpk/glpmpl.h:90:9`!: |
| 6002 | xprintfcxx . . $ `external/glpk/glpenv.h:145:9`!("Reading %s...\n", stmt->ucxx . . $ STATEMENT#u..tabcxx . . $ STATEMENT#$anonymous_type_11#tab.->namecxx . . $ TABLE#name.); |
| 6003 | break; |
| 6004 | case A_OUTPUTcxx . . $ `external/glpk/glpmpl.h:97:9`!: |
| 6005 | xprintfcxx . . $ `external/glpk/glpenv.h:145:9`!("Writing %s...\n", stmt->ucxx . . $ STATEMENT#u..tabcxx . . $ STATEMENT#$anonymous_type_11#tab.->namecxx . . $ TABLE#name.); |
| 6006 | break; |
| 6007 | default: |
| 6008 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(stmt != stmt); |
| 6009 | } |
| 6010 | execute_tablecxx . . $ `external/glpk/glpmpl.h:2355:9`!(mpl, stmt->ucxx . . $ STATEMENT#u..tabcxx . . $ STATEMENT#$anonymous_type_11#tab.); |
| 6011 | break; |
| 6012 | case A_SOLVEcxx . . $ `external/glpk/glpmpl.h:101:9`!: |
| 6013 | break; |
| 6014 | case A_CHECKcxx . . $ `external/glpk/glpmpl.h:80:9`!: |
| 6015 | xprintfcxx . . $ `external/glpk/glpenv.h:145:9`!("Checking (line %d)...\n", stmt->linecxx . . $ STATEMENT#line.); |
| 6016 | execute_checkcxx . . $ `external/glpk/glpmpl.h:2367:9`!(mpl, stmt->ucxx . . $ STATEMENT#u..chkcxx . . $ STATEMENT#$anonymous_type_11#chk.); |
| 6017 | break; |
| 6018 | case A_DISPLAYcxx . . $ `external/glpk/glpmpl.h:82:9`!: |
| 6019 | write_textcxx . . $ `external/glpk/glpmpl.h:2455:9`!(mpl, "Display statement at line %d\n", |
| 6020 | stmt->linecxx . . $ STATEMENT#line.); |
| 6021 | execute_displaycxx . . $ `external/glpk/glpmpl.h:2375:9`!(mpl, stmt->ucxx . . $ STATEMENT#u..dpycxx . . $ STATEMENT#$anonymous_type_11#dpy.); |
| 6022 | break; |
| 6023 | case A_PRINTFcxx . . $ `external/glpk/glpmpl.h:99:9`!: |
| 6024 | execute_printfcxx . . $ `external/glpk/glpmpl.h:2383:9`!(mpl, stmt->ucxx . . $ STATEMENT#u..prtcxx . . $ STATEMENT#$anonymous_type_11#prt.); |
| 6025 | break; |
| 6026 | case A_FORcxx . . $ `external/glpk/glpmpl.h:87:9`!: |
| 6027 | execute_forcxx . . $ `external/glpk/glpmpl.h:2391:9`!(mpl, stmt->ucxx . . $ STATEMENT#u..furcxx . . $ STATEMENT#$anonymous_type_11#fur.); |
| 6028 | break; |
| 6029 | default: |
| 6030 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(stmt != stmt); |
| 6031 | } |
| 6032 | return; |
| 6033 | } |
| 6034 | |
| 6035 | /*---------------------------------------------------------------------- |
| 6036 | -- clean_statement - clean specified model statement. |
| 6037 | -- |
| 6038 | -- This routine cleans specified model statement that assumes deleting |
| 6039 | -- all stuff dynamically allocated on generating/postsolving phase. */ |
| 6040 | |
| 6041 | void clean_statementcxx . . $ `external/glpk/glpmpl.h:2403:9`!(MPLcxx . . $ MPL# *mpl, STATEMENTcxx . . $ STATEMENT# *stmt) |
| 6042 | { switch(stmt->typecxx . . $ STATEMENT#type.) |
| 6043 | { case A_SETcxx . . $ `external/glpk/glpmpl.h:100:9`!: |
| 6044 | clean_setcxx . . $ `external/glpk/glpmpl.h:1603:9`!(mpl, stmt->ucxx . . $ STATEMENT#u..setcxx . . $ STATEMENT#$anonymous_type_11#set.); break; |
| 6045 | case A_PARAMETERcxx . . $ `external/glpk/glpmpl.h:98:9`!: |
| 6046 | clean_parametercxx . . $ `external/glpk/glpmpl.h:1721:9`!(mpl, stmt->ucxx . . $ STATEMENT#u..parcxx . . $ STATEMENT#$anonymous_type_11#par.); break; |
| 6047 | case A_VARIABLEcxx . . $ `external/glpk/glpmpl.h:105:9`!: |
| 6048 | clean_variablecxx . . $ `external/glpk/glpmpl.h:1777:9`!(mpl, stmt->ucxx . . $ STATEMENT#u..varcxx . . $ STATEMENT#$anonymous_type_11#var.); break; |
| 6049 | case A_CONSTRAINTcxx . . $ `external/glpk/glpmpl.h:81:9`!: |
| 6050 | clean_constraintcxx . . $ `external/glpk/glpmpl.h:1835:9`!(mpl, stmt->ucxx . . $ STATEMENT#u..concxx . . $ STATEMENT#$anonymous_type_11#con.); break; |
| 6051 | #if 1 /* 11/II-2008 */ |
| 6052 | case A_TABLEcxx . . $ `external/glpk/glpmpl.h:103:9`!: |
| 6053 | clean_tablecxx . . $ `external/glpk/glpmpl.h:2363:9`!(mpl, stmt->ucxx . . $ STATEMENT#u..tabcxx . . $ STATEMENT#$anonymous_type_11#tab.); break; |
| 6054 | #endif |
| 6055 | case A_SOLVEcxx . . $ `external/glpk/glpmpl.h:101:9`!: |
| 6056 | break; |
| 6057 | case A_CHECKcxx . . $ `external/glpk/glpmpl.h:80:9`!: |
| 6058 | clean_checkcxx . . $ `external/glpk/glpmpl.h:2371:9`!(mpl, stmt->ucxx . . $ STATEMENT#u..chkcxx . . $ STATEMENT#$anonymous_type_11#chk.); break; |
| 6059 | case A_DISPLAYcxx . . $ `external/glpk/glpmpl.h:82:9`!: |
| 6060 | clean_displaycxx . . $ `external/glpk/glpmpl.h:2379:9`!(mpl, stmt->ucxx . . $ STATEMENT#u..dpycxx . . $ STATEMENT#$anonymous_type_11#dpy.); break; |
| 6061 | case A_PRINTFcxx . . $ `external/glpk/glpmpl.h:99:9`!: |
| 6062 | clean_printfcxx . . $ `external/glpk/glpmpl.h:2387:9`!(mpl, stmt->ucxx . . $ STATEMENT#u..prtcxx . . $ STATEMENT#$anonymous_type_11#prt.); break; |
| 6063 | case A_FORcxx . . $ `external/glpk/glpmpl.h:87:9`!: |
| 6064 | clean_forcxx . . $ `external/glpk/glpmpl.h:2395:9`!(mpl, stmt->ucxx . . $ STATEMENT#u..furcxx . . $ STATEMENT#$anonymous_type_11#fur.); break; |
| 6065 | default: |
| 6066 | xassertcxx . . $ `external/glpk/glpenv.h:162:9`!(stmt != stmt); |
| 6067 | } |
| 6068 | return; |
| 6069 | } |
| 6070 | |
| 6071 | /* eof */ |