Changeset 1938


Ignore:
Timestamp:
Apr 9, 2013 12:29:57 PM (6 years ago)
Author:
stefan
Message:

get pdco example working

Location:
trunk/Clp
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/configure

    r1920 r1938  
    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                                        #
  • trunk/Clp/configure.ac

    r1920 r1938  
    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#############################################################################
  • trunk/Clp/examples/Makefile.in

    r1770 r1938  
    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@ \
  • trunk/Clp/examples/pdco.cpp

    r1662 r1938  
    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[])
  • trunk/Clp/src/ClpInterior.cpp

    r1665 r1938  
    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
  • trunk/Clp/src/ClpLsqr.cpp

    r1665 r1938  
    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;
     
    396390     return *this;
    397391}
    398 #endif
  • trunk/Clp/src/ClpPdco.cpp

    r1665 r1938  
    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
  • trunk/Clp/src/ClpPdcoBase.cpp

    r1665 r1938  
    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
Note: See TracChangeset for help on using the changeset viewer.