Changeset 2339


Ignore:
Timestamp:
Oct 12, 2018 1:22:52 PM (14 months ago)
Author:
lou
Message:

Merge trunk r2312 -- r2338.

Location:
branches/autotools-update/Clp
Files:
17 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/autotools-update/Clp

  • branches/autotools-update/Clp/MSVisualStudio/v10/libClp/libClp.vcxproj

    r1934 r2339  
    1 <?xml version="1.0" encoding="utf-8"?>
     1<?xml version="1.0" encoding="utf-8"?>
    22<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    33  <ItemGroup Label="ProjectConfigurations">
     
    849849      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
    850850    </ClCompile>
     851    <ClCompile Include="..\..\..\src\ClpPESimplex.cpp">
     852      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
     853      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     854      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     855      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
     856      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
     857      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     858      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     859      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
     860      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
     861      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     862      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     863      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
     864      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     865      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     866    </ClCompile>
     867    <ClCompile Include="..\..\..\src\ClpPEPrimalColumnDantzig.cpp">
     868      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
     869      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     870      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     871      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
     872      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
     873      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     874      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     875      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
     876      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
     877      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     878      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     879      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
     880      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     881      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     882    </ClCompile>
     883    <ClCompile Include="..\..\..\src\ClpPEPrimalColumnSteepest.cpp">
     884      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
     885      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     886      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     887      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
     888      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
     889      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     890      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     891      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
     892      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
     893      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     894      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     895      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
     896      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     897      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     898    </ClCompile>
     899    <ClCompile Include="..\..\..\src\ClpPEDualRowDantzig.cpp">
     900      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
     901      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     902      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     903      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
     904      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
     905      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     906      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     907      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
     908      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
     909      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     910      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     911      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
     912      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     913      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     914    </ClCompile>
     915    <ClCompile Include="..\..\..\src\ClpPEDualRowSteepest.cpp">
     916      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
     917      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     918      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     919      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
     920      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
     921      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     922      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     923      <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
     924      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
     925      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     926      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     927      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
     928      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     929      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
     930    </ClCompile>
    851931  </ItemGroup>
    852932  <ItemGroup>
     
    901981    <ClInclude Include="..\..\..\src\ClpSolve.hpp" />
    902982    <ClInclude Include="..\..\..\src\Idiot.hpp" />
     983    <ClInclude Include="..\..\..\src\ClpPESimplex.hpp" />
     984    <ClInclude Include="..\..\..\src\ClpPEPrimalColumnDantzig.hpp" />
     985    <ClInclude Include="..\..\..\src\ClpPEPrimalColumnSteepest.hpp" />
     986    <ClInclude Include="..\..\..\src\ClpPEDualRowDantzig.hpp" />
     987    <ClInclude Include="..\..\..\src\ClpPEDualRowSteepest.hpp" />
    903988  </ItemGroup>
    904989  <ItemGroup>
  • branches/autotools-update/Clp/configure.ac

    r2337 r2339  
    2121
    2222# List one file in the package so that the configure script can test
    23 # whether the package is actually there
     23# whether the package is actually there.
    2424
    2525AC_CONFIG_SRCDIR(src/ClpSimplex.cpp)
  • branches/autotools-update/Clp/src

  • branches/autotools-update/Clp/src/ClpModel.hpp

    r2312 r2339  
    10391039         524288 - Clp fast dual
    10401040         1048576 - don't need to finish dual (can return 3)
    1041          2097152 - zero costs!
     1041         2097152 - ray even if >2 pivots AND if problem is "crunched"
    10421042         4194304 - don't scale integer variables
    10431043         8388608 - Idiot when not really sure about it
     1044         16777216 - zero costs!
    10441045         NOTE - many applications can call Clp but there may be some short cuts
    10451046                which are taken which are not guaranteed safe from all applications.
  • branches/autotools-update/Clp/src/ClpPackedMatrix.cpp

    r2312 r2339  
    42294229#ifndef LEAVE_FIXED
    42304230          if (columnUpper[iColumn] >
    4231                     columnLower[iColumn] + 1.0e-12) {
     4231              columnLower[iColumn] + 1.0e-12||
     4232              (simplex &&simplex->getColumnStatus(iColumn)==ClpSimplex::basic)) {
    42324233#endif
    42334234               for (j = start; j < end; j++) {
     
    46064607                         //overallSmallest = CoinMin(overallSmallest,smallest*columnScale[iColumn]);
    46074608                    } else {
    4608                       assert(columnScale[iColumn] == 1.0);
    4609                          //columnScale[iColumn]=1.0;
     4609                      //assert(columnScale[iColumn] == 1.0);
     4610                      columnScale[iColumn]=1.0;
    46104611                    }
    46114612               }
     
    75477548      int iSequence=column[i];
    75487549      assert (model->getColumnStatus(iSequence) == ClpSimplex::isFree ||
    7549               model->getColumnStatus(iSequence) != ClpSimplex::superBasic);
     7550              model->getColumnStatus(iSequence) == ClpSimplex::superBasic);
    75507551    }
    75517552    for (int i=block->firstAtLower_;i<block->firstAtUpper_;i++) {
  • branches/autotools-update/Clp/src/ClpSimplex.cpp

    r2312 r2339  
    718718     }
    719719#if CAN_HAVE_ZERO_OBJ>1
    720      if ((specialOptions_&2097152)==0) {
     720     if ((specialOptions_&16777216)==0) {
    721721#endif
    722722     computeDuals(givenDuals);
     
    31133113#endif
    31143114     for (iSequence = 0; iSequence < numberTotal; iSequence++) {
     3115       //#define LIKELY_SUPERBASIC
     3116#ifdef LIKELY_SUPERBASIC
     3117       if (getStatus(iSequence) == isFree || getStatus(iSequence) == superBasic)
     3118         moreSpecialOptions_ &= ~8;  // Say superbasic variables exist
     3119#endif
    31153120          double value = solution_[iSequence];
    31163121#ifdef COIN_DEBUG
     
    31243129          if (distanceUp < -primalTolerance) {
    31253130               double infeasibility = -distanceUp;
     3131#ifndef LIKELY_SUPERBASIC
     3132               if (getStatus(iSequence) != basic)
     3133                 moreSpecialOptions_ &= ~8;  // Say superbasic variables exist
     3134#endif
    31263135               sumPrimalInfeasibilities_ += infeasibility - primalTolerance_;
    31273136               if (infeasibility > relaxedToleranceP)
     
    31353144          } else if (distanceDown < -primalTolerance) {
    31363145               double infeasibility = -distanceDown;
     3146#ifndef LIKELY_SUPERBASIC
     3147               if (getStatus(iSequence) != basic)
     3148                 moreSpecialOptions_ &= ~8;  // Say superbasic variables exist
     3149#endif
    31373150               sumPrimalInfeasibilities_ += infeasibility - primalTolerance_;
    31383151               if (infeasibility > relaxedToleranceP)
     
    41754188
    41764189     if (what == 63) {
    4177           if (newArrays) {
    4178                // get some arrays
    4179                int iRow, iColumn;
    4180                // these are "indexed" arrays so we always know where nonzeros are
    4181                /**********************************************************
     4190          // Safer to get new arrays anyway so test on newArrays removed
     4191          // get some arrays
     4192          int iRow, iColumn;
     4193          // these are "indexed" arrays so we always know where nonzeros are
     4194          /**********************************************************
    41824195               rowArray_[3] is long enough for rows+columns (2 also maybe)
    41834196               rowArray_[1] is long enough for max(rows,columns)
    4184                *********************************************************/
    4185                for (iRow = 0; iRow < 4; iRow++) {
    4186                     int length = numberRows2 + factorization_->maximumPivots();
    4187                     if (iRow > SHORT_REGION || objective_->type() > 1)
    4188                          length += numberColumns_;
    4189                     else if (iRow == 1)
    4190                          length = CoinMax(length, numberColumns_);
    4191                     if ((specialOptions_ & 65536) == 0 || !rowArray_[iRow]) {
    4192                          delete rowArray_[iRow];
    4193                          rowArray_[iRow] = new CoinIndexedVector();
    4194                     }
    4195                     rowArray_[iRow]->reserve(length);
    4196                }
    4197 
    4198                for (iColumn = 0; iColumn < SHORT_REGION; iColumn++) {
    4199                     if ((specialOptions_ & 65536) == 0 || !columnArray_[iColumn]) {
    4200                          delete columnArray_[iColumn];
    4201                          columnArray_[iColumn] = new CoinIndexedVector();
    4202                     }
    4203                     columnArray_[iColumn]->reserve(numberColumns_+numberRows2);
    4204                }
    4205           } else {
    4206                int iRow, iColumn;
    4207                for (iRow = 0; iRow < 4; iRow++) {
    4208                     int length = numberRows2 + factorization_->maximumPivots();
    4209                     if (iRow > SHORT_REGION || objective_->type() > 1)
    4210                          length += numberColumns_;
    4211                     if(rowArray_[iRow]->capacity() >= length) {
    4212                          rowArray_[iRow]->clear();
    4213                     } else {
    4214                          // model size or maxinv changed
    4215                          rowArray_[iRow]->reserve(length);
    4216                     }
    4217 #ifndef NDEBUG
    4218                     rowArray_[iRow]->checkClear();
    4219 #endif
    4220                }
    4221 
    4222                for (iColumn = 0; iColumn < SHORT_REGION; iColumn++) {
    4223                     int length = numberColumns_;
    4224                     if (iColumn)
    4225                          length = CoinMax(numberRows2, numberColumns_);
    4226                     if(columnArray_[iColumn]->capacity() >= length) {
    4227                          columnArray_[iColumn]->clear();
    4228                     } else {
    4229                          // model size or maxinv changed
    4230                          columnArray_[iColumn]->reserve(length);
    4231                     }
    4232 #ifndef NDEBUG
    4233                     columnArray_[iColumn]->checkClear();
    4234 #endif
    4235                }
    4236           }
     4197          *********************************************************/
     4198          for (iRow = 0; iRow < 4; iRow++) {
     4199            int length = numberRows2 + factorization_->maximumPivots();
     4200            if (iRow > SHORT_REGION || objective_->type() > 1)
     4201              length += numberColumns_;
     4202            else if (iRow == 1)
     4203              length = CoinMax(length, numberColumns_);
     4204            if ((specialOptions_ & 65536) == 0 || !rowArray_[iRow]) {
     4205              delete rowArray_[iRow];
     4206              rowArray_[iRow] = new CoinIndexedVector();
     4207            }
     4208            rowArray_[iRow]->reserve(length);
     4209          }
     4210         
     4211          for (iColumn = 0; iColumn < SHORT_REGION; iColumn++) {
     4212            if ((specialOptions_ & 65536) == 0 || !columnArray_[iColumn]) {
     4213              delete columnArray_[iColumn];
     4214              columnArray_[iColumn] = new CoinIndexedVector();
     4215            }
     4216            columnArray_[iColumn]->reserve(numberColumns_+numberRows2);
     4217          }
    42374218     }
    42384219     if (problemStatus_ == 10) {
     
    54045385          }
    54055386          for (iColumn = 0; iColumn < numberColumns_; iColumn++) {
    5406                if (saveUpper[iColumn] > saveLower[iColumn] + useTolerance) {
     5387               if (saveUpper[iColumn] > saveLower[iColumn] + tolerance) {
    54075388                    // Make large bounds stay infinite
    54085389                    if (saveUpper[iColumn] > 1.0e30 && columnUpper_[iColumn] > 1.0e10) {
     
    55855566#endif
    55865567     int returnCode = static_cast<ClpSimplexDual *> (this)->dual(ifValuesPass, startFinishOptions);
     5568#ifdef DUAL_STATS
     5569     static int nDuals=0;
     5570     static int nFeasDuals=0;
     5571     static int nTens=0;
     5572     static int nOdd=0;
     5573     bool needClean=false;
     5574     nDuals++;
     5575     if (problemStatus_==0) {
     5576       nFeasDuals++;
     5577     } else if (problemStatus_==1) {
     5578     } else if (problemStatus_==10) {
     5579       nTens++;
     5580       needClean=true;
     5581     } else {
     5582       printf("dual odd status %d\n",problemStatus_);
     5583       nOdd++;
     5584     }
     5585#endif
    55875586     eventHandler_->event(ClpEventHandler::looksEndInDual);
    55885587#ifdef EXPENSIVE
     
    56475646          problemStatus_ = 0; // ignore
    56485647     if (problemStatus_==1&&((specialOptions_&(1024 | 4096)) == 0 || (specialOptions_ & 32) != 0)
    5649          &&numberFake_) {
     5648         &&(static_cast<ClpSimplexDual *>(this))->checkFakeBounds()) {
    56505649       problemStatus_ = 10; // clean up in primal as fake bounds
    56515650     }
     
    56975696          baseIteration_ = 0;
    56985697          bool inCbcOrOther = (specialOptions_ & 0x03000000) != 0;
    5699           if (inCbcOrOther) {
     5698          if (inCbcOrOther && (specialOptions_&32)==0) {
    57005699            delete [] ray_;
    57015700            ray_ = NULL;
     
    57905789     //if (problemStatus_==1&&lastAlgorithm==1)
    57915790     //returnCode=10; // so will do primal after postsolve
     5791#ifdef DUAL_STATS
     5792     static int nFeasClean=0;
     5793     if (needClean) {
     5794       if (problemStatus_==0) {
     5795         nFeasClean++;
     5796       } else if (problemStatus_==1) {
     5797       } else if (problemStatus_==10) {
     5798         abort();
     5799       } else {
     5800         printf("dual odd status %d on cleanup\n",problemStatus_);
     5801         abort();
     5802       }
     5803     }
     5804     if ((nDuals%1000)==0)
     5805       printf("%d duals - %d feasible, %d infeasible and %d need cleaning (%d were feasible, %d infeasible) ( %d odd)\n",
     5806              nDuals,nFeasDuals,nDuals-nFeasDuals-nTens-nOdd,nTens,
     5807              nFeasClean,nTens-nFeasClean,nOdd);
     5808#endif
     5809#ifdef CHECK_RAY
     5810     if (problemStatus_==1&&ray_) {
     5811       double * lower = rowLower_;
     5812       double * upper = rowUpper_;
     5813       double * solution = rowActivity_;
     5814       double * dj = dual_;
     5815       assert(ray_);
     5816       double largestBad=0.0;
     5817       double largestBadDj=0.0;
     5818       for (int iRow = 0; iRow < numberRows_; iRow++) {
     5819         if (upper[iRow]==lower[iRow])
     5820           continue;
     5821         if (solution[iRow]<lower[iRow]+primalTolerance_) {
     5822           largestBadDj=CoinMax(largestBadDj,-dj[iRow]);
     5823           largestBad=CoinMax(largestBad,ray_[iRow]);
     5824         } else if (solution[iRow]>upper[iRow]-primalTolerance_) {
     5825           largestBadDj=CoinMax(largestBadDj,dj[iRow]);
     5826           largestBad=CoinMax(largestBad,-ray_[iRow]);
     5827         }
     5828       }
     5829       double * result = new double[numberColumns_];
     5830       CoinFillN ( result, numberColumns_, 0.0);
     5831       this->matrix()->transposeTimes(ray_, result);
     5832       lower = columnLower_;
     5833       upper = columnUpper_;
     5834       solution = columnActivity_;
     5835       dj = reducedCost_;
     5836       for (int iColumn = 0; iColumn < numberColumns_; iColumn++) {
     5837         // should have been ..Times -1.0
     5838         result[iColumn]=-result[iColumn];
     5839         if (upper[iColumn]==lower[iColumn])
     5840           continue;
     5841         if (solution[iColumn]<lower[iColumn]+primalTolerance_) {
     5842           largestBadDj=CoinMax(largestBadDj,-dj[iColumn]);
     5843           largestBad=CoinMax(largestBad,result[iColumn]);
     5844         } else if (solution[iColumn]>upper[iColumn]-primalTolerance_) {
     5845           largestBadDj=CoinMax(largestBadDj,dj[iColumn]);
     5846           largestBad=CoinMax(largestBad,-result[iColumn]);
     5847         }
     5848       }
     5849       if (largestBad>1.0e-5||largestBadDj>1.0e-5) {
     5850         if (numberPrimalInfeasibilities_==1)
     5851           printf("BAD ");
     5852         printf("bad ray %g bad dj %g\n",largestBad,largestBadDj);
     5853       }
     5854       delete [] result;
     5855     }
     5856#endif
     5857     // massage infeasibilities
     5858     if (!problemStatus_) {
     5859       if (handler_->logLevel()==63) {
     5860         if (numberPrimalInfeasibilities_||numberDualInfeasibilities_)
     5861           printf("minor inaccuracy primal sum %g (%d) error %g, dual %g (%d) %g\n",
     5862                  sumPrimalInfeasibilities_,numberPrimalInfeasibilities_,
     5863                  largestPrimalError_,
     5864                  sumDualInfeasibilities_,numberDualInfeasibilities_,
     5865                  largestDualError_);
     5866       }
     5867       if (numberPrimalInfeasibilities_) {
     5868         numberPrimalInfeasibilities_=0;
     5869         sumPrimalInfeasibilities_=0.0;
     5870         if (secondaryStatus_==0)
     5871           secondaryStatus_=2;
     5872         else if (secondaryStatus_==3)
     5873           secondaryStatus_=4;
     5874       }
     5875       if (numberDualInfeasibilities_) {
     5876         numberDualInfeasibilities_=0;
     5877         sumDualInfeasibilities_=0.0;
     5878         if (secondaryStatus_==0)
     5879           secondaryStatus_=3;
     5880         else if (secondaryStatus_==2)
     5881           secondaryStatus_=4;
     5882       }
     5883     }
    57925884     return returnCode;
    57935885}
     
    60466138     //factorization_->pivotTolerance(savedPivotTolerance);
    60476139     onStopped(); // set secondary status if stopped
     6140     // massage infeasibilities
     6141     if (!problemStatus_) {
     6142       if (handler_->logLevel()==63) {
     6143         if (numberPrimalInfeasibilities_||numberDualInfeasibilities_)
     6144           printf("minor inaccuracy primal sum %g (%d) error %g, dual %g (%d) %g\n",
     6145                  sumPrimalInfeasibilities_,numberPrimalInfeasibilities_,
     6146                  largestPrimalError_,
     6147                  sumDualInfeasibilities_,numberDualInfeasibilities_,
     6148                  largestDualError_);
     6149       }
     6150       if (numberPrimalInfeasibilities_) {
     6151         numberPrimalInfeasibilities_=0;
     6152         sumPrimalInfeasibilities_=0.0;
     6153         if (secondaryStatus_==0)
     6154           secondaryStatus_=2;
     6155         else if (secondaryStatus_==3)
     6156           secondaryStatus_=4;
     6157       }
     6158       if (numberDualInfeasibilities_) {
     6159         numberDualInfeasibilities_=0;
     6160         sumDualInfeasibilities_=0.0;
     6161         if (secondaryStatus_==0)
     6162           secondaryStatus_=3;
     6163         else if (secondaryStatus_==2)
     6164           secondaryStatus_=4;
     6165       }
     6166     }
    60486167     //if (problemStatus_==1&&lastAlgorithm==1)
    60496168     //returnCode=10; // so will do primal after postsolve
     
    90489167          } else {
    90499168               // using previous factorization - we assume fine
    9050                if ((moreSpecialOptions_ & 8) == 0) {
     9169               if ((moreSpecialOptions_ & 16777216) == 0) {
    90519170                    // but we need to say not optimal
    90529171                    numberPrimalInfeasibilities_ = 1;
     
    1089611015     info->nNodes_ = 0;
    1089711016     // say can declare optimal
    10898      moreSpecialOptions_ |= 8;
     11017     moreSpecialOptions_ |= 16777216;
    1089911018     int saveMaxIterations = maximumIterations();
    1090011019     setMaximumIterations((((moreSpecialOptions_&2048)==0) ? 200 : 2000)
     
    1160611725     assert (nodeInfo);
    1160711726     // say can declare optimal
    11608      moreSpecialOptions_ |= 8;
     11727     moreSpecialOptions_ |= 16777216;
    1160911728     double limit = 0.0;
    1161011729     getDblParam(ClpDualObjectiveLimit, limit);
  • branches/autotools-update/Clp/src/ClpSimplex.hpp

    r2312 r2339  
    12731273         2 bit - if presolved problem infeasible return
    12741274         4 bit - keep arrays like upper_ around
    1275          8 bit - if factorization kept can still declare optimal at once
     1275         8 bit - no free or superBasic variables
    12761276         16 bit - if checking replaceColumn accuracy before updating
    12771277         32 bit - say optimal if primal feasible!
     
    12901290         524288 bit - stop when primal feasible
    12911291         1048576 bit - stop when primal feasible after n-1000000 iterations
     1292         2097152 bit - no primal in fastDual2 if feasible
     1293         4194304 bit - tolerances have been changed by code
     1294         8388608 bit - tolerances are dynamic (at first)
     1295         16777216 bit - if factorization kept can still declare optimal at once
    12921296     */
    12931297     inline int moreSpecialOptions() const {
     
    13221326         4194304 bit - tolerances have been changed by code
    13231327         8388608 bit - tolerances are dynamic (at first)
     1328         16777216 bit - if factorization kept can still declare optimal at once
    13241329     */
    13251330     inline void setMoreSpecialOptions(int value) {
  • branches/autotools-update/Clp/src/ClpSimplexDual.cpp

    r2312 r2339  
    500500              (moreSpecialOptions_&256)==0 &&
    501501              ((progress_.lastObjective(0)<-1.0e10 &&
    502 -               progress_.lastObjective(1)>-1.0e5)||sumPrimalInfeasibilities_>1.0e10*smallestPrimalInfeasibility)) {
     502-               progress_.lastObjective(1)>-1.0e5)||sumPrimalInfeasibilities_>1.0e10*smallestPrimalInfeasibility)&&problemStatus_<0) {
    503503            // problems - try primal
    504504            problemStatus_=10;
     
    510510            //         i,cost_[i],solution_[i],lower_[i],upper_[i]);
    511511            //}
    512           }
    513           if ((specialOptions_&2097152)!=0&&problemStatus_==1&&!ray_&&
    514               !numberRayTries && numberIterations_) {
     512          } else if ((specialOptions_&(32|2097152))!=0&&
     513                     problemStatus_==1&&!ray_&&
     514                     !numberRayTries && numberIterations_) {
    515515            numberRayTries=1;
    516516            problemStatus_=-1;
     
    526526          }
    527527
    528           // Say good factorization
     528          // Say good factorization 
    529529          factorType = 1;
    530530          if (data.sparseThreshold_) {
     
    610610     algorithm_ = -1;
    611611     moreSpecialOptions_ &= ~16; // clear check replaceColumn accuracy
     612     delete [] ray_;
     613     ray_ = NULL;
    612614     // save data
    613615     ClpDataSave data = saveData();
     
    12811283                      acceptablePivot_ = - fabs(acceptablePivot_); // stop early exit
    12821284#if CAN_HAVE_ZERO_OBJ>1
    1283                     if ((specialOptions_&2097152)!=0)
     1285                    if ((specialOptions_&16777216)!=0)
    12841286                      theta_=0.0;
    12851287#endif
     
    14611463                    if (candidate == -1) {
    14621464#if CLP_CAN_HAVE_ZERO_OBJ>1
    1463                     if ((specialOptions_&2097152)==0) {
     1465                    if ((specialOptions_&16777216)==0) {
    14641466#endif
    14651467                         // make sure incoming doesn't count
     
    18321834                         printf("** no column pivot\n");
    18331835#endif
     1836                    delete [] ray_;
     1837                    ray_ = NULL;
    18341838                    if ((factorization_->pivots() < 2
    18351839                         ||((specialOptions_&2097152)!=0&&factorization_->pivots()<50))
     
    18371841                         //&&goodAccuracy()) {
    18381842                         // If not in branch and bound etc save ray
    1839                          delete [] ray_;
    18401843                         if ((specialOptions_&(1024 | 4096)) == 0 || (specialOptions_ & (32|2097152)) != 0) {
    18411844                              // create ray anyway
     
    24202423               if (iStatus) {
    24212424                    double value = reducedCost[iSequence] - theta * alphaI;
    2422                     assert (iStatus>0);
     2425                    // NO - can have free assert (iStatus>0);
    24232426                    reducedCost[iSequence] = value;
    24242427                    double mult = multiplier[iStatus-1];
     
    31193122                    break;
    31203123               case atUpperBound:
    3121                     if (fabs(value - upperValue) > primalTolerance_)
    3122                          numberInfeasibilities++;
     3124                    if (fabs(value - upperValue) > primalTolerance_) {
     3125                      if(fabs(dj_[iSequence])>1.0e-9) {
     3126                         numberInfeasibilities++;
     3127                      } else {
     3128                        setStatus(iSequence,superBasic);
     3129                        moreSpecialOptions_ &= ~8;
     3130                      }
     3131                    }
    31233132                    break;
    31243133               case atLowerBound:
    3125                     if (fabs(value - lowerValue) > primalTolerance_)
    3126                          numberInfeasibilities++;
     3134                    if (fabs(value - lowerValue) > primalTolerance_) {
     3135                      if(fabs(dj_[iSequence])>1.0e-9) {
     3136                         numberInfeasibilities++;
     3137                      } else {
     3138                        setStatus(iSequence,superBasic);
     3139                        moreSpecialOptions_ &= ~8;
     3140                      }
     3141                    }
    31273142                    break;
    31283143               }
     
    31503165                              newLowerValue = CoinMax(lowerValue, newUpperValue - newBound);
    31513166                         }
    3152                          lower_[iSequence] = newLowerValue;
    3153                          upper_[iSequence] = newUpperValue;
    31543167                         if (newLowerValue > lowerValue) {
    31553168                              if (newUpperValue < upperValue) {
    31563169                                   setFakeBound(iSequence, ClpSimplexDual::bothFake);
    3157 #ifdef CLP_INVESTIGATE
    3158                                    abort(); // No idea what should happen here - I have never got here
    3159 #endif
     3170                                   // redo
     3171                                   if (status == atLowerBound) {
     3172                                     newLowerValue = value;
     3173                                     newUpperValue = CoinMin(upperValue, newLowerValue + newBound);
     3174                                   } else {
     3175                                     newUpperValue = value;
     3176                                     newLowerValue = CoinMax(lowerValue, newUpperValue - newBound);
     3177                                   }
    31603178                                   numberFake_++;
    31613179                              } else {
     
    31693187                              }
    31703188                         }
     3189                         lower_[iSequence] = newLowerValue;
     3190                         upper_[iSequence] = newUpperValue;
    31713191                         if (status == atUpperBound)
    31723192                              solution_[iSequence] = newUpperValue;
     
    31933213          int iSequence;
    31943214          if (initialize == 3) {
    3195                for (iSequence = 0; iSequence < numberRows_ + numberColumns_; iSequence++) {
    3196                     setFakeBound(iSequence, ClpSimplexDual::noFake);
    3197                }
     3215            if (columnScale_) {
     3216              for (iSequence = 0; iSequence < numberColumns_; iSequence++) {
     3217                if (getFakeBound(iSequence) != ClpSimplexDual::noFake) {
     3218                  double multiplier = rhsScale_ * inverseColumnScale_[iSequence];
     3219                  // lower
     3220                  double value = columnLower_[iSequence];
     3221                  if (value > -1.0e30) {
     3222                    value *= multiplier;
     3223                  }
     3224                  lower_[iSequence] = value;
     3225                  // upper
     3226                  value = columnUpper_[iSequence];
     3227                  if (value < 1.0e30) {
     3228                    value *= multiplier;
     3229                  }
     3230                  upper_[iSequence] = value;
     3231                  setFakeBound(iSequence, ClpSimplexDual::noFake);
     3232                }
     3233              }
     3234              for (iSequence = 0; iSequence < numberRows_; iSequence++) {
     3235                // lower
     3236                double multiplier = rhsScale_ * rowScale_[iSequence];
     3237                double value = rowLower_[iSequence];
     3238                if (value > -1.0e30) {
     3239                  value *= multiplier;
     3240                }
     3241                lower_[iSequence+numberColumns_] = value;
     3242                // upper
     3243                value = rowUpper_[iSequence];
     3244                if (value < 1.0e30) {
     3245                  value *= multiplier;
     3246                }
     3247                upper_[iSequence+numberColumns_] = value;
     3248                setFakeBound(iSequence+numberColumns_, ClpSimplexDual::noFake);
     3249              }
     3250            } else {
     3251              for (iSequence = 0; iSequence < numberColumns_; iSequence++) {
     3252                if (getFakeBound(iSequence) != ClpSimplexDual::noFake) {
     3253                  lower_[iSequence] = columnLower_[iSequence];
     3254                  upper_[iSequence] = columnUpper_[iSequence];
     3255                  setFakeBound(iSequence, ClpSimplexDual::noFake);
     3256                }
     3257              }
     3258              for (iSequence = 0; iSequence < numberRows_; iSequence++) {
     3259                if (getFakeBound(iSequence+numberColumns_) != ClpSimplexDual::noFake) {
     3260                  lower_[iSequence+numberColumns_] = rowLower_[iSequence];
     3261                  upper_[iSequence+numberColumns_] = rowUpper_[iSequence];
     3262                  setFakeBound(iSequence+numberColumns_, ClpSimplexDual::noFake);
     3263                }
     3264              }
     3265            }
    31983266          }
    31993267          double testBound = 0.999999 * dualBound_;
     
    53925460     if (!numberPrimalInfeasibilities_ && ((!numberDualInfeasibilitiesWithoutFree_ &&
    53935461                                            numberDualInfeasibilities_)||
    5394                                            (moreSpecialOptions_&2097152)!=0))
     5462                                           (moreSpecialOptions_&16777216)!=0))
    53955463          problemStatus_ = 10;
    53965464     // dual bound coming in
     
    55115579                                   (numberChanged_ || (specialOptions_ & 4096) == 0)) {
    55125580#if CLP_CAN_HAVE_ZERO_OBJ
    5513                            if ((specialOptions_&2097152)==0) {
     5581                           if ((specialOptions_&16777216)==0) {
    55145582#endif
    55155583                              doOriginalTolerance = 2;
     
    57935861                         dualTolerance_ = 1.0e50;
    57945862#if CLP_CAN_HAVE_ZERO_OBJ>1
    5795                     if ((specialOptions_&2097152)==0) {
     5863                    if ((specialOptions_&16777216)==0) {
    57965864#endif
    57975865                    updateDualsInDual(rowArray_[0], columnArray_[0], rowArray_[1],
     
    58355903                         dualTolerance_ = 1.0e50;
    58365904#if CLP_CAN_HAVE_ZERO_OBJ>1
    5837                     if ((specialOptions_&2097152)==0) {
     5905                    if ((specialOptions_&16777216)==0) {
    58385906#endif
    58395907                    updateDualsInDual(rowArray_[0], columnArray_[0], rowArray_[1],
  • branches/autotools-update/Clp/src/ClpSimplexOther.cpp

    r2312 r2339  
    5959#endif
    6060     // long enough for rows+columns
    61      assert(rowArray_[3]->capacity() >= numberRows_ + numberColumns_);
    62      rowArray_[3]->clear();
    63      int * backPivot = rowArray_[3]->getIndices();
     61     int * backPivot = new int [numberRows_+numberColumns_];
    6462     int i;
    6563     for ( i = 0; i < numberRows_ + numberColumns_; i++) {
     
    257255     //columnArray_[1]->clear();
    258256     columnArray_[0]->clear();
    259      //rowArray_[3]->clear();
     257     delete [] backPivot;
    260258     if (!optimizationDirection_)
    261259          printf("*** ????? Ranging with zero optimization costs\n");
     
    666664     // NAME card
    667665
     666     // Set locale so won't get , instead of .
     667     char * saveLocale = strdup(setlocale(LC_ALL,NULL));
     668     setlocale(LC_ALL,"C");
    668669     if (strcmp(strParam_[ClpProbName].c_str(), "") == 0) {
    669670          fprintf(fp, "NAME          BLANK      ");
     
    750751     fprintf(fp, "ENDATA\n");
    751752     fclose(fp);
     753     setlocale(LC_ALL,saveLocale);
     754     free(saveLocale);
    752755     return 0;
    753756}
     
    26412644            CoinStrdup(columnName(iColumn).c_str());
    26422645        }
    2643         lowerColumnMove = reinterpret_cast<double *> (malloc(numberColumns_ * sizeof(double)));
     2646        lowerColumnMove = new double [numberColumns_];
    26442647        memset(lowerColumnMove,0,numberColumns_*sizeof(double));
    2645         upperColumnMove = reinterpret_cast<double *> (malloc(numberColumns_ * sizeof(double)));
     2648        upperColumnMove = new double [numberColumns_];
    26462649        memset(upperColumnMove,0,numberColumns_*sizeof(double));
    2647         objectiveMove = reinterpret_cast<double *> (malloc(numberColumns_ * sizeof(double)));
     2650        objectiveMove = new double [numberColumns_];
    26482651        memset(objectiveMove,0,numberColumns_*sizeof(double));
    26492652        int nLine = 0;
     
    39123915                    //columnArray_[0]->cleanAndPackSafe(1.0e-60);
    39133916#if CLP_CAN_HAVE_ZERO_OBJ
    3914                     if ((specialOptions_&2097152)==0) {
     3917                    if ((specialOptions_&16777216)==0) {
    39153918#endif
    39163919                      nswapped = reinterpret_cast<ClpSimplexDual *> ( this)->updateDualsInDual(rowArray_[0], columnArray_[0],
     
    40954098                    // update primal solution
    40964099#if CLP_CAN_HAVE_ZERO_OBJ
    4097                     if ((specialOptions_&2097152)!=0)
     4100                    if ((specialOptions_&16777216)!=0)
    40984101                      theta_=0.0;
    40994102#endif
     
    41644167                    objectiveChange = 0.0;
    41654168#if CLP_CAN_HAVE_ZERO_OBJ
    4166                     if ((specialOptions_&2097152)==0) {
     4169                    if ((specialOptions_&16777216)==0) {
    41674170#endif
    41684171                      for (int i=0;i<numberTotal;i++)
     
    41824185#if CLP_CAN_HAVE_ZERO_OBJ>1
    41834186#ifdef COIN_REUSE_RANDOM
    4184                          if ((specialOptions_&2097152)!=0) {
     4187                         if ((specialOptions_&16777216)!=0) {
    41854188                           dj_[sequenceOut_] = 1.0e-9*(1.0+CoinDrand48());;
    41864189                         }
     
    41924195#if CLP_CAN_HAVE_ZERO_OBJ>1
    41934196#ifdef COIN_REUSE_RANDOM
    4194                          if ((specialOptions_&2097152)!=0) {
     4197                         if ((specialOptions_&16777216)!=0) {
    41954198                           dj_[sequenceOut_] = -1.0e-9*(1.0+CoinDrand48());;
    41964199                         }
  • branches/autotools-update/Clp/src/ClpSimplexPrimal.cpp

    r2312 r2339  
    571571     progress_.initialWeight_ = 0.0;
    572572     if (problemStatus_ == 1 && secondaryStatus_ != 6) {
     573          double saveWeight = infeasibilityCost_;
     574#ifndef WANT_INFEASIBLE_DUALS
    573575          infeasibilityCost_ = 0.0;
    574576          createRim(1 + 4);
     577#else
     578          infeasibilityCost_ = 1.0;
     579          createRim(1);
     580          memset(cost_,0,(numberRows_+numberColumns_)*sizeof(double));
     581#endif
    575582          delete nonLinearCost_;
    576583          nonLinearCost_ = new ClpNonLinearCost(this);
     
    580587          // and get good feasible duals
    581588          computeDuals(NULL);
     589          infeasibilityCost_=saveWeight;
    582590     }
    583591     // Stop can skip some things in transposeTimes
     
    14051413                         if (infeasibilityCost_ >= MAX_INFEASIBILITY_COST ||
    14061414                                   numberDualInfeasibilities_ == 0) {
    1407                               // we are infeasible - use as ray
    1408                               delete [] ray_;
    1409                               ray_ = new double [numberRows_];
    1410                               // swap sign
    1411                               for (int i=0;i<numberRows_;i++)
    1412                                 ray_[i] = -dual_[i];
     1415                              // we are infeasible - use as ray
     1416                              delete [] ray_;
     1417                              //if ((specialOptions_&(32|0x01000000))!=0x01000000) {
     1418                              if ((specialOptions_&0x03000000)==0) {
     1419                                ray_ = new double [numberRows_];
     1420                                double * saveObjective = CoinCopyOfArray(objective(),
     1421                                                                         numberColumns_);
     1422                                memset(objective(),0,numberColumns_*sizeof(double));
     1423                                infeasibilityCost_ = 1.0;
     1424                                createRim(4);
     1425                                nonLinearCost_->checkInfeasibilities(primalTolerance_);
     1426                                gutsOfSolution(NULL, NULL, false);
     1427                                memcpy(objective(),saveObjective,numberColumns_*sizeof(double));
     1428                                delete [] saveObjective;
     1429                                // swap sign
     1430                                for (int i=0;i<numberRows_;i++)
     1431                                  ray_[i] = -dual_[i];
     1432                              } else {
     1433                                ray_ = NULL;
     1434                              }
    14131435#ifdef PRINT_RAY_METHOD
    14141436                              printf("Primal creating infeasibility ray\n");
  • branches/autotools-update/Clp/src/ClpSolve.cpp

    r2312 r2339  
    20592059                              info.setStartingWeight(1.0e-1);
    20602060                              info.setReduceIterations(6);
    2061                               if (!largestGap)
     2061                              if (!largestGap && nPasses <= 50)
    20622062                                   nPasses *= 2;
    20632063                              //info.setFeasibilityTolerance(1.0e-7);
     
    38053805               double sumPrimal=sumPrimalInfeasibilities_;
    38063806               double sumDual=sumDualInfeasibilities_;
     3807               if (sumDual>1.0e-6&&sumPrimal>1.0e-6)
     3808                 moreSpecialOptions_ &= ~2; // be safe and do final solve
    38073809               // ignore some parts of solution
    38083810               if (finalStatus == 1) {
     
    38383840#ifndef ABC_INHERIT
    38393841                        // use method thought suitable
    3840                         if (sumDual>1000.0*sumPrimal) {
     3842                        int numberSuperBasic=0;
     3843                        for (int i=0;i<numberColumns_;i++) {
     3844                          if (getColumnStatus(i)==superBasic)
     3845                            numberSuperBasic++;
     3846                        }
     3847                        if (sumDual>1000.0*sumPrimal || numberSuperBasic) {
    38413848                          primal(1);
    38423849                        } else if (sumPrimal>1000.0*sumDual) {
  • branches/autotools-update/Clp/src/Idiot.cpp

    r2312 r2339  
    103103          const CoinPackedMatrix * matrix = model_->getMatrixByCol();
    104104#else
    105           ClpMatrixBase * matrix = model_->clpMatrix();
     105          // safer for odd matrices
     106          const CoinPackedMatrix * matrix = model_->matrix();
     107          //ClpMatrixBase * matrix = model_->clpMatrix();
    106108#endif
    107109          const int * row = matrix->getIndices();
     
    293295     const CoinPackedMatrix * matrix = model->getMatrixByCol();
    294296#else
    295      ClpMatrixBase * matrix = model->clpMatrix();
     297     // safer for odd matrices (note really ClpSimplex not OsiSolverInterface)
     298     const CoinPackedMatrix * matrix = model->matrix();
     299     //ClpMatrixBase * matrix = model_->clpMatrix();
    296300#endif
    297301     const int * row = matrix->getIndices();
     
    370374     }
    371375     //printf("setting mu to %g and doing %d passes\n",mu_,majorIterations_);
    372      solve2(handler, messages);
     376     if (numberColumns)
     377       solve2(handler, messages);
    373378#ifndef OSI_IDIOT
    374379     if (doCrossover) {
     
    444449     const CoinPackedMatrix * matrix = model_->getMatrixByCol();
    445450#else
    446      ClpMatrixBase * matrix = model_->clpMatrix();
     451     // safer for odd matrices
     452     const CoinPackedMatrix * matrix = model_->matrix();
     453     //ClpMatrixBase * matrix = model_->clpMatrix();
    447454#endif
    448455     const int * row = matrix->getIndices();
     
    13261333     colsol = model_->primalColumnSolution();;
    13271334     double * cost = model_->objective();
    1328 
    13291335     int slackEnd, ordStart, ordEnd;
    13301336     int slackStart = countCostedSlacks(model_);
     
    19411947                         }
    19421948                    }
     1949
    19431950                    double averageInfeasibility=sum/nrows;
    19441951                    sprintf(line,"sum of infeasibilities %g - average %g, %d fixed columns",
  • branches/autotools-update/Clp/src/OsiClp

  • branches/autotools-update/Clp/src/OsiClp/OsiClpSolverInterface.cpp

    r2312 r2339  
    50525052    basis_ = rhs.basis_;
    50535053    stuff_ = rhs.stuff_;
     5054    delete [] integerInformation_;
     5055    integerInformation_=NULL;
    50545056    if (rhs.integerInformation_) {
    50555057      int numberColumns = modelPtr_->numberColumns();
     
    74867488  }
    74877489}
    7488 
    74897490// Crunch down model
    74907491void
     
    78567857            //printf("%d basic (%d non-unit) %d non-basic\n",n,nn,k);
    78577858            modelPtr_->ray_=ray;
     7859#ifdef CHECK_RAY
     7860            {
     7861              double * lower = modelPtr_->rowLower_;
     7862              double * upper = modelPtr_->rowUpper_;
     7863              double * solution = modelPtr_->rowActivity_;
     7864              double * dj = modelPtr_->dual_;
     7865              double largestBad=0.0;
     7866              double largestBadDj=0.0;
     7867              for (int iRow = 0; iRow < modelPtr_->numberRows_; iRow++) {
     7868                if (upper[iRow]==lower[iRow])
     7869                  continue;
     7870                if (solution[iRow]<lower[iRow]+modelPtr_->primalTolerance_) {
     7871                  largestBadDj=CoinMax(largestBadDj,-dj[iRow]);
     7872                  largestBad=CoinMax(largestBad,ray[iRow]);
     7873                } else if (solution[iRow]>upper[iRow]-modelPtr_->primalTolerance_) {
     7874                  largestBadDj=CoinMax(largestBadDj,dj[iRow]);
     7875                  largestBad=CoinMax(largestBad,-ray[iRow]);
     7876                }
     7877              }
     7878              double * result = new double[modelPtr_->numberColumns_];
     7879              CoinFillN ( result, modelPtr_->numberColumns_, 0.0);
     7880              modelPtr_->matrix()->transposeTimes(ray, result);
     7881              lower = modelPtr_->columnLower_;
     7882              upper = modelPtr_->columnUpper_;
     7883              solution = modelPtr_->columnActivity_;
     7884              dj = modelPtr_->reducedCost_;
     7885              for (int iColumn = 0; iColumn < modelPtr_->numberColumns_; iColumn++) {
     7886                // should have been ..Times -1.0
     7887                result[iColumn]=-result[iColumn];
     7888                if (upper[iColumn]==lower[iColumn])
     7889                  continue;
     7890                if (solution[iColumn]<lower[iColumn]+modelPtr_->primalTolerance_) {
     7891                  largestBadDj=CoinMax(largestBadDj,-dj[iColumn]);
     7892                  largestBad=CoinMax(largestBad,result[iColumn]);
     7893                } else if (solution[iColumn]>upper[iColumn]-modelPtr_->primalTolerance_) {
     7894                  largestBadDj=CoinMax(largestBadDj,dj[iColumn]);
     7895                  largestBad=CoinMax(largestBad,-result[iColumn]);
     7896                }
     7897              }
     7898              if (largestBad>1.0e-5||largestBadDj>1.0e-5) {
     7899                if (modelPtr_->numberPrimalInfeasibilities_==1)
     7900                  printf("BAD ");
     7901                printf("bad ray %g bad dj %g\n",largestBad,largestBadDj);
     7902              }
     7903              delete [] result;
     7904            }
     7905#endif
    78587906            modelPtr_->directionOut_=small->directionOut_;
    78597907            if (small->sequenceOut_<small->numberColumns_)
     
    1048110529  // Save basis in Osi object
    1048210530  setWarmStart(NULL);
     10531}
     10532// Replace setInfo (takes over ownership)
     10533void
     10534OsiClpSolverInterface::replaceSetInfo(int numberSOS,CoinSet * setInfo)
     10535{
     10536  delete [] setInfo_;
     10537  numberSOS_ = numberSOS;
     10538  setInfo_ = setInfo;
    1048310539}
    1048410540 
  • branches/autotools-update/Clp/src/OsiClp/OsiClpSolverInterface.hpp

    r2312 r2339  
    487487  /// Set integer type (0,1,2=optional,3=sc,4=scint)
    488488  inline void setIntegerType(int colIndex,int value)
    489   { integerInformation_[colIndex] = value;}
     489  { integerInformation_[colIndex] = static_cast<char>(value);}
    490490  /// Get pointer to row-wise copy of matrix
    491491  virtual const CoinPackedMatrix * getMatrixByRow() const;
     
    685685  inline const CoinSet * setInfo() const
    686686  { return setInfo_;}
     687  /// Replace setInfo (takes over ownership)
     688  void replaceSetInfo(int numberSOS,CoinSet * setInfo);
    687689  /** \brief Identify integer variables and SOS and create corresponding objects.
    688690 
     
    12661268  /// Sort of lexicographic resolve
    12671269  void lexSolve();
     1270  /// Get continuous model
     1271  inline ClpSimplex * getContinuousModel() const
     1272  { return continuousModel_;}
     1273  /// Set continuous model
     1274  inline void setContinuousModel(ClpSimplex * model)
     1275  { continuousModel_ = model;}
    12681276  //@}
    12691277 
  • branches/autotools-update/Clp/src/unitTest.cpp

    r2312 r2339  
    351351     else
    352352          dirNetlib = dirsep == '/' ? "../../Data/Netlib/" : "..\\..\\Data\\Netlib\\";
    353 #if 0 //FACTORIZATION_STATISTICS==0
     353#if FACTORIZATION_STATISTICS==0
    354354     if (!empty.numberRows()) {
    355355          testingMessage( "Testing ClpSimplex\n" );
     
    15501550               for (int i = 0; i < numberRows; i++)
    15511551                    solution.setRowStatus(i, ClpSimplex::basic);
     1552               solution.objective()[1]=-2.0;
    15521553               solution.primal(1);
    15531554               assert (solution.secondaryStatus() == 102); // Came out at end of pass
     
    20762077                    // test infeasible and ray
    20772078                    solution.columnUpper()[0] = 0.0;
    2078 #ifdef DUAL
     2079#if 1 //def DUAL
    20792080                    solution.setDualBound(100.0);
    20802081                    solution.dual();
Note: See TracChangeset for help on using the changeset viewer.