Cgl 0.60.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CoinPresolveMatrix.hpp
Go to the documentation of this file.
1 /* $Id: CoinPresolveMatrix.hpp 2083 2019-01-06 19:38:09Z unxusr $ */
2 // Copyright (C) 2002, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5
6 #ifndef CoinPresolveMatrix_H
7 #define CoinPresolveMatrix_H
8
9 #include "CoinPragma.hpp"
10 #include "CoinPackedMatrix.hpp"
11 #include "CoinMessage.hpp"
12 #include "CoinTime.hpp"
13
14 #include <cmath>
15 #include <cassert>
16 #include <cfloat>
17 #include <cassert>
18 #include <cstdlib>
19
20 //# define COIN_PRESOLVE_TUNING 2
21 #if PRESOLVE_DEBUG > 0
22 #include "CoinFinite.hpp"
23 #endif
24
32 #if defined(_MSC_VER)
33 // Avoid MS Compiler problem in recognizing type to delete
34 // by casting to type.
35 // Is this still necessary? -- lh, 111202 --
36 #define deleteAction(array, type) delete[]((type)array)
37 #else
38 #define deleteAction(array, type) delete[] array
39 #endif
40
41 /*
42 Define PRESOLVE_DEBUG and PRESOLVE_CONSISTENCY on the configure command
43 line or in a Makefile! See comments in CoinPresolvePsdebug.hpp.
44 */
45 #if PRESOLVE_DEBUG > 0 || PRESOLVE_CONSISTENCY > 0
46
47 #define PRESOLVE_STMT(s) s
48
49 #define PRESOLVEASSERT(x) \
50 ((x) ? 1 : ((std::cerr << "FAILED ASSERTION at line " << __LINE__ << ": " #x "\n"), abort(), 0))
51
52 inline void DIE(const char *s)
53 {
54 std::cout << s;
55 abort();
56 }
57
68 #define PRESENT_IN_REDUCED '\377'
69
70 #else
71
72 #define PRESOLVEASSERT(x) \
73 { \
74 }
75 #define PRESOLVE_STMT(s) \
76 { \
77 }
78
79 inline void DIE(const char *) {}
80
81 #endif
82
83 /*
84 Unclear why these are separate from standard debug.
85 */
86 #ifndef PRESOLVE_DETAIL
87 #define PRESOLVE_DETAIL_PRINT(s) \
88 { \
89 }
90 #else
91 #define PRESOLVE_DETAIL_PRINT(s) s
92 #endif
93
98 const double ZTOLDP = 1e-12;
103 const double ZTOLDP2 = 1e-10;
104
106 #define PRESOLVE_INF COIN_DBL_MAX
107 #define PRESOLVE_SMALL_INF 1.0e20
109 #define PRESOLVEFINITE(n) (-PRESOLVE_INF < (n) && (n) < PRESOLVE_INF)
111
112 class CoinPostsolveMatrix;
113
163 class CoinPresolveAction {
164 public:
171 static void throwCoinError(const char *error, const char *ps_routine)
172 {
173 throw CoinError(error, ps_routine, "CoinPresolve");
174 }
175
180 const CoinPresolveAction *next;
181
187 CoinPresolveAction(const CoinPresolveAction *next)
188 : next(next)
189 {
190 }
192 inline void setNext(const CoinPresolveAction *nextAction)
193 {
194 next = nextAction;
195 }
196
201 virtual const char *name() const = 0;
202
206 virtual void postsolve(CoinPostsolveMatrix *prob) const = 0;
207
209 virtual ~CoinPresolveAction() {}
210 };
211
212 /*
213 These are needed for OSI-aware constructors associated with
214 CoinPrePostsolveMatrix, CoinPresolveMatrix, and CoinPostsolveMatrix.
215 */
216 class ClpSimplex;
217 class OsiSolverInterface;
218
219 /*
220 CoinWarmStartBasis is required for methods in CoinPrePostsolveMatrix
221 that accept/return a CoinWarmStartBasis object.
222 */
223 class CoinWarmStartBasis;
224
279 class CoinPrePostsolveMatrix {
280 public:
290 CoinPrePostsolveMatrix(int ncols_alloc, int nrows_alloc,
291 CoinBigIndex nelems_alloc);
292
297 CoinPrePostsolveMatrix(const OsiSolverInterface *si,
298 int ncols_,
299 int nrows_,
300 CoinBigIndex nelems_);
301
306 CoinPrePostsolveMatrix(const ClpSimplex *si,
307 int ncols_,
308 int nrows_,
309 CoinBigIndex nelems_,
310 double bulkRatio);
311
313 ~CoinPrePostsolveMatrix();
315
325 enum Status {
326 isFree = 0x00,
327 basic = 0x01,
328 atUpperBound = 0x02,
329 atLowerBound = 0x03,
330 superBasic = 0x04
331 };
332
345
347 inline void setRowStatus(int sequence, Status status)
348 {
349 unsigned char &st_byte = rowstat_[sequence];
350 st_byte = static_cast< unsigned char >(st_byte & (~7));
351 st_byte = static_cast< unsigned char >(st_byte | status);
352 }
354 inline Status getRowStatus(int sequence) const
355 {
356 return static_cast< Status >(rowstat_[sequence] & 7);
357 }
359 inline bool rowIsBasic(int sequence) const
360 {
361 return (static_cast< Status >(rowstat_[sequence] & 7) == basic);
362 }
364 inline void setColumnStatus(int sequence, Status status)
365 {
366 unsigned char &st_byte = colstat_[sequence];
367 st_byte = static_cast< unsigned char >(st_byte & (~7));
368 st_byte = static_cast< unsigned char >(st_byte | status);
369
370 #ifdef PRESOLVE_DEBUG
371 switch (status) {
372 case isFree: {
373 if (clo_[sequence] > -PRESOLVE_INF || cup_[sequence] < PRESOLVE_INF) {
374 std::cout << "Bad status: Var " << sequence
375 << " isFree, lb = " << clo_[sequence]
376 << ", ub = " << cup_[sequence] << std::endl;
377 }
378 break;
379 }
380 case basic: {
381 break;
382 }
383 case atUpperBound: {
384 if (cup_[sequence] >= PRESOLVE_INF) {
385 std::cout << "Bad status: Var " << sequence
386 << " atUpperBound, lb = " << clo_[sequence]
387 << ", ub = " << cup_[sequence] << std::endl;
388 }
389 break;
390 }
391 case atLowerBound: {
392 if (clo_[sequence] <= -PRESOLVE_INF) {
393 std::cout << "Bad status: Var " << sequence
394 << " atLowerBound, lb = " << clo_[sequence]
395 << ", ub = " << cup_[sequence] << std::endl;
396 }
397 break;
398 }
399 case superBasic: {
400 if (clo_[sequence] <= -PRESOLVE_INF && cup_[sequence] >= PRESOLVE_INF) {
401 std::cout << "Bad status: Var " << sequence
402 << " superBasic, lb = " << clo_[sequence]
403 << ", ub = " << cup_[sequence] << std::endl;
404 }
405 break;
406 }
407 default: {
408 assert(false);
409 break;
410 }
411 }
412 #endif
413 }
415 inline Status getColumnStatus(int sequence) const
416 {
417 return static_cast< Status >(colstat_[sequence] & 7);
418 }
420 inline bool columnIsBasic(int sequence) const
421 {
422 return (static_cast< Status >(colstat_[sequence] & 7) == basic);
423 }
427 void setRowStatusUsingValue(int iRow);
431 void setColumnStatusUsingValue(int iColumn);
433 void setStructuralStatus(const char *strucStatus, int lenParam);
435 void setArtificialStatus(const char *artifStatus, int lenParam);
437 void setStatus(const CoinWarmStartBasis *basis);
439 CoinWarmStartBasis *getStatus();
443 const char *columnStatusString(int j) const;
447 const char *rowStatusString(int i) const;
449
457 void setObjOffset(double offset);
465 void setObjSense(double objSense);
467 void setPrimalTolerance(double primTol);
469 void setDualTolerance(double dualTol);
471 void setColLower(const double *colLower, int lenParam);
473 void setColUpper(const double *colUpper, int lenParam);
475 void setColSolution(const double *colSol, int lenParam);
477 void setCost(const double *cost, int lenParam);
479 void setReducedCost(const double *redCost, int lenParam);
481 void setRowLower(const double *rowLower, int lenParam);
483 void setRowUpper(const double *rowUpper, int lenParam);
485 void setRowPrice(const double *rowSol, int lenParam);
487 void setRowActivity(const double *rowAct, int lenParam);
489
492 inline int getNumCols() const
494 {
495 return (ncols_);
496 }
498 inline int getNumRows() const
499 {
500 return (nrows_);
501 }
503 inline CoinBigIndex getNumElems() const
504 {
505 return (nelems_);
506 }
508 inline const CoinBigIndex *getColStarts() const
509 {
510 return (mcstrt_);
511 }
513 inline const int *getColLengths() const
514 {
515 return (hincol_);
516 }
518 inline const int *getRowIndicesByCol() const
519 {
520 return (hrow_);
521 }
523 inline const double *getElementsByCol() const
524 {
525 return (colels_);
526 }
528 inline const double *getColLower() const
529 {
530 return (clo_);
531 }
533 inline const double *getColUpper() const
534 {
535 return (cup_);
536 }
538 inline const double *getCost() const
539 {
540 return (cost_);
541 }
543 inline const double *getRowLower() const
544 {
545 return (rlo_);
546 }
548 inline const double *getRowUpper() const
549 {
550 return (rup_);
551 }
553 inline const double *getColSolution() const
554 {
555 return (sol_);
556 }
558 inline const double *getRowActivity() const
559 {
560 return (acts_);
561 }
563 inline const double *getRowPrice() const
564 {
565 return (rowduals_);
566 }
568 inline const double *getReducedCost() const
569 {
570 return (rcosts_);
571 }
573 inline int countEmptyCols()
574 {
575 int empty = 0;
576 for (int i = 0; i < ncols_; i++)
577 if (hincol_[i] == 0)
578 empty++;
579 return (empty);
580 }
582
585 inline CoinMessageHandler *messageHandler() const
587 {
588 return handler_;
589 }
595 inline void setMessageHandler(CoinMessageHandler *handler)
596 {
597 if (defaultHandler_ == true) {
598 delete handler_;
599 defaultHandler_ = false;
600 }
601 handler_ = handler;
602 }
604 inline CoinMessages messages() const
605 {
606 return messages_;
607 }
609
619
621 int ncols_;
623 int nrows_;
625 CoinBigIndex nelems_;
626
628 int ncols0_;
630 int nrows0_;
632 CoinBigIndex nelems0_;
641 CoinBigIndex bulk0_;
643 double bulkRatio_;
645
654 CoinBigIndex *mcstrt_;
657 int *hincol_;
659 int *hrow_;
661 double *colels_;
662
664 double *cost_;
666 double originalOffset_;
667
669 double *clo_;
671 double *cup_;
672
674 double *rlo_;
676 double *rup_;
677
684 int *originalColumn_;
691 int *originalRow_;
692
694 double ztolzb_;
696 double ztoldj_;
697
703 double maxmin_;
705
726 double *sol_;
732 double *rowduals_;
738 double *acts_;
744 double *rcosts_;
745
752 unsigned char *colstat_;
753
760 unsigned char *rowstat_;
762
771 CoinMessageHandler *handler_;
774 bool defaultHandler_;
776 CoinMessage messages_;
778 };
779
783 const char *statusName(CoinPrePostsolveMatrix::Status status);
784
809 class presolvehlink {
810 public:
811 int pre, suc;
812 };
813
814 #define NO_LINK -66666666
815
821 inline void PRESOLVE_REMOVE_LINK(presolvehlink *link, int i)
822 {
823 int ipre = link[i].pre;
824 int isuc = link[i].suc;
825 if (ipre >= 0) {
826 link[ipre].suc = isuc;
827 }
828 if (isuc >= 0) {
829 link[isuc].pre = ipre;
830 }
831 link[i].pre = NO_LINK, link[i].suc = NO_LINK;
832 }
833
839 inline void PRESOLVE_INSERT_LINK(presolvehlink *link, int i, int j)
840 {
841 int isuc = link[j].suc;
842 link[j].suc = i;
843 link[i].pre = j;
844 if (isuc >= 0) {
845 link[isuc].pre = i;
846 }
847 link[i].suc = isuc;
848 }
849
861 inline void PRESOLVE_MOVE_LINK(presolvehlink *link, int i, int j)
862 {
863 int ipre = link[i].pre;
864 int isuc = link[i].suc;
865 if (ipre >= 0) {
866 link[ipre].suc = j;
867 }
868 if (isuc >= 0) {
869 link[isuc].pre = j;
870 }
871 link[i].pre = NO_LINK, link[i].suc = NO_LINK;
872 }
873
905 class CoinPresolveMatrix : public CoinPrePostsolveMatrix {
906 public:
913 CoinPresolveMatrix(int ncols_alloc, int nrows_alloc,
914 CoinBigIndex nelems_alloc);
915
920 CoinPresolveMatrix(int ncols0,
921 double maxmin,
922 // end prepost members
923
924 ClpSimplex *si,
925
926 // rowrep
927 int nrows,
928 CoinBigIndex nelems,
929 bool doStatus,
930 double nonLinearVariable,
931 double bulkRatio);
932
934 void update_model(ClpSimplex *si,
935 int nrows0,
936 int ncols0,
937 CoinBigIndex nelems0);
942 CoinPresolveMatrix(int ncols0,
943 double maxmin,
944 // end prepost members
945 OsiSolverInterface *si,
946 // rowrep
947 int nrows,
948 CoinBigIndex nelems,
949 bool doStatus,
950 double nonLinearVariable,
951 const char *prohibited,
952 const char *rowProhibited = NULL);
953
955 void update_model(OsiSolverInterface *si,
956 int nrows0,
957 int ncols0,
958 CoinBigIndex nelems0);
959
961 ~CoinPresolveMatrix();
962
968 friend void assignPresolveToPostsolve(CoinPresolveMatrix *&preObj);
969
978 void setMatrix(const CoinPackedMatrix *mtx);
979
981 inline int countEmptyRows()
982 {
983 int empty = 0;
984 for (int i = 0; i < nrows_; i++)
985 if (hinrow_[i] == 0)
986 empty++;
987 return (empty);
988 }
989
995 inline void setVariableType(int i, int variableType)
996 {
997 if (integerType_ == 0)
998 integerType_ = new unsigned char[ncols0_];
999 integerType_[i] = static_cast< unsigned char >(variableType);
1000 }
1001
1007 void setVariableType(const unsigned char *variableType, int lenParam);
1008
1014 void setVariableType(bool allIntegers, int lenParam);
1015
1017 inline void setAnyInteger(bool anyInteger = true)
1018 {
1019 anyInteger_ = anyInteger;
1020 }
1022
1026
1028 inline const CoinBigIndex *getRowStarts() const
1029 {
1030 return (mrstrt_);
1031 }
1033 inline const int *getColIndicesByRow() const
1034 {
1035 return (hcol_);
1036 }
1038 inline const double *getElementsByRow() const
1039 {
1040 return (rowels_);
1041 }
1042
1048 inline bool isInteger(int i) const
1049 {
1050 if (integerType_ == 0) {
1051 return (anyInteger_);
1052 } else if (integerType_[i] == 1) {
1053 return (true);
1054 } else {
1055 return (false);
1056 }
1057 }
1058
1063 inline bool anyInteger() const
1064 {
1065 return (anyInteger_);
1066 }
1068 inline int presolveOptions() const
1069 {
1070 return presolveOptions_;
1071 }
1073 inline void setPresolveOptions(int value)
1074 {
1075 presolveOptions_ = value;
1076 }
1078
1086 presolvehlink *clink_;
1089 presolvehlink *rlink_;
1091
1093 double dobias_;
1094
1096 inline void change_bias(double change_amount)
1097 {
1098 dobias_ += change_amount;
1099 #if PRESOLVE_DEBUG > 2
1100 assert(fabs(change_amount) < 1.0e50);
1101 if (change_amount)
1102 PRESOLVE_STMT(printf("changing bias by %g to %g\n",
1103 change_amount, dobias_));
1104 #endif
1105 }
1106
1115 CoinBigIndex *mrstrt_;
1118 int *hinrow_;
1120 double *rowels_;
1122 int *hcol_;
1124
1126 unsigned char *integerType_;
1132 bool anyInteger_;
1134 bool tuning_;
1136 void statistics();
1138 double startTime_;
1139
1141 double feasibilityTolerance_;
1143 inline double feasibilityTolerance()
1144 {
1145 return (feasibilityTolerance_);
1146 }
1148 inline void setFeasibilityTolerance(double val)
1149 {
1150 feasibilityTolerance_ = val;
1151 }
1152
1158 int status_;
1160 inline int status()
1161 {
1162 return (status_);
1163 }
1165 inline void setStatus(int status)
1166 {
1167 status_ = (status & 0x3);
1168 }
1169
1177 int pass_;
1179 inline void setPass(int pass = 0)
1180 {
1181 pass_ = pass;
1182 }
1183
1188 int maxSubstLevel_;
1190 inline void setMaximumSubstitutionLevel(int level)
1191 {
1192 maxSubstLevel_ = level;
1193 }
1194
1218 unsigned char *colChanged_;
1220 int *colsToDo_;
1222 int numberColsToDo_;
1224 int *nextColsToDo_;
1226 int numberNextColsToDo_;
1227
1237 unsigned char *rowChanged_;
1239 int *rowsToDo_;
1241 int numberRowsToDo_;
1243 int *nextRowsToDo_;
1245 int numberNextRowsToDo_;
1263 int presolveOptions_;
1269 bool anyProhibited_;
1271
1282 int *usefulRowInt_;
1285 double *usefulRowDouble_;
1287 int *usefulColumnInt_;
1289 double *usefulColumnDouble_;
1291 double *randomNumber_;
1292
1294 int *infiniteUp_;
1296 double *sumUp_;
1298 int *infiniteDown_;
1300 double *sumDown_;
1302
1314 int recomputeSums(int whichRow);
1315
1317 void initializeStuff();
1319 void deleteStuff();
1320
1323
1329 void initColsToDo();
1330
1336 int stepColsToDo();
1337
1339 inline int numberColsToDo()
1340 {
1341 return (numberColsToDo_);
1342 }
1343
1345 inline bool colChanged(int i) const
1346 {
1347 return (colChanged_[i] & 1) != 0;
1348 }
1350 inline void unsetColChanged(int i)
1351 {
1352 colChanged_[i] = static_cast< unsigned char >(colChanged_[i] & (~1));
1353 }
1355 inline void setColChanged(int i)
1356 {
1357 colChanged_[i] = static_cast< unsigned char >(colChanged_[i] | (1));
1358 }
1360 inline void addCol(int i)
1361 {
1362 if ((colChanged_[i] & 1) == 0) {
1363 colChanged_[i] = static_cast< unsigned char >(colChanged_[i] | (1));
1364 nextColsToDo_[numberNextColsToDo_++] = i;
1365 }
1366 }
1368 inline bool colProhibited(int i) const
1369 {
1370 return (colChanged_[i] & 2) != 0;
1371 }
1378 inline bool colProhibited2(int i) const
1379 {
1380 if (!anyProhibited_)
1381 return false;
1382 else
1383 return (colChanged_[i] & 2) != 0;
1384 }
1386 inline void setColProhibited(int i)
1387 {
1388 colChanged_[i] = static_cast< unsigned char >(colChanged_[i] | (2));
1389 }
1395 inline bool colUsed(int i) const
1396 {
1397 return (colChanged_[i] & 4) != 0;
1398 }
1400 inline void setColUsed(int i)
1401 {
1402 colChanged_[i] = static_cast< unsigned char >(colChanged_[i] | (4));
1403 }
1405 inline void unsetColUsed(int i)
1406 {
1407 colChanged_[i] = static_cast< unsigned char >(colChanged_[i] & (~4));
1408 }
1410 inline bool colInfinite(int i) const
1411 {
1412 return (colChanged_[i] & 8) != 0;
1413 }
1415 inline void unsetColInfinite(int i)
1416 {
1417 colChanged_[i] = static_cast< unsigned char >(colChanged_[i] & (~8));
1418 }
1420 inline void setColInfinite(int i)
1421 {
1422 colChanged_[i] = static_cast< unsigned char >(colChanged_[i] | (8));
1423 }
1424
1430 void initRowsToDo();
1431
1437 int stepRowsToDo();
1438
1440 inline int numberRowsToDo()
1441 {
1442 return (numberRowsToDo_);
1443 }
1444
1446 inline bool rowChanged(int i) const
1447 {
1448 return (rowChanged_[i] & 1) != 0;
1449 }
1451 inline void unsetRowChanged(int i)
1452 {
1453 rowChanged_[i] = static_cast< unsigned char >(rowChanged_[i] & (~1));
1454 }
1456 inline void setRowChanged(int i)
1457 {
1458 rowChanged_[i] = static_cast< unsigned char >(rowChanged_[i] | (1));
1459 }
1461 inline void addRow(int i)
1462 {
1463 if ((rowChanged_[i] & 1) == 0) {
1464 rowChanged_[i] = static_cast< unsigned char >(rowChanged_[i] | (1));
1465 nextRowsToDo_[numberNextRowsToDo_++] = i;
1466 }
1467 }
1469 inline bool rowProhibited(int i) const
1470 {
1471 return (rowChanged_[i] & 2) != 0;
1472 }
1479 inline bool rowProhibited2(int i) const
1480 {
1481 if (!anyProhibited_)
1482 return false;
1483 else
1484 return (rowChanged_[i] & 2) != 0;
1485 }
1487 inline void setRowProhibited(int i)
1488 {
1489 rowChanged_[i] = static_cast< unsigned char >(rowChanged_[i] | (2));
1490 }
1496 inline bool rowUsed(int i) const
1497 {
1498 return (rowChanged_[i] & 4) != 0;
1499 }
1501 inline void setRowUsed(int i)
1502 {
1503 rowChanged_[i] = static_cast< unsigned char >(rowChanged_[i] | (4));
1504 }
1506 inline void unsetRowUsed(int i)
1507 {
1508 rowChanged_[i] = static_cast< unsigned char >(rowChanged_[i] & (~4));
1509 }
1510
1512 inline bool anyProhibited() const
1513 {
1514 return anyProhibited_;
1515 }
1517 inline void setAnyProhibited(bool val = true)
1518 {
1519 anyProhibited_ = val;
1520 }
1522 };
1523
1552 class CoinPostsolveMatrix : public CoinPrePostsolveMatrix {
1553 public:
1560 CoinPostsolveMatrix(int ncols_alloc, int nrows_alloc,
1561 CoinBigIndex nelems_alloc);
1562
1567 CoinPostsolveMatrix(ClpSimplex *si,
1568
1569 int ncols0,
1570 int nrows0,
1571 CoinBigIndex nelems0,
1572
1573 double maxmin_,
1574 // end prepost members
1575
1576 double *sol,
1577 double *acts,
1578
1579 unsigned char *colstat,
1580 unsigned char *rowstat);
1581
1586 CoinPostsolveMatrix(OsiSolverInterface *si,
1587
1588 int ncols0,
1589 int nrows0,
1590 CoinBigIndex nelems0,
1591
1592 double maxmin_,
1593 // end prepost members
1594
1595 double *sol,
1596 double *acts,
1597
1598 unsigned char *colstat,
1599 unsigned char *rowstat);
1600
1611 void assignPresolveToPostsolve(CoinPresolveMatrix *&preObj);
1612
1614 ~CoinPostsolveMatrix();
1615
1627
1629 CoinBigIndex free_list_;
1631 CoinBigIndex maxlink_;
1636 CoinBigIndex *link_;
1637
1639
1647 char *cdone_;
1648 char *rdone_;
1650
1652 void check_nbasic();
1653 };
1654
1661
1666 void presolve_make_memlists(/*CoinBigIndex *starts,*/ int *lengths,
1667 presolvehlink *link, int n);
1668
1676 bool presolve_expand_major(CoinBigIndex *majstrts, double *majels,
1677 int *minndxs, int *majlens,
1678 presolvehlink *majlinks, int nmaj, int k);
1679
1685 inline bool presolve_expand_col(CoinBigIndex *mcstrt, double *colels,
1686 int *hrow, int *hincol,
1687 presolvehlink *clink, int ncols, int colx)
1688 {
1689 return presolve_expand_major(mcstrt, colels,
1690 hrow, hincol, clink, ncols, colx);
1691 }
1692
1698 inline bool presolve_expand_row(CoinBigIndex *mrstrt, double *rowels,
1699 int *hcol, int *hinrow,
1700 presolvehlink *rlink, int nrows, int rowx)
1701 {
1702 return presolve_expand_major(mrstrt, rowels,
1703 hcol, hinrow, rlink, nrows, rowx);
1704 }
1705
1714 inline CoinBigIndex presolve_find_minor(int tgt,
1715 CoinBigIndex ks, CoinBigIndex ke,
1716 const int *minndxs)
1717 {
1718 CoinBigIndex k;
1719 for (k = ks; k < ke; k++)
1720 #ifndef NDEBUG
1721 {
1722 if (minndxs[k] == tgt)
1723 return (k);
1724 }
1725 DIE("FIND_MINOR");
1726
1727 abort();
1728 return -1;
1729 #else
1730 {
1731 if (minndxs[k] == tgt)
1732 break;
1733 }
1734 return (k);
1735 #endif
1736 }
1737
1744 inline CoinBigIndex presolve_find_row(int row, CoinBigIndex kcs,
1745 CoinBigIndex kce, const int *hrow)
1746 {
1747 return presolve_find_minor(row, kcs, kce, hrow);
1748 }
1749
1756 inline CoinBigIndex presolve_find_col(int col, CoinBigIndex krs,
1757 CoinBigIndex kre, const int *hcol)
1758 {
1759 return presolve_find_minor(col, krs, kre, hcol);
1760 }
1761
1770 CoinBigIndex presolve_find_minor1(int tgt, CoinBigIndex ks, CoinBigIndex ke,
1771 const int *minndxs);
1772
1779 inline CoinBigIndex presolve_find_row1(int row, CoinBigIndex kcs,
1780 CoinBigIndex kce, const int *hrow)
1781 {
1782 return presolve_find_minor1(row, kcs, kce, hrow);
1783 }
1784
1791 inline CoinBigIndex presolve_find_col1(int col, CoinBigIndex krs,
1792 CoinBigIndex kre, const int *hcol)
1793 {
1794 return presolve_find_minor1(col, krs, kre, hcol);
1795 }
1796
1805 CoinBigIndex presolve_find_minor2(int tgt, CoinBigIndex ks, int majlen,
1806 const int *minndxs,
1807 const CoinBigIndex *majlinks);
1808
1816 inline CoinBigIndex presolve_find_row2(int row, CoinBigIndex kcs, int collen,
1817 const int *hrow,
1818 const CoinBigIndex *clinks)
1819 {
1820 return presolve_find_minor2(row, kcs, collen, hrow, clinks);
1821 }
1822
1831 CoinBigIndex presolve_find_minor3(int tgt, CoinBigIndex ks, int majlen,
1832 const int *minndxs,
1833 const CoinBigIndex *majlinks);
1834
1842 inline CoinBigIndex presolve_find_row3(int row, CoinBigIndex kcs, int collen,
1843 const int *hrow,
1844 const CoinBigIndex *clinks)
1845 {
1846 return presolve_find_minor3(row, kcs, collen, hrow, clinks);
1847 }
1848
1858 inline void presolve_delete_from_major(int majndx, int minndx,
1859 const CoinBigIndex *majstrts,
1860 int *majlens, int *minndxs, double *els)
1861 {
1862 const CoinBigIndex ks = majstrts[majndx];
1863 const CoinBigIndex ke = ks + majlens[majndx];
1864
1865 const CoinBigIndex kmi = presolve_find_minor(minndx, ks, ke, minndxs);
1866
1867 minndxs[kmi] = minndxs[ke - 1];
1868 els[kmi] = els[ke - 1];
1869 majlens[majndx]--;
1870
1871 return;
1872 }
1873
1880 inline void presolve_delete_many_from_major(int majndx, char *marked,
1881 const CoinBigIndex *majstrts,
1882 int *majlens, int *minndxs, double *els)
1883 {
1884 const CoinBigIndex ks = majstrts[majndx];
1885 const CoinBigIndex ke = ks + majlens[majndx];
1886 CoinBigIndex put = ks;
1887 for (CoinBigIndex k = ks; k < ke; k++) {
1888 int iMinor = minndxs[k];
1889 if (!marked[iMinor]) {
1890 minndxs[put] = iMinor;
1891 els[put++] = els[k];
1892 } else {
1893 marked[iMinor] = 0;
1894 }
1895 }
1896 majlens[majndx] = static_cast< int >(put - ks);
1897 return;
1898 }
1899
1910 inline void presolve_delete_from_col(int row, int col,
1911 const CoinBigIndex *mcstrt,
1912 int *hincol, int *hrow, double *colels)
1913 {
1914 presolve_delete_from_major(col, row, mcstrt, hincol, hrow, colels);
1915 }
1916
1927 inline void presolve_delete_from_row(int row, int col,
1928 const CoinBigIndex *mrstrt,
1929 int *hinrow, int *hcol, double *rowels)
1930 {
1931 presolve_delete_from_major(row, col, mrstrt, hinrow, hcol, rowels);
1932 }
1933
1944 void presolve_delete_from_major2(int majndx, int minndx,
1945 CoinBigIndex *majstrts, int *majlens,
1946 int *minndxs, CoinBigIndex *majlinks,
1947 CoinBigIndex *free_listp);
1948
1959 inline void presolve_delete_from_col2(int row, int col, CoinBigIndex *mcstrt,
1960 int *hincol, int *hrow,
1961 CoinBigIndex *clinks, CoinBigIndex *free_listp)
1962 {
1963 presolve_delete_from_major2(col, row, mcstrt, hincol, hrow, clinks, free_listp);
1964 }
1965
1967
1973
1985 double *presolve_dupmajor(const double *elems, const int *indices,
1986 int length, CoinBigIndex offset, int tgt = -1);
1987
1989 void coin_init_random_vec(double *work, int n);
1990
1992
1993 #endif
1994
1995 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
1996 */
CoinPrePostsolveMatrix::rowStatusString
const char * rowStatusString(int i) const
Return a print string for status of a row (artificial variable)
CoinPresolveMatrix::rowChanged_
unsigned char * rowChanged_
Row change status information.
Definition: CoinPresolveMatrix.hpp:1237
CoinPresolveMatrix::setColChanged
void setColChanged(int i)
Mark column as changed.
Definition: CoinPresolveMatrix.hpp:1355
CoinPresolveMatrix::statistics
void statistics()
Say we want statistics - also set time.
CoinPrePostsolveMatrix::originalRow_
int * originalRow_
Original row numbers.
Definition: CoinPresolveMatrix.hpp:691
CoinPrePostsolveMatrix::rowIsBasic
bool rowIsBasic(int sequence) const
Check if artificial for this row is basic.
Definition: CoinPresolveMatrix.hpp:359
CoinError
Error Class thrown by an exception.
Definition: CoinError.hpp:42
CoinPresolveMatrix::setPass
void setPass(int pass=0)
Set pass number.
Definition: CoinPresolveMatrix.hpp:1179
CoinPresolveMatrix::colsToDo_
int * colsToDo_
Input list of columns to process.
Definition: CoinPresolveMatrix.hpp:1220
CoinPrePostsolveMatrix::getNumRows
int getNumRows() const
Get current number of rows.
Definition: CoinPresolveMatrix.hpp:498
CoinPrePostsolveMatrix::setMessageHandler
void setMessageHandler(CoinMessageHandler *handler)
Set message handler.
Definition: CoinPresolveMatrix.hpp:595
CoinPrePostsolveMatrix::getNumElems
CoinBigIndex getNumElems() const
Get current number of non-zero coefficients.
Definition: CoinPresolveMatrix.hpp:503
CoinPresolveAction::postsolve
virtual void postsolve(CoinPostsolveMatrix *prob) const =0
Apply the postsolve transformation for this particular presolve action.
CoinPrePostsolveMatrix::presolve_expand_major
bool presolve_expand_major(CoinBigIndex *majstrts, double *majels, int *minndxs, int *majlens, presolvehlink *majlinks, int nmaj, int k)
Make sure a major-dimension vector k has room for one more coefficient.
CoinPresolveMatrix::usefulRowInt_
int * usefulRowInt_
Preallocated scratch work array, 3*nrows_.
Definition: CoinPresolveMatrix.hpp:1283
CoinPrePostsolveMatrix::setReducedCost
void setReducedCost(const double *redCost, int lenParam)
Set reduced costs.
CoinPrePostsolveMatrix::ztolzb_
double ztolzb_
Primal feasibility tolerance.
Definition: CoinPresolveMatrix.hpp:694
presolvehlink::PRESOLVE_REMOVE_LINK
void PRESOLVE_REMOVE_LINK(presolvehlink *link, int i)
unlink vector i
Definition: CoinPresolveMatrix.hpp:821
CoinPresolveMatrix::setFeasibilityTolerance
void setFeasibilityTolerance(double val)
Set feasibility tolerance.
Definition: CoinPresolveMatrix.hpp:1148
CoinPresolveMatrix::~CoinPresolveMatrix
~CoinPresolveMatrix()
Destructor.
CoinPrePostsolveMatrix
Collects all the information about the problem that is needed in both presolve and postsolve...
Definition: CoinPresolveMatrix.hpp:279
CoinPrePostsolveMatrix::originalColumn_
int * originalColumn_
Original column numbers.
Definition: CoinPresolveMatrix.hpp:684
CoinPresolveMatrix::anyInteger_
bool anyInteger_
Flag to say if any variables are integer.
Definition: CoinPresolveMatrix.hpp:1132
CoinPrePostsolveMatrix::getRowStatus
Status getRowStatus(int sequence) const
Get row status.
Definition: CoinPresolveMatrix.hpp:354
CoinPresolveMatrix::sumDown_
double * sumDown_
Work array for sum of finite contributions to row lhs lower bound.
Definition: CoinPresolveMatrix.hpp:1300
CoinPrePostsolveMatrix::nrows0_
int nrows0_
Allocated number of rows.
Definition: CoinPresolveMatrix.hpp:630
CoinPrePostsolveMatrix::setColSolution
void setColSolution(const double *colSol, int lenParam)
Set column solution.
CoinPrePostsolveMatrix::colels_
double * colels_
Coefficients (positional correspondence with hrow_)
Definition: CoinPresolveMatrix.hpp:661
CoinPrePostsolveMatrix::atUpperBound
Definition: CoinPresolveMatrix.hpp:328
CoinPostsolveMatrix::rdone_
char * rdone_
Definition: CoinPresolveMatrix.hpp:1648
CoinPrePostsolveMatrix::messages_
CoinMessage messages_
Standard COIN messages.
Definition: CoinPresolveMatrix.hpp:776
CoinPresolveMatrix::CoinPresolveMatrix
CoinPresolveMatrix(int ncols_alloc, int nrows_alloc, CoinBigIndex nelems_alloc)
`Native&#39; constructor
CoinPrePostsolveMatrix::getColumnStatus
Status getColumnStatus(int sequence) const
Get column (structural variable) status.
Definition: CoinPresolveMatrix.hpp:415
CoinPrePostsolveMatrix::setCost
void setCost(const double *cost, int lenParam)
Set objective coefficients.
CoinPrePostsolveMatrix::getColStarts
const CoinBigIndex * getColStarts() const
Get column start vector for column-major packed matrix.
Definition: CoinPresolveMatrix.hpp:508
CoinPostsolveMatrix::presolve_find_row3
CoinBigIndex presolve_find_row3(int row, CoinBigIndex kcs, int collen, const int *hrow, const CoinBigIndex *clinks)
Find position of a row in a column in a column-major threaded matrix.
Definition: CoinPresolveMatrix.hpp:1842
CoinPrePostsolveMatrix::getStatus
CoinWarmStartBasis * getStatus()
Get status in the form of a CoinWarmStartBasis.
CoinPrePostsolveMatrix::nelems0_
CoinBigIndex nelems0_
Allocated number of coefficients.
Definition: CoinPresolveMatrix.hpp:632
CoinPresolveMatrix::infiniteUp_
int * infiniteUp_
Work array for count of infinite contributions to row lhs upper bound.
Definition: CoinPresolveMatrix.hpp:1294
CoinTime.hpp
CoinPresolveMatrix::usefulColumnDouble_
double * usefulColumnDouble_
Preallocated scratch work array, ncols_.
Definition: CoinPresolveMatrix.hpp:1289
CoinPrePostsolveMatrix::rowstat_
unsigned char * rowstat_
Status of constraints.
Definition: CoinPresolveMatrix.hpp:760
CoinPrePostsolveMatrix::columnIsBasic
bool columnIsBasic(int sequence) const
Check if column (structural variable) is basic.
Definition: CoinPresolveMatrix.hpp:420
CoinPresolveMatrix::initRowsToDo
void initRowsToDo()
Initialise the row ToDo lists.
CoinPrePostsolveMatrix::rup_
double * rup_
Row (constraint) upper bounds.
Definition: CoinPresolveMatrix.hpp:676
CoinPresolveMatrix::unsetRowChanged
void unsetRowChanged(int i)
Mark row as not changed.
Definition: CoinPresolveMatrix.hpp:1451
CoinPresolveMatrix::randomNumber_
double * randomNumber_
Array of random numbers (max row,column)
Definition: CoinPresolveMatrix.hpp:1291
CoinPresolveMatrix::stepRowsToDo
int stepRowsToDo()
Step row ToDo lists.
CoinPresolveMatrix::hcol_
int * hcol_
Column indices (positional correspondence with rowels_)
Definition: CoinPresolveMatrix.hpp:1122
CoinPrePostsolveMatrix::getColLengths
const int * getColLengths() const
Get column length vector for column-major packed matrix.
Definition: CoinPresolveMatrix.hpp:513
CoinPostsolveMatrix::presolve_find_minor3
CoinBigIndex presolve_find_minor3(int tgt, CoinBigIndex ks, int majlen, const int *minndxs, const CoinBigIndex *majlinks)
Find position of a minor index in a major vector in a threaded matrix.
ZTOLDP2
const double ZTOLDP2
Alternate zero tolerance.
Definition: CoinPresolveMatrix.hpp:103
CoinPresolveMatrix::presolveOptions_
int presolveOptions_
Fine control over presolve actions.
Definition: CoinPresolveMatrix.hpp:1263
CoinPrePostsolveMatrix::rcosts_
double * rcosts_
Vector of reduced costs.
Definition: CoinPresolveMatrix.hpp:744
CoinPrePostsolveMatrix::nelems_
CoinBigIndex nelems_
current number of coefficients
Definition: CoinPresolveMatrix.hpp:625
presolvehlink
Links to aid in packed matrix modification.
Definition: CoinPresolveMatrix.hpp:809
CoinPresolveMatrix::initializeStuff
void initializeStuff()
Allocate scratch arrays.
CoinPresolveMatrix::nextColsToDo_
int * nextColsToDo_
Output list of columns to process next.
Definition: CoinPresolveMatrix.hpp:1224
CoinPrePostsolveMatrix::ncols0_
int ncols0_
Allocated number of columns.
Definition: CoinPresolveMatrix.hpp:628
CoinPresolveMatrix::rowsToDo_
int * rowsToDo_
Input list of rows to process.
Definition: CoinPresolveMatrix.hpp:1239
CoinPresolveMatrix::recomputeSums
int recomputeSums(int whichRow)
Recompute row lhs bounds.
CoinPresolveAction
Abstract base class of all presolve routines.
Definition: CoinPresolveMatrix.hpp:163
CoinPrePostsolveMatrix::maxmin_
double maxmin_
Maximization/minimization.
Definition: CoinPresolveMatrix.hpp:703
CoinPrePostsolveMatrix::bulkRatio_
double bulkRatio_
Ratio of bulk0_ to nelems0_; default is 2.
Definition: CoinPresolveMatrix.hpp:643
CoinPresolveAction::throwCoinError
static void throwCoinError(const char *error, const char *ps_routine)
Stub routine to throw exceptions.
Definition: CoinPresolveMatrix.hpp:171
CoinPrePostsolveMatrix::presolve_delete_from_col
void presolve_delete_from_col(int row, int col, const CoinBigIndex *mcstrt, int *hincol, int *hrow, double *colels)
Delete the entry for row row from column col in a column-major matrix.
Definition: CoinPresolveMatrix.hpp:1910
CoinPostsolveMatrix::presolve_find_minor2
CoinBigIndex presolve_find_minor2(int tgt, CoinBigIndex ks, int majlen, const int *minndxs, const CoinBigIndex *majlinks)
Find position of a minor index in a major vector in a threaded matrix.
CoinPrePostsolveMatrix::countEmptyCols
int countEmptyCols()
Count empty columns.
Definition: CoinPresolveMatrix.hpp:573
CoinPresolveMatrix::numberNextColsToDo_
int numberNextColsToDo_
Length of nextColsToDo_.
Definition: CoinPresolveMatrix.hpp:1226
CoinPresolveMatrix::anyInteger
bool anyInteger() const
Check if there are any integer variables.
Definition: CoinPresolveMatrix.hpp:1063
CoinPresolveMatrix::status
int status()
Returns problem status (0 = feasible, 1 = infeasible, 2 = unbounded)
Definition: CoinPresolveMatrix.hpp:1160
CoinPresolveMatrix::unsetColUsed
void unsetColUsed(int i)
Mark column as unused.
Definition: CoinPresolveMatrix.hpp:1405
CoinPostsolveMatrix::cdone_
char * cdone_
Definition: CoinPresolveMatrix.hpp:1647
CoinPresolveMatrix::setStatus
void setStatus(int status)
Set problem status.
Definition: CoinPresolveMatrix.hpp:1165
CoinPrePostsolveMatrix::columnStatusString
const char * columnStatusString(int j) const
Return a print string for status of a column (structural variable)
CoinPrePostsolveMatrix::setDualTolerance
void setDualTolerance(double dualTol)
Set the dual feasibility tolerance.
CoinPrePostsolveMatrix::setObjSense
void setObjSense(double objSense)
Set the objective sense (max/min)
CoinWarmStartBasis
The default COIN simplex (basis-oriented) warm start class.
Definition: CoinWarmStartBasis.hpp:40
CoinPresolveMatrix::numberColsToDo_
int numberColsToDo_
Length of colsToDo_.
Definition: CoinPresolveMatrix.hpp:1222
CoinPrePostsolveMatrix::statusName
const char * statusName(CoinPrePostsolveMatrix::Status status)
Generate a print string for a status code.
CoinPrePostsolveMatrix::presolve_find_minor
CoinBigIndex presolve_find_minor(int tgt, CoinBigIndex ks, CoinBigIndex ke, const int *minndxs)
Find position of a minor index in a major vector.
Definition: CoinPresolveMatrix.hpp:1714
CoinPresolveMatrix::numberColsToDo
int numberColsToDo()
Return the number of columns on the colsToDo_ list.
Definition: CoinPresolveMatrix.hpp:1339
CoinPresolveMatrix::setPresolveOptions
void setPresolveOptions(int value)
Sets any special options (see presolveOptions_)
Definition: CoinPresolveMatrix.hpp:1073
CoinPrePostsolveMatrix::Status
Status
Enum for status of various sorts.
Definition: CoinPresolveMatrix.hpp:325
CoinPrePostsolveMatrix::superBasic
Definition: CoinPresolveMatrix.hpp:330
CoinMessageHandler
Base class for message handling.
Definition: CoinMessageHandler.hpp:345
CoinPrePostsolveMatrix::cost_
double * cost_
Objective coefficients.
Definition: CoinPresolveMatrix.hpp:664
CoinPrePostsolveMatrix::presolve_delete_from_major
void presolve_delete_from_major(int majndx, int minndx, const CoinBigIndex *majstrts, int *majlens, int *minndxs, double *els)
Delete the entry for a minor index from a major vector.
Definition: CoinPresolveMatrix.hpp:1858
CoinFinite.hpp
CoinPresolveMatrix::rowProhibited2
bool rowProhibited2(int i) const
Test if row is eligible for preprocessing.
Definition: CoinPresolveMatrix.hpp:1479
CoinPrePostsolveMatrix::~CoinPrePostsolveMatrix
~CoinPrePostsolveMatrix()
Destructor.
CoinPresolveMatrix::anyProhibited_
bool anyProhibited_
Flag to say if any rows or columns are marked as prohibited.
Definition: CoinPresolveMatrix.hpp:1269
OsiSolverInterface
Abstract Base Class for describing an interface to a solver.
Definition: OsiSolverInterface.hpp:61
CoinPresolveMatrix::startTime_
double startTime_
Start time of presolve.
Definition: CoinPresolveMatrix.hpp:1138
presolve_dupmajor
double * presolve_dupmajor(const double *elems, const int *indices, int length, CoinBigIndex offset, int tgt=-1)
Duplicate a major-dimension vector; optionally omit the entry with minor index tgt.
CoinPresolveMatrix::setVariableType
void setVariableType(int i, int variableType)
Set variable type information for a single variable.
Definition: CoinPresolveMatrix.hpp:995
presolvehlink::PRESOLVE_MOVE_LINK
void PRESOLVE_MOVE_LINK(presolvehlink *link, int i, int j)
relink vector j in place of vector i
Definition: CoinPresolveMatrix.hpp:861
CoinMessage
The standard set of Coin messages.
Definition: CoinMessage.hpp:78
CoinPrePostsolveMatrix::presolve_find_minor1
CoinBigIndex presolve_find_minor1(int tgt, CoinBigIndex ks, CoinBigIndex ke, const int *minndxs)
Find position of a minor index in a major vector.
CoinPrePostsolveMatrix::isFree
Definition: CoinPresolveMatrix.hpp:326
CoinPresolveAction::setNext
void setNext(const CoinPresolveAction *nextAction)
modify next (when building rather than passing)
Definition: CoinPresolveMatrix.hpp:192
CoinPostsolveMatrix::assignPresolveToPostsolve
void assignPresolveToPostsolve(CoinPresolveMatrix *&preObj)
Load an empty CoinPostsolveMatrix from a CoinPresolveMatrix.
CoinPresolveMatrix::addCol
void addCol(int i)
Mark column as changed and add to list of columns to process next.
Definition: CoinPresolveMatrix.hpp:1360
CoinPrePostsolveMatrix::setRowStatus
void setRowStatus(int sequence, Status status)
Set row status (i.e., status of artificial for this row)
Definition: CoinPresolveMatrix.hpp:347
CoinPresolveMatrix::integerType_
unsigned char * integerType_
Tracks integrality of columns (1 for integer, 0 for continuous)
Definition: CoinPresolveMatrix.hpp:1126
coin_init_random_vec
void coin_init_random_vec(double *work, int n)
Initialize a vector with random numbers.
CoinPrePostsolveMatrix::setStructuralStatus
void setStructuralStatus(const char *strucStatus, int lenParam)
Set column (structural variable) status vector.
CoinPrePostsolveMatrix::setColumnStatusUsingValue
void setColumnStatusUsingValue(int iColumn)
Set status of column (structural variable) to the correct nonbasic status given bounds and current va...
CoinPrePostsolveMatrix::nrows_
int nrows_
current number of rows
Definition: CoinPresolveMatrix.hpp:623
CoinPrePostsolveMatrix::getCost
const double * getCost() const
Get objective coefficients.
Definition: CoinPresolveMatrix.hpp:538
CoinPrePostsolveMatrix::getElementsByCol
const double * getElementsByCol() const
Get vector of elements for column-major packed matrix.
Definition: CoinPresolveMatrix.hpp:523
CoinPresolveAction::~CoinPresolveAction
virtual ~CoinPresolveAction()
Virtual destructor.
Definition: CoinPresolveMatrix.hpp:209
CoinPresolveMatrix::setAnyInteger
void setAnyInteger(bool anyInteger=true)
Set a flag for presence (true) or absence (false) of integer variables.
Definition: CoinPresolveMatrix.hpp:1017
CoinPresolveMatrix::rowChanged
bool rowChanged(int i) const
Has row been changed?
Definition: CoinPresolveMatrix.hpp:1446
CoinPresolveMatrix::isInteger
bool isInteger(int i) const
Check for integrality of the specified variable.
Definition: CoinPresolveMatrix.hpp:1048
ClpSimplex
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:106
CoinPostsolveMatrix::CoinPostsolveMatrix
CoinPostsolveMatrix(int ncols_alloc, int nrows_alloc, CoinBigIndex nelems_alloc)
`Native&#39; constructor
CoinPresolveMatrix::usefulRowDouble_
double * usefulRowDouble_
Preallocated scratch work array, 2*nrows_.
Definition: CoinPresolveMatrix.hpp:1285
CoinPresolveMatrix::stepColsToDo
int stepColsToDo()
Step column ToDo lists.
CoinPrePostsolveMatrix::cup_
double * cup_
Column (primal variable) upper bounds.
Definition: CoinPresolveMatrix.hpp:671
CoinPresolveMatrix::mrstrt_
CoinBigIndex * mrstrt_
Vector of row start positions in #hcol, rowels_.
Definition: CoinPresolveMatrix.hpp:1116
CoinPrePostsolveMatrix::setColumnStatus
void setColumnStatus(int sequence, Status status)
Set column status (i.e., status of primal variable)
Definition: CoinPresolveMatrix.hpp:364
CoinPresolveMatrix::status_
int status_
Output status: 0 = feasible, 1 = infeasible, 2 = unbounded.
Definition: CoinPresolveMatrix.hpp:1158
CoinPresolveMatrix::setAnyProhibited
void setAnyProhibited(bool val=true)
Set a flag for presence of prohibited rows or columns.
Definition: CoinPresolveMatrix.hpp:1517
CoinPrePostsolveMatrix::hincol_
int * hincol_
Vector of column lengths.
Definition: CoinPresolveMatrix.hpp:657
CoinPresolveMatrix::rowUsed
bool rowUsed(int i) const
Test if row is marked as used.
Definition: CoinPresolveMatrix.hpp:1496
CoinPragma.hpp
CoinPostsolveMatrix::maxlink_
CoinBigIndex maxlink_
Allocated size of link_.
Definition: CoinPresolveMatrix.hpp:1631
CoinPrePostsolveMatrix::acts_
double * acts_
Vector of constraint left-hand-side values (row activity)
Definition: CoinPresolveMatrix.hpp:738
CoinPrePostsolveMatrix::hrow_
int * hrow_
Row indices (positional correspondence with colels_)
Definition: CoinPresolveMatrix.hpp:659
CoinPresolveAction::CoinPresolveAction
CoinPresolveAction(const CoinPresolveAction *next)
Construct a postsolve object and add it to the transformation list.
Definition: CoinPresolveMatrix.hpp:187
CoinPresolveMatrix::update_model
void update_model(ClpSimplex *si, int nrows0, int ncols0, CoinBigIndex nelems0)
Update the model held by a Clp OSI.
CoinPostsolveMatrix::presolve_delete_from_major2
void presolve_delete_from_major2(int majndx, int minndx, CoinBigIndex *majstrts, int *majlens, int *minndxs, CoinBigIndex *majlinks, CoinBigIndex *free_listp)
Delete the entry for a minor index from a major vector in a threaded matrix.
CoinPrePostsolveMatrix::presolve_delete_many_from_major
void presolve_delete_many_from_major(int majndx, char *marked, const CoinBigIndex *majstrts, int *majlens, int *minndxs, double *els)
Delete marked entries.
Definition: CoinPresolveMatrix.hpp:1880
CoinPresolveMatrix::anyProhibited
bool anyProhibited() const
Check if there are any prohibited rows or columns.
Definition: CoinPresolveMatrix.hpp:1512
CoinPresolveMatrix::numberNextRowsToDo_
int numberNextRowsToDo_
Length of nextRowsToDo_.
Definition: CoinPresolveMatrix.hpp:1245
CoinPresolveMatrix::setColProhibited
void setColProhibited(int i)
Mark column as ineligible for preprocessing.
Definition: CoinPresolveMatrix.hpp:1386
CoinPrePostsolveMatrix::setArtificialStatus
void setArtificialStatus(const char *artifStatus, int lenParam)
Set row (artificial variable) status vector.
CoinPrePostsolveMatrix::ztoldj_
double ztoldj_
Dual feasibility tolerance.
Definition: CoinPresolveMatrix.hpp:696
CoinPresolveMatrix::initColsToDo
void initColsToDo()
Initialise the column ToDo lists.
ZTOLDP
const double ZTOLDP
Zero tolerance.
Definition: CoinPresolveMatrix.hpp:98
CoinPrePostsolveMatrix::presolve_find_row
CoinBigIndex presolve_find_row(int row, CoinBigIndex kcs, CoinBigIndex kce, const int *hrow)
Find position of a row in a column in a column-major matrix.
Definition: CoinPresolveMatrix.hpp:1744
CoinPresolveAction::next
const CoinPresolveAction * next
The next presolve transformation.
Definition: CoinPresolveMatrix.hpp:180
CoinPresolveMatrix::rowProhibited
bool rowProhibited(int i) const
Test if row is eligible for preprocessing.
Definition: CoinPresolveMatrix.hpp:1469
CoinPrePostsolveMatrix::getColSolution
const double * getColSolution() const
Get column solution (primal variable values)
Definition: CoinPresolveMatrix.hpp:553
CoinPrePostsolveMatrix::presolve_delete_from_row
void presolve_delete_from_row(int row, int col, const CoinBigIndex *mrstrt, int *hinrow, int *hcol, double *rowels)
Delete the entry for column col from row row in a row-major matrix.
Definition: CoinPresolveMatrix.hpp:1927
CoinPrePostsolveMatrix::getRowPrice
const double * getRowPrice() const
Get row solution (dual variables)
Definition: CoinPresolveMatrix.hpp:563
CoinPostsolveMatrix
Augments CoinPrePostsolveMatrix with information about the problem that is only needed during postsol...
Definition: CoinPresolveMatrix.hpp:1552
CoinPresolveMatrix::assignPresolveToPostsolve
friend void assignPresolveToPostsolve(CoinPresolveMatrix *&preObj)
Initialize a CoinPostsolveMatrix object, destroying the CoinPresolveMatrix object.
CoinPresolveMatrix::setRowProhibited
void setRowProhibited(int i)
Mark row as ineligible for preprocessing.
Definition: CoinPresolveMatrix.hpp:1487
CoinPrePostsolveMatrix::bulk0_
CoinBigIndex bulk0_
Allocated size of bulk storage for row indices and coefficients.
Definition: CoinPresolveMatrix.hpp:641
CoinPresolveMatrix::setMaximumSubstitutionLevel
void setMaximumSubstitutionLevel(int level)
Set Maximum substitution level (normally 3)
Definition: CoinPresolveMatrix.hpp:1190
CoinPostsolveMatrix::~CoinPostsolveMatrix
~CoinPostsolveMatrix()
Destructor.
CoinPresolveMatrix::unsetColInfinite
void unsetColInfinite(int i)
Mark column as not infinite ub (originally)
Definition: CoinPresolveMatrix.hpp:1415
CoinPrePostsolveMatrix::atLowerBound
Definition: CoinPresolveMatrix.hpp:329
CoinPrePostsolveMatrix::getRowUpper
const double * getRowUpper() const
Get row upper bounds.
Definition: CoinPresolveMatrix.hpp:548
CoinPresolveMatrix::colChanged_
unsigned char * colChanged_
Column change status information.
Definition: CoinPresolveMatrix.hpp:1218
CoinPresolveMatrix::colUsed
bool colUsed(int i) const
Test if column is marked as used.
Definition: CoinPresolveMatrix.hpp:1395
CoinPrePostsolveMatrix::setRowUpper
void setRowUpper(const double *rowUpper, int lenParam)
Set row upper bounds.
CoinPrePostsolveMatrix::getRowActivity
const double * getRowActivity() const
Get row activity (constraint lhs values)
Definition: CoinPresolveMatrix.hpp:558
CoinPrePostsolveMatrix::setRowLower
void setRowLower(const double *rowLower, int lenParam)
Set row lower bounds.
CoinPrePostsolveMatrix::defaultHandler_
bool defaultHandler_
Indicates if the current handler_ is default (true) or not (false).
Definition: CoinPresolveMatrix.hpp:774
CoinPrePostsolveMatrix::basic
Definition: CoinPresolveMatrix.hpp:327
CoinPackedMatrix
Sparse Matrix Base Class.
Definition: CoinPackedMatrix.hpp:79
CoinPresolveMatrix::setRowChanged
void setRowChanged(int i)
Mark row as changed.
Definition: CoinPresolveMatrix.hpp:1456
CoinPresolveMatrix::change_bias
void change_bias(double change_amount)
Adjust objective function constant offset.
Definition: CoinPresolveMatrix.hpp:1096
CoinPrePostsolveMatrix::originalOffset_
double originalOffset_
Original objective offset.
Definition: CoinPresolveMatrix.hpp:666
CoinPresolveMatrix::countEmptyRows
int countEmptyRows()
Count number of empty rows.
Definition: CoinPresolveMatrix.hpp:981
CoinPresolveMatrix::setMatrix
void setMatrix(const CoinPackedMatrix *mtx)
Load the cofficient matrix.
CoinPresolveMatrix
Augments CoinPrePostsolveMatrix with information about the problem that is only needed during presolv...
Definition: CoinPresolveMatrix.hpp:905
CoinPresolveMatrix::getRowStarts
const CoinBigIndex * getRowStarts() const
Get row start vector for row-major packed matrix.
Definition: CoinPresolveMatrix.hpp:1028
CoinPresolveMatrix::hinrow_
int * hinrow_
Vector of row lengths.
Definition: CoinPresolveMatrix.hpp:1118
CoinPresolveMatrix::clink_
presolvehlink * clink_
Linked list for the column-major representation.
Definition: CoinPresolveMatrix.hpp:1087
CoinPresolveMatrix::setColInfinite
void setColInfinite(int i)
Mark column as infinite ub (originally)
Definition: CoinPresolveMatrix.hpp:1420
CoinPresolveMatrix::nextRowsToDo_
int * nextRowsToDo_
Output list of rows to process next.
Definition: CoinPresolveMatrix.hpp:1243
CoinPresolveMatrix::numberRowsToDo_
int numberRowsToDo_
Length of rowsToDo_.
Definition: CoinPresolveMatrix.hpp:1241
CoinPrePostsolveMatrix::getColLower
const double * getColLower() const
Get column lower bounds.
Definition: CoinPresolveMatrix.hpp:528
CoinPresolveMatrix::sumUp_
double * sumUp_
Work array for sum of finite contributions to row lhs upper bound.
Definition: CoinPresolveMatrix.hpp:1296
CoinPrePostsolveMatrix::ncols_
int ncols_
current number of columns
Definition: CoinPresolveMatrix.hpp:621
CoinPresolveMatrix::addRow
void addRow(int i)
Mark row as changed and add to list of rows to process next.
Definition: CoinPresolveMatrix.hpp:1461
CoinPrePostsolveMatrix::setStatus
void setStatus(const CoinWarmStartBasis *basis)
Set the status of all variables from a basis.
CoinPresolveMatrix::dobias_
double dobias_
Objective function offset introduced during presolve.
Definition: CoinPresolveMatrix.hpp:1093
CoinPostsolveMatrix::presolve_delete_from_col2
void presolve_delete_from_col2(int row, int col, CoinBigIndex *mcstrt, int *hincol, int *hrow, CoinBigIndex *clinks, CoinBigIndex *free_listp)
Delete the entry for row row from column col in a column-major threaded matrix.
Definition: CoinPresolveMatrix.hpp:1959
CoinBigIndex
int CoinBigIndex
Definition: Coin_C_defines.h:136
presolvehlink::PRESOLVE_INSERT_LINK
void PRESOLVE_INSERT_LINK(presolvehlink *link, int i, int j)
insert vector i after vector j
Definition: CoinPresolveMatrix.hpp:839
CoinPrePostsolveMatrix::messages
CoinMessages messages() const
Return messages.
Definition: CoinPresolveMatrix.hpp:604
CoinPresolveMatrix::rowels_
double * rowels_
Coefficients (positional correspondence with hcol_)
Definition: CoinPresolveMatrix.hpp:1120
CoinPresolveMatrix::tuning_
bool tuning_
Print statistics for tuning.
Definition: CoinPresolveMatrix.hpp:1134
PRESOLVE_INF
#define PRESOLVE_INF
The usual finite infinity.
Definition: CoinPresolveMatrix.hpp:106
CoinPresolveMatrix::infiniteDown_
int * infiniteDown_
Work array for count of infinite contributions to row lhs lower bound.
Definition: CoinPresolveMatrix.hpp:1298
CoinPresolveMatrix::numberRowsToDo
int numberRowsToDo()
Return the number of rows on the rowsToDo_ list.
Definition: CoinPresolveMatrix.hpp:1440
CoinPresolveMatrix::colInfinite
bool colInfinite(int i) const
Has column infinite ub (originally)
Definition: CoinPresolveMatrix.hpp:1410
CoinPrePostsolveMatrix::setPrimalTolerance
void setPrimalTolerance(double primTol)
Set the primal feasibility tolerance.
CoinPresolveMatrix::usefulColumnInt_
int * usefulColumnInt_
Preallocated scratch work array, 2*ncols_.
Definition: CoinPresolveMatrix.hpp:1287
CoinPresolveMatrix::feasibilityTolerance
double feasibilityTolerance()
Return feasibility tolerance.
Definition: CoinPresolveMatrix.hpp:1143
CoinPostsolveMatrix::free_list_
CoinBigIndex free_list_
First entry in free entries thread.
Definition: CoinPresolveMatrix.hpp:1629
CoinPresolveMatrix::getElementsByRow
const double * getElementsByRow() const
Get vector of elements for row-major packed matrix.
Definition: CoinPresolveMatrix.hpp:1038
CoinPostsolveMatrix::check_nbasic
void check_nbasic()
debug
CoinPresolveMatrix::colChanged
bool colChanged(int i) const
Has column been changed?
Definition: CoinPresolveMatrix.hpp:1345
CoinPrePostsolveMatrix::getRowLower
const double * getRowLower() const
Get row lower bounds.
Definition: CoinPresolveMatrix.hpp:543
CoinPrePostsolveMatrix::clo_
double * clo_
Column (primal variable) lower bounds.
Definition: CoinPresolveMatrix.hpp:669
CoinPrePostsolveMatrix::getReducedCost
const double * getReducedCost() const
Get reduced costs.
Definition: CoinPresolveMatrix.hpp:568
CoinPresolveMatrix::deleteStuff
void deleteStuff()
Free scratch arrays.
CoinPresolveMatrix::feasibilityTolerance_
double feasibilityTolerance_
Bounds can be moved by this to retain feasibility.
Definition: CoinPresolveMatrix.hpp:1141
CoinPresolveMatrix::unsetColChanged
void unsetColChanged(int i)
Mark column as not changed.
Definition: CoinPresolveMatrix.hpp:1350
CoinMessage.hpp
This file contains the enum for the standard set of Coin messages and a class definition whose sole p...
CoinPresolveMatrix::rlink_
presolvehlink * rlink_
Linked list for the row-major representation.
Definition: CoinPresolveMatrix.hpp:1089
CoinPrePostsolveMatrix::setColUpper
void setColUpper(const double *colUpper, int lenParam)
Set column upper bounds.
CoinPrePostsolveMatrix::presolve_make_memlists
void presolve_make_memlists(int *lengths, presolvehlink *link, int n)
Initialise linked list for major vector order in bulk storage.
CoinPrePostsolveMatrix::setRowPrice
void setRowPrice(const double *rowSol, int lenParam)
Set row solution.
CoinPrePostsolveMatrix::presolve_find_row1
CoinBigIndex presolve_find_row1(int row, CoinBigIndex kcs, CoinBigIndex kce, const int *hrow)
Find position of a row in a column in a column-major matrix.
Definition: CoinPresolveMatrix.hpp:1779
CoinPrePostsolveMatrix::getNumCols
int getNumCols() const
Get current number of columns.
Definition: CoinPresolveMatrix.hpp:493
presolvehlink::pre
int pre
Definition: CoinPresolveMatrix.hpp:811
CoinPrePostsolveMatrix::setColLower
void setColLower(const double *colLower, int lenParam)
Set column lower bounds.
CoinPresolveMatrix::colProhibited2
bool colProhibited2(int i) const
Test if column is eligible for preprocessing.
Definition: CoinPresolveMatrix.hpp:1378
presolvehlink::suc
int suc
Definition: CoinPresolveMatrix.hpp:811
CoinPrePostsolveMatrix::presolve_find_col1
CoinBigIndex presolve_find_col1(int col, CoinBigIndex krs, CoinBigIndex kre, const int *hcol)
Find position of a column in a row in a row-major matrix.
Definition: CoinPresolveMatrix.hpp:1791
CoinPrePostsolveMatrix::colstat_
unsigned char * colstat_
Status of primal variables.
Definition: CoinPresolveMatrix.hpp:752
CoinPrePostsolveMatrix::getRowIndicesByCol
const int * getRowIndicesByCol() const
Get vector of row indices for column-major packed matrix.
Definition: CoinPresolveMatrix.hpp:518
CoinPrePostsolveMatrix::sol_
double * sol_
Vector of primal variable values.
Definition: CoinPresolveMatrix.hpp:726
CoinPrePostsolveMatrix::rowduals_
double * rowduals_
Vector of dual variable values.
Definition: CoinPresolveMatrix.hpp:732
CoinPostsolveMatrix::link_
CoinBigIndex * link_
Thread array.
Definition: CoinPresolveMatrix.hpp:1636
NO_LINK
#define NO_LINK
Definition: CoinPresolveMatrix.hpp:814
CoinPresolveMatrix::setColUsed
void setColUsed(int i)
Mark column as used.
Definition: CoinPresolveMatrix.hpp:1400
CoinPresolveAction::name
virtual const char * name() const =0
A name for debug printing.
CoinPostsolveMatrix::presolve_find_row2
CoinBigIndex presolve_find_row2(int row, CoinBigIndex kcs, int collen, const int *hrow, const CoinBigIndex *clinks)
Find position of a row in a column in a column-major threaded matrix.
Definition: CoinPresolveMatrix.hpp:1816
CoinPrePostsolveMatrix::handler_
CoinMessageHandler * handler_
Message handler.
Definition: CoinPresolveMatrix.hpp:772
CoinPrePostsolveMatrix::setObjOffset
void setObjOffset(double offset)
Set the objective function offset for the original system.
CoinPostsolveMatrix::presolve_find_col
CoinBigIndex presolve_find_col(int col, CoinBigIndex krs, CoinBigIndex kre, const int *hcol)
Find position of a column in a row in a row-major matrix.
Definition: CoinPresolveMatrix.hpp:1756
CoinPrePostsolveMatrix::setRowActivity
void setRowActivity(const double *rowAct, int lenParam)
Set row activity.
DIE
void DIE(const char *)
Definition: CoinPresolveMatrix.hpp:79
CoinPrePostsolveMatrix::setRowStatusUsingValue
void setRowStatusUsingValue(int iRow)
Set status of row (artificial variable) to the correct nonbasic status given bounds and current value...
CoinPresolveMatrix::setRowUsed
void setRowUsed(int i)
Mark row as used.
Definition: CoinPresolveMatrix.hpp:1501
CoinPrePostsolveMatrix::CoinPrePostsolveMatrix
CoinPrePostsolveMatrix(int ncols_alloc, int nrows_alloc, CoinBigIndex nelems_alloc)
`Native&#39; constructor
CoinPrePostsolveMatrix::presolve_expand_row
bool presolve_expand_row(CoinBigIndex *mrstrt, double *rowels, int *hcol, int *hinrow, presolvehlink *rlink, int nrows, int rowx)
Make sure a row (rowx) in a row-major matrix has room for one more coefficient.
Definition: CoinPresolveMatrix.hpp:1698
CoinPresolveMatrix::pass_
int pass_
Presolve pass number.
Definition: CoinPresolveMatrix.hpp:1177
CoinPresolveMatrix::getColIndicesByRow
const int * getColIndicesByRow() const
Get vector of column indices for row-major packed matrix.
Definition: CoinPresolveMatrix.hpp:1033
CoinMessages
Class to hold and manipulate an array of massaged messages.
Definition: CoinMessageHandler.hpp:140
CoinPackedMatrix.hpp
CoinPresolveMatrix::maxSubstLevel_
int maxSubstLevel_
Maximum substitution level.
Definition: CoinPresolveMatrix.hpp:1188
CoinPrePostsolveMatrix::messageHandler
CoinMessageHandler * messageHandler() const
Return message handler.
Definition: CoinPresolveMatrix.hpp:586
CoinPrePostsolveMatrix::mcstrt_
CoinBigIndex * mcstrt_
Vector of column start positions in hrow_, colels_.
Definition: CoinPresolveMatrix.hpp:655
PRESOLVE_STMT
#define PRESOLVE_STMT(s)
Definition: CoinPresolveMatrix.hpp:75
CoinPresolveMatrix::unsetRowUsed
void unsetRowUsed(int i)
Mark row as unused.
Definition: CoinPresolveMatrix.hpp:1506
CoinPrePostsolveMatrix::getColUpper
const double * getColUpper() const
Get column upper bounds.
Definition: CoinPresolveMatrix.hpp:533
CoinPrePostsolveMatrix::rlo_
double * rlo_
Row (constraint) lower bounds.
Definition: CoinPresolveMatrix.hpp:674
CoinPresolveMatrix::colProhibited
bool colProhibited(int i) const
Test if column is eligible for preprocessing.
Definition: CoinPresolveMatrix.hpp:1368
CoinPrePostsolveMatrix::presolve_expand_col
bool presolve_expand_col(CoinBigIndex *mcstrt, double *colels, int *hrow, int *hincol, presolvehlink *clink, int ncols, int colx)
Make sure a column (colx) in a column-major matrix has room for one more coefficient.
Definition: CoinPresolveMatrix.hpp:1685
CoinPresolveMatrix::presolveOptions
int presolveOptions() const
Picks up any special options.
Definition: CoinPresolveMatrix.hpp:1068