Ignore:
Timestamp:
Feb 26, 2010 12:27:59 PM (10 years ago)
Author:
mjs
Message:

Formatted .cpp, .hpp, .c, .h files with "astyle -A4 -p". This matches the formatting used in the grand CBC reorganization.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/MyEventHandler.cpp

    r1370 r1525  
    11/* $Id$ */
    22// Copyright (C) 2004, International Business Machines
    3 // Corporation and others.  All Rights Reserved. 
     3// Corporation and others.  All Rights Reserved.
    44
    5 #if defined(_MSC_VER) 
     5#if defined(_MSC_VER)
    66#pragma warning(disable:4786)
    77#pragma warning(disable:4503)
     
    1616
    1717//-------------------------------------------------------------------
    18 // Default Constructor 
     18// Default Constructor
    1919//-------------------------------------------------------------------
    20 MyEventHandler::MyEventHandler () 
    21   : ClpEventHandler()
     20MyEventHandler::MyEventHandler ()
     21     : ClpEventHandler()
    2222{
    2323}
    2424
    2525//-------------------------------------------------------------------
    26 // Copy constructor 
     26// Copy constructor
    2727//-------------------------------------------------------------------
    28 MyEventHandler::MyEventHandler (const MyEventHandler & rhs) 
    29 : ClpEventHandler(rhs)
    30 { 
     28MyEventHandler::MyEventHandler (const MyEventHandler & rhs)
     29     : ClpEventHandler(rhs)
     30{
    3131}
    3232
    3333// Constructor with pointer to model
    3434MyEventHandler::MyEventHandler(ClpSimplex * model)
    35   : ClpEventHandler(model)
     35     : ClpEventHandler(model)
    3636{
    3737}
    3838
    3939//-------------------------------------------------------------------
    40 // Destructor 
     40// Destructor
    4141//-------------------------------------------------------------------
    4242MyEventHandler::~MyEventHandler ()
     
    4545
    4646//----------------------------------------------------------------
    47 // Assignment operator 
     47// Assignment operator
    4848//-------------------------------------------------------------------
    4949MyEventHandler &
    5050MyEventHandler::operator=(const MyEventHandler& rhs)
    5151{
    52   if (this != &rhs) {
    53     ClpEventHandler::operator=(rhs);
    54   }
    55   return *this;
     52     if (this != &rhs) {
     53          ClpEventHandler::operator=(rhs);
     54     }
     55     return *this;
    5656}
    5757//-------------------------------------------------------------------
     
    6060ClpEventHandler * MyEventHandler::clone() const
    6161{
    62   return new MyEventHandler(*this);
     62     return new MyEventHandler(*this);
    6363}
    6464
    65 int 
     65int
    6666MyEventHandler::event(Event whichEvent)
    6767{
    68   if (whichEvent==endOfValuesPass)
    69     return 0; // say optimal
    70   else
    71     return -1; // carry on
     68     if (whichEvent == endOfValuesPass)
     69          return 0; // say optimal
     70     else
     71          return -1; // carry on
    7272
    7373#if 0
    74   // This is how one can get some progress information at the end of each iteration.
    75   if (whichEvent==endOfIteration) {
    76     int numIter = model_->getIterationCount();
    77     double sumDualInfeas = model_->sumDualInfeasibilities();
    78     double sumPrimalInfeas = model_->sumPrimalInfeasibilities();
    79     double obj = model_->getObjValue();
    80   }
     74     // This is how one can get some progress information at the end of each iteration.
     75     if (whichEvent == endOfIteration) {
     76          int numIter = model_->getIterationCount();
     77          double sumDualInfeas = model_->sumDualInfeasibilities();
     78          double sumPrimalInfeas = model_->sumPrimalInfeasibilities();
     79          double obj = model_->getObjValue();
     80     }
    8181
    82   // This is how one can tell CLP to stop now.
    83   // The value of cancelAsap needs to come from the application using CLP.
    84   if ( cancelAsap ) return 5;
    85   else return -1;
     82     // This is how one can tell CLP to stop now.
     83     // The value of cancelAsap needs to come from the application using CLP.
     84     if ( cancelAsap ) return 5;
     85     else return -1;
    8686#endif
    8787
    88  
     88
    8989}
Note: See TracChangeset for help on using the changeset viewer.