Changeset 1941 for stable


Ignore:
Timestamp:
Apr 10, 2013 12:52:27 PM (7 years ago)
Author:
stefan
Message:

sync with trunk rev 1940

Location:
stable/1.15/Clp
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • stable/1.15/Clp

  • stable/1.15/Clp/MSVisualStudio/v10/libClp/libClp.vcxproj

    r1922 r1941  
    2626  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
    2727    <ConfigurationType>StaticLibrary</ConfigurationType>
    28     <PlatformToolset>v100</PlatformToolset>
    2928  </PropertyGroup>
    3029  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
    3130    <ConfigurationType>StaticLibrary</ConfigurationType>
    32     <PlatformToolset>v90</PlatformToolset>
    3331  </PropertyGroup>
    3432  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     
    3735  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
    3836    <ConfigurationType>StaticLibrary</ConfigurationType>
    39     <PlatformToolset>v100</PlatformToolset>
    4037  </PropertyGroup>
    4138  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
     
    8683      <AdditionalIncludeDirectories>..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    8784      <PreprocessorDefinitions>CLP_BUILD;WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    88       <MinimalRebuild>true</MinimalRebuild>
    89       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
    9085      <PrecompiledHeader>
    9186      </PrecompiledHeader>
    92       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
    9387    </ClCompile>
    9488    <ResourceCompile>
  • stable/1.15/Clp/MSVisualStudio/v10/libOsiClp/libOsiClp.vcxproj

    r1922 r1941  
    2929  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
    3030    <ConfigurationType>StaticLibrary</ConfigurationType>
    31     <PlatformToolset>v90</PlatformToolset>
    3231  </PropertyGroup>
    3332  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     
    8483      <AdditionalIncludeDirectories>..\..\..\..\Clp\src;..\..\..\..\Clp\src\OsiClp;..\..\..\..\Osi\src;..\..\..\..\Osi\src\Osi;..\..\..\..\CoinUtils\src;..\..\..\..\BuildTools\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    8584      <PreprocessorDefinitions>OSI_BUILD;WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    86       <MinimalRebuild>true</MinimalRebuild>
    87       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
    8885      <PrecompiledHeader>
    8986      </PrecompiledHeader>
    90       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
    91       <CompileAs>Default</CompileAs>
    9287    </ClCompile>
    9388    <ResourceCompile>
  • stable/1.15/Clp/configure

    r1922 r1941  
    3124331243
    3124431244
     31245
     31246# Allow for newlines in the parameter
     31247if test $coin_vpath_config = yes; then
     31248  cvl_tmp="examples/g.tiny"
     31249  for file in $cvl_tmp ; do
     31250    coin_vpath_link_files="$coin_vpath_link_files $file"
     31251  done
     31252fi
     31253
     31254
     31255
     31256# Allow for newlines in the parameter
     31257if test $coin_vpath_config = yes; then
     31258  cvl_tmp="examples/gparm.tiny"
     31259  for file in $cvl_tmp ; do
     31260    coin_vpath_link_files="$coin_vpath_link_files $file"
     31261  done
     31262fi
     31263
     31264
    3124531265#############################################################################
    3124631266#                  Check for doxygen                                        #
  • stable/1.15/Clp/configure.ac

    r1922 r1941  
    177177AC_COIN_VPATH_LINK(examples/hello.mps)
    178178AC_COIN_VPATH_LINK(examples/input.130)
     179AC_COIN_VPATH_LINK(examples/g.tiny)
     180AC_COIN_VPATH_LINK(examples/gparm.tiny)
    179181
    180182#############################################################################
  • stable/1.15/Clp/examples/Makefile.in

    r1770 r1941  
    107107        addColumns.@OBJEXT@ addColumns@EXEEXT@ \
    108108        addRows.@OBJEXT@ addRows@EXEEXT@ \
     109        decomp2.@OBJEXT@ decomp2@EXEEXT@ \
     110        decomp3.@OBJEXT@ decomp3@EXEEXT@ \
    109111        decompose.@OBJEXT@ decompose@EXEEXT@ \
    110112        defaults.@OBJEXT@ defaults@EXEEXT@ \
     
    118120        makeDual.@OBJEXT@ makeDual@EXEEXT@ \
    119121        minimum.@OBJEXT@ minimum@EXEEXT@ \
     122        modify.@OBJEXT@ modify@EXEEXT@ \
    120123        network.@OBJEXT@ network@EXEEXT@ \
     124        pdco.@OBJEXT@ pdco@EXEEXT@ \
    121125        piece.@OBJEXT@ piece@EXEEXT@ \
    122126        rowColumn.@OBJEXT@ rowColumn@EXEEXT@ \
  • stable/1.15/Clp/examples/addBits.cpp

    r1662 r1941  
    166166     if (numberColumns < 50)
    167167          build.setLogLevel(1);
     168     // should fail as we never set multiplier
    168169     int numberErrors = model2.loadProblem(build);
    169      // should fail as we never set multiplier
    170      assert(numberErrors);
     170     if( numberErrors == 0 )
     171     {
     172        printf("%d errors from model2.loadProblem(build), but we expected some", numberErrors);
     173        return 1;
     174     }
    171175     time3 = CoinCpuTime() - time2;
    172176     // subtract out unsuccessful times
  • stable/1.15/Clp/examples/addRows.cpp

    r1662 r1941  
    259259          std::cout << "--------------------------------------" << std::endl;
    260260          // Test CoinAssert
    261           std::cout << "If Clp compiled with -g below should give assert, if with -O1 or COIN_ASSERT CoinError" << std::endl;
     261          std::cout << "If Clp compiled without NDEBUG below should give assert, if with NDEBUG or COIN_ASSERT CoinError" << std::endl;
    262262          model = modelSave;
    263263          model.deleteRows(2, del);
  • stable/1.15/Clp/examples/minimum.cpp

    r1662 r1941  
    1212#if defined(SAMPLEDIR)
    1313/*
    14   SAMPLEDIR should "path/to/Data/Sample/"
     14  SAMPLEDIR should "path/to/Data/Sample"
    1515  Include the quotes and final path separator.
    1616*/
    17           status = model.readMps(SAMPLEDIR "p0033.mps", true);
     17          status = model.readMps(SAMPLEDIR "/p0033.mps", true);
    1818#else
    1919          fprintf(stderr, "Do not know where to find sample MPS files.\n");
  • stable/1.15/Clp/examples/pdco.cpp

    r1662 r1941  
    1616#include <assert.h>
    1717#include <cmath>
     18
     19// easy way to allow compiling all sources for this example within one file,
     20// so no need to do something special in Makefile
     21#include "myPdco.cpp"
    1822
    1923int main(int argc, const char *argv[])
  • stable/1.15/Clp/examples/piece.cpp

    r1662 r1941  
    203203     // Create nonlinear objective
    204204     int returnCode = model.createPiecewiseLinearCosts(segstart, breakpt, slope);
    205      assert(!returnCode);
     205     if( returnCode != 0 )
     206     {
     207        printf("Unexpected return code %d from model.createPiecewiseLinearCosts()\n", returnCode);
     208        return returnCode;
     209     }
    206210
    207211     // delete
  • stable/1.15/Clp/examples/sprint.cpp

    r1662 r1941  
    121121     int smallNumberColumns = CoinMin(3 * numberRows, numberColumns);
    122122     smallNumberColumns = CoinMax(smallNumberColumns, 3000);
     123     // To stop seg faults on unsuitable problems
     124     smallNumberColumns = CoinMin(smallNumberColumns,numberColumns);
    123125     // We will be using all rows
    124126     int * whichRows = new int [numberRows];
  • stable/1.15/Clp/examples/sprint2.cpp

    r1662 r1941  
    7272     // Just take this number of columns in small problem
    7373     int smallNumberColumns = 3 * numberRows;
     74     // To stop seg faults on unsuitable problems
     75     smallNumberColumns = CoinMin(smallNumberColumns,numberColumns);
    7476     // And we want number of rows to be this
    7577     int smallNumberRows = numberRows / 4;
     
    101103               double ratio = ((double) smallNumberRows) / ((double) model2->numberRows());
    102104               smallNumberColumns = (int)(smallNumberColumns * ratio);
     105               // deal with pathological case
     106               smallNumberColumns = CoinMax(smallNumberColumns,0);
    103107          }
    104108          delete model2;
  • stable/1.15/Clp/examples/testGub.cpp

    r1662 r1941  
    245245                         start2, row2, element2, cost2,
    246246                         lowerColumn2, upperColumn2);
    247                model2.replaceMatrix(newMatrix);
     247               model2.replaceMatrix(newMatrix,true);
    248248               newMatrix->switchOffCheck();
    249249               newMatrix->setRefreshFrequency(1000);
     
    275275                                lowerColumn2, upperColumn2,
    276276                                oldMatrix->gubRowStatus(), oldMatrix->dynamicStatus());
    277                model3.replaceMatrix(newMatrix);
     277               model3.replaceMatrix(newMatrix,true);
    278278               // and ordinary status (but only NON gub rows)
    279279               memcpy(model3.statusArray(), model2.statusArray(),
     
    293293                                       oldMatrix->gubRowStatus(), oldMatrix->dynamicStatus(),
    294294                                       oldMatrix->numberGubColumns(), oldMatrix->idGen());
    295                model3.replaceMatrix(newMatrix);
     295               model3.replaceMatrix(newMatrix,true);
    296296               // and ordinary status (but only NON gub rows)
    297297               memcpy(model3.statusArray(), model2.statusArray(),
     
    418418               fwrite(gubSolution, sizeof(double), numberTotalColumns, fp);
    419419               fwrite(status, sizeof(char), numberTotalColumns, fp);
     420#ifndef NDEBUG
    420421               const double * rowsol = model2.primalRowSolution();
     422#endif
    421423               double * rowsol2 = new double[originalNumberRows];
    422424               memset(rowsol2, 0, originalNumberRows * sizeof(double));
  • stable/1.15/Clp/examples/useVolume.cpp

    r1662 r1941  
    172172     } else
    173173          status = model.readMps(argv[1], true);
     174     if( status != 0 )
     175     {
     176        printf("Error %d reading MPS file\n", status);
     177        return status;
     178     }
    174179     /*
    175180       This driver uses volume algorithm
  • stable/1.15/Clp/src

  • stable/1.15/Clp/src/ClpDynamicExampleMatrix.cpp

    r1676 r1941  
    101101     startColumn_[0] = 0;
    102102     cost_ = new double[maximumGubColumns_];
    103      dynamicStatus_ = new unsigned char [maximumGubColumns_];
     103     dynamicStatus_ = new unsigned char [2*maximumGubColumns_];
    104104     memset(dynamicStatus_, 0, maximumGubColumns_);
    105105     id_ = new int[maximumGubColumns_];
     
    158158               columnUpper[i] = 1.0e10;
    159159     }
     160     status_ = new unsigned char [2*numberSets_+4];
    160161     if (status) {
    161           status_ = ClpCopyOfArray(status, numberSets_);
     162          memcpy(status_,status, numberSets_ * sizeof(char));
    162163          assert (dynamicStatus);
    163164          CoinMemcpyN(dynamicStatus, numberIds, dynamicStatus_);
     
    165166     } else {
    166167          assert (!numberIds);
    167           status_ = new unsigned char [numberSets_];
    168168          memset(status_, 0, numberSets_);
    169169          for (i = 0; i < numberSets_; i++) {
     
    220220     }
    221221}
     222#if 0
    222223// This constructor just takes over ownership
    223224ClpDynamicExampleMatrix::ClpDynamicExampleMatrix(ClpSimplex * model, int numberSets,
     
    260261     startColumn_[0] = 0;
    261262     cost_ = new double[maximumGubColumns_];
    262      dynamicStatus_ = new unsigned char [maximumGubColumns_];
     263     dynamicStatus_ = new unsigned char [2*maximumGubColumns_];
    263264     memset(dynamicStatus_, 0, maximumGubColumns_);
    264265     id_ = new int[maximumGubColumns_];
     
    310311               columnUpper[i] = 1.0e10;
    311312     }
     313     status_ = new unsigned char [2*numberSets_+4];
    312314     if (status) {
    313           status_ = ClpCopyOfArray(status, numberSets_);
     315          memcpy(status_,status, numberSets_ * sizeof(char));
    314316          assert (dynamicStatus);
    315317          CoinMemcpyN(dynamicStatus, numberIds, dynamicStatus_);
     
    317319     } else {
    318320          assert (!numberIds);
    319           status_ = new unsigned char [numberSets_];
    320321          memset(status_, 0, numberSets_);
    321322          for (i = 0; i < numberSets_; i++) {
     
    373374     }
    374375}
     376#endif
    375377//-------------------------------------------------------------------
    376378// Destructor
  • stable/1.15/Clp/src/ClpDynamicExampleMatrix.hpp

    r1665 r1941  
    7272                             const unsigned char * dynamicStatus = NULL,
    7373                             int numberIds = 0, const int *ids = NULL);
     74#if 0
    7475     /// This constructor just takes over ownership (except for lower, upper)
    7576     ClpDynamicExampleMatrix(ClpSimplex * model, int numberSets,
     
    8283                             const unsigned char * dynamicStatus = NULL,
    8384                             int numberIds = 0, const int *ids = NULL);
    84 
     85#endif
    8586     /** Destructor */
    8687     virtual ~ClpDynamicExampleMatrix();
  • stable/1.15/Clp/src/ClpDynamicMatrix.cpp

    r1732 r1941  
    156156               next_[last] = -iSet - 1;
    157157          }
    158      }
    159      startSet_[numberSets_] = starts[numberSets_];
     158          startSet_[numberSets_] = starts[numberSets_];
     159     }
    160160     int numberColumns = model->numberColumns();
    161161     int numberRows = model->numberRows();
     
    177177     startColumn_ = ClpCopyOfArray(startColumn, numberGubColumns_ + 1);
    178178     if (!numberGubColumns_) {
    179        //startColumn_ = new CoinBigIndex [1];
     179       if (!startColumn_)
     180         startColumn_ = new CoinBigIndex [1];
    180181       startColumn_[0] = 0;
    181182     }
  • stable/1.15/Clp/src/ClpInterior.cpp

    r1665 r1941  
    1212#include "ClpInterior.hpp"
    1313#include "ClpMatrixBase.hpp"
    14 #ifdef COIN_DO_PDCO
    1514#include "ClpLsqr.hpp"
    1615#include "ClpPdcoBase.hpp"
    17 #endif
    1816#include "CoinDenseVector.hpp"
    1917#include "ClpMessage.hpp"
     
    381379     y_ = ClpCopyOfArray(rhs.y_, numberRows_);
    382380     dj_ = ClpCopyOfArray(rhs.dj_, numberColumns_ + numberRows_);
    383 #ifdef COIN_DO_PDCO
    384      lsqrObject_ = new ClpLsqr(*rhs.lsqrObject_);
    385      pdcoStuff_ = rhs.pdcoStuff_->clone();
    386 #endif
     381     lsqrObject_ = rhs.lsqrObject_ != NULL ? new ClpLsqr(*rhs.lsqrObject_) : NULL;
     382     pdcoStuff_ = rhs.pdcoStuff_ != NULL ? rhs.pdcoStuff_->clone() : NULL;
    387383     largestPrimalError_ = rhs.largestPrimalError_;
    388384     largestDualError_ = rhs.largestDualError_;
     
    472468     delete [] dj_;
    473469     dj_ = NULL;
    474 #ifdef COIN_DO_PDCO
    475470     delete lsqrObject_;
    476471     lsqrObject_ = NULL;
    477      //delete pdcoStuff_;
     472     //delete pdcoStuff_;  // FIXME
    478473     pdcoStuff_ = NULL;
    479 #endif
    480474     delete [] errorRegion_;
    481475     errorRegion_ = NULL;
     
    965959     return status;
    966960}
    967 #ifdef COIN_DO_PDCO
    968961#include "ClpPdco.hpp"
    969962/* Pdco algorithm - see ClpPdco.hpp for method */
     
    979972     return ((ClpPdco *) this)->pdco(stuff, options, info, outfo);
    980973}
    981 #endif
    982974#include "ClpPredictorCorrector.hpp"
    983975// Primal-Dual Predictor-Corrector barrier
  • stable/1.15/Clp/src/ClpLsqr.cpp

    r1665 r1941  
    33// Corporation and others.  All Rights Reserved.
    44// This code is licensed under the terms of the Eclipse Public License (EPL).
    5 
    6 #ifdef COIN_DO_PDCO
    75
    86#include "ClpLsqr.hpp"
     
    3937     char str1[100], str2[100], str3[100], str4[100], head1[100], head2[100];
    4038
    41      int m = nrows_;
    4239     int n = ncols_;     // set  m,n from lsqr object
    4340
    4441     *itn     = 0;
    4542     *istop   = 0;
    46      int nstop  = 0;
    4743     double ctol   = 0;
    4844     if (conlim > 0) ctol = 1 / conlim;
     
    5046     double anorm  = 0;
    5147     double acond  = 0;
    52      double dampsq = damp * damp;
    5348     double ddnorm = 0;
    54      double res2   = 0;
    5549     double xnorm  = 0;
    5650     double xxnorm = 0;
     
    267261               if (*itn   <= 10       ) prnt = 1;
    268262               if (*itn   >= itnlim - 10) prnt = 1;
    269                if (fmod(*itn, 10) == 0  ) prnt = 1;
     263               if (*itn % 10 == 0  ) prnt = 1;
    270264               if (test3 <=  2 * ctol  ) prnt = 1;
    271265               if (test2 <= 10 * atol  ) prnt = 1;
     
    396390     return *this;
    397391}
    398 #endif
  • stable/1.15/Clp/src/ClpModel.cpp

    r1928 r1941  
    22862286          }
    22872287#endif
    2288           //if (elements)
    2289           matrix_->appendMatrix(number, 1, columnStarts, rows, elements);
     2288          if (elements)
     2289            matrix_->appendMatrix(number, 1, columnStarts, rows, elements);
    22902290     }
    22912291}
     
    34243424// Copies in names
    34253425void
    3426 ClpModel::copyNames(std::vector<std::string> & rowNames,
    3427                     std::vector<std::string> & columnNames)
     3426ClpModel::copyNames(const std::vector<std::string> & rowNames,
     3427                    const std::vector<std::string> & columnNames)
    34283428{
    34293429     unsigned int maxLength = 0;
  • stable/1.15/Clp/src/ClpModel.hpp

    r1928 r1941  
    267267     void dropNames();
    268268     /// Copies in names
    269      void copyNames(std::vector<std::string> & rowNames,
    270                     std::vector<std::string> & columnNames);
     269     void copyNames(const std::vector<std::string> & rowNames,
     270                    const std::vector<std::string> & columnNames);
    271271     /// Copies in Row names - modifies names first .. last-1
    272272     void copyRowNames(const std::vector<std::string> & rowNames, int first, int last);
  • stable/1.15/Clp/src/ClpPdco.cpp

    r1665 r1941  
    33// Corporation and others.  All Rights Reserved.
    44// This code is licensed under the terms of the Eclipse Public License (EPL).
    5 
    6 #ifdef COIN_DO_PDCO
    75
    86/* Pdco algorithm
     
    181179     double inf = 1.0e30;
    182180     double eps = 1.0e-15;
    183      double atolold, r3ratio, Pinf, Dinf, Cinf, Cinf0;
     181     double atolold = -1.0, r3ratio = -1.0, Pinf, Dinf, Cinf, Cinf0;
    184182
    185183     printf("\n   --------------------------------------------------------");
     
    226224     //false  = 0;
    227225     //zn     = zeros(n,1);
    228      int nb     = n + m;
    229      int nkkt   = nb;
     226     //int nb     = n + m;
    230227     int CGitns = 0;
    231228     int inform = 0;
     
    260257     double atol2     = options.LSQRatol2;  // Smallest atol,unless atol1 is smaller
    261258     double conlim    = options.LSQRconlim;
    262      int  wait      = options.wait;
     259     //int  wait      = options.wait;
    263260
    264261     // LSproblem:
     
    317314     //---------------------------------------------------------------------
    318315     double time    = CoinCpuTime();
    319      bool useChol = (LSmethod == 1);
    320      bool useQR   = (LSmethod == 2);
     316     //bool useChol = (LSmethod == 1);
     317     //bool useQR   = (LSmethod == 2);
    321318     bool direct  = (LSmethod <= 2 && ifexplicit);
    322319     char solver[6];
     
    456453     x.scale((1.0 / beta));
    457454
    458      double * g_elts = grad.getElements();
     455     //double * g_elts = grad.getElements();
    459456     double * H_elts = H.getElements();
    460457
     
    504501     bool  precon   = true;
    505502     double PDitns    = 0;
    506      bool converged = false;
     503     //bool converged = false;
    507504     double atol      = atol1;
    508505     atol2     = CoinMax( atol2, atolmin );
     
    512509     //  Iteration log.
    513510
    514      double stepx   = 0;
    515      double stepz   = 0;
    516511     int nf      = 0;
    517512     int itncg   = 0;
     
    628623                    //  New version of lsqr
    629624
    630                     int istop, itn;
     625                    int istop;
    631626                    dy.clear();
    632627                    show = false;
     
    918913     */
    919914// Print distribution
    920      float thresh[9] = { 0.00000001, 0.0000001, 0.000001, 0.00001, 0.0001, 0.001, 0.01, 0.1, 1.00001};
     915     double thresh[9] = { 0.00000001, 0.0000001, 0.000001, 0.00001, 0.0001, 0.001, 0.01, 0.1, 1.00001};
    921916     int counts[9] = {0};
    922917     for (int ij = 0; ij < n; ij++) {
     
    930925     printf ("Distribution of Solution Values\n");
    931926     for (int j = 8; j > 1; j--)
    932           printf(" %f  to  %f %d\n", thresh[j-1], thresh[j], counts[j]);
    933      printf("   Less than   %f %d\n", thresh[2], counts[0]);
    934 
    935      return 0;
     927          printf(" %g  to  %g %d\n", thresh[j-1], thresh[j], counts[j]);
     928     printf("   Less than   %g %d\n", thresh[2], counts[0]);
     929
     930     return inform;
    936931}
    937932// LSQR
     
    10181013     pdcoStuff_->getHessian(this, x, H);
    10191014}
    1020 #endif
  • stable/1.15/Clp/src/ClpPdcoBase.cpp

    r1665 r1941  
    33// Corporation and others.  All Rights Reserved.
    44// This code is licensed under the terms of the Eclipse Public License (EPL).
    5 
    6 #ifdef COIN_DO_PDCO
    75
    86#include "CoinPragma.hpp"
     
    6058     return *this;
    6159}
    62 #endif
  • stable/1.15/Clp/src/OsiClp

    • Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset for help on using the changeset viewer.