Blis  0.94
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-2019, 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 "Blis.h"
52 #include "BlisConGenerator.h"
53 #include "BlisHeuristic.h"
54 #include "BlisMessage.h"
55 #include "BlisParams.h"
56 #include "BlisPseudo.h"
57 #include "BlisPresolve.h"
58 
59 //#############################################################################
60 
61 class BlisConstraint;
62 class BlisSolution;
63 class BcpsVariable;
64 class BlisVariable;
65 
66 //#############################################################################
67 
68 /* Declare a BLIS model */
69 class BlisModel : public BcpsModel {
70 
71 protected:
72 
73  //------------------------------------------------------
74  // LP SOLVER.
75  //------------------------------------------------------
76 
78  OsiSolverInterface *origLpSolver_;
80  OsiSolverInterface *presolvedLpSolver_;
83  OsiSolverInterface *lpSolver_;
84 
85  //------------------------------------------------------
86  // PROBLEM DATA. Populate when loadProblem(),
87  //------------------------------------------------------
88 
90  CoinPackedMatrix *colMatrix_;
91 
94  double *varLB_;
95  double *varUB_;
96  double *conLB_;
97  double *conUB_;
99 
102  int numCols_;
103  int numRows_;
106 
109  double objSense_;
110  double *objCoef_;
112 
116  int *intColIndices_; // size of numIntObjects_
118 
121  std::vector<BcpsVariable *> inputVar_;
122  std::vector<BcpsConstraint *> inputCon_;
124 
125  //------------------------------------------------------
126  // PRESOLVE
127  //------------------------------------------------------
128 
130  // AT - Begin
131  bool presolved;
133  // AT - End
134 
135  //------------------------------------------------------
136  // SOLUTION.
137  //------------------------------------------------------
138 
141 
143  double incObjValue_;
144 
146  double *incumbent_;
147 
149  double cutoff_;
150 
152  double cutoffInc_;
153 
154  //------------------------------------------------------
155  // SEARCHING.
156  //------------------------------------------------------
157 
158  int *intObjIndices_; // size of numCols_
159  char *colType_;
160 
163  double *startVarLB_;
164  double *startVarUB_;
165  double *startConLB_;
166  double *startConUB_;
168 
170  BcpsBranchStrategy * branchStrategy_;
171  BcpsBranchStrategy * rampUpBranchStrategy_;
172 
173  // Hotstart strategy 0 = off,
174  // 1 = branch if incorrect,
175  // 2 = branch even if correct, ....
177 
180 
182  BcpsObject **objects_;
183 
186 
188  int *priority_;
189 
191  AlpsTreeNode *activeNode_;
192 
195 
196  // Not used.
197  double nodeWeight_;
198 
201 
202  //------------------------------------------------------
203  // HEURISTICS.
204  //------------------------------------------------------
205 
208 
211 
212  //------------------------------------------------------
213  // CONSTRAINTS.
214  //------------------------------------------------------
215 
218 
221 
224 
227 
230 
232  BcpsConstraintPool *constraintPool_;
233 
236 
239 
242 
244  double *conRandoms_;
245 
248 
249  //------------------------------------------------------
250  // PARAMETERS, STATISTICS, and MESSAGE
251  //------------------------------------------------------
252 
255 
257  CoinMessageHandler *blisMessageHandler_;
258 
260  CoinMessages blisMessages_;
261 
264 
267 
270 
273 
274  //------------------------------------------------------
275  // TEMPORARY STORAGE
276  //------------------------------------------------------
277 
285 
286  //------------------------------------------------------
287  // Knowledge shared
288  //------------------------------------------------------
289 
291  BcpsConstraintPool *constraintPoolSend_;
292 
294  BcpsConstraintPool *constraintPoolReceive_;
295 
296  public:
297 
299  bool isRoot_;
300 
303 
305  double integerTol_;
306 
309 
312 
314  double currRelGap_;
315 
317  double currAbsGap_;
318 
321 
324 
326  OsiCuts newCutPool_;
327 
329  std::vector<AlpsTreeNode *> leafToRootPath;
330 
331  protected:
332 
334  void init();
335 
337  void createObjects();
338 
339  public:
340 
343  {
344  init();
345  }
346 
348  virtual ~BlisModel();
349 
351  void gutsOfDestructor();
352 
353  //------------------------------------------------------
354  // SETUP, LP SOLVER
355  //------------------------------------------------------
356 
358  void setColMatrix(CoinPackedMatrix *mat){ colMatrix_ = mat; }
359 
361  void setNumCons(int num){ numRows_ = num; }
362 
364  void setNumVars(int num){ numCols_ = num; }
365 
367  void setNumElems(int num){ numElems_ = num; }
368 
370  void setConLb(double *cl){ conLB_ = cl; }
371 
373  void setConUb(double *cu){ conUB_ = cu; }
374 
376  void setVarLb(double *lb){ varLB_ = lb; }
377 
379  void setVarUb(double *ub){ varUB_ = ub; }
380 
382  void setColType(char *colType){
383  colType_ = colType;
384  }
385 
387  void setObjCoef(double *obj){ objCoef_ = obj; }
388 
398  virtual void readInstance(const char* dataFile);
399 
411  virtual void importModel(std::vector<BlisVariable *> vars,
412  std::vector<BlisConstraint *> cons);
413 
415  virtual void readParameters(const int argnum, const char * const *arglist);
416 
418  virtual void writeParameters(std::ostream& outstream) const;
419 
423  virtual AlpsTreeNode * createRoot();
424 
434  virtual bool setupSelf();
435 
437  virtual void preprocess();
438 
440  virtual void postprocess();
441 
443  virtual void setSolver(OsiSolverInterface *si) { origLpSolver_ = si; }
444 
446  virtual OsiSolverInterface *getSolver() { return origLpSolver_; }
447 
449  virtual OsiSolverInterface *solver() { return lpSolver_; }
450 
452  bool resolve();
453 
455  void setActiveNode(AlpsTreeNode *node) { activeNode_ = node; }
456 
458  void setSolEstimate(double est) { activeNode_->setSolEstimate(est); }
459 
461  int getNumStrong() { return numStrong_; }
462 
464  void addNumStrong(int num=1) { numStrong_ += num; }
465 
468 
470  void setNumBranchResolve(int num) { numBranchResolve_ = num; }
471 
474 
476  void setFeasCheckTime(double t) { feasCheckTime_ = t; }
477 
479  void addFeasCheckTime(double t) { feasCheckTime_ += t; }
480 
481  //------------------------------------------------------
482  // PROBLEM DATA
483  //------------------------------------------------------
484 
486  double* getObjCoef() const { return objCoef_; }
487 
489  const double * getColLower() { return lpSolver_->getColLower(); }
490 
492  const double * getColUpper() { return lpSolver_->getColUpper(); }
493 
495  int getNumCols() { return lpSolver_->getNumCols(); }
496 
498  int getNumRows() { return lpSolver_->getNumRows(); }
499 
501  double *varLB() { return varLB_; }
502  double *varUB() { return varUB_; }
503 
505  double *conLB() { return conLB_; }
506  double *conUB() { return conUB_; }
507 
509  double *startVarLB() { return startVarLB_; }
510  double *startVarUB() { return startVarUB_; }
511 
513  double *startConLB() { return startConLB_; }
514  double *startConUB() { return startConUB_; }
515 
517  int *tempVarLBPos() { return tempVarLBPos_; }
518  int *tempVarUBPos() { return tempVarUBPos_; }
519  int *tempConLBPos() { return tempConLBPos_; }
520  int *tempConUBPos() { return tempConUBPos_; }
521 
522  //------------------------------------------------------
523  // LP SOLUTION
524  //------------------------------------------------------
525 
527  double getLpObjValue() const { return lpSolver_->getObjValue(); }
528 
530  const double * getLpSolution() const { return lpSolver_->getColSolution();}
531 
532  //------------------------------------------------------
533  // MILP SOLUTION
534  //------------------------------------------------------
535 
537  int getNumSolutions() const { return numSolutions_; }
538 
540  int getNumHeurSolutions() const { return numHeurSolutions_;}
541 
543  double * incumbent() { return incumbent_; }
544 
547 
549  inline double getCutoff() const { return cutoff_; }
550 
552  inline void setCutoff(double co) {
553  double inc = BlisPar_->entry(BlisParams::cutoffInc);
554 #if 0
555  std::cout << "3. cutoff_ = "<< cutoff_
556  << "; inc = " << inc << std::endl;
557 #endif
558  co += inc;
559  if (co < cutoff_) {
560  cutoff_ = co;
561  lpSolver_->setDblParam(OsiDualObjectiveLimit, co);
562  }
563  }
564 
566  BlisSolution *feasibleSolutionHeur(const double *solution);
567 
572  virtual BlisSolution *feasibleSolution(int & numIntegerInfs,
573  int & numObjectInfs);
574 
583  virtual BlisSolution *userFeasibleSolution(const double * solution,
584  bool &feasible) {
585  BlisSolution *sol = NULL;
586  feasible = true; // Feasible by default
587  return sol;
588  }
589 
590  //------------------------------------------------------
591  // BRANCHING
592  //------------------------------------------------------
593 
599  inline BcpsBranchStrategy * branchStrategy() const
600  { return branchStrategy_; }
601 
603  inline void setBranchingMethod(BcpsBranchStrategy * method) {
604  if (branchStrategy_) delete branchStrategy_;
605  branchStrategy_ = method;
606  }
607 
609  inline void setBranchingMethod(BcpsBranchStrategy & method) {
610  if (branchStrategy_) delete branchStrategy_;
611  branchStrategy_ = &method;
612  }
613  inline BcpsBranchStrategy * rampUpBranchStrategy() const
614  { return rampUpBranchStrategy_; }
616 
621  inline int numObjects() const { return numObjects_; }
622 
624  inline void setNumObjects(int num) { numObjects_ = num; }
625 
627  inline BcpsObject ** objects() { return objects_;}
628 
630  inline BcpsObject * objects(int which) { return objects_[which]; }
631 
633  void setSharedObjectMark(int i) { sharedObjectMark_[i] = 1; }
634 
637  for (int k = 0; k < numIntObjects_; ++k) {
638  sharedObjectMark_[k] = 0;
639  }
640  }
641 
643  void deleteObjects();
644 
647  void addObjects(int numObjects, BcpsObject ** objects);
649 
651  void createIntgerObjects(bool startAgain);
652 
654  int* getIntObjIndices() const { return intObjIndices_; }
655 
657  int getNumIntObjects() const { return numIntObjects_; }
658 
660  int* getIntColIndices() const { return intColIndices_; }
661 
663  bool checkInteger(double value) const {
664  double integerTolerance = 1.0e-5;
665  double nearest = floor(value + 0.5);
666  if (fabs(value - nearest) <= integerTolerance) {
667  return true;
668  }
669  else {
670  return false;
671  }
672  }
673 
674  void analyzeObjective();
675 
676  //------------------------------------------------------
677  // HEURISTICS.
678  //------------------------------------------------------
679 
681  void addHeuristic(BlisHeuristic * heur);
682 
684  BlisHeuristic * heuristics(int i) const { return heuristics_[i]; }
685 
687  int numHeuristics() const { return numHeuristics_; }
688 
689  //------------------------------------------------------
690  // CONSTRAINTS.
691  //------------------------------------------------------
692 
694  void addCutGenerator(BlisConGenerator * generator);
695 
697  void addCutGenerator(CglCutGenerator * generator,
698  const char * name = NULL,
700  int cutGenerationFrequency = 1,
701  bool normal = true,
702  bool atSolution = false,
703  bool whenInfeasible = false);
704 
706  BlisConGenerator *cutGenerators(int i) const { return generators_[i]; }
707 
709  int numCutGenerators() const { return numCutGenerators_; }
710 
712  int getMaxNumCons() const { return maxNumCons_; }
713 
715  void setMaxNumCons(int m) { maxNumCons_ = m; }
716 
718  BcpsConstraintPool *constraintPool() { return constraintPool_; }
719 
721  BcpsConstraintPool *constraintPoolReceive()
722  { return constraintPoolReceive_; }
723 
725  BcpsConstraintPool *constraintPoolSend() { return constraintPoolSend_; }
726 
728 
729  int getNumOldConstraints() const { return numOldConstraints_; }
730 
732  void setNumOldConstraints(int num) { numOldConstraints_ = num; }
733 
736 
739 
742 
745 
748  delete [] oldConstraints_;
749  oldConstraints_ = NULL;
750  }
752 
755  return cutStrategy_;
756  }
757 
760 
763 
766 
768  int getDenseConCutoff() const { return denseConCutoff_; }
769 
771  void setDenseConCutoff(int cutoff) { denseConCutoff_ = cutoff; }
772 
774  double *getConRandoms() const { return conRandoms_; }
775 
776  //------------------------------------------------------
777  // PRIORITY AND WEITGHT.
778  //------------------------------------------------------
779 
794  void passInPriorities(const int * priorities,
795  bool ifNotSimpleIntegers,
796  int defaultValue = 1000);
797 
799  inline const int * priority() const { return priority_; }
800 
802  inline int priority(int sequence) const {
803  if (priority_) return priority_[sequence];
804  else return 1000;
805  }
806 
807  inline double getNodeWeight() const { return nodeWeight_; }
808 
809  inline void setNodeWeight(double nw) { nodeWeight_ = nw; }
811 
812  //------------------------------------------------------
813  // STATISTICS.
814  //------------------------------------------------------
815 
817  virtual void modelLog();
818 
820  int getNumNodes() const { return numNodes_; }
821 
823  int getNumIterations() const { return numIterations_; }
824 
826  int getAveIterations() const { return aveIterations_; }
827 
829  void addNumNodes(int newNodes = 1) { numNodes_ += newNodes; }
830 
832  void addNumIterations(int newIter) {
833  numIterations_ += newIter;
835  }
836 
838  CoinMessageHandler * blisMessageHandler() const
839  { return blisMessageHandler_; }
840 
842  CoinMessages blisMessages() { return blisMessages_; }
843 
846  BlisParams * BlisPar() { return BlisPar_; }
848 
850  virtual void nodeLog(AlpsTreeNode *node, bool force);
851 
853  virtual bool fathomAllNodes();
854 
855  //------------------------------------------------------
856  // PARALLEL
857  //------------------------------------------------------
858 
859  protected:
860 
862  AlpsReturnStatus encodeBlis(AlpsEncoded *encoded) const;
863 
865  AlpsReturnStatus decodeBlis(AlpsEncoded &encoded);
866 
868  void packSharedPseudocost(AlpsEncoded *encoded, int numToShare);
869 
871  void unpackSharedPseudocost(AlpsEncoded &encoded);
872 
874  void packSharedConstraints(AlpsEncoded *encoded);
875 
877  void unpackSharedConstraints(AlpsEncoded &encoded);
878 
880  void packSharedVariables(AlpsEncoded *encoded);
881 
883  void unpackSharedVariables(AlpsEncoded &encoded);
884 
885  public:
886 
889  virtual void registerKnowledge();
890 
891  using AlpsKnowledge::encode ;
893  virtual AlpsEncoded* encode() const;
894 
896  virtual void decodeToSelf(AlpsEncoded&);
897 
900  virtual AlpsEncoded* packSharedKnowlege();
901 
903  virtual void unpackSharedKnowledge(AlpsEncoded&);
904 
905  //AT - Begin
906  virtual void presolveForTheWholeTree();
907  //AT - end
908 };
909 
910 #endif /* End of file */
BlisHeuristic * heuristics(int i) const
Get a specific heuristic.
Definition: BlisModel.h:684
virtual OsiSolverInterface * getSolver()
Get lp solver.
Definition: BlisModel.h:446
BcpsBranchStrategy * branchStrategy_
Variable selection function.
Definition: BlisModel.h:170
This class contains the solutions generated by the LP solver (either primal or dual.
Definition: BlisSolution.h:36
int oldConstraintsSize_
The memory size allocated for oldConstraints_.
Definition: BlisModel.h:238
BlisModel()
Default construtor.
Definition: BlisModel.h:342
const double * getColUpper()
Get column upper bound.
Definition: BlisModel.h:492
double * getConRandoms() const
Get randoms for check parallel constraints.
Definition: BlisModel.h:774
void setCutStrategy(BlisCutStrategy u)
Set constraint generation strategy.
Definition: BlisModel.h:759
bool isRoot_
If root node.
Definition: BlisModel.h:299
double * startVarUB()
Definition: BlisModel.h:510
double * conLB()
Get original constraint bounds arrary.
Definition: BlisModel.h:505
BlisSolution * feasibleSolutionHeur(const double *solution)
Test if a solution found by heuristic is feasible.
int * tempConLBPos()
Definition: BlisModel.h:519
virtual void postprocess()
Postprocessing the searching results.
int numOldConstraints_
Number of old constraints.
Definition: BlisModel.h:241
BcpsObject ** objects()
Get the array of objects.
Definition: BlisModel.h:627
void addFeasCheckTime(double t)
Add to the time spent checking solutions for feasibility.
Definition: BlisModel.h:479
int * tempConUBPos()
Definition: BlisModel.h:520
BcpsObject ** objects_
The set of objects.
Definition: BlisModel.h:182
double * startVarUB_
Definition: BlisModel.h:164
BcpsBranchStrategy * rampUpBranchStrategy_
Definition: BlisModel.h:171
double integerTol_
Integer tolerance.
Definition: BlisModel.h:305
int getAveIterations() const
Get the average iterations it took to solve a lp.
Definition: BlisModel.h:826
int numCols_
Number of columns/rows/elements.
Definition: BlisModel.h:102
void setSharedObjectMark(int i)
Mark object to be shared.
Definition: BlisModel.h:633
BcpsConstraintPool * constraintPool_
Store all the cuts.
Definition: BlisModel.h:232
virtual bool fathomAllNodes()
Return true, if all nodes can be fathomed.
int * priority_
Priorities of integer object.
Definition: BlisModel.h:188
BlisCutStrategy getCutStrategy() const
Query constraint generation strategy.
Definition: BlisModel.h:754
void createIntgerObjects(bool startAgain)
Identify integer variable.
double incObjValue_
Incumbent objective value.
Definition: BlisModel.h:143
OsiSolverInterface * presolvedLpSolver_
Presolved.
Definition: BlisModel.h:80
void setNumBranchResolve(int num)
Set the maximum number of resolve during branching.
Definition: BlisModel.h:470
int maxNumCons_
Number of cuts can be generators.
Definition: BlisModel.h:226
void setNumOldConstraints(int num)
Set number of old constraints.
Definition: BlisModel.h:732
char * colType_
Definition: BlisModel.h:159
int numNodes_
Number of processed nodes.
Definition: BlisModel.h:263
double getLpObjValue() const
Get current objective function value.
Definition: BlisModel.h:527
BlisSolutionType
Definition: Blis.h:112
BcpsConstraintPool * constraintPoolReceive()
Access receive constraint pool.
Definition: BlisModel.h:721
void setDenseConCutoff(int cutoff)
Set the thresheld to be considered as a dense constraint.
Definition: BlisModel.h:771
Heuristic base class.
Definition: BlisHeuristic.h:48
double * startConUB()
Definition: BlisModel.h:514
void setNodeWeight(double nw)
Definition: BlisModel.h:809
int numIterations_
Number of lp(Simplex) iterations.
Definition: BlisModel.h:266
BlisHeuristic ** heuristics_
The list of heuristics.
Definition: BlisModel.h:210
int numElems_
Definition: BlisModel.h:104
double * conLB_
Definition: BlisModel.h:96
void analyzeObjective()
int getNumBranchResolve()
Get the maximum number of resolve during branching.
Definition: BlisModel.h:467
int priority(int sequence) const
Returns priority level for an object (or 1000 if no priorities exist)
Definition: BlisModel.h:802
int aveIterations_
Average number of lp iterations to solve a subproblem.
Definition: BlisModel.h:269
BlisConGenerator ** generators_
The list of cut generators used.
Definition: BlisModel.h:229
BlisHotStartStrategy hotstartStrategy_
Definition: BlisModel.h:176
void setOldConstraints(BlisConstraint **old)
set old constraints.
Definition: BlisModel.h:744
void setConLb(double *cl)
Pass column upper bounds.
Definition: BlisModel.h:370
void addHeuristic(BlisHeuristic *heur)
Add a heuristic.
void setFeasCheckTime(double t)
Set the total time spent checking solutions for feasibility.
Definition: BlisModel.h:476
void setBranchingMethod(BcpsBranchStrategy *method)
Set the branching strategy.
Definition: BlisModel.h:603
int numObjects_
Number of objects.
Definition: BlisModel.h:179
double * startVarLB()
The starting variable bounds arrary of a subproblem (internal use).
Definition: BlisModel.h:509
int * tempConUBPos_
Definition: BlisModel.h:283
int getFeasCheckTime()
Get the total time spent checking solutions for feasibility.
Definition: BlisModel.h:473
virtual void nodeLog(AlpsTreeNode *node, bool force)
Node log.
int heurCallFrequency_
Frequency of using heuristics.
Definition: BlisModel.h:323
void setVarLb(double *lb)
Pass variable upper bounds.
Definition: BlisModel.h:376
int getNumIterations() const
Get how many iterations it took to solve the problem.
Definition: BlisModel.h:823
BlisParams * BlisPar()
Access parameters.
Definition: BlisModel.h:846
int storeSolution(BlisSolutionType how, BlisSolution *sol)
Record a new incumbent solution and update objectiveValue.
double * objCoef_
Definition: BlisModel.h:110
bool entry(const chrParams key) const
Definition: BlisParams.h:236
BlisHeurStrategy heurStrategy_
If use heuristics.
Definition: BlisModel.h:320
void delOldConstraints()
Set max number of old constraints.
Definition: BlisModel.h:747
A interface to Osi/Coin Presolve.
Definition: BlisPresolve.h:37
void setNumObjects(int num)
Set the number of objects.
Definition: BlisModel.h:624
BlisPresolve * presolve_
Definition: BlisModel.h:129
int getNumNodes() const
Get how many Nodes it took to solve the problem.
Definition: BlisModel.h:820
int getNumCols()
Get number of columns.
Definition: BlisModel.h:495
double * conUB()
Definition: BlisModel.h:506
void addCutGenerator(BlisConGenerator *generator)
Add a Blis cut generator.
int getNumHeurSolutions() const
Get number of heuristic solutions.
Definition: BlisModel.h:540
virtual OsiSolverInterface * solver()
Get lp solver.
Definition: BlisModel.h:449
BlisParams * BlisPar_
Blis parameters.
Definition: BlisModel.h:254
BcpsBranchStrategy * branchStrategy() const
Get the current branching strategy.
Definition: BlisModel.h:599
AlpsReturnStatus decodeBlis(AlpsEncoded &encoded)
Unpack Blis portion of the model from an encoded object.
double getCutoff() const
Get cut off value.
Definition: BlisModel.h:549
int getDenseConCutoff() const
Get the thresheld to be considered as a dense constraint.
Definition: BlisModel.h:768
double cutoff_
Cutoff in lp solver.
Definition: BlisModel.h:149
const double * getColLower()
Get column lower bound.
Definition: BlisModel.h:489
int numHeuristics() const
Get the number of heuristics.
Definition: BlisModel.h:687
int getNumIntObjects() const
Get number of integers.
Definition: BlisModel.h:657
const double * getLpSolution() const
Get active lp solution.
Definition: BlisModel.h:530
void deleteObjects()
Delete all object information.
void setSolEstimate(double est)
Set the solution estimate of the active node.
Definition: BlisModel.h:458
void setColType(char *colType)
Pass variable types.
Definition: BlisModel.h:382
void unpackSharedVariables(AlpsEncoded &encoded)
Unpack and store shared variables.
double * varLB()
Get variable bounds arrary.
Definition: BlisModel.h:501
BlisCutStrategy cutStrategy_
If use cut generators.
Definition: BlisModel.h:217
void clearSharedObjectMark()
Clear all the share mark.
Definition: BlisModel.h:636
BcpsConstraintPool * constraintPoolSend_
Constraints that can be sent/broadcasted to other processes.
Definition: BlisModel.h:291
double * startConUB_
Definition: BlisModel.h:166
int * tempVarLBPos_
Tempory storage for var/con indices.
Definition: BlisModel.h:280
int numHeurSolutions_
Definition: BlisModel.h:140
void unpackSharedPseudocost(AlpsEncoded &encoded)
Unpack and store shared pseduocost.
int numCutGenerators_
Number of cut generators used.
Definition: BlisModel.h:223
int getMaxNumCons() const
Get the max number of cuts can be generated.
Definition: BlisModel.h:712
int * getIntObjIndices() const
Get integers&#39; object indices.
Definition: BlisModel.h:654
virtual void setSolver(OsiSolverInterface *si)
Set lp solver.
Definition: BlisModel.h:443
void setNumCons(int num)
Pass column upper bounds.
Definition: BlisModel.h:361
double feasCheckTime_
Time spent checking feasibility of solutions.
Definition: BlisModel.h:272
int getNumRows()
Get number of rows.
Definition: BlisModel.h:498
double * conRandoms_
Random keys.
Definition: BlisModel.h:244
CoinMessages blisMessages()
Return messages.
Definition: BlisModel.h:842
int * intObjIndices_
Definition: BlisModel.h:158
const int * priority() const
Priorities.
Definition: BlisModel.h:799
OsiCuts newCutPool_
Store new cuts in each pass.
Definition: BlisModel.h:326
void gutsOfDestructor()
Actual destructor.
double optimalRelGap_
Input relative optimal gap.
Definition: BlisModel.h:308
virtual BlisSolution * userFeasibleSolution(const double *solution, bool &feasible)
User&#39;s criteria for a feasible solution.
Definition: BlisModel.h:583
BlisConGenerator * cutGenerators(int i) const
Get a specific cut generator.
Definition: BlisModel.h:706
void setMaxNumCons(int m)
Set the max number of cuts can be generated.
Definition: BlisModel.h:715
int numRows_
Definition: BlisModel.h:103
virtual AlpsEncoded * encode() const
The method that encodes the model into an encoded object.
int getCutGenerationFrequency() const
Query constraint generation frequency.
Definition: BlisModel.h:762
void createObjects()
Create variables and constraints.
virtual void preprocess()
Preprocessing the model.
void packSharedPseudocost(AlpsEncoded *encoded, int numToShare)
Retrieve and pack shared pseudocost.
void addObjects(int numObjects, BcpsObject **objects)
Add in object information.
The value added to relaxation value when deciding fathom.
Definition: BlisParams.h:142
void setNumElems(int num)
Pass column upper bounds.
Definition: BlisModel.h:367
BlisHeurStrategy
Definition: Blis.h:77
virtual bool setupSelf()
All processes call this function.
virtual void presolveForTheWholeTree()
BcpsObject * objects(int which)
Get the specified object.
Definition: BlisModel.h:630
double * varUB_
Definition: BlisModel.h:95
double * startVarLB_
Starting var/con bounds for processing each node.
Definition: BlisModel.h:163
BlisConstraint ** oldConstraints()
Access old constraints.
Definition: BlisModel.h:741
bool presolved
Definition: BlisModel.h:131
BlisHotStartStrategy
Definition: Blis.h:95
AlpsReturnStatus encodeBlis(AlpsEncoded *encoded) const
Pack Blis portion of the model into an encoded object.
virtual void modelLog()
Log of specific models.
int denseConCutoff_
Dense constraint cutoff.
Definition: BlisModel.h:247
int numObjects() const
Get the number of objects.
Definition: BlisModel.h:621
void setObjCoef(double *obj)
Pass objective coefficients.
Definition: BlisModel.h:387
std::vector< BcpsVariable * > inputVar_
User&#39;s input objects.
Definition: BlisModel.h:121
int * tempVarUBPos()
Definition: BlisModel.h:518
BcpsConstraintPool * constraintPool()
Access constraint pool.
Definition: BlisModel.h:718
bool checkInteger(double value) const
Check if a value is integer.
Definition: BlisModel.h:663
int cutGenerationFrequency_
Frequency of cut generation.
Definition: BlisModel.h:220
virtual AlpsTreeNode * createRoot()
For parallel code, only the master calls this function.
virtual void unpackSharedKnowledge(AlpsEncoded &)
Unpack and store shared knowledge from an encoded object.
void setVarUb(double *ub)
Pass variable lower bounds.
Definition: BlisModel.h:379
CoinMessageHandler * blisMessageHandler() const
Get the message handler.
Definition: BlisModel.h:838
int * tempVarUBPos_
Definition: BlisModel.h:281
double optimalAbsGap_
Input absolute optimal gap.
Definition: BlisModel.h:311
CoinMessageHandler * blisMessageHandler_
Message handler.
Definition: BlisModel.h:257
OsiSolverInterface * origLpSolver_
Input by user.
Definition: BlisModel.h:78
int numIntObjects_
Column types.
Definition: BlisModel.h:115
int numBranchResolve_
Maximum number of resolve during branching.
Definition: BlisModel.h:200
CoinPackedMatrix * colMatrix_
Column majored matrix.
Definition: BlisModel.h:90
std::vector< AlpsTreeNode * > leafToRootPath
Record the path from leaf to root.
Definition: BlisModel.h:329
int * intColIndices_
Definition: BlisModel.h:116
double * incumbent()
Return best ip solution found so far.
Definition: BlisModel.h:543
int getNumOldConstraints() const
Get number of old constraints.
Definition: BlisModel.h:729
BcpsBranchStrategy * rampUpBranchStrategy() const
Definition: BlisModel.h:613
int getOldConstraintsSize() const
Get max number of old constraints.
Definition: BlisModel.h:735
virtual void registerKnowledge()
Register knowledge.
BlisConstraint ** oldConstraints_
Temporary store old cuts at a node when installing a node.
Definition: BlisModel.h:235
virtual void decodeToSelf(AlpsEncoded &)
The method that decodes the model from an encoded object.
double getNodeWeight() const
Definition: BlisModel.h:807
void setCutoff(double co)
Set cut off value.
Definition: BlisModel.h:552
virtual void readInstance(const char *dataFile)
For parallel code, only the master calls this function.
OsiSolverInterface * lpSolver_
Actually used.
Definition: BlisModel.h:83
double * varLB_
Variable and constraint bounds.
Definition: BlisModel.h:94
AlpsTreeNode * activeNode_
Active node.
Definition: BlisModel.h:191
std::vector< BcpsConstraint * > inputCon_
Definition: BlisModel.h:122
virtual void importModel(std::vector< BlisVariable *> vars, std::vector< BlisConstraint *> cons)
For parallel code, only the master calls this function.
CoinMessages blisMessages_
Blis messages.
Definition: BlisModel.h:260
double objSense_
Objective function.
Definition: BlisModel.h:109
void addNumStrong(int num=1)
Add num to number of strong branchings.
Definition: BlisModel.h:464
void setNumVars(int num)
Pass column upper bounds.
Definition: BlisModel.h:364
virtual void readParameters(const int argnum, const char *const *arglist)
Read in Alps, Blis parameters.
double * incumbent_
Incumbent.
Definition: BlisModel.h:146
void unpackSharedConstraints(AlpsEncoded &encoded)
Unpack and store shared constraints.
void addNumIterations(int newIter)
Increment Iteration count.
Definition: BlisModel.h:832
void passInPriorities(const int *priorities, bool ifNotSimpleIntegers, int defaultValue=1000)
Pass in branching priorities.
double * conUB_
Definition: BlisModel.h:97
void packSharedVariables(AlpsEncoded *encoded)
Retrieve and pack shared variables.
void addNumNodes(int newNodes=1)
Increment node count.
Definition: BlisModel.h:829
double * startConLB_
Definition: BlisModel.h:165
int numCutGenerators() const
Get the number of cut generators.
Definition: BlisModel.h:709
char * sharedObjectMark_
The objects that can be shared.
Definition: BlisModel.h:185
void packSharedConstraints(AlpsEncoded *encoded)
Retrieve and pack shared constraints.
double * varUB()
Definition: BlisModel.h:502
double cutoffInc_
Cutoff increment.
Definition: BlisModel.h:152
void setBranchingMethod(BcpsBranchStrategy &method)
Set the branching stratedy.
Definition: BlisModel.h:609
BcpsConstraintPool * constraintPoolSend()
Access send constraint pool.
Definition: BlisModel.h:725
void setCutStrategy(int f)
Set constraint generation frequency.
Definition: BlisModel.h:765
BcpsConstraintPool * constraintPoolReceive_
Constraints that are received from other processses.
Definition: BlisModel.h:294
int numSolutions_
Definition: BlisModel.h:139
virtual ~BlisModel()
Destructor.
void init()
Intialize member data.
BlisCutStrategy
Definition: Blis.h:69
int numStrong_
Number of strong branching.
Definition: BlisModel.h:194
virtual AlpsEncoded * packSharedKnowlege()
Pack knowledge to be shared with others into an encoded object.
int boundingPass_
The number of passes during bounding procedure.
Definition: BlisModel.h:302
double currRelGap_
Current relative optimal gap.
Definition: BlisModel.h:314
double * startConLB()
The starting constraint bounds arrary of a subproblem (internal use).
Definition: BlisModel.h:513
bool resolve()
Resolving a lp.
int * tempVarLBPos()
Temparory storage.
Definition: BlisModel.h:517
virtual BlisSolution * feasibleSolution(int &numIntegerInfs, int &numObjectInfs)
Test the current LP solution for feasiblility.
double nodeWeight_
Definition: BlisModel.h:197
int * tempConLBPos_
Definition: BlisModel.h:282
int * getIntColIndices() const
Get integers&#39; column indices.
Definition: BlisModel.h:660
virtual void writeParameters(std::ostream &outstream) const
Write out parameters.
void setConUb(double *cu)
Pass column lower bounds.
Definition: BlisModel.h:373
int getNumStrong()
Get number of strong branchings.
Definition: BlisModel.h:461
double * getObjCoef() const
Get objective coefficients.
Definition: BlisModel.h:486
void setActiveNode(AlpsTreeNode *node)
Set active node.
Definition: BlisModel.h:455
void setOldConstraintsSize(int num)
Set max number of old constraints.
Definition: BlisModel.h:738
Interface between Blis and Cut Generation Library.
void setColMatrix(CoinPackedMatrix *mat)
Pass a matrix in.
Definition: BlisModel.h:358
int numHeuristics_
Number of heuristics.
Definition: BlisModel.h:207
bool problemSetup
Definition: BlisModel.h:132
int getNumSolutions() const
Get number of solutions.
Definition: BlisModel.h:537
double currAbsGap_
Current absolute optimal gap.
Definition: BlisModel.h:317