Repository navigation
Commit 0a36960
committed
Initialize the objective sense of mps_data_model_t to minimize
mps_data_model_t's default constructor left maximize_ uninitialized; it is
the only data member without a default member initializer. A model built
through the public C++ API without an explicit set_maximize() call could
therefore be solved or written to MPS as a maximization problem,
depending on whatever bytes happened to be in memory.
Default the sense to minimize, as data_model_view_t already does, and
add a test that default-constructs the model over non-zero storage.
Signed-off-by: Nicolò Angileri <[email protected]>1 parent 02bfe53 commit 0a36960
2 files changed
Lines changed: 16 additions & 1 deletion
File tree
- cpp
- include/cuopt/mathematical_optimization/io
- tests/linear_programming
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
| 336 | + | |
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
1244 | 1246 | | |
1245 | 1247 | | |
1246 | 1248 | | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
1247 | 1261 | | |
1248 | 1262 | | |
1249 | 1263 | | |
| |||
1270 | 1284 | | |
1271 | 1285 | | |
1272 | 1286 | | |
| 1287 | + | |
1273 | 1288 | | |
1274 | 1289 | | |
1275 | 1290 | | |
| |||
0 commit comments