Blis 0.95.0
Loading...
Searching...
No Matches
BlisModel.h
Go to the documentation of this file.
1/*===========================================================================*
2 * This file is part of the BiCePS Linear Integer Solver (BLIS). *
3 * *
4 * BLIS is distributed under the Eclipse Public License as part of the *
5 * COIN-OR repository (http://www.coin-or.org). *
6 * *
7 * Authors: *
8 * *
9 * Yan Xu, Lehigh University *
10 * Ted Ralphs, Lehigh University *
11 * *
12 * Conceptual Design: *
13 * *
14 * Yan Xu, Lehigh University *
15 * Ted Ralphs, Lehigh University *
16 * Laszlo Ladanyi, IBM T.J. Watson Research Center *
17 * Matthew Saltzman, Clemson University *
18 * *
19 * *
20 * Copyright (C) 2001-2023, Lehigh University, Yan Xu, and Ted Ralphs. *
21 * All Rights Reserved. *
22 *===========================================================================*/
23
24//#############################################################################
25
26#ifndef BlisModel_h_
27#define BlisModel_h_
28
29//#############################################################################
30
31#include <vector>
32
33#include "CoinMpsIO.hpp"
34#include "CoinLpIO.hpp"
35#include "CoinPackedMatrix.hpp"
36
37#include "CglCutGenerator.hpp"
38
39#include "OsiCuts.hpp"
40#include "OsiSolverInterface.hpp"
41
42#include "AlpsEnumProcessT.h"
43#include "AlpsParams.h"
44#include "AlpsTreeNode.h"
45
46#include "BcpsBranchStrategy.h"
47#include "BcpsObject.h"
48#include "BcpsObjectPool.h"
49#include "BcpsModel.h"
50
51#include "BlisConfig.h"
52#include "Blis.h"
53#include "BlisConGenerator.h"
54#include "BlisHeuristic.h"
55#include "BlisMessage.h"
56#include "BlisParams.h"
57#include "BlisPseudo.h"
58#include "BlisPresolve.h"
59
60//#############################################################################
61
62class BlisConstraint;
63class BlisSolution;
64class BcpsVariable;
65class BlisVariable;
66
67//#############################################################################
68
69/* Declare a BLIS model */
70class BLISLIB_EXPORT BlisModel : public BcpsModel {
71
72protected:
73
74 //------------------------------------------------------
75 // LP SOLVER.
76 //------------------------------------------------------
77
79 OsiSolverInterface *origLpSolver_;
81 OsiSolverInterface *presolvedLpSolver_;
84 OsiSolverInterface *lpSolver_;
85
86 //------------------------------------------------------
87 // PROBLEM DATA. Populate when loadProblem(),
88 //------------------------------------------------------
89
91 CoinPackedMatrix *colMatrix_;
92
95 double *varLB_;
96 double *varUB_;
97 double *conLB_;
98 double *conUB_;
100
107
110 double objSense_;
111 double *objCoef_;
113
117 int *intColIndices_; // size of numIntObjects_
119
122 std::vector<BcpsVariable *> inputVar_;
123 std::vector<BcpsConstraint *> inputCon_;
125
126 //------------------------------------------------------
127 // PRESOLVE
128 //------------------------------------------------------
129
131 // AT - Begin
134 // AT - End
135
136 //------------------------------------------------------
137 // SOLUTION.
138 //------------------------------------------------------
139
142
145
147 double *incumbent_;
148
150 double cutoff_;
151
154
155 //------------------------------------------------------
156 // SEARCHING.
157 //------------------------------------------------------
158
159 int *intObjIndices_; // size of numCols_
160 char *colType_;
161
164 double *startVarLB_;
165 double *startVarUB_;
166 double *startConLB_;
167 double *startConUB_;
169
171 BcpsBranchStrategy * branchStrategy_;
172 BcpsBranchStrategy * rampUpBranchStrategy_;
173
174 // Hotstart strategy 0 = off,
175 // 1 = branch if incorrect,
176 // 2 = branch even if correct, ....
178
181
183 BcpsObject **objects_;
184
187
190
192 AlpsTreeNode *activeNode_;
193
196
197 // Not used.
199
202
203 //------------------------------------------------------
204 // HEURISTICS.
205 //------------------------------------------------------
206
209
212
213 //------------------------------------------------------
214 // CONSTRAINTS.
215 //------------------------------------------------------
216
219
222
225
228
231
233 BcpsConstraintPool *constraintPool_;
234
237
240
243
245 double *conRandoms_;
246
249
250 //------------------------------------------------------
251 // PARAMETERS, STATISTICS, and MESSAGE
252 //------------------------------------------------------
253
256
258 CoinMessageHandler *blisMessageHandler_;
259
261 CoinMessages blisMessages_;
262
265
268
271
274
275 //------------------------------------------------------
276 // TEMPORARY STORAGE
277 //------------------------------------------------------
278
286
287 //------------------------------------------------------
288 // Knowledge shared
289 //------------------------------------------------------
290
292 BcpsConstraintPool *constraintPoolSend_;
293
295 BcpsConstraintPool *constraintPoolReceive_;
296
297 public:
298
301
304
307
310
313
316
319
322
325
327 OsiCuts newCutPool_;
328
330 std::vector<AlpsTreeNode *> leafToRootPath;
331
332 protected:
333
335 void init();
336
339
340 public:
341
344 {
345 init();
346 }
347
349 virtual ~BlisModel();
350
353
354 //------------------------------------------------------
355 // SETUP, LP SOLVER
356 //------------------------------------------------------
357
359 void setColMatrix(CoinPackedMatrix *mat){ colMatrix_ = mat; }
360
362 void setNumCons(int num){ numRows_ = num; }
363
365 void setNumVars(int num){ numCols_ = num; }
366
368 void setNumElems(int num){ numElems_ = num; }
369
371 void setConLb(double *cl){ conLB_ = cl; }
372
374 void setConUb(double *cu){ conUB_ = cu; }
375
377 void setVarLb(double *lb){ varLB_ = lb; }
378
380 void setVarUb(double *ub){ varUB_ = ub; }
381
383 void setColType(char *colType){
384 colType_ = colType;
385 }
386
388 void setObjCoef(double *obj){ objCoef_ = obj; }
389
399 virtual void readInstance(const char* dataFile);
400
412 virtual void importModel(std::vector<BlisVariable *> vars,
413 std::vector<BlisConstraint *> cons);
414
416 virtual void readParameters(const int argnum, const char * const *arglist);
417
419 virtual void writeParameters(std::ostream& outstream) const;
420
424 virtual AlpsTreeNode * createRoot();
425
435 virtual bool setupSelf();
436
438 virtual void preprocess();
439
441 virtual void postprocess();
442
444 virtual void setSolver(OsiSolverInterface *si) { origLpSolver_ = si; }
445
447 virtual OsiSolverInterface *getSolver() { return origLpSolver_; }
448
450 virtual OsiSolverInterface *solver() { return lpSolver_; }
451
453 bool resolve();
454
456 void setActiveNode(AlpsTreeNode *node) { activeNode_ = node; }
457
459 void setSolEstimate(double est) { activeNode_->setSolEstimate(est); }
460
462 int getNumStrong() { return numStrong_; }
463
465 void addNumStrong(int num=1) { numStrong_ += num; }
466
468 int getNumBranchResolve() { return numBranchResolve_; }
469
471 void setNumBranchResolve(int num) { numBranchResolve_ = num; }
472
474 double getFeasCheckTime() { return feasCheckTime_; }
475
477 void setFeasCheckTime(double t) { feasCheckTime_ = t; }
478
480 void addFeasCheckTime(double t) { feasCheckTime_ += t; }
481
482 //------------------------------------------------------
483 // PROBLEM DATA
484 //------------------------------------------------------
485
487 double* getObjCoef() const { return objCoef_; }
488
490 const double * getColLower() { return lpSolver_->getColLower(); }
491
493 const double * getColUpper() { return lpSolver_->getColUpper(); }
494
496 int getNumCols() { return lpSolver_->getNumCols(); }
497
499 int getNumRows() { return lpSolver_->getNumRows(); }
500
502 double *varLB() { return varLB_; }
503 double *varUB() { return varUB_; }
504
506 double *conLB() { return conLB_; }
507 double *conUB() { return conUB_; }
508
510 double *startVarLB() { return startVarLB_; }
511 double *startVarUB() { return startVarUB_; }
512
514 double *startConLB() { return startConLB_; }
515 double *startConUB() { return startConUB_; }
516
518 int *tempVarLBPos() { return tempVarLBPos_; }
519 int *tempVarUBPos() { return tempVarUBPos_; }
520 int *tempConLBPos() { return tempConLBPos_; }
521 int *tempConUBPos() { return tempConUBPos_; }
522
523 //------------------------------------------------------
524 // LP SOLUTION
525 //------------------------------------------------------
526
528 double getLpObjValue() const { return lpSolver_->getObjValue(); }
529
531 const double * getLpSolution() const { return lpSolver_->getColSolution();}
532
533 //------------------------------------------------------
534 // MILP SOLUTION
535 //------------------------------------------------------
536
538 int getNumSolutions() const { return numSolutions_; }
539
541 int getNumHeurSolutions() const { return numHeurSolutions_;}
542
544 double * incumbent() { return incumbent_; }
545
548
550 inline double getCutoff() const { return cutoff_; }
551
553 inline void setCutoff(double co) {
554 double inc = BlisPar_->entry(BlisParams::cutoffInc);
555#if 0
556 std::cout << "3. cutoff_ = "<< cutoff_
557 << "; inc = " << inc << std::endl;
558#endif
559 co += inc;
560 if (co < cutoff_) {
561 cutoff_ = co;
562 lpSolver_->setDblParam(OsiDualObjectiveLimit, co);
563 }
564 }
565
567 BlisSolution *feasibleSolutionHeur(const double *solution);
568
573 virtual BlisSolution *feasibleSolution(int & numIntegerInfs,
574 int & numObjectInfs);
575
584 virtual BlisSolution *userFeasibleSolution(const double * solution,
585 bool &feasible) {
586 BlisSolution *sol = NULL;
587 feasible = true; // Feasible by default
588 return sol;
589 }
590
591 //------------------------------------------------------
592 // BRANCHING
593 //------------------------------------------------------
594
600 inline BcpsBranchStrategy * branchStrategy() const
601 { return branchStrategy_; }
602
604 inline void setBranchingMethod(BcpsBranchStrategy * method) {
605 if (branchStrategy_) delete branchStrategy_;
606 branchStrategy_ = method;
607 }
608
610 inline void setBranchingMethod(BcpsBranchStrategy & method) {
611 if (branchStrategy_) delete branchStrategy_;
612 branchStrategy_ = &method;
613 }
614 inline BcpsBranchStrategy * rampUpBranchStrategy() const
615 { return rampUpBranchStrategy_; }
617
622 inline int numObjects() const { return numObjects_; }
623
625 inline void setNumObjects(int num) { numObjects_ = num; }
626
628 inline BcpsObject ** objects() { return objects_;}
629
631 inline BcpsObject * objects(int which) { return objects_[which]; }
632
634 void setSharedObjectMark(int i) { sharedObjectMark_[i] = 1; }
635
638 for (int k = 0; k < numIntObjects_; ++k) {
639 sharedObjectMark_[k] = 0;
640 }
641 }
642
645
648 void addObjects(int numObjects, BcpsObject ** objects);
650
652 void createIntgerObjects(bool startAgain);
653
655 int* getIntObjIndices() const { return intObjIndices_; }
656
658 int getNumIntObjects() const { return numIntObjects_; }
659
661 int* getIntColIndices() const { return intColIndices_; }
662
664 bool checkInteger(double value) const {
665 double integerTolerance = 1.0e-5;
666 double nearest = floor(value + 0.5);
667 if (fabs(value - nearest) <= integerTolerance) {
668 return true;
669 }
670 else {
671 return false;
672 }
673 }
674
676
677 //------------------------------------------------------
678 // HEURISTICS.
679 //------------------------------------------------------
680
683
685 BlisHeuristic * heuristics(int i) const { return heuristics_[i]; }
686
688 int numHeuristics() const { return numHeuristics_; }
689
690 //------------------------------------------------------
691 // CONSTRAINTS.
692 //------------------------------------------------------
693
696
698 void addCutGenerator(CglCutGenerator * generator,
699 const char * name = NULL,
701 int cutGenerationFrequency = 1,
702 bool normal = true,
703 bool atSolution = false,
704 bool whenInfeasible = false);
705
707 BlisConGenerator *cutGenerators(int i) const { return generators_[i]; }
708
710 int numCutGenerators() const { return numCutGenerators_; }
711
713 int getMaxNumCons() const { return maxNumCons_; }
714
716 void setMaxNumCons(int m) { maxNumCons_ = m; }
717
719 BcpsConstraintPool *constraintPool() { return constraintPool_; }
720
722 BcpsConstraintPool *constraintPoolReceive()
723 { return constraintPoolReceive_; }
724
726 BcpsConstraintPool *constraintPoolSend() { return constraintPoolSend_; }
727
729
730 int getNumOldConstraints() const { return numOldConstraints_; }
731
733 void setNumOldConstraints(int num) { numOldConstraints_ = num; }
734
736 int getOldConstraintsSize() const { return oldConstraintsSize_; }
737
739 void setOldConstraintsSize(int num) { oldConstraintsSize_ = num; }
740
742 BlisConstraint **oldConstraints() { return oldConstraints_; }
743
745 void setOldConstraints(BlisConstraint **old) { oldConstraints_ = old; }
746
749 delete [] oldConstraints_;
750 oldConstraints_ = NULL;
751 }
753
756 return cutStrategy_;
757 }
758
760 void setCutStrategy(BlisCutStrategy u) { cutStrategy_ = u; }
761
763 int getCutGenerationFrequency() const { return cutGenerationFrequency_; }
764
766 void setCutStrategy(int f) { cutGenerationFrequency_ = f; }
767
769 int getDenseConCutoff() const { return denseConCutoff_; }
770
772 void setDenseConCutoff(int cutoff) { denseConCutoff_ = cutoff; }
773
775 double *getConRandoms() const { return conRandoms_; }
776
777 //------------------------------------------------------
778 // PRIORITY AND WEITGHT.
779 //------------------------------------------------------
780
795 void passInPriorities(const int * priorities,
796 bool ifNotSimpleIntegers,
797 int defaultValue = 1000);
798
800 inline const int * priority() const { return priority_; }
801
803 inline int priority(int sequence) const {
804 if (priority_) return priority_[sequence];
805 else return 1000;
806 }
807
808 inline double getNodeWeight() const { return nodeWeight_; }
809
810 inline void setNodeWeight(double nw) { nodeWeight_ = nw; }
812
813 //------------------------------------------------------
814 // STATISTICS.
815 //------------------------------------------------------
816
818 virtual void modelLog();
819
821 int getNumNodes() const { return numNodes_; }
822
824 int getNumIterations() const { return numIterations_; }
825
827 int getAveIterations() const { return aveIterations_; }
828
830 void addNumNodes(int newNodes = 1) { numNodes_ += newNodes; }
831
833 void addNumIterations(int newIter) {
834 numIterations_ += newIter;
835 aveIterations_ = numIterations_ / numNodes_;
836 }
837
839 CoinMessageHandler * blisMessageHandler() const
840 { return blisMessageHandler_; }
841
843 CoinMessages blisMessages() { return blisMessages_; }
844
847 BlisParams * BlisPar() { return BlisPar_; }
849
851 virtual void nodeLog(AlpsTreeNode *node, bool force);
852
854 virtual bool fathomAllNodes();
855
856 //------------------------------------------------------
857 // PARALLEL
858 //------------------------------------------------------
859
860 protected:
861
863 AlpsReturnStatus encodeBlis(AlpsEncoded *encoded) const;
864
866 AlpsReturnStatus decodeBlis(AlpsEncoded &encoded);
867
869 void packSharedPseudocost(AlpsEncoded *encoded, int numToShare);
870
872 void unpackSharedPseudocost(AlpsEncoded &encoded);
873
875 void packSharedConstraints(AlpsEncoded *encoded);
876
878 void unpackSharedConstraints(AlpsEncoded &encoded);
879
881 void packSharedVariables(AlpsEncoded *encoded);
882
884 void unpackSharedVariables(AlpsEncoded &encoded);
885
886 public:
887
890 virtual void registerKnowledge();
891
892 using AlpsKnowledge::encode ;
894 virtual AlpsEncoded* encode() const;
895
897 virtual void decodeToSelf(AlpsEncoded&);
898
901 virtual AlpsEncoded* packSharedKnowlege();
902
904 virtual void unpackSharedKnowledge(AlpsEncoded&);
905
906 //AT - Begin
908 //AT - end
909};
910
911#endif /* End of file */
BlisSolutionType
Definition Blis.h:112
BlisHotStartStrategy
Definition Blis.h:95
BlisHeurStrategy
Definition Blis.h:77
BlisCutStrategy
Definition Blis.h:69
@ BlisCutStrategyAuto
Definition Blis.h:73
Interface between Blis and Cut Generation Library.
Heuristic base class.
int * tempConLBPos_
Definition BlisModel.h:283
BlisHeuristic * heuristics(int i) const
Get a specific heuristic.
Definition BlisModel.h:685
double getFeasCheckTime()
Get the total time spent checking solutions for feasibility.
Definition BlisModel.h:474
double nodeWeight_
Definition BlisModel.h:198
double * objCoef_
Definition BlisModel.h:111
double optimalAbsGap_
Input absolute optimal gap.
Definition BlisModel.h:312
void setNodeWeight(double nw)
Definition BlisModel.h:810
void delOldConstraints()
Set max number of old constraints.
Definition BlisModel.h:748
void createObjects()
Create variables and constraints.
int * intColIndices_
Definition BlisModel.h:117
int * tempVarUBPos()
Definition BlisModel.h:519
CoinMessageHandler * blisMessageHandler() const
Get the message handler.
Definition BlisModel.h:839
int cutGenerationFrequency_
Frequency of cut generation.
Definition BlisModel.h:221
virtual OsiSolverInterface * solver()
Get lp solver.
Definition BlisModel.h:450
void setDenseConCutoff(int cutoff)
Set the thresheld to be considered as a dense constraint.
Definition BlisModel.h:772
virtual OsiSolverInterface * getSolver()
Get lp solver.
Definition BlisModel.h:447
const double * getLpSolution() const
Get active lp solution.
Definition BlisModel.h:531
void setSolEstimate(double est)
Set the solution estimate of the active node.
Definition BlisModel.h:459
virtual AlpsEncoded * encode() const
The method that encodes the model into an encoded object.
int * tempConLBPos()
Definition BlisModel.h:520
int numStrong_
Number of strong branching.
Definition BlisModel.h:195
bool checkInteger(double value) const
Check if a value is integer.
Definition BlisModel.h:664
virtual AlpsTreeNode * createRoot()
For parallel code, only the master calls this function.
double * incumbent_
Incumbent.
Definition BlisModel.h:147
double * getObjCoef() const
Get objective coefficients.
Definition BlisModel.h:487
void deleteObjects()
Delete all object information.
virtual bool setupSelf()
All processes call this function.
double * startConUB()
Definition BlisModel.h:515
virtual ~BlisModel()
Destructor.
const int * priority() const
Priorities.
Definition BlisModel.h:800
virtual void modelLog()
Log of specific models.
int getMaxNumCons() const
Get the max number of cuts can be generated.
Definition BlisModel.h:713
OsiSolverInterface * origLpSolver_
Input by user.
Definition BlisModel.h:79
void setNumBranchResolve(int num)
Set the maximum number of resolve during branching.
Definition BlisModel.h:471
BlisCutStrategy cutStrategy_
If use cut generators.
Definition BlisModel.h:218
int numNodes_
Number of processed nodes.
Definition BlisModel.h:264
int numElems_
Definition BlisModel.h:105
void setMaxNumCons(int m)
Set the max number of cuts can be generated.
Definition BlisModel.h:716
CoinMessageHandler * blisMessageHandler_
Message handler.
Definition BlisModel.h:258
BlisConstraint ** oldConstraints_
Temporary store old cuts at a node when installing a node.
Definition BlisModel.h:236
void analyzeObjective()
int storeSolution(BlisSolutionType how, BlisSolution *sol)
Record a new incumbent solution and update objectiveValue.
void addObjects(int numObjects, BcpsObject **objects)
Add in object information.
double * startVarLB_
Starting var/con bounds for processing each node.
Definition BlisModel.h:164
void setActiveNode(AlpsTreeNode *node)
Set active node.
Definition BlisModel.h:456
BlisCutStrategy getCutStrategy() const
Query constraint generation strategy.
Definition BlisModel.h:755
int boundingPass_
The number of passes during bounding procedure.
Definition BlisModel.h:303
int numRows_
Definition BlisModel.h:104
void packSharedPseudocost(AlpsEncoded *encoded, int numToShare)
Retrieve and pack shared pseudocost.
void unpackSharedVariables(AlpsEncoded &encoded)
Unpack and store shared variables.
bool problemSetup
Definition BlisModel.h:133
int numObjects() const
Get the number of objects.
Definition BlisModel.h:622
int denseConCutoff_
Dense constraint cutoff.
Definition BlisModel.h:248
virtual void importModel(std::vector< BlisVariable * > vars, std::vector< BlisConstraint * > cons)
For parallel code, only the master calls this function.
double optimalRelGap_
Input relative optimal gap.
Definition BlisModel.h:309
void addNumStrong(int num=1)
Add num to number of strong branchings.
Definition BlisModel.h:465
virtual void setSolver(OsiSolverInterface *si)
Set lp solver.
Definition BlisModel.h:444
std::vector< AlpsTreeNode * > leafToRootPath
Record the path from leaf to root.
Definition BlisModel.h:330
virtual void registerKnowledge()
Register knowledge.
BlisSolution * feasibleSolutionHeur(const double *solution)
Test if a solution found by heuristic is feasible.
BcpsConstraintPool * constraintPoolSend()
Access send constraint pool.
Definition BlisModel.h:726
double * conUB()
Definition BlisModel.h:507
BlisHotStartStrategy hotstartStrategy_
Definition BlisModel.h:177
virtual BlisSolution * feasibleSolution(int &numIntegerInfs, int &numObjectInfs)
Test the current LP solution for feasiblility.
CoinPackedMatrix * colMatrix_
Column majored matrix.
Definition BlisModel.h:91
int * tempVarLBPos_
Tempory storage for var/con indices.
Definition BlisModel.h:281
int numIterations_
Number of lp(Simplex) iterations.
Definition BlisModel.h:267
double feasCheckTime_
Time spent checking feasibility of solutions.
Definition BlisModel.h:273
int * tempConUBPos()
Definition BlisModel.h:521
void setOldConstraintsSize(int num)
Set max number of old constraints.
Definition BlisModel.h:739
int numHeurSolutions_
Definition BlisModel.h:141
BlisHeuristic ** heuristics_
The list of heuristics.
Definition BlisModel.h:211
void setNumOldConstraints(int num)
Set number of old constraints.
Definition BlisModel.h:733
double * conRandoms_
Random keys.
Definition BlisModel.h:245
double getLpObjValue() const
Get current objective function value.
Definition BlisModel.h:528
void setCutStrategy(BlisCutStrategy u)
Set constraint generation strategy.
Definition BlisModel.h:760
void addNumIterations(int newIter)
Increment Iteration count.
Definition BlisModel.h:833
void passInPriorities(const int *priorities, bool ifNotSimpleIntegers, int defaultValue=1000)
Pass in branching priorities.
std::vector< BcpsConstraint * > inputCon_
Definition BlisModel.h:123
int getCutGenerationFrequency() const
Query constraint generation frequency.
Definition BlisModel.h:763
virtual void writeParameters(std::ostream &outstream) const
Write out parameters.
void clearSharedObjectMark()
Clear all the share mark.
Definition BlisModel.h:637
void addCutGenerator(CglCutGenerator *generator, const char *name=NULL, BlisCutStrategy strategy=BlisCutStrategyAuto, int cutGenerationFrequency=1, bool normal=true, bool atSolution=false, bool whenInfeasible=false)
Add a Cgl cut generator.
int * intObjIndices_
Definition BlisModel.h:159
BlisParams * BlisPar()
Access parameters.
Definition BlisModel.h:847
BlisConGenerator * cutGenerators(int i) const
Get a specific cut generator.
Definition BlisModel.h:707
std::vector< BcpsVariable * > inputVar_
User's input objects.
Definition BlisModel.h:122
int * tempConUBPos_
Definition BlisModel.h:284
double * startConUB_
Definition BlisModel.h:167
int * tempVarUBPos_
Definition BlisModel.h:282
BcpsBranchStrategy * rampUpBranchStrategy() const
Definition BlisModel.h:614
void setCutStrategy(int f)
Set constraint generation frequency.
Definition BlisModel.h:766
int getNumOldConstraints() const
Get number of old constraints.
Definition BlisModel.h:730
int oldConstraintsSize_
The memory size allocated for oldConstraints_.
Definition BlisModel.h:239
BlisPresolve * presolve_
Definition BlisModel.h:130
void setOldConstraints(BlisConstraint **old)
set old constraints.
Definition BlisModel.h:745
int getNumStrong()
Get number of strong branchings.
Definition BlisModel.h:462
double cutoff_
Cutoff in lp solver.
Definition BlisModel.h:150
const double * getColUpper()
Get column upper bound.
Definition BlisModel.h:493
OsiSolverInterface * lpSolver_
Actually used.
Definition BlisModel.h:84
int getNumIterations() const
Get how many iterations it took to solve the problem.
Definition BlisModel.h:824
CoinMessages blisMessages_
Blis messages.
Definition BlisModel.h:261
int getAveIterations() const
Get the average iterations it took to solve a lp.
Definition BlisModel.h:827
void init()
Intialize member data.
BcpsConstraintPool * constraintPool()
Access constraint pool.
Definition BlisModel.h:719
void setCutoff(double co)
Set cut off value.
Definition BlisModel.h:553
BcpsObject ** objects_
The set of objects.
Definition BlisModel.h:183
double * conLB_
Definition BlisModel.h:97
void setConLb(double *cl)
Pass column upper bounds.
Definition BlisModel.h:371
int * getIntObjIndices() const
Get integers' object indices.
Definition BlisModel.h:655
BcpsObject * objects(int which)
Get the specified object.
Definition BlisModel.h:631
BcpsBranchStrategy * rampUpBranchStrategy_
Definition BlisModel.h:172
double * incumbent()
Return best ip solution found so far.
Definition BlisModel.h:544
void unpackSharedPseudocost(AlpsEncoded &encoded)
Unpack and store shared pseduocost.
int priority(int sequence) const
Returns priority level for an object (or 1000 if no priorities exist)
Definition BlisModel.h:803
BlisParams * BlisPar_
Blis parameters.
Definition BlisModel.h:255
void setNumCons(int num)
Pass column upper bounds.
Definition BlisModel.h:362
AlpsReturnStatus encodeBlis(AlpsEncoded *encoded) const
Pack Blis portion of the model into an encoded object.
int getOldConstraintsSize() const
Get max number of old constraints.
Definition BlisModel.h:736
BcpsConstraintPool * constraintPoolReceive_
Constraints that are received from other processses.
Definition BlisModel.h:295
double currRelGap_
Current relative optimal gap.
Definition BlisModel.h:315
void setObjCoef(double *obj)
Pass objective coefficients.
Definition BlisModel.h:388
BcpsBranchStrategy * branchStrategy() const
Get the current branching strategy.
Definition BlisModel.h:600
BcpsBranchStrategy * branchStrategy_
Variable selection function.
Definition BlisModel.h:171
int numCols_
Number of columns/rows/elements.
Definition BlisModel.h:103
void setColMatrix(CoinPackedMatrix *mat)
Pass a matrix in.
Definition BlisModel.h:359
int numCutGenerators() const
Get the number of cut generators.
Definition BlisModel.h:710
virtual void readParameters(const int argnum, const char *const *arglist)
Read in Alps, Blis parameters.
double currAbsGap_
Current absolute optimal gap.
Definition BlisModel.h:318
int getNumBranchResolve()
Get the maximum number of resolve during branching.
Definition BlisModel.h:468
double objSense_
Objective function.
Definition BlisModel.h:110
void setSharedObjectMark(int i)
Mark object to be shared.
Definition BlisModel.h:634
char * sharedObjectMark_
The objects that can be shared.
Definition BlisModel.h:186
int numObjects_
Number of objects.
Definition BlisModel.h:180
const double * getColLower()
Get column lower bound.
Definition BlisModel.h:490
int numOldConstraints_
Number of old constraints.
Definition BlisModel.h:242
void setVarUb(double *ub)
Pass variable lower bounds.
Definition BlisModel.h:380
void packSharedVariables(AlpsEncoded *encoded)
Retrieve and pack shared variables.
void setColType(char *colType)
Pass variable types.
Definition BlisModel.h:383
BlisConGenerator ** generators_
The list of cut generators used.
Definition BlisModel.h:230
BcpsObject ** objects()
Get the array of objects.
Definition BlisModel.h:628
int * priority_
Priorities of integer object.
Definition BlisModel.h:189
BcpsConstraintPool * constraintPoolReceive()
Access receive constraint pool.
Definition BlisModel.h:722
virtual bool fathomAllNodes()
Return true, if all nodes can be fathomed.
void setFeasCheckTime(double t)
Set the total time spent checking solutions for feasibility.
Definition BlisModel.h:477
BlisConstraint ** oldConstraints()
Access old constraints.
Definition BlisModel.h:742
double * startConLB()
The starting constraint bounds arrary of a subproblem (internal use).
Definition BlisModel.h:514
void setNumObjects(int num)
Set the number of objects.
Definition BlisModel.h:625
OsiCuts newCutPool_
Store new cuts in each pass.
Definition BlisModel.h:327
bool resolve()
Resolving a lp.
int getDenseConCutoff() const
Get the thresheld to be considered as a dense constraint.
Definition BlisModel.h:769
double getCutoff() const
Get cut off value.
Definition BlisModel.h:550
virtual void presolveForTheWholeTree()
int getNumNodes() const
Get how many Nodes it took to solve the problem.
Definition BlisModel.h:821
void addFeasCheckTime(double t)
Add to the time spent checking solutions for feasibility.
Definition BlisModel.h:480
int * tempVarLBPos()
Temparory storage.
Definition BlisModel.h:518
int getNumRows()
Get number of rows.
Definition BlisModel.h:499
int numBranchResolve_
Maximum number of resolve during branching.
Definition BlisModel.h:201
bool isRoot_
If root node.
Definition BlisModel.h:300
virtual void nodeLog(AlpsTreeNode *node, bool force)
Node log.
void setNumVars(int num)
Pass column upper bounds.
Definition BlisModel.h:365
void addHeuristic(BlisHeuristic *heur)
Add a heuristic.
BcpsConstraintPool * constraintPoolSend_
Constraints that can be sent/broadcasted to other processes.
Definition BlisModel.h:292
int getNumHeurSolutions() const
Get number of heuristic solutions.
Definition BlisModel.h:541
double * startVarUB()
Definition BlisModel.h:511
int aveIterations_
Average number of lp iterations to solve a subproblem.
Definition BlisModel.h:270
int numHeuristics() const
Get the number of heuristics.
Definition BlisModel.h:688
double * varUB_
Definition BlisModel.h:96
OsiSolverInterface * presolvedLpSolver_
Presolved.
Definition BlisModel.h:81
double * varLB()
Get variable bounds arrary.
Definition BlisModel.h:502
void setBranchingMethod(BcpsBranchStrategy *method)
Set the branching strategy.
Definition BlisModel.h:604
double * startVarUB_
Definition BlisModel.h:165
int * getIntColIndices() const
Get integers' column indices.
Definition BlisModel.h:661
double incObjValue_
Incumbent objective value.
Definition BlisModel.h:144
virtual void unpackSharedKnowledge(AlpsEncoded &)
Unpack and store shared knowledge from an encoded object.
AlpsTreeNode * activeNode_
Active node.
Definition BlisModel.h:192
double getNodeWeight() const
Definition BlisModel.h:808
void gutsOfDestructor()
Actual destructor.
int getNumSolutions() const
Get number of solutions.
Definition BlisModel.h:538
char * colType_
Definition BlisModel.h:160
double cutoffInc_
Cutoff increment.
Definition BlisModel.h:153
void setNumElems(int num)
Pass column upper bounds.
Definition BlisModel.h:368
double * conUB_
Definition BlisModel.h:98
virtual void postprocess()
Postprocessing the searching results.
int numCutGenerators_
Number of cut generators used.
Definition BlisModel.h:224
void setBranchingMethod(BcpsBranchStrategy &method)
Set the branching stratedy.
Definition BlisModel.h:610
bool presolved
Definition BlisModel.h:132
double integerTol_
Integer tolerance.
Definition BlisModel.h:306
double * varUB()
Definition BlisModel.h:503
AlpsReturnStatus decodeBlis(AlpsEncoded &encoded)
Unpack Blis portion of the model from an encoded object.
int getNumCols()
Get number of columns.
Definition BlisModel.h:496
virtual AlpsEncoded * packSharedKnowlege()
Pack knowledge to be shared with others into an encoded object.
void setConUb(double *cu)
Pass column lower bounds.
Definition BlisModel.h:374
BlisModel()
Default construtor.
Definition BlisModel.h:343
void addNumNodes(int newNodes=1)
Increment node count.
Definition BlisModel.h:830
BlisHeurStrategy heurStrategy_
If use heuristics.
Definition BlisModel.h:321
double * varLB_
Variable and constraint bounds.
Definition BlisModel.h:95
virtual void preprocess()
Preprocessing the model.
int getNumIntObjects() const
Get number of integers.
Definition BlisModel.h:658
void packSharedConstraints(AlpsEncoded *encoded)
Retrieve and pack shared constraints.
int numSolutions_
Definition BlisModel.h:140
int numIntObjects_
Column types.
Definition BlisModel.h:116
void createIntgerObjects(bool startAgain)
Identify integer variable.
double * startConLB_
Definition BlisModel.h:166
virtual BlisSolution * userFeasibleSolution(const double *solution, bool &feasible)
User's criteria for a feasible solution.
Definition BlisModel.h:584
void unpackSharedConstraints(AlpsEncoded &encoded)
Unpack and store shared constraints.
double * conLB()
Get original constraint bounds arrary.
Definition BlisModel.h:506
virtual void decodeToSelf(AlpsEncoded &)
The method that decodes the model from an encoded object.
double * getConRandoms() const
Get randoms for check parallel constraints.
Definition BlisModel.h:775
int numHeuristics_
Number of heuristics.
Definition BlisModel.h:208
int maxNumCons_
Number of cuts can be generators.
Definition BlisModel.h:227
void addCutGenerator(BlisConGenerator *generator)
Add a Blis cut generator.
double * startVarLB()
The starting variable bounds arrary of a subproblem (internal use).
Definition BlisModel.h:510
int heurCallFrequency_
Frequency of using heuristics.
Definition BlisModel.h:324
virtual void readInstance(const char *dataFile)
For parallel code, only the master calls this function.
CoinMessages blisMessages()
Return messages.
Definition BlisModel.h:843
void setVarLb(double *lb)
Pass variable upper bounds.
Definition BlisModel.h:377
BcpsConstraintPool * constraintPool_
Store all the cuts.
Definition BlisModel.h:233
@ cutoffInc
The value added to relaxation value when deciding fathom.
Definition BlisParams.h:147
bool entry(const chrParams key) const
Definition BlisParams.h:242
A interface to Osi/Coin Presolve.
This class contains the solutions generated by the LP solver (either primal or dual.
#define BLISLIB_EXPORT
Definition config.h:5