Ignore:
Timestamp:
Jan 6, 2019 2:43:06 PM (4 months ago)
Author:
unxusr
Message:

formatting

File:
1 edited

Legend:

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

    r2235 r2385  
    2525*/
    2626
    27 class ClpEventHandler  {
     27class ClpEventHandler {
    2828
    2929public:
    30      /** enums for what sort of event.
     30  /** enums for what sort of event.
    3131
    3232         These will also be returned in ClpModel::secondaryStatus() as int
    3333     */
    34      enum Event {
    35           endOfIteration = 100, // used to set secondary status
    36           endOfFactorization, // after gutsOfSolution etc
    37           endOfValuesPass,
    38           node, // for Cbc
    39           treeStatus, // for Cbc
    40           solution, // for Cbc
    41           theta, // hit in parametrics
    42           pivotRow, // used to choose pivot row
    43           presolveStart, // ClpSolve presolve start
    44           presolveSize, // sees if ClpSolve presolve too big or too small
    45           presolveInfeasible, // ClpSolve presolve infeasible
    46           presolveBeforeSolve, // ClpSolve presolve before solve
    47           presolveAfterFirstSolve, // ClpSolve presolve after solve
    48           presolveAfterSolve, // ClpSolve presolve after solve
    49           presolveEnd, // ClpSolve presolve end
    50           goodFactorization, // before gutsOfSolution
    51           complicatedPivotIn, // in modifyCoefficients
    52           noCandidateInPrimal, // tentative end
    53           looksEndInPrimal, // About to declare victory (or defeat)
    54           endInPrimal, // Victory (or defeat)
    55           beforeStatusOfProblemInPrimal,
    56           startOfStatusOfProblemInPrimal,
    57           complicatedPivotOut, // in modifyCoefficients
    58           noCandidateInDual, // tentative end
    59           looksEndInDual, // About to declare victory (or defeat)
    60           endInDual, // Victory (or defeat)
    61           beforeStatusOfProblemInDual,
    62           startOfStatusOfProblemInDual,
    63           startOfIterationInDual,
    64           updateDualsInDual,
    65           beforeDeleteRim,
    66           endOfCreateRim,
    67           slightlyInfeasible,
    68           modifyMatrixInMiniPresolve,
    69           moreMiniPresolve,
    70           modifyMatrixInMiniPostsolve,
    71           beforeChooseIncoming,
    72           afterChooseIncoming,
    73           beforeCreateNonLinear,
    74           afterCreateNonLinear,
    75           startOfCrossover, // in Idiot
    76           noTheta // At end (because no pivot)
    77      };
    78      /**@name Virtual method that the derived classes should provide.
     34  enum Event {
     35    endOfIteration = 100, // used to set secondary status
     36    endOfFactorization, // after gutsOfSolution etc
     37    endOfValuesPass,
     38    node, // for Cbc
     39    treeStatus, // for Cbc
     40    solution, // for Cbc
     41    theta, // hit in parametrics
     42    pivotRow, // used to choose pivot row
     43    presolveStart, // ClpSolve presolve start
     44    presolveSize, // sees if ClpSolve presolve too big or too small
     45    presolveInfeasible, // ClpSolve presolve infeasible
     46    presolveBeforeSolve, // ClpSolve presolve before solve
     47    presolveAfterFirstSolve, // ClpSolve presolve after solve
     48    presolveAfterSolve, // ClpSolve presolve after solve
     49    presolveEnd, // ClpSolve presolve end
     50    goodFactorization, // before gutsOfSolution
     51    complicatedPivotIn, // in modifyCoefficients
     52    noCandidateInPrimal, // tentative end
     53    looksEndInPrimal, // About to declare victory (or defeat)
     54    endInPrimal, // Victory (or defeat)
     55    beforeStatusOfProblemInPrimal,
     56    startOfStatusOfProblemInPrimal,
     57    complicatedPivotOut, // in modifyCoefficients
     58    noCandidateInDual, // tentative end
     59    looksEndInDual, // About to declare victory (or defeat)
     60    endInDual, // Victory (or defeat)
     61    beforeStatusOfProblemInDual,
     62    startOfStatusOfProblemInDual,
     63    startOfIterationInDual,
     64    updateDualsInDual,
     65    beforeDeleteRim,
     66    endOfCreateRim,
     67    slightlyInfeasible,
     68    modifyMatrixInMiniPresolve,
     69    moreMiniPresolve,
     70    modifyMatrixInMiniPostsolve,
     71    beforeChooseIncoming,
     72    afterChooseIncoming,
     73    beforeCreateNonLinear,
     74    afterCreateNonLinear,
     75    startOfCrossover, // in Idiot
     76    noTheta // At end (because no pivot)
     77  };
     78  /**@name Virtual method that the derived classes should provide.
    7979      The base class instance does nothing and as event() is only useful method
    8080      it would not be very useful NOT providing one!
    8181     */
    82      //@{
    83      /** This can do whatever it likes.  If return code -1 then carries on
     82  //@{
     83  /** This can do whatever it likes.  If return code -1 then carries on
    8484         if 0 sets ClpModel::status() to 5 (stopped by event) and will return to user.
    8585         At present if <-1 carries on and if >0 acts as if 0 - this may change.
    8686         For ClpSolve 2 -> too big return status of -2 and -> too small 3
    8787     */
    88      virtual int event(Event whichEvent);
    89      /** This can do whatever it likes.  Return code -1 means no action.
     88  virtual int event(Event whichEvent);
     89  /** This can do whatever it likes.  Return code -1 means no action.
    9090         This passes in something
    9191     */
    92      virtual int eventWithInfo(Event whichEvent, void * info) ;
    93      //@}
     92  virtual int eventWithInfo(Event whichEvent, void *info);
     93  //@}
    9494
     95  /**@name Constructors, destructor */
    9596
    96      /**@name Constructors, destructor */
     97  //@{
     98  /** Default constructor. */
     99  ClpEventHandler(ClpSimplex *model = NULL);
     100  /** Destructor */
     101  virtual ~ClpEventHandler();
     102  // Copy
     103  ClpEventHandler(const ClpEventHandler &);
     104  // Assignment
     105  ClpEventHandler &operator=(const ClpEventHandler &);
     106  /// Clone
     107  virtual ClpEventHandler *clone() const;
    97108
    98      //@{
    99      /** Default constructor. */
    100      ClpEventHandler(ClpSimplex * model = NULL);
    101      /** Destructor */
    102      virtual ~ClpEventHandler();
    103      // Copy
    104      ClpEventHandler(const ClpEventHandler&);
    105      // Assignment
    106      ClpEventHandler& operator=(const ClpEventHandler&);
    107      /// Clone
    108      virtual ClpEventHandler * clone() const;
     109  //@}
    109110
    110      //@}
     111  /**@name Sets/gets */
    111112
    112      /**@name Sets/gets */
    113 
    114      //@{
    115      /** set model. */
    116      void setSimplex(ClpSimplex * model);
    117      /// Get model
    118      inline ClpSimplex * simplex() const {
    119           return model_;
    120      }
    121      //@}
    122 
     113  //@{
     114  /** set model. */
     115  void setSimplex(ClpSimplex *model);
     116  /// Get model
     117  inline ClpSimplex *simplex() const
     118  {
     119    return model_;
     120  }
     121  //@}
    123122
    124123protected:
    125      /**@name Data members
     124  /**@name Data members
    126125        The data members are protected to allow access for derived classes. */
    127      //@{
    128      /// Pointer to simplex
    129      ClpSimplex * model_;
    130      //@}
     126  //@{
     127  /// Pointer to simplex
     128  ClpSimplex *model_;
     129  //@}
    131130};
    132131/** Base class for Clp disaster handling
     
    137136*/
    138137
    139 class ClpDisasterHandler  {
     138class ClpDisasterHandler {
    140139
    141140public:
    142      /**@name Virtual methods that the derived classe should provide.
     141  /**@name Virtual methods that the derived classe should provide.
    143142     */
    144      //@{
    145      /// Into simplex
    146      virtual void intoSimplex() = 0;
    147      /// Checks if disaster
    148      virtual bool check() const = 0;
    149      /// saves information for next attempt
    150      virtual void saveInfo() = 0;
    151      /// Type of disaster 0 can fix, 1 abort
    152      virtual int typeOfDisaster();
    153      //@}
     143  //@{
     144  /// Into simplex
     145  virtual void intoSimplex() = 0;
     146  /// Checks if disaster
     147  virtual bool check() const = 0;
     148  /// saves information for next attempt
     149  virtual void saveInfo() = 0;
     150  /// Type of disaster 0 can fix, 1 abort
     151  virtual int typeOfDisaster();
     152  //@}
    154153
     154  /**@name Constructors, destructor */
    155155
    156      /**@name Constructors, destructor */
     156  //@{
     157  /** Default constructor. */
     158  ClpDisasterHandler(ClpSimplex *model = NULL);
     159  /** Destructor */
     160  virtual ~ClpDisasterHandler();
     161  // Copy
     162  ClpDisasterHandler(const ClpDisasterHandler &);
     163  // Assignment
     164  ClpDisasterHandler &operator=(const ClpDisasterHandler &);
     165  /// Clone
     166  virtual ClpDisasterHandler *clone() const = 0;
    157167
    158      //@{
    159      /** Default constructor. */
    160      ClpDisasterHandler(ClpSimplex * model = NULL);
    161      /** Destructor */
    162      virtual ~ClpDisasterHandler();
    163      // Copy
    164      ClpDisasterHandler(const ClpDisasterHandler&);
    165      // Assignment
    166      ClpDisasterHandler& operator=(const ClpDisasterHandler&);
    167      /// Clone
    168      virtual ClpDisasterHandler * clone() const = 0;
     168  //@}
    169169
    170      //@}
     170  /**@name Sets/gets */
    171171
    172      /**@name Sets/gets */
    173 
    174      //@{
    175      /** set model. */
    176      void setSimplex(ClpSimplex * model);
    177      /// Get model
    178      inline ClpSimplex * simplex() const {
    179           return model_;
    180      }
    181      //@}
    182 
     172  //@{
     173  /** set model. */
     174  void setSimplex(ClpSimplex *model);
     175  /// Get model
     176  inline ClpSimplex *simplex() const
     177  {
     178    return model_;
     179  }
     180  //@}
    183181
    184182protected:
    185      /**@name Data members
     183  /**@name Data members
    186184        The data members are protected to allow access for derived classes. */
    187      //@{
    188      /// Pointer to simplex
    189      ClpSimplex * model_;
    190      //@}
     185  //@{
     186  /// Pointer to simplex
     187  ClpSimplex *model_;
     188  //@}
    191189};
    192190#endif
     191
     192/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
     193*/
Note: See TracChangeset for help on using the changeset viewer.