Cbc  2.9.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AbcPrimalColumnPivot.hpp
Go to the documentation of this file.
1 /* $Id: AbcPrimalColumnPivot.hpp 1910 2013-01-27 02:00:13Z stefan $ */
2 // Copyright (C) 2002, International Business Machines
3 // Corporation and others, Copyright (C) 2012, FasterCoin. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5 
6 #ifndef AbcPrimalColumnPivot_H
7 #define AbcPrimalColumnPivot_H
8 #include "AbcCommon.hpp"
9 
10 class AbcSimplex;
11 class CoinIndexedVector;
12 
13 //#############################################################################
14 
27 
28 public:
29 
31 
32 
51  virtual int pivotColumn(CoinPartitionedVector * updates,
52  CoinPartitionedVector * spareRow2,
53  CoinPartitionedVector * spareColumn1) = 0;
54 
56  virtual void updateWeights(CoinIndexedVector * input);
57 
69  virtual void saveWeights(AbcSimplex * model, int mode) = 0;
75  virtual int pivotRow(double & way) {
76  way = 0;
77  return -2;
78  }
80  virtual void clearArrays();
82  virtual bool looksOptimal() const {
83  return looksOptimal_;
84  }
86  virtual void setLooksOptimal(bool flag) {
87  looksOptimal_ = flag;
88  }
90 
91 
93 
96 
99 
102 
104  virtual ~AbcPrimalColumnPivot ();
105 
107  virtual AbcPrimalColumnPivot * clone(bool copyData = true) const = 0;
108 
110 
112 
113  inline AbcSimplex * model() {
115  return model_;
116  }
118  inline void setModel(AbcSimplex * newmodel) {
119  model_ = newmodel;
120  }
121 
123  inline int type() {
124  return type_;
125  }
126 
130  virtual int numberSprintColumns(int & numberIterations) const;
132  virtual void switchOffSprint();
134  virtual void maximumPivotsChanged() {}
135 
137 
138  //---------------------------------------------------------------------------
139 
140 protected:
142 
143  AbcSimplex * model_;
146  int type_;
150 };
151 #ifndef CLP_PRIMAL_SLACK_MULTIPLIER
152 #define CLP_PRIMAL_SLACK_MULTIPLIER 1.01
153 #endif
154 #endif
virtual void saveWeights(AbcSimplex *model, int mode)=0
Saves any weights round factorization as pivot rows may change Will be empty unless steepest edge (wi...
Primal Column Pivot Abstract Base Class.
virtual int pivotRow(double &way)
Signals pivot row choice: -2 (default) - use normal pivot row choice -1 to numberRows-1 - use this (w...
void setModel(AbcSimplex *newmodel)
Sets model.
virtual ~AbcPrimalColumnPivot()
Destructor.
virtual void setLooksOptimal(bool flag)
Sets optimality flag (for advanced use)
virtual void switchOffSprint()
Switch off sprint idea.
virtual int pivotColumn(CoinPartitionedVector *updates, CoinPartitionedVector *spareRow2, CoinPartitionedVector *spareColumn1)=0
Returns pivot column, -1 if none.
AbcPrimalColumnPivot()
Default Constructor.
Indexed Vector.
bool looksOptimal_
Says if looks optimal (normally computed)
int type_
Type of column pivot algorithm.
virtual bool looksOptimal() const
Returns true if would not find any column.
virtual void clearArrays()
Gets rid of all arrays (may be empty)
AbcSimplex * model_
Pointer to model.
int type()
Returns type (above 63 is extra information)
AbcSimplex * model()
Returns model.
virtual void maximumPivotsChanged()
Called when maximum pivots changes.
virtual int numberSprintColumns(int &numberIterations) const
Returns number of extra columns for sprint algorithm - 0 means off.
virtual AbcPrimalColumnPivot * clone(bool copyData=true) const =0
Clone.
AbcPrimalColumnPivot & operator=(const AbcPrimalColumnPivot &rhs)
Assignment operator.
virtual void updateWeights(CoinIndexedVector *input)
Updates weights - part 1 (may be empty)