Ignore:
Timestamp:
Apr 10, 2008 1:55:10 PM (13 years ago)
Author:
ladanyi
Message:

Incorporated changes from branches/heur

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcBranchActual.hpp

    r848 r912  
    449449  */
    450450  virtual double branch();
     451
     452#if 0
     453  // No need to override. Default works fine.
     454  /** Reset every information so that the branching object appears to point to
     455      the previous child. This method does not need to modify anything in any
     456      solver. */
     457  virtual void previousBranch();
     458#endif
    451459
    452460  using CbcBranchingObject::print ;
     
    487495#endif
    488496
     497  /** Return the type (an integer identifier) of \c this */
     498  virtual int type() const { return 100; }
     499
     500  /** Compare the \c this with \c brObj. \c this and \c brObj must be os the
     501      same type and must have the same original object, but they may have
     502      different feasible regions.
     503      Return the appropriate CbcRangeCompare value (first argument being the
     504      sub/superset if that's the case). In case of overlap (and if \c
     505      replaceIfOverlap is true) replace the current branching object with one
     506      whose feasible region is the overlap.
     507   */
     508  virtual CbcRangeCompare compareBranchingObject
     509  (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
     510
    489511protected:
    490512  /// Lower [0] and upper [1] bounds for the down arm (way_ = -1)
     
    661683  inline void setChangeInGuessed(double value)
    662684  { changeInGuessed_=value;}
     685
     686  /** Return the type (an integer identifier) of \c this */
     687  virtual int type() const { return 101; }
     688
     689  /** Compare the \c this with \c brObj. \c this and \c brObj must be os the
     690      same type and must have the same original object, but they may have
     691      different feasible regions.
     692      Return the appropriate CbcRangeCompare value (first argument being the
     693      sub/superset if that's the case). In case of overlap (and if \c
     694      replaceIfOverlap is true) replace the current branching object with one
     695      whose feasible region is the overlap.
     696   */
     697  virtual CbcRangeCompare compareBranchingObject
     698  (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
     699
    663700protected:
    664701  /// Change in guessed objective value for next branch
     
    704741  virtual double branch();
    705742
     743#if 0
     744  // No need to override. Default works fine.
     745  /** Reset every information so that the branching object appears to point to
     746      the previous child. This method does not need to modify anything in any
     747      solver. */
     748  virtual void previousBranch();
     749#endif
     750
    706751  using CbcBranchingObject::print ;
    707752  /** \brief Print something about branch - only if log level high
    708753  */
    709754  virtual void print();
     755
     756  /** Return the type (an integer identifier) of \c this */
     757  virtual int type() const { return 102; }
     758
     759  /** Compare the original object of \c this with the original object of \c
     760      brObj. Assumes that there is an ordering of the original objects.
     761      This method should be invoked only if \c this and brObj are of the same
     762      type.
     763      Return negative/0/positive depending on whether \c this is
     764      smaller/same/larger than the argument.
     765  */
     766  virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
     767
     768  /** Compare the \c this with \c brObj. \c this and \c brObj must be os the
     769      same type and must have the same original object, but they may have
     770      different feasible regions.
     771      Return the appropriate CbcRangeCompare value (first argument being the
     772      sub/superset if that's the case). In case of overlap (and if \c
     773      replaceIfOverlap is true) replace the current branching object with one
     774      whose feasible region is the overlap.
     775   */
     776  virtual CbcRangeCompare compareBranchingObject
     777  (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
     778
    710779private:
    711780  /// data
     
    751820  virtual double branch();
    752821
     822#if 0
     823  // No need to override. Default works fine.
     824  /** Reset every information so that the branching object appears to point to
     825      the previous child. This method does not need to modify anything in any
     826      solver. */
     827  virtual void previousBranch();
     828#endif
     829
    753830  using CbcBranchingObject::print ;
    754831  /** \brief Print something about branch - only if log level high
    755832  */
    756833  virtual void print();
     834
     835  /** Return the type (an integer identifier) of \c this */
     836  virtual int type() const { return 103; }
     837
     838  /** Compare the original object of \c this with the original object of \c
     839      brObj. Assumes that there is an ordering of the original objects.
     840      This method should be invoked only if \c this and brObj are of the same
     841      type.
     842      Return negative/0/positive depending on whether \c this is
     843      smaller/same/larger than the argument.
     844  */
     845  virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
     846
     847  /** Compare the \c this with \c brObj. \c this and \c brObj must be os the
     848      same type and must have the same original object, but they may have
     849      different feasible regions.
     850      Return the appropriate CbcRangeCompare value (first argument being the
     851      sub/superset if that's the case). In case of overlap (and if \c
     852      replaceIfOverlap is true) replace the current branching object with one
     853      whose feasible region is the overlap.
     854   */
     855  virtual CbcRangeCompare compareBranchingObject
     856  (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
     857
    757858private:
    758859  /// data
     
    797898  virtual double branch();
    798899
     900  /** Reset every information so that the branching object appears to point to
     901      the previous child. This method does not need to modify anything in any
     902      solver. */
     903  virtual void previousBranch() {
     904    CbcBranchingObject::previousBranch();
     905    computeNonzeroRange();
     906  }
     907
    799908  using CbcBranchingObject::print ;
    800909  /** \brief Print something about branch - only if log level high
    801910  */
    802911  virtual void print();
     912
     913  /** Return the type (an integer identifier) of \c this */
     914  virtual int type() const { return 104; }
     915
     916  /** Compare the original object of \c this with the original object of \c
     917      brObj. Assumes that there is an ordering of the original objects.
     918      This method should be invoked only if \c this and brObj are of the same
     919      type.
     920      Return negative/0/positive depending on whether \c this is
     921      smaller/same/larger than the argument.
     922  */
     923  virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
     924
     925  /** Compare the \c this with \c brObj. \c this and \c brObj must be os the
     926      same type and must have the same original object, but they may have
     927      different feasible regions.
     928      Return the appropriate CbcRangeCompare value (first argument being the
     929      sub/superset if that's the case). In case of overlap (and if \c
     930      replaceIfOverlap is true) replace the current branching object with one
     931      whose feasible region is the overlap.
     932   */
     933  virtual CbcRangeCompare compareBranchingObject
     934  (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
     935
     936  /** Fill out the \c firstNonzero_ and \c lastNonzero_ data members */
     937  void computeNonzeroRange();
     938
    803939private:
    804940  /// data
     
    806942  /// separator
    807943  double separator_;
     944  /** The following two members describe the range in the members_ of the
     945      original object that whose upper bound is not fixed to 0. This is not
     946      necessary for Cbc to function correctly, this is there for heuristics so
     947      that separate branching decisions on the same object can be pooled into
     948      one branching object. */
     949  int firstNonzero_;
     950  int lastNonzero_;
    808951};
    809952
     
    840983  /// Does next branch and updates state
    841984  virtual double branch();
     985
     986#if 0
     987  // FIXME: what do we need to do here?
     988  /** Reset every information so that the branching object appears to point to
     989      the previous child. This method does not need to modify anything in any
     990      solver. */
     991  virtual void previousBranch();
     992#endif
    842993
    843994  using CbcBranchingObject::print ;
     
    8521003  virtual bool twoWay() const
    8531004  { return false;}
     1005
     1006  /** Return the type (an integer identifier) of \c this */
     1007  virtual int type() const { return 105; }
     1008
     1009  /** Compare the original object of \c this with the original object of \c
     1010      brObj. Assumes that there is an ordering of the original objects.
     1011      This method should be invoked only if \c this and brObj are of the same
     1012      type.
     1013      Return negative/0/positive depending on whether \c this is
     1014      smaller/same/larger than the argument.
     1015  */
     1016  virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
     1017
     1018  /** Compare the \c this with \c brObj. \c this and \c brObj must be os the
     1019      same type and must have the same original object, but they may have
     1020      different feasible regions.
     1021      Return the appropriate CbcRangeCompare value (first argument being the
     1022      sub/superset if that's the case). In case of overlap (and if \c
     1023      replaceIfOverlap is true) replace the current branching object with one
     1024      whose feasible region is the overlap.
     1025   */
     1026  virtual CbcRangeCompare compareBranchingObject
     1027  (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
     1028
    8541029private:
    8551030  /// order of branching - points back to CbcNWay
     
    10371212  virtual double branch();
    10381213
     1214#if 0
     1215  // No need to override. Default works fine.
     1216  /** Reset every information so that the branching object appears to point to
     1217      the previous child. This method does not need to modify anything in any
     1218      solver. */
     1219  virtual void previousBranch();
     1220#endif
     1221
    10391222  using CbcBranchingObject::print ;
    10401223  /** \brief Print something about branch - only if log level high
    10411224  */
    10421225  virtual void print();
     1226
     1227  /** Return the type (an integer identifier) of \c this */
     1228  virtual int type() const { return 106; }
     1229
     1230  /** Compare the original object of \c this with the original object of \c
     1231      brObj. Assumes that there is an ordering of the original objects.
     1232      This method should be invoked only if \c this and brObj are of the same
     1233      type.
     1234      Return negative/0/positive depending on whether \c this is
     1235      smaller/same/larger than the argument.
     1236  */
     1237  virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
     1238
     1239  /** Compare the \c this with \c brObj. \c this and \c brObj must be os the
     1240      same type and must have the same original object, but they may have
     1241      different feasible regions.
     1242      Return the appropriate CbcRangeCompare value (first argument being the
     1243      sub/superset if that's the case). In case of overlap (and if \c
     1244      replaceIfOverlap is true) replace the current branching object with one
     1245      whose feasible region is the overlap.
     1246   */
     1247  virtual CbcRangeCompare compareBranchingObject
     1248  (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
     1249
    10431250private:
    10441251  /// data
     
    11351342  virtual double branch();
    11361343
     1344#if 0
     1345  // No need to override. Default works fine.
     1346  /** Reset every information so that the branching object appears to point to
     1347      the previous child. This method does not need to modify anything in any
     1348      solver. */
     1349  virtual void previousBranch();
     1350#endif
     1351
    11371352  using CbcBranchingObject::print ;
    11381353  /** \brief Print something about branch - only if log level high
     
    11401355  virtual void print();
    11411356
     1357  /** Return the type (an integer identifier) of \c this */
     1358  virtual int type() const { return 107; }
     1359
     1360  /** Compare the original object of \c this with the original object of \c
     1361      brObj. Assumes that there is an ordering of the original objects.
     1362      This method should be invoked only if \c this and brObj are of the same
     1363      type.
     1364      Return negative/0/positive depending on whether \c this is
     1365      smaller/same/larger than the argument.
     1366  */
     1367  virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
     1368
     1369  /** Compare the \c this with \c brObj. \c this and \c brObj must be os the
     1370      same type and must have the same original object, but they may have
     1371      different feasible regions.
     1372      Return the appropriate CbcRangeCompare value (first argument being the
     1373      sub/superset if that's the case). In case of overlap (and if \c
     1374      replaceIfOverlap is true) replace the current branching object with one
     1375      whose feasible region is the overlap.
     1376   */
     1377  virtual CbcRangeCompare compareBranchingObject
     1378  (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
     1379
    11421380};
    11431381
Note: See TracChangeset for help on using the changeset viewer.