Cgl 0.59.7

- 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 1761 2014-12-10 09:43:07Z forrest $ */
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 #if PRESOLVE_DEBUG > 0
21 #include "CoinFinite.hpp"
22 #endif
23
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 " \
51 << __LINE__ << ": " #x "\n"), abort(), 0))
52
53 inline void DIE(const char *s) { std::cout << s ; abort() ; }
54
65 #define PRESENT_IN_REDUCED '\377'
66
67 #else
68
69 #define PRESOLVEASSERT(x) {}
70 #define PRESOLVE_STMT(s) {}
71
72 inline void DIE(const char *) {}
73
74 #endif
75
76 /*
77 Unclear why these are separate from standard debug.
78 */
79 #ifndef PRESOLVE_DETAIL
80 #define PRESOLVE_DETAIL_PRINT(s) {}
81 #else
82 #define PRESOLVE_DETAIL_PRINT(s) s
83 #endif
84
89 const double ZTOLDP = 1e-12 ;
94 const double ZTOLDP2 = 1e-10 ;
95
97 #define PRESOLVE_INF COIN_DBL_MAX
98 #define PRESOLVE_SMALL_INF 1.0e20
100 #define PRESOLVEFINITE(n) (-PRESOLVE_INF < (n) && (n) < PRESOLVE_INF)
102
103
104 class CoinPostsolveMatrix ;
105
155 class CoinPresolveAction
156 {
157 public:
164 static void throwCoinError(const char *error, const char *ps_routine)
165 { throw CoinError(error, ps_routine, "CoinPresolve"); }
166
171 const CoinPresolveAction *next;
172
178 CoinPresolveAction(const CoinPresolveAction *next) : next(next) {}
180 inline void setNext(const CoinPresolveAction *nextAction)
181 { next = nextAction;}
182
187 virtual const char *name() const = 0;
188
192 virtual void postsolve(CoinPostsolveMatrix *prob) const = 0;
193
195 virtual ~CoinPresolveAction() {}
196 };
197
198 /*
199 These are needed for OSI-aware constructors associated with
200 CoinPrePostsolveMatrix, CoinPresolveMatrix, and CoinPostsolveMatrix.
201 */
202 class ClpSimplex;
203 class OsiSolverInterface;
204
205 /*
206 CoinWarmStartBasis is required for methods in CoinPrePostsolveMatrix
207 that accept/return a CoinWarmStartBasis object.
208 */
209 class CoinWarmStartBasis ;
210
265 class CoinPrePostsolveMatrix
266 {
267 public:
268
278 CoinPrePostsolveMatrix(int ncols_alloc, int nrows_alloc,
279 CoinBigIndex nelems_alloc) ;
280
285 CoinPrePostsolveMatrix(const OsiSolverInterface * si,
286 int ncols_,
287 int nrows_,
288 CoinBigIndex nelems_);
289
294 CoinPrePostsolveMatrix(const ClpSimplex * si,
295 int ncols_,
296 int nrows_,
297 CoinBigIndex nelems_,
298 double bulkRatio);
299
301 ~CoinPrePostsolveMatrix();
303
313 enum Status {
314 isFree = 0x00,
315 basic = 0x01,
316 atUpperBound = 0x02,
317 atLowerBound = 0x03,
318 superBasic = 0x04
319 };
320
333
335 inline void setRowStatus(int sequence, Status status)
336 {
337 unsigned char & st_byte = rowstat_[sequence];
338 st_byte = static_cast<unsigned char>(st_byte & (~7)) ;
339 st_byte = static_cast<unsigned char>(st_byte | status) ;
340 }
342 inline Status getRowStatus(int sequence) const
343 {return static_cast<Status> (rowstat_[sequence]&7);}
345 inline bool rowIsBasic(int sequence) const
346 {return (static_cast<Status> (rowstat_[sequence]&7)==basic);}
348 inline void setColumnStatus(int sequence, Status status)
349 {
350 unsigned char & st_byte = colstat_[sequence];
351 st_byte = static_cast<unsigned char>(st_byte & (~7)) ;
352 st_byte = static_cast<unsigned char>(st_byte | status) ;
353
354 # ifdef PRESOLVE_DEBUG
355 switch (status)
356 { case isFree:
357 { if (clo_[sequence] > -PRESOLVE_INF || cup_[sequence] < PRESOLVE_INF)
358 { std::cout << "Bad status: Var " << sequence
359 << " isFree, lb = " << clo_[sequence]
360 << ", ub = " << cup_[sequence] << std::endl ; }
361 break ; }
362 case basic:
363 { break ; }
364 case atUpperBound:
365 { if (cup_[sequence] >= PRESOLVE_INF)
366 { std::cout << "Bad status: Var " << sequence
367 << " atUpperBound, lb = " << clo_[sequence]
368 << ", ub = " << cup_[sequence] << std::endl ; }
369 break ; }
370 case atLowerBound:
371 { if (clo_[sequence] <= -PRESOLVE_INF)
372 { std::cout << "Bad status: Var " << sequence
373 << " atLowerBound, lb = " << clo_[sequence]
374 << ", ub = " << cup_[sequence] << std::endl ; }
375 break ; }
376 case superBasic:
377 { if (clo_[sequence] <= -PRESOLVE_INF && cup_[sequence] >= PRESOLVE_INF)
378 { std::cout << "Bad status: Var " << sequence
379 << " superBasic, lb = " << clo_[sequence]
380 << ", ub = " << cup_[sequence] << std::endl ; }
381 break ; }
382 default:
383 { assert(false) ;
384 break ; } }
385 # endif
386 }
388 inline Status getColumnStatus(int sequence) const
389 {return static_cast<Status> (colstat_[sequence]&7);}
391 inline bool columnIsBasic(int sequence) const
392 {return (static_cast<Status> (colstat_[sequence]&7)==basic);}
396 void setRowStatusUsingValue(int iRow);
400 void setColumnStatusUsingValue(int iColumn);
402 void setStructuralStatus(const char *strucStatus, int lenParam) ;
404 void setArtificialStatus(const char *artifStatus, int lenParam) ;
406 void setStatus(const CoinWarmStartBasis *basis) ;
408 CoinWarmStartBasis *getStatus() ;
412 const char *columnStatusString(int j) const ;
416 const char *rowStatusString(int i) const ;
418
426 void setObjOffset(double offset) ;
434 void setObjSense(double objSense) ;
436 void setPrimalTolerance(double primTol) ;
438 void setDualTolerance(double dualTol) ;
440 void setColLower(const double *colLower, int lenParam) ;
442 void setColUpper(const double *colUpper, int lenParam) ;
444 void setColSolution(const double *colSol, int lenParam) ;
446 void setCost(const double *cost, int lenParam) ;
448 void setReducedCost(const double *redCost, int lenParam) ;
450 void setRowLower(const double *rowLower, int lenParam) ;
452 void setRowUpper(const double *rowUpper, int lenParam) ;
454 void setRowPrice(const double *rowSol, int lenParam) ;
456 void setRowActivity(const double *rowAct, int lenParam) ;
458
461 inline int getNumCols() const
463 { return (ncols_) ; }
465 inline int getNumRows() const
466 { return (nrows_) ; }
468 inline int getNumElems() const
469 { return (nelems_) ; }
471 inline const CoinBigIndex *getColStarts() const
472 { return (mcstrt_) ; }
474 inline const int *getColLengths() const
475 { return (hincol_) ; }
477 inline const int *getRowIndicesByCol() const
478 { return (hrow_) ; }
480 inline const double *getElementsByCol() const
481 { return (colels_) ; }
483 inline const double *getColLower() const
484 { return (clo_) ; }
486 inline const double *getColUpper() const
487 { return (cup_) ; }
489 inline const double *getCost() const
490 { return (cost_) ; }
492 inline const double *getRowLower() const
493 { return (rlo_) ; }
495 inline const double *getRowUpper() const
496 { return (rup_) ; }
498 inline const double *getColSolution() const
499 { return (sol_) ; }
501 inline const double *getRowActivity() const
502 { return (acts_) ; }
504 inline const double *getRowPrice() const
505 { return (rowduals_) ; }
507 inline const double *getReducedCost() const
508 { return (rcosts_) ; }
510 inline int countEmptyCols()
511 { int empty = 0 ;
512 for (int i = 0 ; i < ncols_ ; i++) if (hincol_[i] == 0) empty++ ;
513 return (empty) ; }
515
516
519 inline CoinMessageHandler *messageHandler() const
521 { return handler_; }
527 inline void setMessageHandler(CoinMessageHandler *handler)
528 { if (defaultHandler_ == true)
529 { delete handler_ ;
530 defaultHandler_ = false ; }
531 handler_ = handler ; }
533 inline CoinMessages messages() const
534 { return messages_; }
536
546
548 int ncols_;
550 int nrows_;
552 CoinBigIndex nelems_;
553
555 int ncols0_;
557 int nrows0_ ;
559 CoinBigIndex nelems0_ ;
568 CoinBigIndex bulk0_ ;
570 double bulkRatio_;
572
581 CoinBigIndex *mcstrt_;
584 int *hincol_;
586 int *hrow_;
588 double *colels_;
589
591 double *cost_;
593 double originalOffset_;
594
596 double *clo_;
598 double *cup_;
599
601 double *rlo_;
603 double *rup_;
604
611 int * originalColumn_;
618 int * originalRow_;
619
621 double ztolzb_;
623 double ztoldj_;
624
630 double maxmin_;
632
653 double *sol_;
659 double *rowduals_;
665 double *acts_;
671 double *rcosts_;
672
679 unsigned char *colstat_;
680
687 unsigned char *rowstat_;
689
698 CoinMessageHandler *handler_;
701 bool defaultHandler_;
703 CoinMessage messages_;
705
706 };
707
711 const char *statusName (CoinPrePostsolveMatrix::Status status) ;
712
713
738 class presolvehlink
739 { public:
740 int pre, suc;
741 } ;
742
743 #define NO_LINK -66666666
744
750 inline void PRESOLVE_REMOVE_LINK(presolvehlink *link, int i)
751 {
752 int ipre = link[i].pre;
753 int isuc = link[i].suc;
754 if (ipre >= 0) {
755 link[ipre].suc = isuc;
756 }
757 if (isuc >= 0) {
758 link[isuc].pre = ipre;
759 }
760 link[i].pre = NO_LINK, link[i].suc = NO_LINK;
761 }
762
768 inline void PRESOLVE_INSERT_LINK(presolvehlink *link, int i, int j)
769 {
770 int isuc = link[j].suc;
771 link[j].suc = i;
772 link[i].pre = j;
773 if (isuc >= 0) {
774 link[isuc].pre = i;
775 }
776 link[i].suc = isuc;
777 }
778
790 inline void PRESOLVE_MOVE_LINK(presolvehlink *link, int i, int j)
791 {
792 int ipre = link[i].pre;
793 int isuc = link[i].suc;
794 if (ipre >= 0) {
795 link[ipre].suc = j;
796 }
797 if (isuc >= 0) {
798 link[isuc].pre = j;
799 }
800 link[i].pre = NO_LINK, link[i].suc = NO_LINK;
801 }
802
803
835 class CoinPresolveMatrix : public CoinPrePostsolveMatrix
836 {
837 public:
838
845 CoinPresolveMatrix(int ncols_alloc, int nrows_alloc,
846 CoinBigIndex nelems_alloc) ;
847
852 CoinPresolveMatrix(int ncols0,
853 double maxmin,
854 // end prepost members
855
856 ClpSimplex * si,
857
858 // rowrep
859 int nrows,
860 CoinBigIndex nelems,
861 bool doStatus,
862 double nonLinearVariable,
863 double bulkRatio);
864
866 void update_model(ClpSimplex * si,
867 int nrows0,
868 int ncols0,
869 CoinBigIndex nelems0);
874 CoinPresolveMatrix(int ncols0,
875 double maxmin,
876 // end prepost members
877 OsiSolverInterface * si,
878 // rowrep
879 int nrows,
880 CoinBigIndex nelems,
881 bool doStatus,
882 double nonLinearVariable,
883 const char * prohibited,
884 const char * rowProhibited=NULL);
885
887 void update_model(OsiSolverInterface * si,
888 int nrows0,
889 int ncols0,
890 CoinBigIndex nelems0);
891
893 ~CoinPresolveMatrix();
894
900 friend void assignPresolveToPostsolve (CoinPresolveMatrix *&preObj) ;
901
910 void setMatrix(const CoinPackedMatrix *mtx) ;
911
913 inline int countEmptyRows()
914 { int empty = 0 ;
915 for (int i = 0 ; i < nrows_ ; i++) if (hinrow_[i] == 0) empty++ ;
916 return (empty) ; }
917
923 inline void setVariableType(int i, int variableType)
924 { if (integerType_ == 0) integerType_ = new unsigned char [ncols0_] ;
925 integerType_[i] = static_cast<unsigned char>(variableType) ; }
926
932 void setVariableType(const unsigned char *variableType, int lenParam) ;
933
939 void setVariableType (bool allIntegers, int lenParam) ;
940
942 inline void setAnyInteger (bool anyInteger = true)
943 { anyInteger_ = anyInteger ; }
945
949
951 inline const CoinBigIndex *getRowStarts() const
952 { return (mrstrt_) ; }
954 inline const int *getColIndicesByRow() const
955 { return (hcol_) ; }
957 inline const double *getElementsByRow() const
958 { return (rowels_) ; }
959
965 inline bool isInteger (int i) const
966 { if (integerType_ == 0)
967 { return (anyInteger_) ; }
968 else
969 if (integerType_[i] == 1)
970 { return (true) ; }
971 else
972 { return (false) ; } }
973
978 inline bool anyInteger () const
979 { return (anyInteger_) ; }
981 inline int presolveOptions() const
982 { return presolveOptions_;}
984 inline void setPresolveOptions(int value)
985 { presolveOptions_=value;}
987
995 presolvehlink *clink_;
998 presolvehlink *rlink_;
1000
1002 double dobias_ ;
1003
1005 inline void change_bias(double change_amount)
1006 {
1007 dobias_ += change_amount ;
1008 # if PRESOLVE_DEBUG > 2
1009 assert(fabs(change_amount)<1.0e50) ;
1010 if (change_amount)
1011 PRESOLVE_STMT(printf("changing bias by %g to %g\n",
1012 change_amount, dobias_)) ;
1013 # endif
1014 }
1015
1024 CoinBigIndex *mrstrt_;
1027 int *hinrow_;
1029 double *rowels_;
1031 int *hcol_;
1033
1035 unsigned char *integerType_;
1041 bool anyInteger_ ;
1043 bool tuning_;
1045 void statistics();
1047 double startTime_;
1048
1050 double feasibilityTolerance_;
1052 inline double feasibilityTolerance()
1053 { return (feasibilityTolerance_) ; }
1055 inline void setFeasibilityTolerance (double val)
1056 { feasibilityTolerance_ = val ; }
1057
1063 int status_;
1065 inline int status()
1066 { return (status_) ; }
1068 inline void setStatus(int status)
1069 { status_ = (status&0x3) ; }
1070
1078 int pass_;
1080 inline void setPass (int pass = 0)
1081 { pass_ = pass ; }
1082
1087 int maxSubstLevel_;
1089 inline void setMaximumSubstitutionLevel (int level)
1090 { maxSubstLevel_ = level ; }
1091
1092
1116 unsigned char * colChanged_;
1118 int * colsToDo_;
1120 int numberColsToDo_;
1122 int * nextColsToDo_;
1124 int numberNextColsToDo_;
1125
1135 unsigned char * rowChanged_;
1137 int * rowsToDo_;
1139 int numberRowsToDo_;
1141 int * nextRowsToDo_;
1143 int numberNextRowsToDo_;
1161 int presolveOptions_;
1167 bool anyProhibited_;
1169
1180 int *usefulRowInt_ ;
1183 double *usefulRowDouble_ ;
1185 int *usefulColumnInt_ ;
1187 double *usefulColumnDouble_ ;
1189 double *randomNumber_ ;
1190
1192 int *infiniteUp_ ;
1194 double *sumUp_ ;
1196 int *infiniteDown_ ;
1198 double *sumDown_ ;
1200
1212 int recomputeSums(int whichRow) ;
1213
1215 void initializeStuff() ;
1217 void deleteStuff() ;
1218
1221
1227 void initColsToDo () ;
1228
1234 int stepColsToDo () ;
1235
1237 inline int numberColsToDo()
1238 { return (numberColsToDo_) ; }
1239
1241 inline bool colChanged(int i) const {
1242 return (colChanged_[i]&1)!=0;
1243 }
1245 inline void unsetColChanged(int i) {
1246 colChanged_[i] = static_cast<unsigned char>(colChanged_[i] & (~1)) ;
1247 }
1249 inline void setColChanged(int i) {
1250 colChanged_[i] = static_cast<unsigned char>(colChanged_[i] | (1)) ;
1251 }
1253 inline void addCol(int i) {
1254 if ((colChanged_[i]&1)==0) {
1255 colChanged_[i] = static_cast<unsigned char>(colChanged_[i] | (1)) ;
1256 nextColsToDo_[numberNextColsToDo_++] = i;
1257 }
1258 }
1260 inline bool colProhibited(int i) const {
1261 return (colChanged_[i]&2)!=0;
1262 }
1269 inline bool colProhibited2(int i) const {
1270 if (!anyProhibited_)
1271 return false;
1272 else
1273 return (colChanged_[i]&2)!=0;
1274 }
1276 inline void setColProhibited(int i) {
1277 colChanged_[i] = static_cast<unsigned char>(colChanged_[i] | (2)) ;
1278 }
1284 inline bool colUsed(int i) const {
1285 return (colChanged_[i]&4)!=0;
1286 }
1288 inline void setColUsed(int i) {
1289 colChanged_[i] = static_cast<unsigned char>(colChanged_[i] | (4)) ;
1290 }
1292 inline void unsetColUsed(int i) {
1293 colChanged_[i] = static_cast<unsigned char>(colChanged_[i] & (~4)) ;
1294 }
1296 inline bool colInfinite(int i) const {
1297 return (colChanged_[i]&8)!=0;
1298 }
1300 inline void unsetColInfinite(int i) {
1301 colChanged_[i] = static_cast<unsigned char>(colChanged_[i] & (~8)) ;
1302 }
1304 inline void setColInfinite(int i) {
1305 colChanged_[i] = static_cast<unsigned char>(colChanged_[i] | (8)) ;
1306 }
1307
1313 void initRowsToDo () ;
1314
1320 int stepRowsToDo () ;
1321
1323 inline int numberRowsToDo()
1324 { return (numberRowsToDo_) ; }
1325
1327 inline bool rowChanged(int i) const {
1328 return (rowChanged_[i]&1)!=0;
1329 }
1331 inline void unsetRowChanged(int i) {
1332 rowChanged_[i] = static_cast<unsigned char>(rowChanged_[i] & (~1)) ;
1333 }
1335 inline void setRowChanged(int i) {
1336 rowChanged_[i] = static_cast<unsigned char>(rowChanged_[i] | (1)) ;
1337 }
1339 inline void addRow(int i) {
1340 if ((rowChanged_[i]&1)==0) {
1341 rowChanged_[i] = static_cast<unsigned char>(rowChanged_[i] | (1)) ;
1342 nextRowsToDo_[numberNextRowsToDo_++] = i;
1343 }
1344 }
1346 inline bool rowProhibited(int i) const {
1347 return (rowChanged_[i]&2)!=0;
1348 }
1355 inline bool rowProhibited2(int i) const {
1356 if (!anyProhibited_)
1357 return false;
1358 else
1359 return (rowChanged_[i]&2)!=0;
1360 }
1362 inline void setRowProhibited(int i) {
1363 rowChanged_[i] = static_cast<unsigned char>(rowChanged_[i] | (2)) ;
1364 }
1370 inline bool rowUsed(int i) const {
1371 return (rowChanged_[i]&4)!=0;
1372 }
1374 inline void setRowUsed(int i) {
1375 rowChanged_[i] = static_cast<unsigned char>(rowChanged_[i] | (4)) ;
1376 }
1378 inline void unsetRowUsed(int i) {
1379 rowChanged_[i] = static_cast<unsigned char>(rowChanged_[i] & (~4)) ;
1380 }
1381
1382
1384 inline bool anyProhibited() const
1385 { return anyProhibited_;}
1387 inline void setAnyProhibited(bool val = true)
1388 { anyProhibited_ = val ; }
1390
1391 };
1392
1421 class CoinPostsolveMatrix : public CoinPrePostsolveMatrix
1422 {
1423 public:
1424
1431 CoinPostsolveMatrix(int ncols_alloc, int nrows_alloc,
1432 CoinBigIndex nelems_alloc) ;
1433
1434
1439 CoinPostsolveMatrix(ClpSimplex * si,
1440
1441 int ncols0,
1442 int nrows0,
1443 CoinBigIndex nelems0,
1444
1445 double maxmin_,
1446 // end prepost members
1447
1448 double *sol,
1449 double *acts,
1450
1451 unsigned char *colstat,
1452 unsigned char *rowstat);
1453
1458 CoinPostsolveMatrix(OsiSolverInterface * si,
1459
1460 int ncols0,
1461 int nrows0,
1462 CoinBigIndex nelems0,
1463
1464 double maxmin_,
1465 // end prepost members
1466
1467 double *sol,
1468 double *acts,
1469
1470 unsigned char *colstat,
1471 unsigned char *rowstat);
1472
1483 void assignPresolveToPostsolve (CoinPresolveMatrix *&preObj) ;
1484
1486 ~CoinPostsolveMatrix();
1487
1499
1501 CoinBigIndex free_list_;
1503 int maxlink_;
1508 CoinBigIndex *link_;
1509
1511
1519 char *cdone_;
1520 char *rdone_;
1522
1524 void check_nbasic();
1525
1526 };
1527
1528
1535
1540 void presolve_make_memlists(/*CoinBigIndex *starts,*/ int *lengths,
1541 presolvehlink *link, int n);
1542
1550 bool presolve_expand_major(CoinBigIndex *majstrts, double *majels,
1551 int *minndxs, int *majlens,
1552 presolvehlink *majlinks, int nmaj, int k) ;
1553
1559 inline bool presolve_expand_col(CoinBigIndex *mcstrt, double *colels,
1560 int *hrow, int *hincol,
1561 presolvehlink *clink, int ncols, int colx)
1562 { return presolve_expand_major(mcstrt,colels,
1563 hrow,hincol,clink,ncols,colx) ; }
1564
1570 inline bool presolve_expand_row(CoinBigIndex *mrstrt, double *rowels,
1571 int *hcol, int *hinrow,
1572 presolvehlink *rlink, int nrows, int rowx)
1573 { return presolve_expand_major(mrstrt,rowels,
1574 hcol,hinrow,rlink,nrows,rowx) ; }
1575
1576
1585 inline CoinBigIndex presolve_find_minor(int tgt,
1586 CoinBigIndex ks, CoinBigIndex ke,
1587 const int *minndxs)
1588 { CoinBigIndex k ;
1589 for (k = ks ; k < ke ; k++)
1590 #ifndef NDEBUG
1591 { if (minndxs[k] == tgt)
1592 return (k) ; }
1593 DIE("FIND_MINOR") ;
1594
1595 abort () ; return -1;
1596 #else
1597 { if (minndxs[k] == tgt)
1598 break ; }
1599 return (k) ;
1600 #endif
1601 }
1602
1609 inline CoinBigIndex presolve_find_row(int row, CoinBigIndex kcs,
1610 CoinBigIndex kce, const int *hrow)
1611 { return presolve_find_minor(row,kcs,kce,hrow) ; }
1612
1619 inline CoinBigIndex presolve_find_col(int col, CoinBigIndex krs,
1620 CoinBigIndex kre, const int *hcol)
1621 { return presolve_find_minor(col,krs,kre,hcol) ; }
1622
1623
1632 CoinBigIndex presolve_find_minor1(int tgt, CoinBigIndex ks, CoinBigIndex ke,
1633 const int *minndxs);
1634
1641 inline CoinBigIndex presolve_find_row1(int row, CoinBigIndex kcs,
1642 CoinBigIndex kce, const int *hrow)
1643 { return presolve_find_minor1(row,kcs,kce,hrow) ; }
1644
1651 inline CoinBigIndex presolve_find_col1(int col, CoinBigIndex krs,
1652 CoinBigIndex kre, const int *hcol)
1653 { return presolve_find_minor1(col,krs,kre,hcol) ; }
1654
1663 CoinBigIndex presolve_find_minor2(int tgt, CoinBigIndex ks, int majlen,
1664 const int *minndxs,
1665 const CoinBigIndex *majlinks) ;
1666
1674 inline CoinBigIndex presolve_find_row2(int row, CoinBigIndex kcs, int collen,
1675 const int *hrow,
1676 const CoinBigIndex *clinks)
1677 { return presolve_find_minor2(row,kcs,collen,hrow,clinks) ; }
1678
1687 CoinBigIndex presolve_find_minor3(int tgt, CoinBigIndex ks, int majlen,
1688 const int *minndxs,
1689 const CoinBigIndex *majlinks) ;
1690
1698 inline CoinBigIndex presolve_find_row3(int row, CoinBigIndex kcs, int collen,
1699 const int *hrow,
1700 const CoinBigIndex *clinks)
1701 { return presolve_find_minor3(row,kcs,collen,hrow,clinks) ; }
1702
1712 inline void presolve_delete_from_major(int majndx, int minndx,
1713 const CoinBigIndex *majstrts,
1714 int *majlens, int *minndxs, double *els)
1715 {
1716 const CoinBigIndex ks = majstrts[majndx] ;
1717 const CoinBigIndex ke = ks+majlens[majndx] ;
1718
1719 const CoinBigIndex kmi = presolve_find_minor(minndx,ks,ke,minndxs) ;
1720
1721 minndxs[kmi] = minndxs[ke-1] ;
1722 els[kmi] = els[ke-1] ;
1723 majlens[majndx]-- ;
1724
1725 return ;
1726 }
1727
1734 inline void presolve_delete_many_from_major(int majndx, char *marked,
1735 const CoinBigIndex *majstrts,
1736 int *majlens, int *minndxs, double *els)
1737 {
1738 const CoinBigIndex ks = majstrts[majndx] ;
1739 const CoinBigIndex ke = ks+majlens[majndx] ;
1740 CoinBigIndex put = ks ;
1741 for (CoinBigIndex k = ks ; k < ke ; k++) {
1742 int iMinor = minndxs[k] ;
1743 if (!marked[iMinor]) {
1744 minndxs[put] = iMinor ;
1745 els[put++] = els[k] ;
1746 } else {
1747 marked[iMinor] = 0 ;
1748 }
1749 }
1750 majlens[majndx] = put-ks ;
1751 return ;
1752 }
1753
1764 inline void presolve_delete_from_col(int row, int col,
1765 const CoinBigIndex *mcstrt,
1766 int *hincol, int *hrow, double *colels)
1767 { presolve_delete_from_major(col,row,mcstrt,hincol,hrow,colels) ; }
1768
1779 inline void presolve_delete_from_row(int row, int col,
1780 const CoinBigIndex *mrstrt,
1781 int *hinrow, int *hcol, double *rowels)
1782 { presolve_delete_from_major(row,col,mrstrt,hinrow,hcol,rowels) ; }
1783
1794 void presolve_delete_from_major2 (int majndx, int minndx,
1795 CoinBigIndex *majstrts, int *majlens,
1796 int *minndxs, int *majlinks,
1797 CoinBigIndex *free_listp) ;
1798
1809 inline void presolve_delete_from_col2(int row, int col, CoinBigIndex *mcstrt,
1810 int *hincol, int *hrow,
1811 int *clinks, CoinBigIndex *free_listp)
1812 { presolve_delete_from_major2(col,row,mcstrt,hincol,hrow,clinks,free_listp) ; }
1813
1815
1821
1833 double *presolve_dupmajor(const double *elems, const int *indices,
1834 int length, CoinBigIndex offset, int tgt = -1);
1835
1837 void coin_init_random_vec(double *work, int n);
1838
1840
1841
1842 #endif
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:1135
CoinPresolveMatrix::setColChanged
void setColChanged(int i)
Mark column as changed.
Definition: CoinPresolveMatrix.hpp:1249
CoinPresolveMatrix::statistics
void statistics()
Say we want statistics - also set time.
CoinPrePostsolveMatrix::originalRow_
int * originalRow_
Original row numbers.
Definition: CoinPresolveMatrix.hpp:618
CoinPrePostsolveMatrix::rowIsBasic
bool rowIsBasic(int sequence) const
Check if artificial for this row is basic.
Definition: CoinPresolveMatrix.hpp:345
CoinError
Error Class thrown by an exception.
Definition: CoinError.hpp:42
CoinPresolveMatrix::setPass
void setPass(int pass=0)
Set pass number.
Definition: CoinPresolveMatrix.hpp:1080
CoinPresolveMatrix::colsToDo_
int * colsToDo_
Input list of columns to process.
Definition: CoinPresolveMatrix.hpp:1118
CoinPrePostsolveMatrix::getNumRows
int getNumRows() const
Get current number of rows.
Definition: CoinPresolveMatrix.hpp:465
CoinPrePostsolveMatrix::setMessageHandler
void setMessageHandler(CoinMessageHandler *handler)
Set message handler.
Definition: CoinPresolveMatrix.hpp:527
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:1181
CoinPrePostsolveMatrix::setReducedCost
void setReducedCost(const double *redCost, int lenParam)
Set reduced costs.
CoinPrePostsolveMatrix::ztolzb_
double ztolzb_
Primal feasibility tolerance.
Definition: CoinPresolveMatrix.hpp:621
presolvehlink::PRESOLVE_REMOVE_LINK
void PRESOLVE_REMOVE_LINK(presolvehlink *link, int i)
unlink vector i
Definition: CoinPresolveMatrix.hpp:750
CoinPresolveMatrix::setFeasibilityTolerance
void setFeasibilityTolerance(double val)
Set feasibility tolerance.
Definition: CoinPresolveMatrix.hpp:1055
CoinPresolveMatrix::~CoinPresolveMatrix
~CoinPresolveMatrix()
Destructor.
CoinPrePostsolveMatrix
Collects all the information about the problem that is needed in both presolve and postsolve...
Definition: CoinPresolveMatrix.hpp:265
CoinPrePostsolveMatrix::originalColumn_
int * originalColumn_
Original column numbers.
Definition: CoinPresolveMatrix.hpp:611
CoinPresolveMatrix::anyInteger_
bool anyInteger_
Flag to say if any variables are integer.
Definition: CoinPresolveMatrix.hpp:1041
CoinPrePostsolveMatrix::getRowStatus
Status getRowStatus(int sequence) const
Get row status.
Definition: CoinPresolveMatrix.hpp:342
CoinPresolveMatrix::sumDown_
double * sumDown_
Work array for sum of finite contributions to row lhs lower bound.
Definition: CoinPresolveMatrix.hpp:1198
CoinPrePostsolveMatrix::nrows0_
int nrows0_
Allocated number of rows.
Definition: CoinPresolveMatrix.hpp:557
CoinPrePostsolveMatrix::setColSolution
void setColSolution(const double *colSol, int lenParam)
Set column solution.
CoinPrePostsolveMatrix::colels_
double * colels_
Coefficients (positional correspondence with hrow_)
Definition: CoinPresolveMatrix.hpp:588
CoinPrePostsolveMatrix::atUpperBound
Definition: CoinPresolveMatrix.hpp:316
CoinPostsolveMatrix::rdone_
char * rdone_
Definition: CoinPresolveMatrix.hpp:1520
CoinPrePostsolveMatrix::messages_
CoinMessage messages_
Standard COIN messages.
Definition: CoinPresolveMatrix.hpp:703
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:388
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:471
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:1698
CoinPrePostsolveMatrix::getStatus
CoinWarmStartBasis * getStatus()
Get status in the form of a CoinWarmStartBasis.
CoinPrePostsolveMatrix::nelems0_
CoinBigIndex nelems0_
Allocated number of coefficients.
Definition: CoinPresolveMatrix.hpp:559
CoinPresolveMatrix::infiniteUp_
int * infiniteUp_
Work array for count of infinite contributions to row lhs upper bound.
Definition: CoinPresolveMatrix.hpp:1192
CoinTime.hpp
CoinPresolveMatrix::usefulColumnDouble_
double * usefulColumnDouble_
Preallocated scratch work array, ncols_.
Definition: CoinPresolveMatrix.hpp:1187
CoinPrePostsolveMatrix::rowstat_
unsigned char * rowstat_
Status of constraints.
Definition: CoinPresolveMatrix.hpp:687
CoinPrePostsolveMatrix::columnIsBasic
bool columnIsBasic(int sequence) const
Check if column (structural variable) is basic.
Definition: CoinPresolveMatrix.hpp:391
CoinPresolveMatrix::initRowsToDo
void initRowsToDo()
Initialise the row ToDo lists.
CoinPrePostsolveMatrix::rup_
double * rup_
Row (constraint) upper bounds.
Definition: CoinPresolveMatrix.hpp:603
CoinPresolveMatrix::unsetRowChanged
void unsetRowChanged(int i)
Mark row as not changed.
Definition: CoinPresolveMatrix.hpp:1331
CoinPresolveMatrix::randomNumber_
double * randomNumber_
Array of random numbers (max row,column)
Definition: CoinPresolveMatrix.hpp:1189
CoinPresolveMatrix::stepRowsToDo
int stepRowsToDo()
Step row ToDo lists.
CoinPresolveMatrix::hcol_
int * hcol_
Column indices (positional correspondence with rowels_)
Definition: CoinPresolveMatrix.hpp:1031
CoinPrePostsolveMatrix::getColLengths
const int * getColLengths() const
Get column length vector for column-major packed matrix.
Definition: CoinPresolveMatrix.hpp:474
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:94
CoinPresolveMatrix::presolveOptions_
int presolveOptions_
Fine control over presolve actions.
Definition: CoinPresolveMatrix.hpp:1161
CoinPrePostsolveMatrix::rcosts_
double * rcosts_
Vector of reduced costs.
Definition: CoinPresolveMatrix.hpp:671
CoinPrePostsolveMatrix::nelems_
CoinBigIndex nelems_
current number of coefficients
Definition: CoinPresolveMatrix.hpp:552
presolvehlink
Links to aid in packed matrix modification.
Definition: CoinPresolveMatrix.hpp:738
CoinPresolveMatrix::initializeStuff
void initializeStuff()
Allocate scratch arrays.
CoinPresolveMatrix::nextColsToDo_
int * nextColsToDo_
Output list of columns to process next.
Definition: CoinPresolveMatrix.hpp:1122
CoinPrePostsolveMatrix::ncols0_
int ncols0_
Allocated number of columns.
Definition: CoinPresolveMatrix.hpp:555
CoinPresolveMatrix::rowsToDo_
int * rowsToDo_
Input list of rows to process.
Definition: CoinPresolveMatrix.hpp:1137
CoinPresolveMatrix::recomputeSums
int recomputeSums(int whichRow)
Recompute row lhs bounds.
CoinPresolveAction
Abstract base class of all presolve routines.
Definition: CoinPresolveMatrix.hpp:155
CoinPrePostsolveMatrix::maxmin_
double maxmin_
Maximization/minimization.
Definition: CoinPresolveMatrix.hpp:630
CoinPrePostsolveMatrix::bulkRatio_
double bulkRatio_
Ratio of bulk0_ to nelems0_; default is 2.
Definition: CoinPresolveMatrix.hpp:570
CoinPresolveAction::throwCoinError
static void throwCoinError(const char *error, const char *ps_routine)
Stub routine to throw exceptions.
Definition: CoinPresolveMatrix.hpp:164
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:1764
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:510
CoinPresolveMatrix::numberNextColsToDo_
int numberNextColsToDo_
Length of nextColsToDo_.
Definition: CoinPresolveMatrix.hpp:1124
CoinPresolveMatrix::anyInteger
bool anyInteger() const
Check if there are any integer variables.
Definition: CoinPresolveMatrix.hpp:978
CoinPresolveMatrix::status
int status()
Returns problem status (0 = feasible, 1 = infeasible, 2 = unbounded)
Definition: CoinPresolveMatrix.hpp:1065
CoinPresolveMatrix::unsetColUsed
void unsetColUsed(int i)
Mark column as unused.
Definition: CoinPresolveMatrix.hpp:1292
CoinPostsolveMatrix::cdone_
char * cdone_
Definition: CoinPresolveMatrix.hpp:1519
CoinPresolveMatrix::setStatus
void setStatus(int status)
Set problem status.
Definition: CoinPresolveMatrix.hpp:1068
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:1120
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:1585
CoinPresolveMatrix::numberColsToDo
int numberColsToDo()
Return the number of columns on the colsToDo_ list.
Definition: CoinPresolveMatrix.hpp:1237
CoinPresolveMatrix::setPresolveOptions
void setPresolveOptions(int value)
Sets any special options (see presolveOptions_)
Definition: CoinPresolveMatrix.hpp:984
CoinPrePostsolveMatrix::Status
Status
Enum for status of various sorts.
Definition: CoinPresolveMatrix.hpp:313
CoinPrePostsolveMatrix::superBasic
Definition: CoinPresolveMatrix.hpp:318
CoinPostsolveMatrix::presolve_delete_from_major2
void presolve_delete_from_major2(int majndx, int minndx, CoinBigIndex *majstrts, int *majlens, int *minndxs, int *majlinks, CoinBigIndex *free_listp)
Delete the entry for a minor index from a major vector in a threaded matrix.
CoinMessageHandler
Base class for message handling.
Definition: CoinMessageHandler.hpp:327
CoinPrePostsolveMatrix::cost_
double * cost_
Objective coefficients.
Definition: CoinPresolveMatrix.hpp:591
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:1712
CoinFinite.hpp
CoinPresolveMatrix::rowProhibited2
bool rowProhibited2(int i) const
Test if row is eligible for preprocessing.
Definition: CoinPresolveMatrix.hpp:1355
CoinPrePostsolveMatrix::~CoinPrePostsolveMatrix
~CoinPrePostsolveMatrix()
Destructor.
CoinPresolveMatrix::anyProhibited_
bool anyProhibited_
Flag to say if any rows or columns are marked as prohibited.
Definition: CoinPresolveMatrix.hpp:1167
OsiSolverInterface
Abstract Base Class for describing an interface to a solver.
Definition: OsiSolverInterface.hpp:62
CoinPresolveMatrix::startTime_
double startTime_
Start time of presolve.
Definition: CoinPresolveMatrix.hpp:1047
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:923
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:790
CoinMessage
The standard set of Coin messages.
Definition: CoinMessage.hpp:80
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:314
CoinPresolveAction::setNext
void setNext(const CoinPresolveAction *nextAction)
modify next (when building rather than passing)
Definition: CoinPresolveMatrix.hpp:180
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:1253
CoinPrePostsolveMatrix::setRowStatus
void setRowStatus(int sequence, Status status)
Set row status (i.e., status of artificial for this row)
Definition: CoinPresolveMatrix.hpp:335
CoinPresolveMatrix::integerType_
unsigned char * integerType_
Tracks integrality of columns (1 for integer, 0 for continuous)
Definition: CoinPresolveMatrix.hpp:1035
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:550
CoinPrePostsolveMatrix::getCost
const double * getCost() const
Get objective coefficients.
Definition: CoinPresolveMatrix.hpp:489
CoinPrePostsolveMatrix::getElementsByCol
const double * getElementsByCol() const
Get vector of elements for column-major packed matrix.
Definition: CoinPresolveMatrix.hpp:480
CoinPresolveAction::~CoinPresolveAction
virtual ~CoinPresolveAction()
Virtual destructor.
Definition: CoinPresolveMatrix.hpp:195
CoinPresolveMatrix::setAnyInteger
void setAnyInteger(bool anyInteger=true)
Set a flag for presence (true) or absence (false) of integer variables.
Definition: CoinPresolveMatrix.hpp:942
CoinPresolveMatrix::rowChanged
bool rowChanged(int i) const
Has row been changed?
Definition: CoinPresolveMatrix.hpp:1327
CoinPresolveMatrix::isInteger
bool isInteger(int i) const
Check for integrality of the specified variable.
Definition: CoinPresolveMatrix.hpp:965
ClpSimplex
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:70
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:1183
CoinPresolveMatrix::stepColsToDo
int stepColsToDo()
Step column ToDo lists.
CoinPrePostsolveMatrix::cup_
double * cup_
Column (primal variable) upper bounds.
Definition: CoinPresolveMatrix.hpp:598
CoinPresolveMatrix::mrstrt_
CoinBigIndex * mrstrt_
Vector of row start positions in #hcol, rowels_.
Definition: CoinPresolveMatrix.hpp:1025
CoinPrePostsolveMatrix::setColumnStatus
void setColumnStatus(int sequence, Status status)
Set column status (i.e., status of primal variable)
Definition: CoinPresolveMatrix.hpp:348
CoinPresolveMatrix::status_
int status_
Output status: 0 = feasible, 1 = infeasible, 2 = unbounded.
Definition: CoinPresolveMatrix.hpp:1063
CoinPresolveMatrix::setAnyProhibited
void setAnyProhibited(bool val=true)
Set a flag for presence of prohibited rows or columns.
Definition: CoinPresolveMatrix.hpp:1387
CoinPrePostsolveMatrix::hincol_
int * hincol_
Vector of column lengths.
Definition: CoinPresolveMatrix.hpp:584
CoinPresolveMatrix::rowUsed
bool rowUsed(int i) const
Test if row is marked as used.
Definition: CoinPresolveMatrix.hpp:1370
CoinPragma.hpp
CoinPrePostsolveMatrix::acts_
double * acts_
Vector of constraint left-hand-side values (row activity)
Definition: CoinPresolveMatrix.hpp:665
CoinPrePostsolveMatrix::hrow_
int * hrow_
Row indices (positional correspondence with colels_)
Definition: CoinPresolveMatrix.hpp:586
CoinPresolveAction::CoinPresolveAction
CoinPresolveAction(const CoinPresolveAction *next)
Construct a postsolve object and add it to the transformation list.
Definition: CoinPresolveMatrix.hpp:178
CoinPresolveMatrix::update_model
void update_model(ClpSimplex *si, int nrows0, int ncols0, CoinBigIndex nelems0)
Update the model held by a Clp OSI.
CoinPrePostsolveMatrix::getNumElems
int getNumElems() const
Get current number of non-zero coefficients.
Definition: CoinPresolveMatrix.hpp:468
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:1734
CoinPresolveMatrix::anyProhibited
bool anyProhibited() const
Check if there are any prohibited rows or columns.
Definition: CoinPresolveMatrix.hpp:1384
CoinPresolveMatrix::numberNextRowsToDo_
int numberNextRowsToDo_
Length of nextRowsToDo_.
Definition: CoinPresolveMatrix.hpp:1143
CoinPresolveMatrix::setColProhibited
void setColProhibited(int i)
Mark column as ineligible for preprocessing.
Definition: CoinPresolveMatrix.hpp:1276
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:623
CoinPresolveMatrix::initColsToDo
void initColsToDo()
Initialise the column ToDo lists.
ZTOLDP
const double ZTOLDP
Zero tolerance.
Definition: CoinPresolveMatrix.hpp:89
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:1609
CoinPresolveAction::next
const CoinPresolveAction * next
The next presolve transformation.
Definition: CoinPresolveMatrix.hpp:171
CoinPresolveMatrix::rowProhibited
bool rowProhibited(int i) const
Test if row is eligible for preprocessing.
Definition: CoinPresolveMatrix.hpp:1346
CoinPrePostsolveMatrix::getColSolution
const double * getColSolution() const
Get column solution (primal variable values)
Definition: CoinPresolveMatrix.hpp:498
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:1779
CoinPrePostsolveMatrix::getRowPrice
const double * getRowPrice() const
Get row solution (dual variables)
Definition: CoinPresolveMatrix.hpp:504
CoinPostsolveMatrix
Augments CoinPrePostsolveMatrix with information about the problem that is only needed during postsol...
Definition: CoinPresolveMatrix.hpp:1421
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:1362
CoinPrePostsolveMatrix::bulk0_
CoinBigIndex bulk0_
Allocated size of bulk storage for row indices and coefficients.
Definition: CoinPresolveMatrix.hpp:568
CoinPresolveMatrix::setMaximumSubstitutionLevel
void setMaximumSubstitutionLevel(int level)
Set Maximum substitution level (normally 3)
Definition: CoinPresolveMatrix.hpp:1089
CoinPostsolveMatrix::~CoinPostsolveMatrix
~CoinPostsolveMatrix()
Destructor.
CoinPresolveMatrix::unsetColInfinite
void unsetColInfinite(int i)
Mark column as not infinite ub (originally)
Definition: CoinPresolveMatrix.hpp:1300
CoinPrePostsolveMatrix::atLowerBound
Definition: CoinPresolveMatrix.hpp:317
CoinPrePostsolveMatrix::getRowUpper
const double * getRowUpper() const
Get row upper bounds.
Definition: CoinPresolveMatrix.hpp:495
CoinPresolveMatrix::colChanged_
unsigned char * colChanged_
Column change status information.
Definition: CoinPresolveMatrix.hpp:1116
CoinPresolveMatrix::colUsed
bool colUsed(int i) const
Test if column is marked as used.
Definition: CoinPresolveMatrix.hpp:1284
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:501
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:701
CoinPrePostsolveMatrix::basic
Definition: CoinPresolveMatrix.hpp:315
CoinPackedMatrix
Sparse Matrix Base Class.
Definition: CoinPackedMatrix.hpp:79
CoinPresolveMatrix::setRowChanged
void setRowChanged(int i)
Mark row as changed.
Definition: CoinPresolveMatrix.hpp:1335
CoinPresolveMatrix::change_bias
void change_bias(double change_amount)
Adjust objective function constant offset.
Definition: CoinPresolveMatrix.hpp:1005
CoinPrePostsolveMatrix::originalOffset_
double originalOffset_
Original objective offset.
Definition: CoinPresolveMatrix.hpp:593
CoinPresolveMatrix::countEmptyRows
int countEmptyRows()
Count number of empty rows.
Definition: CoinPresolveMatrix.hpp:913
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:835
CoinPresolveMatrix::getRowStarts
const CoinBigIndex * getRowStarts() const
Get row start vector for row-major packed matrix.
Definition: CoinPresolveMatrix.hpp:951
CoinPresolveMatrix::hinrow_
int * hinrow_
Vector of row lengths.
Definition: CoinPresolveMatrix.hpp:1027
CoinPresolveMatrix::clink_
presolvehlink * clink_
Linked list for the column-major representation.
Definition: CoinPresolveMatrix.hpp:996
CoinPresolveMatrix::setColInfinite
void setColInfinite(int i)
Mark column as infinite ub (originally)
Definition: CoinPresolveMatrix.hpp:1304
CoinPresolveMatrix::nextRowsToDo_
int * nextRowsToDo_
Output list of rows to process next.
Definition: CoinPresolveMatrix.hpp:1141
CoinPresolveMatrix::numberRowsToDo_
int numberRowsToDo_
Length of rowsToDo_.
Definition: CoinPresolveMatrix.hpp:1139
CoinPrePostsolveMatrix::getColLower
const double * getColLower() const
Get column lower bounds.
Definition: CoinPresolveMatrix.hpp:483
CoinPresolveMatrix::sumUp_
double * sumUp_
Work array for sum of finite contributions to row lhs upper bound.
Definition: CoinPresolveMatrix.hpp:1194
CoinPrePostsolveMatrix::ncols_
int ncols_
current number of columns
Definition: CoinPresolveMatrix.hpp:548
CoinPresolveMatrix::addRow
void addRow(int i)
Mark row as changed and add to list of rows to process next.
Definition: CoinPresolveMatrix.hpp:1339
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:1002
CoinBigIndex
int CoinBigIndex
Definition: Coin_C_defines.h:105
presolvehlink::PRESOLVE_INSERT_LINK
void PRESOLVE_INSERT_LINK(presolvehlink *link, int i, int j)
insert vector i after vector j
Definition: CoinPresolveMatrix.hpp:768
CoinPrePostsolveMatrix::messages
CoinMessages messages() const
Return messages.
Definition: CoinPresolveMatrix.hpp:533
CoinPresolveMatrix::rowels_
double * rowels_
Coefficients (positional correspondence with hcol_)
Definition: CoinPresolveMatrix.hpp:1029
CoinPresolveMatrix::tuning_
bool tuning_
Print statistics for tuning.
Definition: CoinPresolveMatrix.hpp:1043
PRESOLVE_INF
#define PRESOLVE_INF
The usual finite infinity.
Definition: CoinPresolveMatrix.hpp:97
CoinPresolveMatrix::infiniteDown_
int * infiniteDown_
Work array for count of infinite contributions to row lhs lower bound.
Definition: CoinPresolveMatrix.hpp:1196
CoinPresolveMatrix::numberRowsToDo
int numberRowsToDo()
Return the number of rows on the rowsToDo_ list.
Definition: CoinPresolveMatrix.hpp:1323
CoinPresolveMatrix::colInfinite
bool colInfinite(int i) const
Has column infinite ub (originally)
Definition: CoinPresolveMatrix.hpp:1296
CoinPrePostsolveMatrix::setPrimalTolerance
void setPrimalTolerance(double primTol)
Set the primal feasibility tolerance.
CoinPresolveMatrix::usefulColumnInt_
int * usefulColumnInt_
Preallocated scratch work array, 2*ncols_.
Definition: CoinPresolveMatrix.hpp:1185
CoinPresolveMatrix::feasibilityTolerance
double feasibilityTolerance()
Return feasibility tolerance.
Definition: CoinPresolveMatrix.hpp:1052
CoinPostsolveMatrix::free_list_
CoinBigIndex free_list_
First entry in free entries thread.
Definition: CoinPresolveMatrix.hpp:1501
CoinPresolveMatrix::getElementsByRow
const double * getElementsByRow() const
Get vector of elements for row-major packed matrix.
Definition: CoinPresolveMatrix.hpp:957
CoinPostsolveMatrix::check_nbasic
void check_nbasic()
debug
CoinPresolveMatrix::colChanged
bool colChanged(int i) const
Has column been changed?
Definition: CoinPresolveMatrix.hpp:1241
CoinPrePostsolveMatrix::getRowLower
const double * getRowLower() const
Get row lower bounds.
Definition: CoinPresolveMatrix.hpp:492
CoinPrePostsolveMatrix::clo_
double * clo_
Column (primal variable) lower bounds.
Definition: CoinPresolveMatrix.hpp:596
CoinPrePostsolveMatrix::getReducedCost
const double * getReducedCost() const
Get reduced costs.
Definition: CoinPresolveMatrix.hpp:507
CoinPresolveMatrix::deleteStuff
void deleteStuff()
Free scratch arrays.
CoinPresolveMatrix::feasibilityTolerance_
double feasibilityTolerance_
Bounds can be moved by this to retain feasibility.
Definition: CoinPresolveMatrix.hpp:1050
CoinPresolveMatrix::unsetColChanged
void unsetColChanged(int i)
Mark column as not changed.
Definition: CoinPresolveMatrix.hpp:1245
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:998
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:1641
CoinPrePostsolveMatrix::getNumCols
int getNumCols() const
Get current number of columns.
Definition: CoinPresolveMatrix.hpp:462
presolvehlink::pre
int pre
Definition: CoinPresolveMatrix.hpp:740
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:1269
presolvehlink::suc
int suc
Definition: CoinPresolveMatrix.hpp:740
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:1651
CoinPrePostsolveMatrix::colstat_
unsigned char * colstat_
Status of primal variables.
Definition: CoinPresolveMatrix.hpp:679
CoinPrePostsolveMatrix::getRowIndicesByCol
const int * getRowIndicesByCol() const
Get vector of row indices for column-major packed matrix.
Definition: CoinPresolveMatrix.hpp:477
CoinPrePostsolveMatrix::sol_
double * sol_
Vector of primal variable values.
Definition: CoinPresolveMatrix.hpp:653
CoinPrePostsolveMatrix::rowduals_
double * rowduals_
Vector of dual variable values.
Definition: CoinPresolveMatrix.hpp:659
CoinPostsolveMatrix::link_
CoinBigIndex * link_
Thread array.
Definition: CoinPresolveMatrix.hpp:1508
NO_LINK
#define NO_LINK
Definition: CoinPresolveMatrix.hpp:743
CoinPresolveMatrix::setColUsed
void setColUsed(int i)
Mark column as used.
Definition: CoinPresolveMatrix.hpp:1288
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:1674
CoinPrePostsolveMatrix::handler_
CoinMessageHandler * handler_
Message handler.
Definition: CoinPresolveMatrix.hpp:699
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:1619
CoinPrePostsolveMatrix::setRowActivity
void setRowActivity(const double *rowAct, int lenParam)
Set row activity.
DIE
void DIE(const char *)
Definition: CoinPresolveMatrix.hpp:72
CoinPrePostsolveMatrix::setRowStatusUsingValue
void setRowStatusUsingValue(int iRow)
Set status of row (artificial variable) to the correct nonbasic status given bounds and current value...
CoinPostsolveMatrix::presolve_delete_from_col2
void presolve_delete_from_col2(int row, int col, CoinBigIndex *mcstrt, int *hincol, int *hrow, int *clinks, CoinBigIndex *free_listp)
Delete the entry for row row from column col in a column-major threaded matrix.
Definition: CoinPresolveMatrix.hpp:1809
CoinPresolveMatrix::setRowUsed
void setRowUsed(int i)
Mark row as used.
Definition: CoinPresolveMatrix.hpp:1374
CoinPrePostsolveMatrix::CoinPrePostsolveMatrix
CoinPrePostsolveMatrix(int ncols_alloc, int nrows_alloc, CoinBigIndex nelems_alloc)
`Native&#39; constructor
CoinPostsolveMatrix::maxlink_
int maxlink_
Allocated size of link_.
Definition: CoinPresolveMatrix.hpp:1503
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:1570
CoinPresolveMatrix::pass_
int pass_
Presolve pass number.
Definition: CoinPresolveMatrix.hpp:1078
CoinPresolveMatrix::getColIndicesByRow
const int * getColIndicesByRow() const
Get vector of column indices for row-major packed matrix.
Definition: CoinPresolveMatrix.hpp:954
CoinMessages
Class to hold and manipulate an array of massaged messages.
Definition: CoinMessageHandler.hpp:128
CoinPackedMatrix.hpp
CoinPresolveMatrix::maxSubstLevel_
int maxSubstLevel_
Maximum substitution level.
Definition: CoinPresolveMatrix.hpp:1087
CoinPrePostsolveMatrix::messageHandler
CoinMessageHandler * messageHandler() const
Return message handler.
Definition: CoinPresolveMatrix.hpp:520
CoinPrePostsolveMatrix::mcstrt_
CoinBigIndex * mcstrt_
Vector of column start positions in hrow_, colels_.
Definition: CoinPresolveMatrix.hpp:582
PRESOLVE_STMT
#define PRESOLVE_STMT(s)
Definition: CoinPresolveMatrix.hpp:70
CoinPresolveMatrix::unsetRowUsed
void unsetRowUsed(int i)
Mark row as unused.
Definition: CoinPresolveMatrix.hpp:1378
CoinPrePostsolveMatrix::getColUpper
const double * getColUpper() const
Get column upper bounds.
Definition: CoinPresolveMatrix.hpp:486
CoinPrePostsolveMatrix::rlo_
double * rlo_
Row (constraint) lower bounds.
Definition: CoinPresolveMatrix.hpp:601
CoinPresolveMatrix::colProhibited
bool colProhibited(int i) const
Test if column is eligible for preprocessing.
Definition: CoinPresolveMatrix.hpp:1260
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:1559
CoinPresolveMatrix::presolveOptions
int presolveOptions() const
Picks up any special options.
Definition: CoinPresolveMatrix.hpp:981