5#ifndef OsiChooseVariable_H
6#define OsiChooseVariable_H
11#include "CoinWarmStartBasis.hpp"
75 const double *solution,
88 double changeInObjective,
double changeInValue,
355 double changeInObjective,
double changeInValue,
473 int numberToDo,
int returnCriterion);
Abstract branching object base class.
int numberBranches() const
The number of branch arms created for this branching object.
This class chooses a variable to branch on.
void setShadowPriceMode(int value)
Set Shadow price mode.
OsiChooseStrong(const OsiChooseStrong &)
Copy constructor.
int numResults_
The number of OsiHotInfo objetcs that contain information.
OsiChooseStrong()
Default Constructor.
OsiChooseStrong(const OsiSolverInterface *solver)
Constructor from solver (so we can set up arrays etc)
int shadowPriceMode() const
Pseudo Shadow Price mode 0 - off 1 - use if no strong info 2 - use if strong not trusted 3 - use even...
OsiChooseStrong & operator=(const OsiChooseStrong &rhs)
Assignment operator.
virtual int chooseVariable(OsiSolverInterface *solver, OsiBranchingInformation *info, bool fixVariables)
Choose a variable Returns - -1 Node is infeasible 0 Normal termination - we have a candidate 1 All lo...
virtual ~OsiChooseStrong()
Destructor.
virtual int setupList(OsiBranchingInformation *info, bool initialize)
Sets up strong list and clears all if initialize is true.
int numberBeforeTrusted() const
A feww pass-through methods to access members of pseudoCosts_ as if they were members of OsiChooseStr...
int shadowPriceMode_
Pseudo Shadow Price mode 0 - off 1 - use and multiply by strong info 2 - use.
int numberObjects() const
void resetResults(int num)
Clear out the results array.
void setNumberBeforeTrusted(int value)
const OsiPseudoCosts & pseudoCosts() const
Accessor method to pseudo cost object.
OsiPseudoCosts pseudoCosts_
The pseudo costs for the chooser.
OsiHotInfo * results_
The results of the strong branching done on the candidates where the pseudocosts were not sufficient.
virtual OsiChooseVariable * clone() const
Clone.
OsiPseudoCosts & pseudoCosts()
Accessor method to pseudo cost object.
int doStrongBranching(OsiSolverInterface *solver, OsiBranchingInformation *info, int numberToDo, int returnCriterion)
This is a utility function which does strong branching on a list of objects and stores the results in...
This class chooses a variable to branch on.
int firstForcedWhichWay() const
Preferred way of forced object.
int firstForcedObjectIndex() const
Index of forced object.
int numberOnList() const
Number left on strong list.
void setTrustStrongForSolution(bool yesNo)
Set trust results from strong branching for valid solution.
void setStatus(int value)
double goodObjectiveValue() const
Objective value for feasible solution.
void setNumberStrong(int value)
Set number of objects to choose for strong branching.
virtual void updateInformation(const OsiBranchingInformation *info, int branch, OsiHotInfo *hotInfo)
Given a candidate fill in useful information e.g. estimates.
double * goodSolution_
Good solution - deleted by finalize.
int bestObjectIndex() const
Index of chosen object.
void setFirstForcedObjectIndex(int value)
Set index of forced object.
OsiChooseVariable(const OsiChooseVariable &)
Copy constructor.
void setBestObjectIndex(int value)
Set index of chosen object.
int numberUnsatisfied() const
Get the number of objects unsatisfied at this node - accurate on first pass.
int numberStrongFixed() const
Number of strong branches which changed bounds.
double downChange() const
Estimate of down change or max change on other possibilities if n-way.
void saveSolution(const OsiSolverInterface *solver)
Saves a good solution.
const int * candidates() const
List of candidates.
int numberStrongIterations_
Number of strong iterations actually done.
int numberStrongFixed_
Number of bound changes due to strong branching.
virtual void updateInformation(int whichObject, int branch, double changeInObjective, double changeInValue, int status)
Given a branch fill in useful information e.g. estimates.
OsiChooseVariable()
Default Constructor.
int * list_
List of candidates.
bool trustStrongForSolution() const
Trust results from strong branching for valid solution.
const double * goodSolution() const
Good solution - deleted by finalize.
double goodObjectiveValue_
Objective value for feasible solution.
virtual ~OsiChooseVariable()
Destructor.
virtual OsiChooseVariable * clone() const
Clone.
int firstForcedWhichWay_
Preferred way of forced object.
virtual bool feasibleSolution(const OsiBranchingInformation *info, const double *solution, int numberObjects, const OsiObject **objects)
Returns true if solution looks feasible against given objects.
int status() const
Return status - -1 Node is infeasible 0 Normal termination - we have a candidate 1 All looks satisfie...
double * useful_
Useful array (for sorting etc)
virtual int setupList(OsiBranchingInformation *info, bool initialize)
Sets up strong list and clears all if initialize is true.
int firstForcedObjectIndex_
Index of forced object.
bool trustStrongForSolution_
Trust results from strong branching for valid solution.
OsiChooseVariable(const OsiSolverInterface *solver)
Constructor from solver (so we can set up arrays etc)
int numberUnsatisfied_
The number of objects unsatisfied at this node.
void setTrustStrongForBound(bool yesNo)
Set trust results from strong branching for changing bounds.
int numberStrong() const
Number of objects to choose for strong branching.
void setBestWhichWay(int value)
Set preferred way of chosen object.
bool trustStrongForBound() const
Trust results from strong branching for changing bounds.
int bestObjectIndex_
Index of chosen object.
void setSolver(const OsiSolverInterface *solver)
Set solver and redo arrays.
int numberStrong_
Number of objects to choose for strong branching.
int numberStrongIterations() const
Number of strong iterations actually done.
const OsiSolverInterface * solver_
Pointer to solver.
double upChange_
Estimate of up change or change on chosen if n-way.
void clearGoodSolution()
Clears out good solution after use.
int numberOnList_
Number left on strong list.
int bestWhichWay() const
Preferred way of chosen object.
double downChange_
Estimate of down change or max change on other possibilities if n-way.
int numberStrongDone_
Number of strong branches actually done.
int numberStrongDone() const
Number of strong branches actually done.
void setFirstForcedWhichWay(int value)
Set preferred way of forced object.
int bestWhichWay_
Preferred way of chosen object.
OsiChooseVariable & operator=(const OsiChooseVariable &rhs)
Assignment operator.
virtual int chooseVariable(OsiSolverInterface *solver, OsiBranchingInformation *info, bool fixVariables)
Choose a variable Returns - -1 Node is infeasible 0 Normal termination - we have a candidate 1 All lo...
double upChange() const
Estimate of up change or change on chosen if n-way.
bool trustStrongForBound_
List of unsatisfied objects - first numberOnList_ for strong branching Trust results from strong bran...
This class contains the result of strong branching on a variable When created it stores enough inform...
void setUpChange(double value)
Set up change - invalid if n-way.
OsiHotInfo & operator=(const OsiHotInfo &rhs)
Assignment operator.
double change(int k) const
Change on way k.
virtual ~OsiHotInfo()
Destructor.
void setDownChange(double value)
Set down change - invalid if n-way.
double originalObjectiveValue_
Original objective value.
OsiHotInfo()
Default Constructor.
int downIterationCount() const
Down iteration count - invalid if n-way.
double * changes_
Objective changes.
double upChange() const
Up change - invalid if n-way.
OsiBranchingObject * branchingObject() const
Branching object.
int status(int k) const
Status on way k.
int upIterationCount() const
Up iteration count - invalid if n-way.
OsiHotInfo(const OsiHotInfo &)
Copy constructor.
int upStatus() const
Up status - invalid if n-way.
int whichObject_
Which object on list.
OsiBranchingObject * branchingObject_
Branching object.
double downChange() const
Down change - invalid if n-way.
void setDownStatus(int value)
Set down status - invalid if n-way.
int iterationCount(int k) const
Iteration count on way k.
int * statuses_
Status -1 - not done 0 - feasible and finished 1 - infeasible 2 - not finished.
virtual OsiHotInfo * clone() const
Clone.
void setUpStatus(int value)
Set up status - invalid if n-way.
int * iterationCounts_
Iteration counts.
OsiHotInfo(OsiSolverInterface *solver, const OsiBranchingInformation *info, const OsiObject *const *objects, int whichObject)
Constructor from useful information.
int updateInformation(const OsiSolverInterface *solver, const OsiBranchingInformation *info, OsiChooseVariable *choose)
Fill in useful information after strong branch.
int downStatus() const
Down status - invalid if n-way.
double originalObjectiveValue() const
Original objective value.
Abstract base class for ‘objects’.
This class is the placeholder for the pseudocosts used by OsiChooseStrong.
int numberBeforeTrusted_
Number before we trust.
virtual void updateInformation(int whichObject, int branch, double changeInObjective, double changeInValue, int status)
Given a branch fill in useful information e.g. estimates.
OsiPseudoCosts(const OsiPseudoCosts &rhs)
int * upNumber_
Number of times up.
const int * downNumber() const
const int * upNumber() const
virtual void updateInformation(const OsiBranchingInformation *info, int branch, OsiHotInfo *hotInfo)
Given a candidate fill in useful information e.g. estimates.
OsiPseudoCosts & operator=(const OsiPseudoCosts &rhs)
const double * upTotalChange() const
double * upTotalChange_
Total of all changes up.
virtual ~OsiPseudoCosts()
int numberObjects() const
Give the number of objects for which pseudo costs are stored.
void initialize(int n)
Initialize the pseudocosts with n entries.
void gutsOfCopy(const OsiPseudoCosts &rhs)
void setNumberBeforeTrusted(int value)
Set number of times before trusted.
double * downTotalChange()
int numberBeforeTrusted() const
Number of times before trusted.
const double * downTotalChange() const
double * downTotalChange_
Total of all changes down.
int * downNumber_
Number of times down.
int numberObjects_
Number of objects (could be found from solver)
Abstract Base Class for describing an interface to a solver.