Changeset 413


Ignore:
Timestamp:
Aug 26, 2004 6:04:01 AM (15 years ago)
Author:
forrest
Message:

afor jean sebastien
VS: ----------------------------------------------------------------------

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpSimplex.cpp

    r399 r413  
    43004300{
    43014301  // bad if empty
    4302   if (!numberRows_||!numberColumns_||!matrix_->getNumElements()) {
     4302  if (!numberColumns_||((!numberRows_||!matrix_->getNumElements())&&objective_->type()<2)) {
    43034303    int infeasNumber[2];
    43044304    double infeasSum[2];
     
    52555255  // sanity check
    52565256  // bad if empty (trap here to avoid using bad matrix_)
    5257   if (!matrix_||!matrix_->getNumElements()) {
     5257  if (!matrix_||(!matrix_->getNumElements()&&objective_->type()<2)) {
    52585258    int infeasNumber[2];
    52595259    double infeasSum[2];
     
    54065406/* Factorizes and returns true if optimal.  Used by user */
    54075407bool
    5408 ClpSimplex::statusOfProblem()
     5408ClpSimplex::statusOfProblem(bool initial)
    54095409{
    54105410  // is factorization okay?
    5411   assert (internalFactorize(1)==0);
     5411  if (initial) {
     5412    // First time - allow singularities
     5413    int numberThrownOut = -1;
     5414    int totalNumberThrownOut=0;
     5415    while(numberThrownOut) {
     5416      int status = internalFactorize(0);
     5417      if (status<0)
     5418        return false; // some error
     5419      else
     5420        numberThrownOut = status;
     5421     
     5422      // for this we need clean basis so it is after factorize
     5423      //if (!numberThrownOut)
     5424      //numberThrownOut = gutsOfSolution(  NULL,NULL,
     5425      //                                   false);
     5426      //else
     5427      //matrix_->rhsOffset(this,true); // redo rhs offset
     5428      totalNumberThrownOut+= numberThrownOut;
     5429     
     5430    }
     5431   
     5432    if (totalNumberThrownOut)
     5433      handler_->message(CLP_SINGULARITIES,messages_)
     5434        <<totalNumberThrownOut
     5435        <<CoinMessageEol;
     5436  } else {
     5437    int returnCode=internalFactorize(1);
     5438    assert (!returnCode);
     5439  }
    54125440  // put back original costs and then check
    54135441  // also move to work arrays
  • trunk/include/ClpSimplex.hpp

    r393 r413  
    293293 
    294294  /** Factorizes and returns true if optimal.  Used by user */
    295   bool statusOfProblem();
     295  bool statusOfProblem(bool initial=false);
    296296  //@}
    297297
Note: See TracChangeset for help on using the changeset viewer.