Ignore:
Timestamp:
Jan 29, 2010 9:25:07 AM (10 years ago)
Author:
forrest
Message:

moving sandbox stuff to trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/ClpDualRowPivot.hpp

    r1370 r1502  
    1919
    2020class ClpDualRowPivot  {
    21  
     21
    2222public:
    23  
    24   ///@name Algorithmic methods
    25   //@{
    26  
    27   /// Returns pivot row, -1 if none
    28   virtual int pivotRow() = 0;
    29  
    30   /** Updates weights and returns pivot alpha.
    31       Also does FT update */
    32   virtual double updateWeights(CoinIndexedVector * input,
    33                              CoinIndexedVector * spare,
    34                              CoinIndexedVector * spare2,
    35                              CoinIndexedVector * updatedColumn) = 0;
    36  
    37   /** Updates primal solution (and maybe list of candidates)
    38       Uses input vector which it deletes
    39       Computes change in objective function
    40       Would be faster if we kept basic regions, but on other hand it
    41       means everything is always in sync
    42   */
    43    /* FIXME: this was pure virtul (=0). Why? */
    44   virtual void updatePrimalSolution(CoinIndexedVector * input,
    45                                     double theta,
    46                                     double & changeInObjective) = 0;
    47   /** Saves any weights round factorization as pivot rows may change
    48       Will be empty unless steepest edge (will save model)
    49       May also recompute infeasibility stuff
    50       1) before factorization
    51       2) after good factorization (if weights empty may initialize)
    52       3) after something happened but no factorization
    53          (e.g. check for infeasible)
    54       4) as 2 but restore weights from previous snapshot
    55       5) for strong branching - initialize  , infeasibilities
    56   */
    57   virtual void saveWeights(ClpSimplex * model,int mode);
    58   /// checks accuracy and may re-initialize (may be empty)
    59   virtual void checkAccuracy();
    60   /// Gets rid of last update (may be empty)
    61   virtual void unrollWeights();
    62   /// Gets rid of all arrays (may be empty)
    63   virtual void clearArrays();
    64   /// Returns true if would not find any row
    65   virtual bool looksOptimal() const
    66   { return false;}
    67   /// Called when maximum pivots changes
    68   virtual void maximumPivotsChanged() {}
    69   //@}
    70  
    71  
    72   ///@name Constructors and destructors
    73   //@{
    74   /// Default Constructor
    75   ClpDualRowPivot();
    76  
    77   /// Copy constructor
    78   ClpDualRowPivot(const ClpDualRowPivot &);
    79  
    80   /// Assignment operator
    81   ClpDualRowPivot & operator=(const ClpDualRowPivot& rhs);
    82  
    83   /// Destructor
    84   virtual ~ClpDualRowPivot ();
    8523
    86   /// Clone
    87   virtual ClpDualRowPivot * clone(bool copyData = true) const = 0;
    88  
    89   //@}
     24    ///@name Algorithmic methods
     25    //@{
    9026
    91   ///@name Other
    92   //@{
    93   /// Returns model
    94   inline ClpSimplex * model()
    95   { return model_;}
    96  
    97   /// Sets model (normally to NULL)
    98   inline void setModel(ClpSimplex * model)
    99   { model_=model;}
    100  
    101   /// Returns type (above 63 is extra information)
    102   inline int type()
    103   { return type_;}
    104  
    105   //@}
     27    /// Returns pivot row, -1 if none
     28    virtual int pivotRow() = 0;
    10629
    107   //---------------------------------------------------------------------------
    108  
     30    /** Updates weights and returns pivot alpha.
     31        Also does FT update */
     32    virtual double updateWeights(CoinIndexedVector * input,
     33                                 CoinIndexedVector * spare,
     34                                 CoinIndexedVector * spare2,
     35                                 CoinIndexedVector * updatedColumn) = 0;
     36
     37    /** Updates primal solution (and maybe list of candidates)
     38        Uses input vector which it deletes
     39        Computes change in objective function
     40        Would be faster if we kept basic regions, but on other hand it
     41        means everything is always in sync
     42    */
     43    /* FIXME: this was pure virtul (=0). Why? */
     44    virtual void updatePrimalSolution(CoinIndexedVector * input,
     45                                      double theta,
     46                                      double & changeInObjective) = 0;
     47    /** Saves any weights round factorization as pivot rows may change
     48        Will be empty unless steepest edge (will save model)
     49        May also recompute infeasibility stuff
     50        1) before factorization
     51        2) after good factorization (if weights empty may initialize)
     52        3) after something happened but no factorization
     53           (e.g. check for infeasible)
     54        4) as 2 but restore weights from previous snapshot
     55        5) for strong branching - initialize  , infeasibilities
     56    */
     57    virtual void saveWeights(ClpSimplex * model, int mode);
     58    /// checks accuracy and may re-initialize (may be empty)
     59    virtual void checkAccuracy();
     60    /// Gets rid of last update (may be empty)
     61    virtual void unrollWeights();
     62    /// Gets rid of all arrays (may be empty)
     63    virtual void clearArrays();
     64    /// Returns true if would not find any row
     65    virtual bool looksOptimal() const {
     66        return false;
     67    }
     68    /// Called when maximum pivots changes
     69    virtual void maximumPivotsChanged() {}
     70    //@}
     71
     72
     73    ///@name Constructors and destructors
     74    //@{
     75    /// Default Constructor
     76    ClpDualRowPivot();
     77
     78    /// Copy constructor
     79    ClpDualRowPivot(const ClpDualRowPivot &);
     80
     81    /// Assignment operator
     82    ClpDualRowPivot & operator=(const ClpDualRowPivot& rhs);
     83
     84    /// Destructor
     85    virtual ~ClpDualRowPivot ();
     86
     87    /// Clone
     88    virtual ClpDualRowPivot * clone(bool copyData = true) const = 0;
     89
     90    //@}
     91
     92    ///@name Other
     93    //@{
     94    /// Returns model
     95    inline ClpSimplex * model() {
     96        return model_;
     97    }
     98
     99    /// Sets model (normally to NULL)
     100    inline void setModel(ClpSimplex * newmodel) {
     101        model_ = newmodel;
     102    }
     103
     104    /// Returns type (above 63 is extra information)
     105    inline int type() {
     106        return type_;
     107    }
     108
     109    //@}
     110
     111    //---------------------------------------------------------------------------
     112
    109113protected:
    110   ///@name Protected member data
    111   //@{
    112   /// Pointer to model
    113   ClpSimplex * model_;
    114   /// Type of row pivot algorithm
    115   int type_;
    116   //@}
     114    ///@name Protected member data
     115    //@{
     116    /// Pointer to model
     117    ClpSimplex * model_;
     118    /// Type of row pivot algorithm
     119    int type_;
     120    //@}
    117121};
    118122
Note: See TracChangeset for help on using the changeset viewer.