Changeset 1290 for branches/sandbox


Ignore:
Timestamp:
Nov 9, 2009 10:00:50 PM (10 years ago)
Author:
bjarni
Message:

Extract classes CbcCompare? and CbcChooseVariable? from CbcCompareBase?.hpp to their own .hpp files

Location:
branches/sandbox/Cbc/src
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/Cbc/src/CbcCompareActual.hpp

    r1286 r1290  
    1616#include "CbcNode.hpp"
    1717#include "CbcCompareBase.hpp"
     18#include "CbcCompare.hpp"
     19
    1820class CbcModel;
    1921// This is default before first solution
  • branches/sandbox/Cbc/src/CbcCompareBase.hpp

    r1286 r1290  
    120120    bool threaded_;
    121121};
    122 class CbcCompare {
    123 public:
    124     CbcCompareBase * test_;
    125     // Default Constructor
    126     CbcCompare () {
    127         test_ = NULL;
    128     }
    129122
    130     virtual ~CbcCompare() {}
    131 
    132     bool operator() (CbcNode * x, CbcNode * y) {
    133         return test_->test(x, y);
    134     }
    135     bool compareNodes (CbcNode * x, CbcNode * y) {
    136         return test_->test(x, y);
    137     }
    138     /// This is alternate test function
    139     inline bool alternateTest (CbcNode * x, CbcNode * y) {
    140         return test_->alternateTest(x, y);
    141     }
    142 
    143     /// return comparison object
    144     inline CbcCompareBase * comparisonObject() const {
    145         return test_;
    146     }
    147 };
    148 //#############################################################################
    149 /*  These can be alternative strategies for choosing variables
    150     Any descendant can be passed in by setVariableChoice
    151 */
    152 
    153 class CbcChooseVariable {
    154 public:
    155     // Default Constructor
    156     CbcChooseVariable () {}
    157 
    158     virtual ~CbcChooseVariable() {}
    159     /** If strong branching, then only those passed in (and movement is that length)
    160         .  If not strong
    161         branching then all passed in and ignore movement.
    162         Returns which one chosen (or -1 if none).  way should be +1
    163         if branching up, -1 if down */
    164     virtual int chosen (const CbcModel * model, int numberToLookAt,
    165                         const int * which, const double * downMovement,
    166                         const double * upMovement, const double * solution,
    167                         int & way, double & value) = 0;
    168 
    169 };
    170123#endif
  • branches/sandbox/Cbc/src/CbcModel.hpp

    r1286 r1290  
    1313#include "CoinWarmStartBasis.hpp"
    1414#include "CbcCompareBase.hpp"
     15#include "CbcCompare.hpp"
    1516#include "CbcMessage.hpp"
    1617#include "CbcEventHandler.hpp"
Note: See TracChangeset for help on using the changeset viewer.