Changeset 346


Ignore:
Timestamp:
Apr 8, 2004 12:48:27 PM (17 years ago)
Author:
forrest
Message:

Comments

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpSimplex.cpp

    r344 r346  
    33473347{
    33483348  assert (ifValuesPass>=0&&ifValuesPass<3);
     3349  /*  Note use of "down casting".  The only class the user sees is ClpSimplex.
     3350      Classes ClpSimplexDual, ClpSimplexPrimal, (ClpSimplexPrimalQuadratic)
     3351      and ClpSimplexOther all exist and inherit from ClpSimplex but have no
     3352      additional data and have no destructor or (non-default) constructor.
     3353
     3354      This is to stop classes becoming too unwieldy and so I (JJF) can use e.g. "perturb"
     3355      in primal and dual.
     3356
     3357      As far as I can see this is perfectly safe.
     3358  */
    33493359  int returnCode = ((ClpSimplexDual *) this)->dual(ifValuesPass);
    33503360  if (problemStatus_==10) {
     
    34213431{
    34223432  assert (ifValuesPass>=0&&ifValuesPass<3);
     3433  /*  Note use of "down casting".  The only class the user sees is ClpSimplex.
     3434      Classes ClpSimplexDual, ClpSimplexPrimal, (ClpSimplexPrimalQuadratic)
     3435      and ClpSimplexOther all exist and inherit from ClpSimplex but have no
     3436      additional data and have no destructor or (non-default) constructor.
     3437
     3438      This is to stop classes becoming too unwieldy and so I (JJF) can use e.g. "perturb"
     3439      in primal and dual.
     3440
     3441      As far as I can see this is perfectly safe.
     3442  */
    34233443  int returnCode = ((ClpSimplexPrimal *) this)->primal(ifValuesPass);
    34243444  if (problemStatus_==10) {
  • trunk/include/ClpEventHandler.hpp

    r344 r346  
    88/** Base class for Clp event handling
    99   
    10 This is just here to allow for event handling
     10This is just here to allow for event handling.  By event I mean a Clp event
     11e.g. end of values pass.
     12
     13One use would be to let a user handle a system event e.g. Control-C.  This could be done
     14by deriving a class MyEventHandler which knows about such events.  If one occurs
     15MyEventHandler::event() could clear event status and return 3 (stopped).
     16
     17Clp would then return to user code.
     18
     19As it is called every iteration this should be fine grained enough.
    1120   
    1221*/
     
    1524 
    1625public:
    17   /** enums for what sort of event
     26  /** enums for what sort of event.
     27
     28      These will also be returned in ClpModel::secondaryStatus() as int
    1829  */
    1930  enum Event {
     
    2233    endOfValuesPass
    2334  };
    24   /**@name Virtual methods that the derived classes must provide */
     35  /**@name Virtual method that the derived classe should provide.
     36   The base class instance does nothing and as event() is only useful method
     37   it would not be very useful NOT providing one!
     38  */
    2539  //@{
    2640  /** This can do whatever it likes.  If return code -1 then carries on
    27       if >=0 sets status and exits
     41      if >=0 sets ClpModel::status() to that value and will return to user
    2842  */
    2943  virtual int event(Event whichEvent);
Note: See TracChangeset for help on using the changeset viewer.