Ignore:
Timestamp:
Dec 4, 2009 5:15:40 PM (10 years ago)
Author:
bjarni
Message:

Added Lou's annotations to Cbc_ampl.cpp, CbcSolver?.cpp, CbcSolver?.hpp, CbcStrategy?.cpp, CbcTreeLocal?.cpp, ClpAmplStuff?.cpp, CoinSolve?.cpp, and unitTestClp.cpp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/Cbc/src/CbcSolver.cpp

    r1336 r1361  
    22// Copyright (C) 2007, International Business Machines
    33// Corporation and others.  All Rights Reserved.
     4
     5/*! \file CbcSolver.cpp
     6    \brief Second level routines for the cbc stand-alone solver.
     7*/
    48
    59#include "CbcConfig.h"
     
    535539        delete clpSolver;
    536540}
     541
     542/*
     543  Initialise a subset of the parameters prior to processing any input from
     544  the user.
     545
     546  Why this choice of subset?
     547*/
     548/*!
     549  \todo Guard/replace clp-specific code
     550*/
    537551void CbcSolver::fillValuesInSolver()
    538552{
    539553    OsiSolverInterface * solver = model_.solver();
    540     OsiClpSolverInterface * clpSolver = dynamic_cast< OsiClpSolverInterface*> (solver);
     554    OsiClpSolverInterface * clpSolver =
     555                dynamic_cast< OsiClpSolverInterface*> (solver);
    541556    assert (clpSolver);
    542     noPrinting_ = (clpSolver->getModelPtr()->logLevel() == 0);
     557        ClpSimplex * lpSolver = clpSolver->getModelPtr();
     558
     559    /*
     560      Why are we reaching into the underlying solver(s) for these settings?
     561      Shouldn't CbcSolver have its own defaults, which are then imposed on the
     562      underlying solver?
     563
     564      Coming at if from the other side, if CbcSolver had the capability to use
     565      multiple solvers then it definitely makes sense to acquire the defaults from
     566      the solver (on the assumption that we haven't processed command line
     567      parameters yet, which can then override the defaults). But then it's more of
     568      a challenge to avoid solver-specific coding here.
     569    */
     570    noPrinting_ = (lpSolver->logLevel() == 0);
    543571    CoinMessageHandler * generalMessageHandler = clpSolver->messageHandler();
    544572    generalMessageHandler->setPrefix(true);
    545     ClpSimplex * lpSolver = clpSolver->getModelPtr();
    546     lpSolver->setPerturbation(50);
     573
     574        lpSolver->setPerturbation(50);
    547575    lpSolver->messageHandler()->setPrefix(false);
     576
    548577    parameters_[whichParam(DUALBOUND, numberParameters_, parameters_)].setDoubleValue(lpSolver->dualBound());
    549578    parameters_[whichParam(DUALTOLERANCE, numberParameters_, parameters_)].setDoubleValue(lpSolver->dualTolerance());
     579    /*
     580      Why are we doing this? We read the log level from parameters_, set it into
     581      the message handlers for cbc and the underlying solver. Then we read the
     582      log level back from the handlers and use it to set the values in
     583      parameters_!
     584    */
    550585    int iParam = whichParam(SOLVERLOGLEVEL, numberParameters_, parameters_);
    551586    int value = parameters_[iParam].intValue();
Note: See TracChangeset for help on using the changeset viewer.