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
ClpSimplex.hpp
Go to the documentation of this file.
1 /* $Id: ClpSimplex.hpp 2114 2015-02-10 12:12:46Z 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 Authors
7
8 John Forrest
9
10 */
11 #ifndef ClpSimplex_H
12 #define ClpSimplex_H
13
14 #include <iostream>
15 #include <cfloat>
16 #include "ClpModel.hpp"
17 #include "ClpMatrixBase.hpp"
18 #include "ClpSolve.hpp"
19 #include "ClpConfig.h"
20 class ClpDualRowPivot;
21 class ClpPrimalColumnPivot;
22 class ClpFactorization;
23 class CoinIndexedVector;
24 class ClpNonLinearCost;
25 class ClpNodeStuff;
26 class CoinStructuredModel;
27 class OsiClpSolverInterface;
28 class CoinWarmStartBasis;
29 class ClpDisasterHandler;
30 class ClpConstraint;
31 /*
32 May want to use Clp defaults so that with ABC defined but not used
33 it behaves as Clp (and ABC used will be different than if not defined)
34 */
35 #ifdef ABC_INHERIT
36 #ifndef CLP_INHERIT_MODE
37 #define CLP_INHERIT_MODE 1
38 #endif
39 #ifndef ABC_CLP_DEFAULTS
40 #define ABC_CLP_DEFAULTS 0
41 #endif
42 #else
43 #undef ABC_CLP_DEFAULTS
44 #define ABC_CLP_DEFAULTS 1
45 #endif
46 #ifdef CLP_HAS_ABC
47 #include "AbcCommon.hpp"
48 class AbcTolerancesEtc;
49 class AbcSimplex;
50 #include "CoinAbcCommon.hpp"
51 #endif
52
70 class ClpSimplex : public ClpModel {
71 friend void ClpSimplexUnitTest(const std::string & mpsDir);
72
73 public:
78 enum Status {
79 isFree = 0x00,
80 basic = 0x01,
81 atUpperBound = 0x02,
82 atLowerBound = 0x03,
83 superBasic = 0x04,
84 isFixed = 0x05
85 };
86 // For Dual
87 enum FakeBound {
88 noFake = 0x00,
89 lowerFake = 0x01,
90 upperFake = 0x02,
91 bothFake = 0x03
92 };
93
96 ClpSimplex (bool emptyMessages = false );
98
103 ClpSimplex(const ClpSimplex & rhs, int scalingMode = -1);
108 ClpSimplex(const ClpModel & rhs, int scalingMode = -1);
115 ClpSimplex (const ClpModel * wholeModel,
116 int numberRows, const int * whichRows,
117 int numberColumns, const int * whichColumns,
118 bool dropNames = true, bool dropIntegers = true,
119 bool fixOthers = false);
126 ClpSimplex (const ClpSimplex * wholeModel,
127 int numberRows, const int * whichRows,
128 int numberColumns, const int * whichColumns,
129 bool dropNames = true, bool dropIntegers = true,
130 bool fixOthers = false);
134 ClpSimplex (ClpSimplex * wholeModel,
135 int numberColumns, const int * whichColumns);
138 void originalModel(ClpSimplex * miniModel);
139 inline int abcState() const
140 { return abcState_;}
141 inline void setAbcState(int state)
142 { abcState_=state;}
143 #ifdef ABC_INHERIT
144 inline AbcSimplex * abcSimplex() const
145 { return abcSimplex_;}
146 inline void setAbcSimplex(AbcSimplex * simplex)
147 { abcSimplex_=simplex;}
149 int doAbcDual();
151 int doAbcPrimal(int ifValuesPass);
152 #endif
153
158 void setPersistenceFlag(int value);
160 void makeBaseModel();
162 void deleteBaseModel();
164 inline ClpSimplex * baseModel() const {
165 return baseModel_;
166 }
170 void setToBaseModel(ClpSimplex * model = NULL);
172 ClpSimplex & operator=(const ClpSimplex & rhs);
174 ~ClpSimplex ( );
175 // Ones below are just ClpModel with some changes
187 void loadProblem ( const ClpMatrixBase& matrix,
188 const double* collb, const double* colub,
189 const double* obj,
190 const double* rowlb, const double* rowub,
191 const double * rowObjective = NULL);
192 void loadProblem ( const CoinPackedMatrix& matrix,
193 const double* collb, const double* colub,
194 const double* obj,
195 const double* rowlb, const double* rowub,
196 const double * rowObjective = NULL);
197
200 void loadProblem ( const int numcols, const int numrows,
201 const CoinBigIndex* start, const int* index,
202 const double* value,
203 const double* collb, const double* colub,
204 const double* obj,
205 const double* rowlb, const double* rowub,
206 const double * rowObjective = NULL);
208 void loadProblem ( const int numcols, const int numrows,
209 const CoinBigIndex* start, const int* index,
210 const double* value, const int * length,
211 const double* collb, const double* colub,
212 const double* obj,
213 const double* rowlb, const double* rowub,
214 const double * rowObjective = NULL);
219 int loadProblem ( CoinModel & modelObject, bool keepSolution = false);
221 int readMps(const char *filename,
222 bool keepNames = false,
223 bool ignoreErrors = false);
225 int readGMPL(const char *filename, const char * dataName,
226 bool keepNames = false);
229 int readLp(const char *filename, const double epsilon = 1e-5);
234 void borrowModel(ClpModel & otherModel);
235 void borrowModel(ClpSimplex & otherModel);
237 void passInEventHandler(const ClpEventHandler * eventHandler);
239 void getbackSolution(const ClpSimplex & smallModel, const int * whichRow, const int * whichColumn);
248 int loadNonLinear(void * info, int & numberConstraints,
249 ClpConstraint ** & constraints);
250 #ifdef ABC_INHERIT
251 void loadTolerancesEtc(const AbcTolerancesEtc & data);
254 void unloadTolerancesEtc(AbcTolerancesEtc & data);
255 #endif
256
257
263 int initialSolve(ClpSolve & options);
265 int initialSolve();
267 int initialDualSolve();
269 int initialPrimalSolve();
271 int initialBarrierSolve();
273 int initialBarrierNoCrossSolve();
284 int dual(int ifValuesPass = 0, int startFinishOptions = 0);
285 // If using Debug
286 int dualDebug(int ifValuesPass = 0, int startFinishOptions = 0);
297 int primal(int ifValuesPass = 0, int startFinishOptions = 0);
303 int nonlinearSLP(int numberPasses, double deltaTolerance);
309 int nonlinearSLP(int numberConstraints, ClpConstraint ** constraints,
310 int numberPasses, double deltaTolerance);
313 int barrier(bool crossover = true);
316 int reducedGradient(int phase = 0);
318 int solve(CoinStructuredModel * model);
319 #ifdef ABC_INHERIT
320
325 AbcSimplex * dealWithAbc(int solveType,int startUp,bool interrupt=false);
326 //void dealWithAbc(int solveType,int startUp,bool interrupt=false);
327 #endif
328
334 int loadProblem ( CoinStructuredModel & modelObject,
335 bool originalOrder = true, bool keepSolution = false);
350 int cleanup(int cleanupScaling);
371 int dualRanging(int numberCheck, const int * which,
372 double * costIncrease, int * sequenceIncrease,
373 double * costDecrease, int * sequenceDecrease,
374 double * valueIncrease = NULL, double * valueDecrease = NULL);
389 int primalRanging(int numberCheck, const int * which,
390 double * valueIncrease, int * sequenceIncrease,
391 double * valueDecrease, int * sequenceDecrease);
401 int modifyCoefficientsAndPivot(int number,
402 const int * which,
403 const CoinBigIndex * start,
404 const int * row,
405 const double * newCoefficient,
406 const unsigned char * newStatus=NULL,
407 const double * newLower=NULL,
408 const double * newUpper=NULL,
409 const double * newObjective=NULL);
417 int outDuplicateRows(int numberLook,int * whichRows, bool noOverlaps=false, double tolerance=-1.0,
418 double cleanUp=0.0);
421 double moveTowardsPrimalFeasible();
424 void removeSuperBasicSlacks(int threshold=0);
437 ClpSimplex * miniPresolve(char * rowType, char * columnType,void ** info);
439 void miniPostsolve(const ClpSimplex * presolvedModel,void * info);
441 void miniSolve(char * rowType, char *columnType,int algorithm, int startUp);
456 int writeBasis(const char *filename,
457 bool writeValues = false,
458 int formatType = 0) const;
461 int readBasis(const char *filename);
463 CoinWarmStartBasis * getBasis() const;
465 void setFactorization( ClpFactorization & factorization);
466 // Swaps factorization
467 ClpFactorization * swapFactorization( ClpFactorization * factorization);
469 void copyFactorization( ClpFactorization & factorization);
479 int tightenPrimalBounds(double factor = 0.0, int doTight = 0, bool tightIntegers = false);
496 int crash(double gap, int pivot);
498 void setDualRowPivotAlgorithm(ClpDualRowPivot & choice);
500 void setPrimalColumnPivotAlgorithm(ClpPrimalColumnPivot & choice);
502 void markHotStart(void * & saveStuff);
504 void solveFromHotStart(void * saveStuff);
506 void unmarkHotStart(void * saveStuff);
515 int strongBranching(int numberVariables, const int * variables,
516 double * newLower, double * newUpper,
517 double ** outputSolution,
518 int * outputStatus, int * outputIterations,
519 bool stopOnFirstInfeasible = true,
520 bool alwaysFinish = false,
521 int startFinishOptions = 0);
523 int fathom(void * stuff);
529 int fathomMany(void * stuff);
531 double doubleCheck();
533 int startFastDual2(ClpNodeStuff * stuff);
535 int fastDual2(ClpNodeStuff * stuff);
537 void stopFastDual2(ClpNodeStuff * stuff);
544 ClpSimplex * fastCrunch(ClpNodeStuff * stuff, int mode);
546
554 int pivot();
555
561 int primalPivotResult();
562
568 int dualPivotResultPart1();
572 int pivotResultPart2(int algorithm,int state);
573
585 int startup(int ifValuesPass, int startFinishOptions = 0);
586 void finish(int startFinishOptions = 0);
587
589 bool statusOfProblem(bool initial = false);
591 void defaultFactorizationFrequency();
593 void copyEnabledStuff(const ClpSimplex * rhs);
595
598 inline bool primalFeasible() const {
600 return (numberPrimalInfeasibilities_ == 0);
601 }
603 inline bool dualFeasible() const {
604 return (numberDualInfeasibilities_ == 0);
605 }
607 inline ClpFactorization * factorization() const {
608 return factorization_;
609 }
611 bool sparseFactorization() const;
612 void setSparseFactorization(bool value);
614 int factorizationFrequency() const;
615 void setFactorizationFrequency(int value);
617 inline double dualBound() const {
618 return dualBound_;
619 }
620 void setDualBound(double value);
622 inline double infeasibilityCost() const {
623 return infeasibilityCost_;
624 }
625 void setInfeasibilityCost(double value);
642 inline int perturbation() const {
643 return perturbation_;
644 }
645 void setPerturbation(int value);
647 inline int algorithm() const {
648 return algorithm_;
649 }
651 inline void setAlgorithm(int value) {
652 algorithm_ = value;
653 }
655 bool isObjectiveLimitTestValid() const ;
657 inline double sumDualInfeasibilities() const {
658 return sumDualInfeasibilities_;
659 }
660 inline void setSumDualInfeasibilities(double value) {
661 sumDualInfeasibilities_ = value;
662 }
664 inline double sumOfRelaxedDualInfeasibilities() const {
665 return sumOfRelaxedDualInfeasibilities_;
666 }
667 inline void setSumOfRelaxedDualInfeasibilities(double value) {
668 sumOfRelaxedDualInfeasibilities_ = value;
669 }
671 inline int numberDualInfeasibilities() const {
672 return numberDualInfeasibilities_;
673 }
674 inline void setNumberDualInfeasibilities(int value) {
675 numberDualInfeasibilities_ = value;
676 }
678 inline int numberDualInfeasibilitiesWithoutFree() const {
679 return numberDualInfeasibilitiesWithoutFree_;
680 }
682 inline double sumPrimalInfeasibilities() const {
683 return sumPrimalInfeasibilities_;
684 }
685 inline void setSumPrimalInfeasibilities(double value) {
686 sumPrimalInfeasibilities_ = value;
687 }
689 inline double sumOfRelaxedPrimalInfeasibilities() const {
690 return sumOfRelaxedPrimalInfeasibilities_;
691 }
692 inline void setSumOfRelaxedPrimalInfeasibilities(double value) {
693 sumOfRelaxedPrimalInfeasibilities_ = value;
694 }
696 inline int numberPrimalInfeasibilities() const {
697 return numberPrimalInfeasibilities_;
698 }
699 inline void setNumberPrimalInfeasibilities(int value) {
700 numberPrimalInfeasibilities_ = value;
701 }
708 int saveModel(const char * fileName);
711 int restoreModel(const char * fileName);
712
720 void checkSolution(int setToBounds = 0);
723 void checkSolutionInternal();
725 void checkUnscaledSolution();
727 inline CoinIndexedVector * rowArray(int index) const {
728 return rowArray_[index];
729 }
731 inline CoinIndexedVector * columnArray(int index) const {
732 return columnArray_[index];
733 }
735
736 /******************** End of most useful part **************/
742 int getSolution ( const double * rowActivities,
743 const double * columnActivities);
747 int getSolution ();
754 int createPiecewiseLinearCosts(const int * starts,
755 const double * lower, const double * gradient);
757 inline ClpDualRowPivot * dualRowPivot() const {
758 return dualRowPivot_;
759 }
761 inline ClpPrimalColumnPivot * primalColumnPivot() const {
762 return primalColumnPivot_;
763 }
765 inline bool goodAccuracy() const {
766 return (largestPrimalError_ < 1.0e-7 && largestDualError_ < 1.0e-7);
767 }
769 void returnModel(ClpSimplex & otherModel);
777 int internalFactorize(int solveType);
779 ClpDataSave saveData() ;
781 void restoreData(ClpDataSave saved);
783 void cleanStatus();
785 int factorize();
788 void computeDuals(double * givenDjs);
790 void computePrimals ( const double * rowActivities,
791 const double * columnActivities);
793 void add(double * array,
794 int column, double multiplier) const;
800 void unpack(CoinIndexedVector * rowArray) const ;
806 void unpack(CoinIndexedVector * rowArray, int sequence) const;
813 void unpackPacked(CoinIndexedVector * rowArray) ;
820 void unpackPacked(CoinIndexedVector * rowArray, int sequence);
821 #ifndef CLP_USER_DRIVEN
822 protected:
823 #endif
824
828 int housekeeping(double objectiveChange);
831 void checkPrimalSolution(const double * rowActivities = NULL,
832 const double * columnActivies = NULL);
835 void checkDualSolution();
837 void checkBothSolutions();
842 double scaleObjective(double value);
844 int solveDW(CoinStructuredModel * model, ClpSolve & options);
846 int solveBenders(CoinStructuredModel * model, ClpSolve & options);
847 public:
858 void setValuesPassAction(double incomingInfeasibility,
859 double allowedInfeasibility);
862 int cleanFactorization(int ifValuesPass);
864
866 public:
868 inline double alphaAccuracy() const {
869 return alphaAccuracy_;
870 }
871 inline void setAlphaAccuracy(double value) {
872 alphaAccuracy_ = value;
873 }
874 public:
876 //inline double objectiveValue() const {
877 //return (objectiveValue_-bestPossibleImprovement_)*optimizationDirection_ - dblParam_[ClpObjOffset];
878 //}
880 inline void setDisasterHandler(ClpDisasterHandler * handler) {
881 disasterArea_ = handler;
882 }
884 inline ClpDisasterHandler * disasterHandler() const {
885 return disasterArea_;
886 }
888 inline double largeValue() const {
889 return largeValue_;
890 }
891 void setLargeValue( double value) ;
893 inline double largestPrimalError() const {
894 return largestPrimalError_;
895 }
897 inline double largestDualError() const {
898 return largestDualError_;
899 }
901 inline void setLargestPrimalError(double value) {
902 largestPrimalError_ = value;
903 }
905 inline void setLargestDualError(double value) {
906 largestDualError_ = value;
907 }
909 inline double zeroTolerance() const {
910 return zeroTolerance_;/*factorization_->zeroTolerance();*/
911 }
913 inline void setZeroTolerance( double value) {
914 zeroTolerance_ = value;
915 }
917 inline int * pivotVariable() const {
918 return pivotVariable_;
919 }
921 inline bool automaticScaling() const {
922 return automaticScale_ != 0;
923 }
924 inline void setAutomaticScaling(bool onOff) {
925 automaticScale_ = onOff ? 1 : 0;
926 }
928 inline double currentDualTolerance() const {
929 return dualTolerance_;
930 }
931 inline void setCurrentDualTolerance(double value) {
932 dualTolerance_ = value;
933 }
935 inline double currentPrimalTolerance() const {
936 return primalTolerance_;
937 }
938 inline void setCurrentPrimalTolerance(double value) {
939 primalTolerance_ = value;
940 }
942 inline int numberRefinements() const {
943 return numberRefinements_;
944 }
945 void setNumberRefinements( int value) ;
947 inline double alpha() const {
948 return alpha_;
949 }
950 inline void setAlpha(double value) {
951 alpha_ = value;
952 }
954 inline double dualIn() const {
955 return dualIn_;
956 }
958 inline void setDualIn(double value) {
959 dualIn_ = value;
960 }
962 inline int pivotRow() const {
963 return pivotRow_;
964 }
965 inline void setPivotRow(int value) {
966 pivotRow_ = value;
967 }
969 double valueIncomingDual() const;
971
972 #ifndef CLP_USER_DRIVEN
973 protected:
974 #endif
975
980 int gutsOfSolution ( double * givenDuals,
981 const double * givenPrimals,
982 bool valuesPass = false);
984 void gutsOfDelete(int type);
986 void gutsOfCopy(const ClpSimplex & rhs);
998 bool createRim(int what, bool makeRowCopy = false, int startFinishOptions = 0);
1000 void createRim1(bool initial);
1002 void createRim4(bool initial);
1004 void createRim5(bool initial);
1009 void deleteRim(int getRidOfFactorizationData = 2);
1011 bool sanityCheck();
1013 public:
1018 inline double * solutionRegion(int section) const {
1019 if (!section) return rowActivityWork_;
1020 else return columnActivityWork_;
1021 }
1022 inline double * djRegion(int section) const {
1023 if (!section) return rowReducedCost_;
1024 else return reducedCostWork_;
1025 }
1026 inline double * lowerRegion(int section) const {
1027 if (!section) return rowLowerWork_;
1028 else return columnLowerWork_;
1029 }
1030 inline double * upperRegion(int section) const {
1031 if (!section) return rowUpperWork_;
1032 else return columnUpperWork_;
1033 }
1034 inline double * costRegion(int section) const {
1035 if (!section) return rowObjectiveWork_;
1036 else return objectiveWork_;
1037 }
1039 inline double * solutionRegion() const {
1040 return solution_;
1041 }
1042 inline double * djRegion() const {
1043 return dj_;
1044 }
1045 inline double * lowerRegion() const {
1046 return lower_;
1047 }
1048 inline double * upperRegion() const {
1049 return upper_;
1050 }
1051 inline double * costRegion() const {
1052 return cost_;
1053 }
1054 inline Status getStatus(int sequence) const {
1055 return static_cast<Status> (status_[sequence] & 7);
1056 }
1057 inline void setStatus(int sequence, Status newstatus) {
1058 unsigned char & st_byte = status_[sequence];
1059 st_byte = static_cast<unsigned char>(st_byte & ~7);
1060 st_byte = static_cast<unsigned char>(st_byte | newstatus);
1061 }
1063 bool startPermanentArrays();
1068 void setInitialDenseFactorization(bool onOff);
1069 bool initialDenseFactorization() const;
1071 inline int sequenceIn() const {
1072 return sequenceIn_;
1073 }
1074 inline int sequenceOut() const {
1075 return sequenceOut_;
1076 }
1078 inline void setSequenceIn(int sequence) {
1079 sequenceIn_ = sequence;
1080 }
1081 inline void setSequenceOut(int sequence) {
1082 sequenceOut_ = sequence;
1083 }
1085 inline int directionIn() const {
1086 return directionIn_;
1087 }
1088 inline int directionOut() const {
1089 return directionOut_;
1090 }
1092 inline void setDirectionIn(int direction) {
1093 directionIn_ = direction;
1094 }
1095 inline void setDirectionOut(int direction) {
1096 directionOut_ = direction;
1097 }
1099 inline double valueOut() const {
1100 return valueOut_;
1101 }
1103 inline void setValueOut(double value) {
1104 valueOut_ = value;
1105 }
1107 inline double dualOut() const {
1108 return dualOut_;
1109 }
1111 inline void setDualOut(double value) {
1112 dualOut_ = value;
1113 }
1115 inline void setLowerOut(double value) {
1116 lowerOut_ = value;
1117 }
1119 inline void setUpperOut(double value) {
1120 upperOut_ = value;
1121 }
1123 inline void setTheta(double value) {
1124 theta_ = value;
1125 }
1127 inline int isColumn(int sequence) const {
1128 return sequence < numberColumns_ ? 1 : 0;
1129 }
1131 inline int sequenceWithin(int sequence) const {
1132 return sequence < numberColumns_ ? sequence : sequence - numberColumns_;
1133 }
1135 inline double solution(int sequence) {
1136 return solution_[sequence];
1137 }
1139 inline double & solutionAddress(int sequence) {
1140 return solution_[sequence];
1141 }
1142 inline double reducedCost(int sequence) {
1143 return dj_[sequence];
1144 }
1145 inline double & reducedCostAddress(int sequence) {
1146 return dj_[sequence];
1147 }
1148 inline double lower(int sequence) {
1149 return lower_[sequence];
1150 }
1152 inline double & lowerAddress(int sequence) {
1153 return lower_[sequence];
1154 }
1155 inline double upper(int sequence) {
1156 return upper_[sequence];
1157 }
1159 inline double & upperAddress(int sequence) {
1160 return upper_[sequence];
1161 }
1162 inline double cost(int sequence) {
1163 return cost_[sequence];
1164 }
1166 inline double & costAddress(int sequence) {
1167 return cost_[sequence];
1168 }
1170 inline double originalLower(int iSequence) const {
1171 if (iSequence < numberColumns_) return columnLower_[iSequence];
1172 else
1173 return rowLower_[iSequence-numberColumns_];
1174 }
1176 inline double originalUpper(int iSequence) const {
1177 if (iSequence < numberColumns_) return columnUpper_[iSequence];
1178 else
1179 return rowUpper_[iSequence-numberColumns_];
1180 }
1182 inline double theta() const {
1183 return theta_;
1184 }
1187 inline double bestPossibleImprovement() const {
1188 return bestPossibleImprovement_;
1189 }
1191 inline ClpNonLinearCost * nonLinearCost() const {
1192 return nonLinearCost_;
1193 }
1215 inline int moreSpecialOptions() const {
1216 return moreSpecialOptions_;
1217 }
1243 inline void setMoreSpecialOptions(int value) {
1244 moreSpecialOptions_ = value;
1245 }
1247
1249 inline void setFakeBound(int sequence, FakeBound fakeBound) {
1250 unsigned char & st_byte = status_[sequence];
1251 st_byte = static_cast<unsigned char>(st_byte & ~24);
1252 st_byte = static_cast<unsigned char>(st_byte | (fakeBound << 3));
1253 }
1254 inline FakeBound getFakeBound(int sequence) const {
1255 return static_cast<FakeBound> ((status_[sequence] >> 3) & 3);
1256 }
1257 inline void setRowStatus(int sequence, Status newstatus) {
1258 unsigned char & st_byte = status_[sequence+numberColumns_];
1259 st_byte = static_cast<unsigned char>(st_byte & ~7);
1260 st_byte = static_cast<unsigned char>(st_byte | newstatus);
1261 }
1262 inline Status getRowStatus(int sequence) const {
1263 return static_cast<Status> (status_[sequence+numberColumns_] & 7);
1264 }
1265 inline void setColumnStatus(int sequence, Status newstatus) {
1266 unsigned char & st_byte = status_[sequence];
1267 st_byte = static_cast<unsigned char>(st_byte & ~7);
1268 st_byte = static_cast<unsigned char>(st_byte | newstatus);
1269 }
1270 inline Status getColumnStatus(int sequence) const {
1271 return static_cast<Status> (status_[sequence] & 7);
1272 }
1273 inline void setPivoted( int sequence) {
1274 status_[sequence] = static_cast<unsigned char>(status_[sequence] | 32);
1275 }
1276 inline void clearPivoted( int sequence) {
1277 status_[sequence] = static_cast<unsigned char>(status_[sequence] & ~32);
1278 }
1279 inline bool pivoted(int sequence) const {
1280 return (((status_[sequence] >> 5) & 1) != 0);
1281 }
1283 void setFlagged( int sequence);
1284 inline void clearFlagged( int sequence) {
1285 status_[sequence] = static_cast<unsigned char>(status_[sequence] & ~64);
1286 }
1287 inline bool flagged(int sequence) const {
1288 return ((status_[sequence] & 64) != 0);
1289 }
1291 inline void setActive( int iRow) {
1292 status_[iRow] = static_cast<unsigned char>(status_[iRow] | 128);
1293 }
1294 inline void clearActive( int iRow) {
1295 status_[iRow] = static_cast<unsigned char>(status_[iRow] & ~128);
1296 }
1297 inline bool active(int iRow) const {
1298 return ((status_[iRow] & 128) != 0);
1299 }
1301 inline void setPerturbed( int iSequence) {
1302 status_[iSequence] = static_cast<unsigned char>(status_[iSequence] | 128);
1303 }
1304 inline void clearPerturbed( int iSequence) {
1305 status_[iSequence] = static_cast<unsigned char>(status_[iSequence] & ~128);
1306 }
1307 inline bool perturbed(int iSequence) const {
1308 return ((status_[iSequence] & 128) != 0);
1309 }
1312 void createStatus() ;
1315 void allSlackBasis(bool resetSolution = false);
1316
1318 inline int lastBadIteration() const {
1319 return lastBadIteration_;
1320 }
1322 inline void setLastBadIteration(int value) {
1323 lastBadIteration_=value;
1324 }
1326 inline int progressFlag() const {
1327 return (progressFlag_ & 3);
1328 }
1330 inline ClpSimplexProgress * progress()
1331 { return &progress_;}
1333 inline int forceFactorization() const {
1334 return forceFactorization_ ;
1335 }
1337 inline void forceFactorization(int value) {
1338 forceFactorization_ = value;
1339 }
1341 inline double rawObjectiveValue() const {
1342 return objectiveValue_;
1343 }
1345 void computeObjectiveValue(bool useWorkingSolution = false);
1347 double computeInternalObjectiveValue();
1350 double * infeasibilityRay(bool fullRay=false) const;
1354 inline int numberExtraRows() const {
1355 return numberExtraRows_;
1356 }
1359 inline int maximumBasic() const {
1360 return maximumBasic_;
1361 }
1363 inline int baseIteration() const {
1364 return baseIteration_;
1365 }
1367 void generateCpp( FILE * fp, bool defaultFactor = false);
1369 ClpFactorization * getEmptyFactorization();
1371 void setEmptyFactorization();
1373 void moveInfo(const ClpSimplex & rhs, bool justStatus = false);
1375
1377 // These are only to be used using startFinishOptions (ClpSimplexDual, ClpSimplexPrimal)
1378 // *** At present only without scaling
1379 // *** Slacks havve -1.0 element (so == row activity) - take care
1381 void getBInvARow(int row, double* z, double * slack = NULL);
1382
1384 void getBInvRow(int row, double* z);
1385
1387 void getBInvACol(int col, double* vec);
1388
1390 void getBInvCol(int col, double* vec);
1391
1396 void getBasics(int* index);
1397
1399 //-------------------------------------------------------------------------
1403 void setObjectiveCoefficient( int elementIndex, double elementValue );
1405 inline void setObjCoeff( int elementIndex, double elementValue ) {
1406 setObjectiveCoefficient( elementIndex, elementValue);
1407 }
1408
1411 void setColumnLower( int elementIndex, double elementValue );
1412
1415 void setColumnUpper( int elementIndex, double elementValue );
1416
1418 void setColumnBounds( int elementIndex,
1419 double lower, double upper );
1420
1429 void setColumnSetBounds(const int* indexFirst,
1430 const int* indexLast,
1431 const double* boundList);
1432
1435 inline void setColLower( int elementIndex, double elementValue ) {
1436 setColumnLower(elementIndex, elementValue);
1437 }
1440 inline void setColUpper( int elementIndex, double elementValue ) {
1441 setColumnUpper(elementIndex, elementValue);
1442 }
1443
1445 inline void setColBounds( int elementIndex,
1446 double newlower, double newupper ) {
1447 setColumnBounds(elementIndex, newlower, newupper);
1448 }
1449
1456 inline void setColSetBounds(const int* indexFirst,
1457 const int* indexLast,
1458 const double* boundList) {
1459 setColumnSetBounds(indexFirst, indexLast, boundList);
1460 }
1461
1464 void setRowLower( int elementIndex, double elementValue );
1465
1468 void setRowUpper( int elementIndex, double elementValue ) ;
1469
1471 void setRowBounds( int elementIndex,
1472 double lower, double upper ) ;
1473
1480 void setRowSetBounds(const int* indexFirst,
1481 const int* indexLast,
1482 const double* boundList);
1484 void resize (int newNumberRows, int newNumberColumns);
1485
1487
1489 protected:
1490
1499 double bestPossibleImprovement_;
1501 double zeroTolerance_;
1503 int columnPrimalSequence_;
1505 int rowPrimalSequence_;
1507 double bestObjectiveValue_;
1509 int moreSpecialOptions_;
1511 int baseIteration_;
1513 double primalToleranceToGetOptimal_;
1515 double largeValue_;
1517 double largestPrimalError_;
1519 double largestDualError_;
1521 double alphaAccuracy_;
1523 double dualBound_;
1525 double alpha_;
1527 double theta_;
1529 double lowerIn_;
1531 double valueIn_;
1533 double upperIn_;
1535 double dualIn_;
1537 double lowerOut_;
1539 double valueOut_;
1541 double upperOut_;
1543 double dualOut_;
1545 double dualTolerance_;
1547 double primalTolerance_;
1549 double sumDualInfeasibilities_;
1551 double sumPrimalInfeasibilities_;
1553 double infeasibilityCost_;
1555 double sumOfRelaxedDualInfeasibilities_;
1557 double sumOfRelaxedPrimalInfeasibilities_;
1559 double acceptablePivot_;
1561 double minimumPrimalTolerance_;
1563 #define CLP_INFEAS_SAVE 5
1564 double averageInfeasibility_[CLP_INFEAS_SAVE];
1566 double * lower_;
1568 double * rowLowerWork_;
1570 double * columnLowerWork_;
1572 double * upper_;
1574 double * rowUpperWork_;
1576 double * columnUpperWork_;
1578 double * cost_;
1580 double * rowObjectiveWork_;
1582 double * objectiveWork_;
1584 CoinIndexedVector * rowArray_[6];
1586 CoinIndexedVector * columnArray_[6];
1588 int sequenceIn_;
1590 int directionIn_;
1592 int sequenceOut_;
1594 int directionOut_;
1596 int pivotRow_;
1598 int lastGoodIteration_;
1600 double * dj_;
1602 double * rowReducedCost_;
1604 double * reducedCostWork_;
1606 double * solution_;
1608 double * rowActivityWork_;
1610 double * columnActivityWork_;
1612 int numberDualInfeasibilities_;
1614 int numberDualInfeasibilitiesWithoutFree_;
1616 int numberPrimalInfeasibilities_;
1618 int numberRefinements_;
1620 ClpDualRowPivot * dualRowPivot_;
1622 ClpPrimalColumnPivot * primalColumnPivot_;
1624 int * pivotVariable_;
1626 ClpFactorization * factorization_;
1628 double * savedSolution_;
1630 int numberTimesOptimal_;
1632 ClpDisasterHandler * disasterArea_;
1634 int changeMade_;
1636 int algorithm_;
1639 int forceFactorization_;
1647 int perturbation_;
1649 unsigned char * saveStatus_;
1654 ClpNonLinearCost * nonLinearCost_;
1656 int lastBadIteration_;
1658 int lastFlaggedIteration_;
1660 int numberFake_;
1662 int numberChanged_;
1664 int progressFlag_;
1666 int firstFree_;
1670 int numberExtraRows_;
1673 int maximumBasic_;
1675 int dontFactorizePivots_;
1685 double incomingInfeasibility_;
1686 double allowedInfeasibility_;
1688 int automaticScale_;
1690 int maximumPerturbationSize_;
1692 double * perturbationArray_;
1694 ClpSimplex * baseModel_;
1696 ClpSimplexProgress progress_;
1697 #ifdef ABC_INHERIT
1698 AbcSimplex * abcSimplex_;
1699 #define CLP_ABC_WANTED 1
1700 #define CLP_ABC_WANTED_PARALLEL 2
1701 #define CLP_ABC_FULL_DONE 8
1702 // bits 256,512,1024 for crash
1703 #endif
1704 #define CLP_ABC_BEEN_FEASIBLE 65536
1705 int abcState_;
1707 int numberDegeneratePivots_;
1708 public:
1710 mutable int spareIntArray_[4];
1712 mutable double spareDoubleArray_[4];
1713 protected:
1715 friend class OsiClpSolverInterface;
1717 friend class OsiCLPSolverInterface;
1719 };
1720 //#############################################################################
1729 void
1730 ClpSimplexUnitTest(const std::string & mpsDir);
1731
1732 // For Devex stuff
1733 #define DEVEX_TRY_NORM 1.0e-4
1734 #define DEVEX_ADD_ONE 1.0
1735 #if defined(ABC_INHERIT) || defined(CBC_THREAD) || defined(THREADS_IN_ANALYZE)
1736 // Use pthreads
1737 #include <pthread.h>
1738 typedef struct {
1739 double result;
1740 //const CoinIndexedVector * constVector; // can get rid of
1741 //CoinIndexedVector * vectors[2]; // can get rid of
1742 void * extraInfo;
1743 void * extraInfo2;
1744 int status;
1745 int stuff[4];
1746 } CoinThreadInfo;
1747 class CoinPthreadStuff {
1748 public:
1753 CoinPthreadStuff (int numberThreads=0,
1754 void * parallelManager(void * stuff)=NULL);
1756 CoinPthreadStuff & operator=(const CoinPthreadStuff & rhs);
1758 ~CoinPthreadStuff ( );
1760 inline void setStopStart(int value)
1761 { stopStart_=value;}
1762 #ifndef NUMBER_THREADS
1763 #define NUMBER_THREADS 8
1764 #endif
1765 // For waking up thread
1766 inline pthread_mutex_t * mutexPointer(int which,int thread=0)
1767 { return mutex_+which+3*thread;}
1768 #ifdef PTHREAD_BARRIER_SERIAL_THREAD
1769 inline pthread_barrier_t * barrierPointer()
1770 { return &barrier_;}
1771 #endif
1772 inline int whichLocked(int thread=0) const
1773 { return locked_[thread];}
1774 inline CoinThreadInfo * threadInfoPointer(int thread=0)
1775 { return threadInfo_+thread;}
1776 void startParallelTask(int type,int iThread,void * info=NULL);
1777 int waitParallelTask(int type, int & iThread,bool allowIdle);
1778 void waitAllTasks();
1780 int whichThread() const;
1781 void sayIdle(int iThread);
1782 //void startThreads(int numberThreads);
1783 //void stopThreads();
1784 // For waking up thread
1785 pthread_mutex_t mutex_[3*(NUMBER_THREADS+1)];
1786 #ifdef PTHREAD_BARRIER_SERIAL_THREAD
1787 pthread_barrier_t barrier_;
1788 #endif
1789 CoinThreadInfo threadInfo_[NUMBER_THREADS+1];
1790 pthread_t abcThread_[NUMBER_THREADS+1];
1791 int locked_[NUMBER_THREADS+1];
1792 int stopStart_;
1793 int numberThreads_;
1794 };
1795 void * clp_parallelManager(void * stuff);
1796 #endif
1797 #endif
ClpSimplex::djRegion
double * djRegion() const
Definition: ClpSimplex.hpp:1042
ClpSimplex::deleteRim
void deleteRim(int getRidOfFactorizationData=2)
releases above arrays and does solution scaling out.
ClpSolve
This is a very simple class to guide algorithms.
Definition: ClpSolve.hpp:20
ClpSimplex::lowerIn_
double lowerIn_
Lower Bound on In variable.
Definition: ClpSimplex.hpp:1529
ClpSimplex::alpha
double alpha() const
Alpha (pivot element) for use by classes e.g. steepestedge.
Definition: ClpSimplex.hpp:947
ClpSimplex::solveDW
int solveDW(CoinStructuredModel *model, ClpSolve &options)
Solve using Dantzig-Wolfe decomposition and maybe in parallel.
ClpSimplex::setObjCoeff
void setObjCoeff(int elementIndex, double elementValue)
Set an objective function coefficient.
Definition: ClpSimplex.hpp:1405
ClpSimplex::maximumBasic
int maximumBasic() const
Maximum number of basic variables - can be more than number of rows if GUB.
Definition: ClpSimplex.hpp:1359
ClpSimplex::reducedCostWork_
double * reducedCostWork_
Possible scaled reduced costs.
Definition: ClpSimplex.hpp:1604
ClpSimplex::returnModel
void returnModel(ClpSimplex &otherModel)
Return model - updates any scalars.
ClpSimplex::perturbation_
int perturbation_
Perturbation: -50 to +50 - perturb by this power of ten (-6 sounds good) 100 - auto perturb if takes ...
Definition: ClpSimplex.hpp:1647
ClpSimplex::setColumnBounds
void setColumnBounds(int elementIndex, double lower, double upper)
Set a single column lower and upper bound.
ClpSimplex::getSolution
int getSolution()
Given an existing factorization computes and checks primal and dual solutions.
ClpSimplex::setRowUpper
void setRowUpper(int elementIndex, double elementValue)
Set a single row upper bound Use DBL_MAX for infinity.
ClpSimplex::nonLinearCost_
ClpNonLinearCost * nonLinearCost_
Very wasteful way of dealing with infeasibilities in primal.
Definition: ClpSimplex.hpp:1654
ClpSimplex::setAlpha
void setAlpha(double value)
Definition: ClpSimplex.hpp:950
ClpSimplex::startup
int startup(int ifValuesPass, int startFinishOptions=0)
Common bits of coding for dual and primal.
ClpSolve.hpp
ClpSimplex::setRowBounds
void setRowBounds(int elementIndex, double lower, double upper)
Set a single row lower and upper bound.
ClpSimplex::FakeBound
FakeBound
Definition: ClpSimplex.hpp:87
ClpSimplex::moreSpecialOptions_
int moreSpecialOptions_
More special options - see set for details.
Definition: ClpSimplex.hpp:1509
ClpSimplex::progressFlag
int progressFlag() const
Progress flag - at present 0 bit says artificials out.
Definition: ClpSimplex.hpp:1326
ClpSimplex::initialBarrierSolve
int initialBarrierSolve()
Barrier initial solve.
ClpSimplex::pivoted
bool pivoted(int sequence) const
Definition: ClpSimplex.hpp:1279
ClpSimplex::Status
Status
enums for status of various sorts.
Definition: ClpSimplex.hpp:78
ClpSimplex::atLowerBound
Definition: ClpSimplex.hpp:82
ClpModel::rowUpper_
double * rowUpper_
Row upper.
Definition: ClpModel.hpp:1138
ClpSimplex::unpack
void unpack(CoinIndexedVector *rowArray) const
Unpacks one column of the matrix into indexed array Uses sequenceIn_ Also applies scaling if needed...
ClpSimplex::lower_
double * lower_
Working copy of lower bounds (Owner of arrays below)
Definition: ClpSimplex.hpp:1566
ClpSimplex::lastBadIteration_
int lastBadIteration_
So we know when to be cautious.
Definition: ClpSimplex.hpp:1656
ClpSimplex::setMoreSpecialOptions
void setMoreSpecialOptions(int value)
Set more special options 1 bit - if presolve says infeasible in ClpSolve return 2 bit - if presolved ...
Definition: ClpSimplex.hpp:1243
ClpSimplex::infeasibilityRay
double * infeasibilityRay(bool fullRay=false) const
Infeasibility/unbounded ray (NULL returned if none/wrong) Up to user to use delete [] on these arrays...
ClpSimplex::modifyCoefficientsAndPivot
int modifyCoefficientsAndPivot(int number, const int *which, const CoinBigIndex *start, const int *row, const double *newCoefficient, const unsigned char *newStatus=NULL, const double *newLower=NULL, const double *newUpper=NULL, const double *newObjective=NULL)
Modifies coefficients etc and if necessary pivots in and out.
ClpSimplex::operator=
ClpSimplex & operator=(const ClpSimplex &rhs)
Assignment operator. This copies the data.
ClpSimplex::numberDualInfeasibilities_
int numberDualInfeasibilities_
Number of dual infeasibilities.
Definition: ClpSimplex.hpp:1612
ClpSimplex::sumDualInfeasibilities
double sumDualInfeasibilities() const
Sum of dual infeasibilities.
Definition: ClpSimplex.hpp:657
ClpSimplex::factorization_
ClpFactorization * factorization_
factorization
Definition: ClpSimplex.hpp:1626
ClpSimplex::setCurrentPrimalTolerance
void setCurrentPrimalTolerance(double value)
Definition: ClpSimplex.hpp:938
ClpSimplex::setDualBound
void setDualBound(double value)
CoinAbcCommon.hpp
ClpPrimalColumnPivot
Primal Column Pivot Abstract Base Class.
Definition: ClpPrimalColumnPivot.hpp:25
ClpSimplex::directionIn
int directionIn() const
Return direction In or Out.
Definition: ClpSimplex.hpp:1085
ClpSimplex::finish
void finish(int startFinishOptions=0)
ClpSimplex::reducedGradient
int reducedGradient(int phase=0)
Solves non-linear using reduced gradient.
ClpSimplex::dualBound_
double dualBound_
Dual bound.
Definition: ClpSimplex.hpp:1523
ClpSimplex::loadProblem
void loadProblem(const ClpMatrixBase &matrix, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub, const double *rowObjective=NULL)
Loads a problem (the constraints on the rows are given by lower and upper bounds).
ClpMatrixBase
Abstract base class for Clp Matrices.
Definition: ClpMatrixBase.hpp:38
ClpSimplex::costAddress
double & costAddress(int sequence)
Return address of row or column cost.
Definition: ClpSimplex.hpp:1166
ClpModel
Definition: ClpModel.hpp:38
ClpSimplex::setDirectionIn
void setDirectionIn(int direction)
Set directionIn or Out.
Definition: ClpSimplex.hpp:1092
ClpSimplex::setAutomaticScaling
void setAutomaticScaling(bool onOff)
Definition: ClpSimplex.hpp:924
ClpSimplex::alphaAccuracy
double alphaAccuracy() const
Initial value for alpha accuracy calculation (-1.0 off)
Definition: ClpSimplex.hpp:868
ClpSimplex::setDisasterHandler
void setDisasterHandler(ClpDisasterHandler *handler)
Objective value.
Definition: ClpSimplex.hpp:880
ClpSimplex::isColumn
int isColumn(int sequence) const
Returns 1 if sequence indicates column.
Definition: ClpSimplex.hpp:1127
AbcSimplex
Definition: AbcSimplex.hpp:62
ClpSimplex::writeBasis
int writeBasis(const char *filename, bool writeValues=false, int formatType=0) const
Write the basis in MPS format to the specified file.
ClpSimplex::basic
Definition: ClpSimplex.hpp:80
ClpSimplex::setCurrentDualTolerance
void setCurrentDualTolerance(double value)
Definition: ClpSimplex.hpp:931
ClpSimplex::restoreModel
int restoreModel(const char *fileName)
Restore model from file, returns 0 if success, deletes current model.
ClpSimplex::unmarkHotStart
void unmarkHotStart(void *saveStuff)
Delete the snapshot.
ClpSimplex::costRegion
double * costRegion() const
Definition: ClpSimplex.hpp:1051
ClpSimplex::clearFlagged
void clearFlagged(int sequence)
Definition: ClpSimplex.hpp:1284
ClpSimplex::getStatus
Status getStatus(int sequence) const
Definition: ClpSimplex.hpp:1054
ClpSimplex::costRegion
double * costRegion(int section) const
Definition: ClpSimplex.hpp:1034
ClpSimplex::incomingInfeasibility_
double incomingInfeasibility_
For advanced use.
Definition: ClpSimplex.hpp:1685
ClpSimplex::averageInfeasibility_
double averageInfeasibility_[CLP_INFEAS_SAVE]
Definition: ClpSimplex.hpp:1564
ClpSimplex::spareDoubleArray_
double spareDoubleArray_[4]
Spare double array for passing information [0]!=0 switches on.
Definition: ClpSimplex.hpp:1712
ClpSimplex::rowArray_
CoinIndexedVector * rowArray_[6]
Useful row length arrays.
Definition: ClpSimplex.hpp:1584
ClpSimplex::upperRegion
double * upperRegion() const
Definition: ClpSimplex.hpp:1048
ClpSimplex::barrier
int barrier(bool crossover=true)
Solves using barrier (assumes you have good cholesky factor code).
ClpSimplex::dualOut_
double dualOut_
Infeasibility (dual) or ? (primal) of Out variable.
Definition: ClpSimplex.hpp:1543
ClpSimplex::reducedCostAddress
double & reducedCostAddress(int sequence)
Definition: ClpSimplex.hpp:1145
ClpSimplex::getbackSolution
void getbackSolution(const ClpSimplex &smallModel, const int *whichRow, const int *whichColumn)
Puts solution back into small model.
ClpSimplex::dualPivotResultPart1
int dualPivotResultPart1()
Pivot out a variable and choose an incoing one.
ClpSimplex::numberPrimalInfeasibilities
int numberPrimalInfeasibilities() const
Number of primal infeasibilities.
Definition: ClpSimplex.hpp:696
ClpSimplex::theta
double theta() const
Theta (pivot change)
Definition: ClpSimplex.hpp:1182
ClpSimplex::originalLower
double originalLower(int iSequence) const
Return original lower bound.
Definition: ClpSimplex.hpp:1170
ClpSimplex::valueIn_
double valueIn_
Value of In variable.
Definition: ClpSimplex.hpp:1531
ClpSimplex::defaultFactorizationFrequency
void defaultFactorizationFrequency()
If user left factorization frequency then compute.
ClpSimplex::moveInfo
void moveInfo(const ClpSimplex &rhs, bool justStatus=false)
Move status and solution across.
ClpSimplex::upperAddress
double & upperAddress(int sequence)
Return address of row or column upper bound.
Definition: ClpSimplex.hpp:1159
ClpSimplex::setUpperOut
void setUpperOut(double value)
Set upper of out variable.
Definition: ClpSimplex.hpp:1119
ClpSimplex::dualRanging
int dualRanging(int numberCheck, const int *which, double *costIncrease, int *sequenceIncrease, double *costDecrease, int *sequenceDecrease, double *valueIncrease=NULL, double *valueDecrease=NULL)
Dual ranging.
ClpSimplex::stopFastDual2
void stopFastDual2(ClpNodeStuff *stuff)
Stops Fast dual2.
ClpSimplex::startFastDual2
int startFastDual2(ClpNodeStuff *stuff)
Starts Fast dual2.
ClpConstraint
Constraint Abstract Base Class.
Definition: ClpConstraint.hpp:19
ClpSimplex::cost_
double * cost_
Working copy of objective (Owner of arrays below)
Definition: ClpSimplex.hpp:1578
ClpSimplex::sequenceIn
int sequenceIn() const
Return sequence In or Out.
Definition: ClpSimplex.hpp:1071
ClpSimplex::setPrimalColumnPivotAlgorithm
void setPrimalColumnPivotAlgorithm(ClpPrimalColumnPivot &choice)
Sets column pivot choice algorithm in primal.
ClpSimplex::bestPossibleImprovement_
double bestPossibleImprovement_
Best possible improvement using djs (primal) or obj change by flipping bounds to make dual feasible (...
Definition: ClpSimplex.hpp:1499
ClpSimplex::setColumnStatus
void setColumnStatus(int sequence, Status newstatus)
Definition: ClpSimplex.hpp:1265
ClpSimplex::setDirectionOut
void setDirectionOut(int direction)
Definition: ClpSimplex.hpp:1095
ClpSimplex::dualOut
double dualOut() const
Dual value of Out variable.
Definition: ClpSimplex.hpp:1107
ClpSimplex::maximumPerturbationSize_
int maximumPerturbationSize_
Maximum perturbation array size (take out when code rewritten)
Definition: ClpSimplex.hpp:1690
ClpSimplex::setToBaseModel
void setToBaseModel(ClpSimplex *model=NULL)
Reset to base model (just size and arrays needed) If model NULL use internal copy.
ClpSimplexProgress
For saving extra information to see if looping.
Definition: ClpSolve.hpp:261
ClpSimplex::checkSolutionInternal
void checkSolutionInternal()
Just check solution (for internal use) - sets sum of infeasibilities etc.
ClpSimplex::forceFactorization_
int forceFactorization_
Now for some reliability aids This forces re-factorization early.
Definition: ClpSimplex.hpp:1639
ClpSimplex::checkUnscaledSolution
void checkUnscaledSolution()
Check unscaled primal solution but allow for rounding error.
ClpDisasterHandler
Base class for Clp disaster handling.
Definition: ClpEventHandler.hpp:134
ClpSimplex::upperOut_
double upperOut_
Upper Bound on Out variable.
Definition: ClpSimplex.hpp:1541
ClpSimplex::scaleObjective
double scaleObjective(double value)
If input negative scales objective so maximum &lt;= -value and returns scale factor used.
ClpSimplex::upperIn_
double upperIn_
Upper Bound on In variable.
Definition: ClpSimplex.hpp:1533
ClpSimplex::nonLinearCost
ClpNonLinearCost * nonLinearCost() const
Return pointer to details of costs.
Definition: ClpSimplex.hpp:1191
ClpSimplex::primalRanging
int primalRanging(int numberCheck, const int *which, double *valueIncrease, int *sequenceIncrease, double *valueDecrease, int *sequenceDecrease)
Primal ranging.
CoinModel
This is a simple minded model which is stored in a format which makes it easier to construct and modi...
Definition: CoinModel.hpp:161
ClpSimplex::setColSetBounds
void setColSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of columns simultaneously
Definition: ClpSimplex.hpp:1456
OsiClpSolverInterface
Clp Solver Interface.
Definition: OsiClpSolverInterface.hpp:38
ClpSimplex::cleanFactorization
int cleanFactorization(int ifValuesPass)
Get a clean factorization - i.e.
ClpSimplex::setAlgorithm
void setAlgorithm(int value)
Set algorithm.
Definition: ClpSimplex.hpp:651
ClpSimplex::zeroTolerance
double zeroTolerance() const
Get zero tolerance.
Definition: ClpSimplex.hpp:909
ClpSimplex::primalFeasible
bool primalFeasible() const
If problem is primal feasible.
Definition: ClpSimplex.hpp:599
ClpSimplex::theta_
double theta_
Theta (pivot change)
Definition: ClpSimplex.hpp:1527
ClpNonLinearCost
Definition: ClpNonLinearCost.hpp:78
ClpFactorization
This just implements CoinFactorization when an ClpMatrixBase object is passed.
Definition: ClpFactorization.hpp:35
ClpSimplex::setZeroTolerance
void setZeroTolerance(double value)
Set zero tolerance.
Definition: ClpSimplex.hpp:913
ClpSimplex::miniPresolve
ClpSimplex * miniPresolve(char *rowType, char *columnType, void **info)
Mini presolve (faster) Char arrays must be numberRows and numberColumns long on entry second part mus...
ClpSimplex::atUpperBound
Definition: ClpSimplex.hpp:81
CoinWarmStartBasis
The default COIN simplex (basis-oriented) warm start class.
Definition: CoinWarmStartBasis.hpp:40
ClpSimplex::djRegion
double * djRegion(int section) const
Definition: ClpSimplex.hpp:1022
ClpSimplex::loadNonLinear
int loadNonLinear(void *info, int &numberConstraints, ClpConstraint **&constraints)
Load nonlinear part of problem from AMPL info Returns 0 if linear 1 if quadratic objective 2 if quadr...
ClpModel::eventHandler
ClpEventHandler * eventHandler() const
Event handler.
Definition: ClpModel.hpp:887
ClpSimplex::directionIn_
int directionIn_
Direction of In, 1 going up, -1 going down, 0 not a clude.
Definition: ClpSimplex.hpp:1590
ClpSimplex::gutsOfSolution
int gutsOfSolution(double *givenDuals, const double *givenPrimals, bool valuesPass=false)
May change basis and then returns number changed.
ClpSimplex::solveBenders
int solveBenders(CoinStructuredModel *model, ClpSolve &options)
Solve using Benders decomposition and maybe in parallel.
ClpSimplex::checkDualSolution
void checkDualSolution()
This sets largest infeasibility and most infeasible and sum and number of infeasibilities (Dual) ...
ClpSimplex::computePrimals
void computePrimals(const double *rowActivities, const double *columnActivities)
Computes primals from scratch.
ClpSimplex::dualDebug
int dualDebug(int ifValuesPass=0, int startFinishOptions=0)
ClpSimplex::resize
void resize(int newNumberRows, int newNumberColumns)
Resizes rim part of model.
ClpSimplex::primal
int primal(int ifValuesPass=0, int startFinishOptions=0)
Primal algorithm - see ClpSimplexPrimal.hpp for method.
ClpSimplex::currentDualTolerance
double currentDualTolerance() const
Current dual tolerance.
Definition: ClpSimplex.hpp:928
ClpSimplex::getBasis
CoinWarmStartBasis * getBasis() const
Returns a basis (to be deleted by user)
ClpSimplex::getBInvRow
void getBInvRow(int row, double *z)
Get a row of the basis inverse.
ClpMatrixBase.hpp
ClpSimplex::initialDualSolve
int initialDualSolve()
Dual initial solve.
ClpSimplex::makeBaseModel
void makeBaseModel()
Save a copy of model with certain state - normally without cuts.
ClpSimplex::cleanStatus
void cleanStatus()
Clean up status.
ClpSimplex::numberFake_
int numberFake_
Can be used for count of fake bounds (dual) or fake costs (primal)
Definition: ClpSimplex.hpp:1660
AbcTolerancesEtc
Definition: CoinAbcCommon.hpp:256
ClpSimplex::lowerAddress
double & lowerAddress(int sequence)
Return address of row or column lower bound.
Definition: ClpSimplex.hpp:1152
ClpSimplex::copyEnabledStuff
void copyEnabledStuff(const ClpSimplex *rhs)
Copy across enabled stuff from one solver to another.
ClpSimplex::baseIteration
int baseIteration() const
Iteration when we entered dual or primal.
Definition: ClpSimplex.hpp:1363
ClpSimplex::sumOfRelaxedDualInfeasibilities
double sumOfRelaxedDualInfeasibilities() const
Sum of relaxed dual infeasibilities.
Definition: ClpSimplex.hpp:664
ClpSimplex::setNumberRefinements
void setNumberRefinements(int value)
ClpSimplex::outDuplicateRows
int outDuplicateRows(int numberLook, int *whichRows, bool noOverlaps=false, double tolerance=-1.0, double cleanUp=0.0)
Take out duplicate rows (includes scaled rows and intersections).
ClpSimplex::upperFake
Definition: ClpSimplex.hpp:90
ClpModel::numberColumns
int numberColumns() const
Definition: ClpModel.hpp:325
ClpSimplex::deleteBaseModel
void deleteBaseModel()
Switch off base model.
ClpSimplex::rawObjectiveValue
double rawObjectiveValue() const
Raw objective value (so always minimize in primal)
Definition: ClpSimplex.hpp:1341
ClpSimplex::superBasic
Definition: ClpSimplex.hpp:83
ClpSimplex::sequenceIn_
int sequenceIn_
Sequence of In variable.
Definition: ClpSimplex.hpp:1588
ClpConfig.h
CoinStructuredModel
Definition: CoinStructuredModel.hpp:36
ClpSimplex::bestObjectiveValue_
double bestObjectiveValue_
&quot;Best&quot; objective value
Definition: ClpSimplex.hpp:1507
ClpSimplex::numberExtraRows
int numberExtraRows() const
Number of extra rows.
Definition: ClpSimplex.hpp:1354
ClpSimplex::allSlackBasis
void allSlackBasis(bool resetSolution=false)
Sets up all slack basis and resets solution to as it was after initial load or readMps.
ClpSimplex::computeInternalObjectiveValue
double computeInternalObjectiveValue()
Compute minimization objective value from internal solution without perturbation. ...
ClpSimplex::setNumberDualInfeasibilities
void setNumberDualInfeasibilities(int value)
Definition: ClpSimplex.hpp:674
ClpSimplex::noFake
Definition: ClpSimplex.hpp:88
NUMBER_THREADS
#define NUMBER_THREADS
Definition: AbcSimplex.hpp:863
ClpSimplex::dualBound
double dualBound() const
Dual bound.
Definition: ClpSimplex.hpp:617
ClpSimplex::perturbation
int perturbation() const
Amount of print out: 0 - none 1 - just final 2 - just factorizations 3 - as 2 plus a bit more 4 - ver...
Definition: ClpSimplex.hpp:642
ClpSimplex::dualFeasible
bool dualFeasible() const
If problem is dual feasible.
Definition: ClpSimplex.hpp:603
ClpSimplex::currentPrimalTolerance
double currentPrimalTolerance() const
Current primal tolerance.
Definition: ClpSimplex.hpp:935
ClpSimplex::primalColumnPivot
ClpPrimalColumnPivot * primalColumnPivot() const
primal column pivot choice
Definition: ClpSimplex.hpp:761
ClpSimplex::lastFlaggedIteration_
int lastFlaggedIteration_
So we know when to open up again.
Definition: ClpSimplex.hpp:1658
ClpSimplex::computeDuals
void computeDuals(double *givenDjs)
Computes duals from scratch.
ClpSimplex::infeasibilityCost
double infeasibilityCost() const
Infeasibility cost.
Definition: ClpSimplex.hpp:622
ClpSimplex::forceFactorization
void forceFactorization(int value)
Force re-factorization early.
Definition: ClpSimplex.hpp:1337
ClpSimplex::lowerOut_
double lowerOut_
Lower Bound on Out variable.
Definition: ClpSimplex.hpp:1537
ClpSimplex::setSumDualInfeasibilities
void setSumDualInfeasibilities(double value)
Definition: ClpSimplex.hpp:660
ClpSimplex::disasterArea_
ClpDisasterHandler * disasterArea_
Disaster handler.
Definition: ClpSimplex.hpp:1632
ClpSimplex::getBasics
void getBasics(int *index)
Get basic indices (order of indices corresponds to the order of elements in a vector retured by getBI...
ClpSimplex::spareIntArray_
int spareIntArray_[4]
Spare int array for passing information [0]!=0 switches on.
Definition: ClpSimplex.hpp:1710
ClpSimplex::setLastBadIteration
void setLastBadIteration(int value)
Set so we know when to be cautious.
Definition: ClpSimplex.hpp:1322
ClpSimplex::miniSolve
void miniSolve(char *rowType, char *columnType, int algorithm, int startUp)
mini presolve and solve
ClpSimplex::dual
int dual(int ifValuesPass=0, int startFinishOptions=0)
Dual algorithm - see ClpSimplexDual.hpp for method.
ClpSimplex::checkPrimalSolution
void checkPrimalSolution(const double *rowActivities=NULL, const double *columnActivies=NULL)
This sets largest infeasibility and most infeasible and sum and number of infeasibilities (Primal) ...
ClpSimplex::solveFromHotStart
void solveFromHotStart(void *saveStuff)
Optimize starting from the hotstart.
ClpSimplex::pivot
int pivot()
Pivot in a variable and out a variable.
ClpSimplex::clearActive
void clearActive(int iRow)
Definition: ClpSimplex.hpp:1294
ClpSimplex::setInitialDenseFactorization
void setInitialDenseFactorization(bool onOff)
Normally the first factorization does sparse coding because the factorization could be singular...
ClpSimplex::getBInvACol
void getBInvACol(int col, double *vec)
Get a column of the tableau.
ClpSimplex::upper_
double * upper_
Working copy of upper bounds (Owner of arrays below)
Definition: ClpSimplex.hpp:1572
AbcCommon.hpp
ClpSimplex::columnArray_
CoinIndexedVector * columnArray_[6]
Useful column length arrays.
Definition: ClpSimplex.hpp:1586
ClpSimplex::columnLowerWork_
double * columnLowerWork_
Column lower bounds - working copy.
Definition: ClpSimplex.hpp:1570
ClpSimplex::generateCpp
void generateCpp(FILE *fp, bool defaultFactor=false)
Create C++ lines to get to current state.
ClpSimplex::clearPivoted
void clearPivoted(int sequence)
Definition: ClpSimplex.hpp:1276
ClpSimplex
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:70
ClpSimplex::setColumnSetBounds
void setColumnSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of columns simultaneously The default implementation just invokes setColL...
ClpSimplex::housekeeping
int housekeeping(double objectiveChange)
This does basis housekeeping and does values for in/out variables.
CoinIndexedVector
Indexed Vector.
Definition: CoinIndexedVector.hpp:104
ClpSimplex::numberChanged_
int numberChanged_
Can be used for count of changed costs (dual) or changed bounds (primal)
Definition: ClpSimplex.hpp:1662
ClpModel::columnUpper_
double * columnUpper_
Column Upper.
Definition: ClpModel.hpp:1146
ClpSimplex::baseIteration_
int baseIteration_
Iteration when we entered dual or primal.
Definition: ClpSimplex.hpp:1511
ClpSimplex::createRim5
void createRim5(bool initial)
Does rows and columns and objective.
ClpSimplex::setDualIn
void setDualIn(double value)
Set reduced cost of last incoming to force error.
Definition: ClpSimplex.hpp:958
ClpSimplex::sumOfRelaxedPrimalInfeasibilities
double sumOfRelaxedPrimalInfeasibilities() const
Sum of relaxed primal infeasibilities.
Definition: ClpSimplex.hpp:689
ClpSimplex::getFakeBound
FakeBound getFakeBound(int sequence) const
Definition: ClpSimplex.hpp:1254
ClpSimplex::initialPrimalSolve
int initialPrimalSolve()
Primal initial solve.
ClpSimplex::restoreData
void restoreData(ClpDataSave saved)
Restore data.
ClpSimplex::moveTowardsPrimalFeasible
double moveTowardsPrimalFeasible()
Try simple crash like techniques to get closer to primal feasibility returns final sum of infeasibili...
ClpSimplex::setInfeasibilityCost
void setInfeasibilityCost(double value)
ClpSimplex::setColLower
void setColLower(int elementIndex, double elementValue)
Set a single column lower bound Use -DBL_MAX for -infinity.
Definition: ClpSimplex.hpp:1435
ClpSimplex::bothFake
Definition: ClpSimplex.hpp:91
ClpSimplex::borrowModel
void borrowModel(ClpModel &otherModel)
Borrow model.
ClpSimplex::readMps
int readMps(const char *filename, bool keepNames=false, bool ignoreErrors=false)
Read an mps file from the given filename.
ClpSimplex::setSequenceOut
void setSequenceOut(int sequence)
Definition: ClpSimplex.hpp:1081
ClpSimplex::numberRefinements_
int numberRefinements_
How many iterative refinements to do.
Definition: ClpSimplex.hpp:1618
ClpSimplex::numberDualInfeasibilitiesWithoutFree_
int numberDualInfeasibilitiesWithoutFree_
Number of dual infeasibilities (without free)
Definition: ClpSimplex.hpp:1614
ClpSimplex::columnActivityWork_
double * columnActivityWork_
Column activities - working copy.
Definition: ClpSimplex.hpp:1610
ClpSimplex::setPivotRow
void setPivotRow(int value)
Definition: ClpSimplex.hpp:965
ClpSimplex::setObjectiveCoefficient
void setObjectiveCoefficient(int elementIndex, double elementValue)
Set an objective function coefficient.
ClpSimplex::dualRowPivot_
ClpDualRowPivot * dualRowPivot_
dual row pivot choice
Definition: ClpSimplex.hpp:1620
ClpSimplex::columnPrimalSequence_
int columnPrimalSequence_
Sequence of worst (-1 if feasible)
Definition: ClpSimplex.hpp:1503
ClpSimplex::unpackPacked
void unpackPacked(CoinIndexedVector *rowArray)
Unpacks one column of the matrix into indexed array as packed vector Uses sequenceIn_ Also applies sc...
ClpSimplex::sequenceWithin
int sequenceWithin(int sequence) const
Returns sequence number within section.
Definition: ClpSimplex.hpp:1131
ClpSimplex::changeMade_
int changeMade_
If change has been made (first attempt at stopping looping)
Definition: ClpSimplex.hpp:1634
ClpSimplex::largestDualError_
double largestDualError_
Largest error on basic duals.
Definition: ClpSimplex.hpp:1519
ClpSimplex::algorithm
int algorithm() const
Current (or last) algorithm.
Definition: ClpSimplex.hpp:647
ClpSimplex::pivotVariable_
int * pivotVariable_
Basic variables pivoting on which rows.
Definition: ClpSimplex.hpp:1624
ClpSimplex::saveStatus_
unsigned char * saveStatus_
Saved status regions.
Definition: ClpSimplex.hpp:1649
ClpSimplex::getColumnStatus
Status getColumnStatus(int sequence) const
Definition: ClpSimplex.hpp:1270
ClpSimplex::setPerturbation
void setPerturbation(int value)
ClpModel::numberColumns_
int numberColumns_
Number of columns.
Definition: ClpModel.hpp:1126
ClpSimplex::gutsOfCopy
void gutsOfCopy(const ClpSimplex &rhs)
Does most of copying.
ClpSimplex::setValueOut
void setValueOut(double value)
Set value of out variable.
Definition: ClpSimplex.hpp:1103
ClpSimplex::ClpSimplexUnitTest
friend void ClpSimplexUnitTest(const std::string &mpsDir)
A function that tests the methods in the ClpSimplex class.
ClpDataSave
This is a tiny class where data can be saved round calls.
Definition: ClpModel.hpp:1269
ClpSimplex::markHotStart
void markHotStart(void *&saveStuff)
Create a hotstart point of the optimization process.
ClpSimplex::setLargeValue
void setLargeValue(double value)
ClpSimplex::dontFactorizePivots_
int dontFactorizePivots_
If may skip final factorize then allow up to this pivots (default 20)
Definition: ClpSimplex.hpp:1675
ClpSimplex::ClpSimplex
ClpSimplex(bool emptyMessages=false)
Default constructor.
ClpSimplex::setAlphaAccuracy
void setAlphaAccuracy(double value)
Definition: ClpSimplex.hpp:871
ClpSimplex::nonlinearSLP
int nonlinearSLP(int numberPasses, double deltaTolerance)
Solves nonlinear problem using SLP - may be used as crash for other algorithms when number of iterati...
ClpSimplex::automaticScaling
bool automaticScaling() const
If automatic scaling on.
Definition: ClpSimplex.hpp:921
ClpSimplex::computeObjectiveValue
void computeObjectiveValue(bool useWorkingSolution=false)
Compute objective value from solution and put in objectiveValue_.
ClpSimplex::getRowStatus
Status getRowStatus(int sequence) const
Definition: ClpSimplex.hpp:1262
ClpSimplex::columnArray
CoinIndexedVector * columnArray(int index) const
Useful column length arrays (0,1,2,3,4,5)
Definition: ClpSimplex.hpp:731
ClpSimplex::sumPrimalInfeasibilities
double sumPrimalInfeasibilities() const
Sum of primal infeasibilities.
Definition: ClpSimplex.hpp:682
ClpSimplex::setPerturbed
void setPerturbed(int iSequence)
To say perturbed.
Definition: ClpSimplex.hpp:1301
ClpSimplex::setFactorizationFrequency
void setFactorizationFrequency(int value)
ClpModel::rowObjective
double * rowObjective() const
Row Objective.
Definition: ClpModel.hpp:676
ClpSimplex::setAbcState
void setAbcState(int state)
Definition: ClpSimplex.hpp:141
ClpSimplex::numberTimesOptimal_
int numberTimesOptimal_
Number of times code has tentatively thought optimal.
Definition: ClpSimplex.hpp:1630
ClpSimplex::setColumnLower
void setColumnLower(int elementIndex, double elementValue)
Set a single column lower bound Use -DBL_MAX for -infinity.
ClpSimplex::tightenPrimalBounds
int tightenPrimalBounds(double factor=0.0, int doTight=0, bool tightIntegers=false)
Tightens primal bounds to make dual faster.
ClpSimplex::savedSolution_
double * savedSolution_
Saved version of solution.
Definition: ClpSimplex.hpp:1628
ClpSimplex::numberDualInfeasibilities
int numberDualInfeasibilities() const
Number of dual infeasibilities.
Definition: ClpSimplex.hpp:671
ClpSimplex::fathom
int fathom(void *stuff)
Fathom - 1 if solution.
ClpSimplex::copyFactorization
void copyFactorization(ClpFactorization &factorization)
Copies in factorization to existing one.
ClpSimplex::primalTolerance_
double primalTolerance_
Current primal tolerance for algorithm.
Definition: ClpSimplex.hpp:1547
ClpSimplex::numberDualInfeasibilitiesWithoutFree
int numberDualInfeasibilitiesWithoutFree() const
Number of dual infeasibilities (without free)
Definition: ClpSimplex.hpp:678
ClpSimplex::progressFlag_
int progressFlag_
Progress flag - at present 0 bit says artificials out, 1 free in.
Definition: ClpSimplex.hpp:1664
ClpSimplex::upper
double upper(int sequence)
Definition: ClpSimplex.hpp:1155
ClpSimplex::goodAccuracy
bool goodAccuracy() const
Returns true if model looks OK.
Definition: ClpSimplex.hpp:765
ClpSimplex::dualIn
double dualIn() const
Reduced cost of last incoming for use by classes e.g. steepestedge.
Definition: ClpSimplex.hpp:954
ClpSimplex::algorithm_
int algorithm_
Algorithm &gt;0 == Primal, &lt;0 == Dual.
Definition: ClpSimplex.hpp:1636
ClpSimplex::lastGoodIteration_
int lastGoodIteration_
Last good iteration (immediately after a re-factorization)
Definition: ClpSimplex.hpp:1598
ClpSimplex::perturbationArray_
double * perturbationArray_
Perturbation array (maximumPerturbationSize_)
Definition: ClpSimplex.hpp:1692
ClpModel::solveType
int solveType() const
Solve type - 1 simplex, 2 simplex interface, 3 Interior.
Definition: ClpModel.hpp:373
ClpSimplex::miniPostsolve
void miniPostsolve(const ClpSimplex *presolvedModel, void *info)
After mini presolve.
ClpSimplex::rowReducedCost_
double * rowReducedCost_
Reduced costs of slacks not same as duals (or - duals)
Definition: ClpSimplex.hpp:1602
ClpSimplex::rowObjectiveWork_
double * rowObjectiveWork_
Row objective - working copy.
Definition: ClpSimplex.hpp:1580
ClpSimplex::primalPivotResult
int primalPivotResult()
Pivot in a variable and choose an outgoing one.
ClpSimplex::pivotRow_
int pivotRow_
Pivot Row.
Definition: ClpSimplex.hpp:1596
ClpSimplex::maximumBasic_
int maximumBasic_
Maximum number of basic variables - can be more than number of rows if GUB.
Definition: ClpSimplex.hpp:1673
ClpSimplex::~ClpSimplex
~ClpSimplex()
Destructor.
ClpSimplex::largestPrimalError_
double largestPrimalError_
Largest error on Ax-b.
Definition: ClpSimplex.hpp:1517
ClpSimplex::solutionAddress
double & solutionAddress(int sequence)
Return address of row or column values.
Definition: ClpSimplex.hpp:1139
ClpSimplex::setFactorization
void setFactorization(ClpFactorization &factorization)
Passes in factorization.
ClpSimplex::largeValue
double largeValue() const
Large bound value (for complementarity etc)
Definition: ClpSimplex.hpp:888
ClpSimplexUnitTest
void ClpSimplexUnitTest(const std::string &mpsDir)
A function that tests the methods in the ClpSimplex class.
ClpSimplex::setSequenceIn
void setSequenceIn(int sequence)
Set sequenceIn or Out.
Definition: ClpSimplex.hpp:1078
ClpSimplex::primalToleranceToGetOptimal_
double primalToleranceToGetOptimal_
Primal tolerance needed to make dual feasible (&lt;largeTolerance)
Definition: ClpSimplex.hpp:1513
ClpSimplex::OsiCLPSolverInterface
friend class OsiCLPSolverInterface
And OsiCLP.
Definition: ClpSimplex.hpp:1717
ClpSimplex::startPermanentArrays
bool startPermanentArrays()
Start or reset using maximumRows_ and Columns_ - true if change.
ClpSimplex::numberDegeneratePivots_
int numberDegeneratePivots_
Number of degenerate pivots since last perturbed.
Definition: ClpSimplex.hpp:1707
ClpSimplex::sumOfRelaxedPrimalInfeasibilities_
double sumOfRelaxedPrimalInfeasibilities_
Sum of Primal infeasibilities using tolerance based on error in primals.
Definition: ClpSimplex.hpp:1557
ClpSimplex::cleanup
int cleanup(int cleanupScaling)
When scaling is on it is possible that the scaled problem is feasible but the unscaled is not...
ClpSimplex::abcState_
int abcState_
Definition: ClpSimplex.hpp:1705
ClpSimplex::sequenceOut
int sequenceOut() const
Definition: ClpSimplex.hpp:1074
ClpSimplex::sumDualInfeasibilities_
double sumDualInfeasibilities_
Sum of dual infeasibilities.
Definition: ClpSimplex.hpp:1549
CoinPackedMatrix
Sparse Matrix Base Class.
Definition: CoinPackedMatrix.hpp:79
ClpSimplex::acceptablePivot_
double acceptablePivot_
Acceptable pivot value just after factorization.
Definition: ClpSimplex.hpp:1559
ClpSimplex::statusOfProblem
bool statusOfProblem(bool initial=false)
Factorizes and returns true if optimal.
ClpSimplex::initialSolve
int initialSolve()
Default initial solve.
ClpSimplex::sumOfRelaxedDualInfeasibilities_
double sumOfRelaxedDualInfeasibilities_
Sum of Dual infeasibilities using tolerance based on error in duals.
Definition: ClpSimplex.hpp:1555
ClpSimplex::dualIn_
double dualIn_
Reduced cost of In variable.
Definition: ClpSimplex.hpp:1535
ClpSimplex::abcState
int abcState() const
Definition: ClpSimplex.hpp:139
ClpSimplex::rowUpperWork_
double * rowUpperWork_
Row upper bounds - working copy.
Definition: ClpSimplex.hpp:1574
ClpSimplex::createPiecewiseLinearCosts
int createPiecewiseLinearCosts(const int *starts, const double *lower, const double *gradient)
Constructs a non linear cost from list of non-linearities (columns only) First lower of each column i...
ClpSimplex::moreSpecialOptions
int moreSpecialOptions() const
Return more special options 1 bit - if presolve says infeasible in ClpSolve return 2 bit - if presolv...
Definition: ClpSimplex.hpp:1215
ClpSimplex::lower
double lower(int sequence)
Definition: ClpSimplex.hpp:1148
ClpSimplex::objectiveWork_
double * objectiveWork_
Column objective - working copy.
Definition: ClpSimplex.hpp:1582
ClpSimplex::readBasis
int readBasis(const char *filename)
Read a basis from the given filename, returns -1 on file error, 0 if no values, 1 if values...
ClpSimplex::setRowLower
void setRowLower(int elementIndex, double elementValue)
Set a single row lower bound Use -DBL_MAX for -infinity.
ClpSimplex::setSumOfRelaxedPrimalInfeasibilities
void setSumOfRelaxedPrimalInfeasibilities(double value)
Definition: ClpSimplex.hpp:692
ClpModel::numberRows
int numberRows() const
Number of rows.
Definition: ClpModel.hpp:315
ClpEventHandler
Base class for Clp event handling.
Definition: ClpEventHandler.hpp:27
ClpSimplex::add
void add(double *array, int column, double multiplier) const
Adds multiple of a column into an array.
ClpSimplex::getEmptyFactorization
ClpFactorization * getEmptyFactorization()
Gets clean and emptyish factorization.
ClpSimplex::disasterHandler
ClpDisasterHandler * disasterHandler() const
Get disaster handler.
Definition: ClpSimplex.hpp:884
ClpSimplex::setDualOut
void setDualOut(double value)
Set dual value of out variable.
Definition: ClpSimplex.hpp:1111
ClpSimplex::flagged
bool flagged(int sequence) const
Definition: ClpSimplex.hpp:1287
CoinBigIndex
int CoinBigIndex
Definition: Coin_C_defines.h:105
ClpSimplex::numberRefinements
int numberRefinements() const
How many iterative refinements to do.
Definition: ClpSimplex.hpp:942
ClpSimplex::setColBounds
void setColBounds(int elementIndex, double newlower, double newupper)
Set a single column lower and upper bound.
Definition: ClpSimplex.hpp:1445
ClpSimplex::swapFactorization
ClpFactorization * swapFactorization(ClpFactorization *factorization)
ClpSimplex::setColUpper
void setColUpper(int elementIndex, double elementValue)
Set a single column upper bound Use DBL_MAX for infinity.
Definition: ClpSimplex.hpp:1440
ClpSimplex::factorizationFrequency
int factorizationFrequency() const
Factorization frequency.
ClpSimplex::lowerRegion
double * lowerRegion(int section) const
Definition: ClpSimplex.hpp:1026
ClpModel::status_
unsigned char * status_
Status (i.e.
Definition: ClpModel.hpp:1173
ClpSimplex::internalFactorize
int internalFactorize(int solveType)
Factorizes using current basis.
ClpSimplex::originalUpper
double originalUpper(int iSequence) const
Return original lower bound.
Definition: ClpSimplex.hpp:1176
ClpSimplex::saveModel
int saveModel(const char *fileName)
Save model to file, returns 0 if success.
ClpSimplex::valueOut_
double valueOut_
Value of Out variable.
Definition: ClpSimplex.hpp:1539
ClpSimplex::isFixed
Definition: ClpSimplex.hpp:84
ClpSimplex::getBInvCol
void getBInvCol(int col, double *vec)
Get a column of the basis inverse.
ClpSimplex::reducedCost
double reducedCost(int sequence)
Definition: ClpSimplex.hpp:1142
ClpSimplex::solutionRegion
double * solutionRegion(int section) const
Return row or column sections - not as much needed as it once was.
Definition: ClpSimplex.hpp:1018
ClpSimplex::gutsOfDelete
void gutsOfDelete(int type)
Does most of deletion (0 = all, 1 = most, 2 most + factorization)
ClpSimplex::factorization
ClpFactorization * factorization() const
factorization
Definition: ClpSimplex.hpp:607
ClpSimplex::dualTolerance_
double dualTolerance_
Current dual tolerance for algorithm.
Definition: ClpSimplex.hpp:1545
ClpSimplex::setLowerOut
void setLowerOut(double value)
Set lower of out variable.
Definition: ClpSimplex.hpp:1115
ClpSimplex::sequenceOut_
int sequenceOut_
Sequence of Out variable.
Definition: ClpSimplex.hpp:1592
ClpSimplex::setLargestPrimalError
void setLargestPrimalError(double value)
Largest error on Ax-b.
Definition: ClpSimplex.hpp:901
ClpSimplex::setFakeBound
void setFakeBound(int sequence, FakeBound fakeBound)
Definition: ClpSimplex.hpp:1249
ClpSimplex::getBInvARow
void getBInvARow(int row, double *z, double *slack=NULL)
Get a row of the tableau (slack part in slack if not NULL)
ClpSimplex::removeSuperBasicSlacks
void removeSuperBasicSlacks(int threshold=0)
Try simple crash like techniques to remove super basic slacks but only if &gt; threshold.
ClpSimplex::readLp
int readLp(const char *filename, const double epsilon=1e-5)
Read file in LP format from file with name filename.
ClpSimplex::setTheta
void setTheta(double value)
Set theta of out variable.
Definition: ClpSimplex.hpp:1123
ClpSimplex::cost
double cost(int sequence)
Definition: ClpSimplex.hpp:1162
ClpSimplex::perturbed
bool perturbed(int iSequence) const
Definition: ClpSimplex.hpp:1307
ClpSimplex::createRim4
void createRim4(bool initial)
Does objective.
ClpSimplex::progress
ClpSimplexProgress * progress()
For dealing with all issues of cycling etc.
Definition: ClpSimplex.hpp:1330
ClpSimplex::largeValue_
double largeValue_
Large bound value (for complementarity etc)
Definition: ClpSimplex.hpp:1515
ClpSimplex::solutionRegion
double * solutionRegion() const
Return region as single array.
Definition: ClpSimplex.hpp:1039
ClpSimplex::pivotResultPart2
int pivotResultPart2(int algorithm, int state)
Do actual pivot state is 0 if need tableau column, 1 if in rowArray_[1].
ClpSimplex::setRowSetBounds
void setRowSetBounds(const int *indexFirst, const int *indexLast, const double *boundList)
Set the bounds on a number of rows simultaneously
ClpSimplex::originalModel
void originalModel(ClpSimplex *miniModel)
This copies back stuff from miniModel and then deletes miniModel.
ClpSimplex::fastCrunch
ClpSimplex * fastCrunch(ClpNodeStuff *stuff, int mode)
Deals with crunch aspects mode 0 - in 1 - out with solution 2 - out without solution returns small mo...
ClpModel.hpp
ClpNodeStuff
Definition: ClpNode.hpp:176
ClpSimplex::directionOut
int directionOut() const
Definition: ClpSimplex.hpp:1088
ClpSimplex::infeasibilityCost_
double infeasibilityCost_
Weight assigned to being infeasible in primal.
Definition: ClpSimplex.hpp:1553
ClpSimplex::baseModel_
ClpSimplex * baseModel_
A copy of model with certain state - normally without cuts.
Definition: ClpSimplex.hpp:1694
ClpModel::rowLower_
double * rowLower_
Row lower.
Definition: ClpModel.hpp:1136
ClpSimplex::initialBarrierNoCrossSolve
int initialBarrierNoCrossSolve()
Barrier initial solve, not to be followed by crossover.
ClpSimplex::upperRegion
double * upperRegion(int section) const
Definition: ClpSimplex.hpp:1030
ClpSimplex::pivotRow
int pivotRow() const
Pivot Row for use by classes e.g. steepestedge.
Definition: ClpSimplex.hpp:962
ClpSimplex::pivotVariable
int * pivotVariable() const
Basic variables pivoting on which rows.
Definition: ClpSimplex.hpp:917
ClpSimplex::solution
double solution(int sequence)
Return row or column values.
Definition: ClpSimplex.hpp:1135
ClpSimplex::checkBothSolutions
void checkBothSolutions()
This sets sum and number of infeasibilities (Dual and Primal)
ClpSimplex::forceFactorization
int forceFactorization() const
Force re-factorization early value.
Definition: ClpSimplex.hpp:1333
ClpSimplex::columnUpperWork_
double * columnUpperWork_
Column upper bounds - working copy.
Definition: ClpSimplex.hpp:1576
ClpSimplex::zeroTolerance_
double zeroTolerance_
Zero tolerance.
Definition: ClpSimplex.hpp:1501
ClpSimplex::setFlagged
void setFlagged(int sequence)
To flag a variable (not inline to allow for column generation)
ClpSimplex::valueIncomingDual
double valueIncomingDual() const
value of incoming variable (in Dual)
ClpSimplex::setSumOfRelaxedDualInfeasibilities
void setSumOfRelaxedDualInfeasibilities(double value)
Definition: ClpSimplex.hpp:667
ClpSimplex::primalColumnPivot_
ClpPrimalColumnPivot * primalColumnPivot_
primal column pivot choice
Definition: ClpSimplex.hpp:1622
ClpSimplex::createStatus
void createStatus()
Set up status array (can be used by OsiClp).
ClpSimplex::alpha_
double alpha_
Alpha (pivot element)
Definition: ClpSimplex.hpp:1525
ClpSimplex::clearPerturbed
void clearPerturbed(int iSequence)
Definition: ClpSimplex.hpp:1304
ClpSimplex::directionOut_
int directionOut_
Direction of Out, 1 to upper bound, -1 to lower bound, 0 - superbasic.
Definition: ClpSimplex.hpp:1594
ClpSimplex::dualRowPivot
ClpDualRowPivot * dualRowPivot() const
dual row pivot choice
Definition: ClpSimplex.hpp:757
ClpSimplex::numberExtraRows_
int numberExtraRows_
Number of extra rows.
Definition: ClpSimplex.hpp:1670
ClpSimplex::rowArray
CoinIndexedVector * rowArray(int index) const
Useful row length arrays (0,1,2,3,4,5)
Definition: ClpSimplex.hpp:727
ClpSimplex::rowLowerWork_
double * rowLowerWork_
Row lower bounds - working copy.
Definition: ClpSimplex.hpp:1568
ClpSimplex::readGMPL
int readGMPL(const char *filename, const char *dataName, bool keepNames=false)
Read GMPL files from the given filenames.
ClpSimplex::setNumberPrimalInfeasibilities
void setNumberPrimalInfeasibilities(int value)
Definition: ClpSimplex.hpp:699
ClpSimplex::setSumPrimalInfeasibilities
void setSumPrimalInfeasibilities(double value)
Definition: ClpSimplex.hpp:685
ClpSimplex::createRim1
void createRim1(bool initial)
Does rows and columns.
ClpSimplex::saveData
ClpDataSave saveData()
Save data.
ClpSimplex::numberPrimalInfeasibilities_
int numberPrimalInfeasibilities_
Number of primal infeasibilities.
Definition: ClpSimplex.hpp:1616
ClpSimplex::setStatus
void setStatus(int sequence, Status newstatus)
Definition: ClpSimplex.hpp:1057
ClpSimplex::setEmptyFactorization
void setEmptyFactorization()
May delete or may make clean and emptyish factorization.
ClpSimplex::largestPrimalError
double largestPrimalError() const
Largest error on Ax-b.
Definition: ClpSimplex.hpp:893
ClpSimplex::createRim
bool createRim(int what, bool makeRowCopy=false, int startFinishOptions=0)
puts in format I like (rowLower,rowUpper) also see StandardMatrix 1 bit does rows (now and columns)...
ClpModel::dropNames
void dropNames()
Drops names - makes lengthnames 0 and names empty.
ClpSimplex::setRowStatus
void setRowStatus(int sequence, Status newstatus)
Definition: ClpSimplex.hpp:1257
ClpSimplex::setPivoted
void setPivoted(int sequence)
Definition: ClpSimplex.hpp:1273
ClpSimplex::fastDual2
int fastDual2(ClpNodeStuff *stuff)
Like Fast dual.
ClpModel::objectiveValue_
double objectiveValue_
Objective value.
Definition: ClpModel.hpp:1116
ClpSimplex::progress_
ClpSimplexProgress progress_
For dealing with all issues of cycling etc.
Definition: ClpSimplex.hpp:1696
ClpSimplex::active
bool active(int iRow) const
Definition: ClpSimplex.hpp:1297
ClpSimplex::setPersistenceFlag
void setPersistenceFlag(int value)
Array persistence flag If 0 then as now (delete/new) 1 then only do arrays if bigger needed 2 as 1 bu...
ClpSimplex::isFree
Definition: ClpSimplex.hpp:79
ClpSimplex::sumPrimalInfeasibilities_
double sumPrimalInfeasibilities_
Sum of primal infeasibilities.
Definition: ClpSimplex.hpp:1551
ClpSimplex::initialDenseFactorization
bool initialDenseFactorization() const
ClpSimplex::setDualRowPivotAlgorithm
void setDualRowPivotAlgorithm(ClpDualRowPivot &choice)
Sets row pivot choice algorithm in dual.
ClpSimplex::lastBadIteration
int lastBadIteration() const
So we know when to be cautious.
Definition: ClpSimplex.hpp:1318
ClpSimplex::fathomMany
int fathomMany(void *stuff)
Do up to N deep - returns -1 - no solution nNodes_ valid nodes &gt;= if solution and that node gives sol...
ClpSimplex::passInEventHandler
void passInEventHandler(const ClpEventHandler *eventHandler)
Pass in Event handler (cloned and deleted at end)
ClpDualRowPivot
Dual Row Pivot Abstract Base Class.
Definition: ClpDualRowPivot.hpp:22
ClpSimplex::allowedInfeasibility_
double allowedInfeasibility_
Definition: ClpSimplex.hpp:1686
ClpSimplex::rowActivityWork_
double * rowActivityWork_
Row activities - working copy.
Definition: ClpSimplex.hpp:1608
ClpModel::matrix
CoinPackedMatrix * matrix() const
Matrix (if not ClpPackedmatrix be careful about memory leak.
Definition: ClpModel.hpp:697
ClpSimplex::setSparseFactorization
void setSparseFactorization(bool value)
ClpSimplex::valueOut
double valueOut() const
Value of Out variable.
Definition: ClpSimplex.hpp:1099
ClpSimplex::crash
int crash(double gap, int pivot)
Crash - at present just aimed at dual, returns -2 if dual preferred and crash basis created -1 if dua...
ClpSimplex::strongBranching
int strongBranching(int numberVariables, const int *variables, double *newLower, double *newUpper, double **outputSolution, int *outputStatus, int *outputIterations, bool stopOnFirstInfeasible=true, bool alwaysFinish=false, int startFinishOptions=0)
For strong branching.
ClpSimplex::setActive
void setActive(int iRow)
To say row active in primal pivot row choice.
Definition: ClpSimplex.hpp:1291
ClpSimplex::minimumPrimalTolerance_
double minimumPrimalTolerance_
Minimum primal tolerance.
Definition: ClpSimplex.hpp:1561
ClpModel::columnLower_
double * columnLower_
Column Lower.
Definition: ClpModel.hpp:1144
ClpSimplex::alphaAccuracy_
double alphaAccuracy_
For computing whether to re-factorize.
Definition: ClpSimplex.hpp:1521
ClpSimplex::largestDualError
double largestDualError() const
Largest error on basic duals.
Definition: ClpSimplex.hpp:897
ClpSimplex::solve
int solve(CoinStructuredModel *model)
Solve using structure of model and maybe in parallel.
ClpSimplex::dj_
double * dj_
Working copy of reduced costs (Owner of arrays below)
Definition: ClpSimplex.hpp:1600
ClpSimplex::solution_
double * solution_
Working copy of primal solution (Owner of arrays below)
Definition: ClpSimplex.hpp:1606
ClpSimplex::setLargestDualError
void setLargestDualError(double value)
Largest error on basic duals.
Definition: ClpSimplex.hpp:905
CLP_INFEAS_SAVE
#define CLP_INFEAS_SAVE
Last few infeasibilities.
Definition: ClpSimplex.hpp:1563
ClpSimplex::lowerRegion
double * lowerRegion() const
Definition: ClpSimplex.hpp:1045
ClpSimplex::automaticScale_
int automaticScale_
Automatic scaling of objective and rhs and bounds.
Definition: ClpSimplex.hpp:1688
ClpSimplex::bestPossibleImprovement
double bestPossibleImprovement() const
Best possible improvement using djs (primal) or obj change by flipping bounds to make dual feasible (...
Definition: ClpSimplex.hpp:1187
ClpSimplex::sanityCheck
bool sanityCheck()
Sanity check on input rim data (after scaling) - returns true if okay.
ClpSimplex::setValuesPassAction
void setValuesPassAction(double incomingInfeasibility, double allowedInfeasibility)
For advanced use.
ClpSimplex::lowerFake
Definition: ClpSimplex.hpp:89
ClpSimplex::checkSolution
void checkSolution(int setToBounds=0)
Just check solution (for external use) - sets sum of infeasibilities etc.
ClpSimplex::doubleCheck
double doubleCheck()
Double checks OK.
ClpSimplex::firstFree_
int firstFree_
First free/super-basic variable (-1 if none)
Definition: ClpSimplex.hpp:1666
ClpSimplex::factorize
int factorize()
Factorizes using current basis. For external use.
ClpSimplex::sparseFactorization
bool sparseFactorization() const
Sparsity on or off.
ClpSimplex::setColumnUpper
void setColumnUpper(int elementIndex, double elementValue)
Set a single column upper bound Use DBL_MAX for infinity.
ClpSimplex::isObjectiveLimitTestValid
bool isObjectiveLimitTestValid() const
Return true if the objective limit test can be relied upon.
ClpSimplex::baseModel
ClpSimplex * baseModel() const
See if we have base model.
Definition: ClpSimplex.hpp:164
ClpSimplex::rowPrimalSequence_
int rowPrimalSequence_
Sequence of worst (-1 if feasible)
Definition: ClpSimplex.hpp:1505