Changeset 217 for branches


Ignore:
Timestamp:
Oct 3, 2003 3:10:09 PM (16 years ago)
Author:
forrest
Message:

Nearly there

Location:
branches/pre
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • branches/pre/ClpInterior.cpp

    r215 r217  
    209209  delete lsqrObject_;
    210210  lsqrObject_ = NULL;
    211   delete pdcoStuff_;
     211  //delete pdcoStuff_;
    212212  pdcoStuff_=NULL;
    213213}
  • branches/pre/ClpPdco.cpp

    r215 r217  
    203203  dj_=NULL;
    204204
     205  // Save stuff so available elsewhere
     206  pdcoStuff_ = stuff;
     207
    205208  double normb  = b.infNorm();
    206209  double normx0 = x.infNorm();
     
    539542  // Lsqr
    540543  ClpLsqr  thisLsqr(this);
    541 
    542544  //  while (converged) {
    543545  while(PDitns < maxitn) {
     
    803805      printf(" %5.1f%7d%7.3f", log10(atolold), itncg, r3ratio);
    804806    }
    805 
     807    printf("\n************ debug\n");
     808    break;
    806809    //-------------------------------------------------------------------
    807810    // Test for termination.
  • branches/pre/ClpPresolve.cpp

    r212 r217  
    11171117  const int bufsize = 2*nelems_in;
    11181118
    1119   // Set up change bits
    1120   rowChanged_ = new unsigned int[(nrows_+31)>>5];
    1121   memset(rowChanged_,0,((nrows_+31)>>5)*sizeof(unsigned int));
    1122   colChanged_ = new unsigned int[(ncols_+31)>>5];
    1123   memset(colChanged_,0,((ncols_+31)>>5)*sizeof(unsigned int));
     1119  // Set up change bits etc
     1120  rowChanged_ = new unsigned char[nrows_];
     1121  memset(rowChanged_,0,nrows_);
     1122  colChanged_ = new unsigned char[ncols_];
     1123  memset(colChanged_,0,ncols_);
    11241124  CoinPackedMatrix * m = si->matrix();
    11251125
     
    11651165  // Set up prohibited bits if needed
    11661166  if (nonLinearValue) {
    1167     rowProhibited_ = new unsigned int[(nrows_+31)>>5];
    1168     memset(rowProhibited_,0,((nrows_+31)>>5)*sizeof(unsigned int));
    1169     colProhibited_ = new unsigned int[(ncols_+31)>>5];
    1170     memset(colProhibited_,0,((ncols_+31)>>5)*sizeof(unsigned int));
     1167    anyProhibited_ = true;
    11711168    for (icol=0;icol<ncols_;icol++) {
    11721169      int j;
     
    11841181    }
    11851182  } else {
    1186     rowProhibited_ = NULL;
    1187     colProhibited_ = NULL;
     1183    anyProhibited_ = false;
    11881184  }
    11891185
  • branches/pre/Makefile.Clp

    r215 r217  
    2525LIBSRC += ClpPackedMatrix.cpp
    2626LIBSRC += ClpPlusMinusOneMatrix.cpp
     27LIBSRC += ClpDummyMatrix.cpp
    2728LIBSRC += ClpPrimalColumnDantzig.cpp
    2829LIBSRC += ClpPrimalColumnPivot.cpp
  • branches/pre/Samples/Makefile.pdco

    r215 r217  
    1515
    1616LibDir :=
     17LibDir += ${ClpLibDir}
    1718LibDir += ${CoinLibDir}
    18 LibDir += ${ClpLibDir}
    1919LibDir += ${zlibLibDir}
    2020LibDir += ${bzlibLibDir}
    2121
    2222LibName :=
     23LibName += ${ClpLibName}
    2324LibName += ${CoinLibName}
    24 LibName += ${ClpLibName}
    2525LibName += ${zlibLibName}
    2626LibName += ${bzlibLibName}
     
    5555LDFLAGS += $(call ifprefix,$(SHLINKPREFIX),$(LIBDIRS))
    5656LDFLAGS += $(patsubst lib%,-l%,$(basename $(LIBS)))
     57#LDFLAGS += -static
    5758#if DENSE and using given libraries
    5859LDFLAGS += -llapack -lblas -lg2c
     
    6263        LDFLAGS += -lhistory -lreadline -ltermcap
    6364endif
    64 LDFLAGS += -lefence
     65#LDFLAGS += -lefence
    6566###############################################################################
    6667
  • branches/pre/Samples/myPdco.cpp

    r215 r217  
    1010#include "ClpInterior.hpp"
    1111#include "myPdco.hpp"
     12#include "ClpDummyMatrix.hpp"
    1213#include "ClpMessage.hpp"
    1314
     
    2122myPdco::myPdco ()
    2223  : ClpPdcoBase(),
     24    rowIndex_(NULL),
    2325    numlinks_(0),
    2426    numnodes_(0)
     
    3133             int numnodes, int numlinks)
    3234  : ClpPdcoBase(),
     35    rowIndex_(NULL),
    3336    numlinks_(numlinks),
    3437    numnodes_(numnodes)
     
    4548  numlinks_(rhs.numlinks_),
    4649  numnodes_(rhs.numnodes_)
    47 
     50{
     51  rowIndex_ = ClpCopyOfArray(rhs.rowIndex_,2*(numlinks_+2*numnodes_));
    4852}
    4953
     
    5357myPdco::~myPdco ()
    5458{
     59  delete [] rowIndex_;
    5560}
    5661
     
    6570    numlinks_ = rhs.numlinks_;
    6671    numnodes_ = rhs.numnodes_;
     72    rowIndex_ = ClpCopyOfArray(rhs.rowIndex_,2*(numlinks_+2*numnodes_));
    6773  }
    6874  return *this;
     
    7884void myPdco::matVecMult(ClpInterior * model,  int mode, double* x_elts, double* y_elts) const
    7985{
    80   const int * rowIndex = model->matrix()->getIndices();
    8186  int nrow = model->numberRows();
    8287  if (mode ==1){
     
    8489    for (int k=0; k<numlinks_; k++){
    8590      y_sum += y_elts[k];
    86       int i1 = rowIndex[2*k];
     91      int i1 = rowIndex_[2*k];
    8792      x_elts[i1] += y_elts[k];
    88       int i2 = rowIndex[2*k+1];
     93      int i2 = rowIndex_[2*k+1];
    8994      x_elts[i2] -= y_elts[k];
    9095    }
     
    103108    for (int k=0; k<numlinks_; k++){
    104109      x_elts[k] += y_elts[nrow-1];
    105       int i1 = rowIndex[2*k];
     110      int i1 = rowIndex_[2*k];
    106111      x_elts[k] += y_elts[i1];
    107       int i2 = rowIndex[2*k+1];
     112      int i2 = rowIndex_[2*k+1];
    108113      x_elts[k] -= y_elts[i2];
    109114    }
     
    128133    ysq[k] = y_elts[k]*y_elts[k];
    129134 
    130   const int * rowIndex = model->matrix()->getIndices();
    131135  for (int k=0; k<numlinks_; k++){
    132136    y_sum += ysq[k];
    133     int i1 = rowIndex[2*k];
     137    int i1 = rowIndex_[2*k];
    134138    x_elts[i1] += ysq[k];
    135     int i2 = rowIndex[2*k+1];
     139    int i2 = rowIndex_[2*k+1];
    136140    x_elts[i2] += ysq[k];
    137141  }
     
    187191  int ncol;
    188192  int numelts;
    189   int *rowIndex;
    190   int *colStarts;
    191   double  *values;
    192193  double  *rowUpper;
    193194  double  *rowLower;
     
    198199  double  *y;
    199200  double  *dj;
    200   int numlinks;
    201   int numnodes;
    202201  int ipair[2], igparm[4], maxrows, maxlinks;
    203202  // Open graph and parameter files
     
    237236  numnodes_ = imax + 1;
    238237  numlinks_ = maxlinks;
    239   nrow = numnodes + 3;
    240   ncol = numlinks + 2*numnodes;
     238  nrow = numnodes_ + 3;
     239  ncol = numlinks_ + 2*numnodes_;
    241240  numelts = 3*ncol;
    242241 
    243   rowIndex = ir;
     242  rowIndex_ = ir;
    244243
    245244  d1_ = 1.0e-3;
     
    269268  colLower = L_def;
    270269  // We have enough to create a model
    271   // Create dummy starts and elements
    272   colStarts = new int [ncol+1];
    273   values = new double[numelts];
    274   colStarts[ncol]=numelts;
    275   for (int k=0; k<ncol; k++)
    276     colStarts[k]=3*k;
    277   for (int k=0; k<3*ncol; k++)
    278     values[k]=1.0;
    279   model.loadProblem(ncol,nrow,colStarts,rowIndex,values,
    280                      colLower,colUpper,NULL,rowLower,rowUpper);
     270  ClpDummyMatrix dummy(ncol,nrow,numelts);
     271  model.loadProblem(dummy,
     272                    colLower,colUpper,NULL,rowLower,rowUpper);
    281273  double *y_def = new double[nrow];
    282274  for (int k=0; k<nrow; k++)
     
    288280  dj = dj_def;
    289281  // delete arrays
    290   delete [] rhs_def;
    291282  delete [] U_def;
    292283  delete [] L_def;
    293   delete [] rowIndex;
    294   delete [] colStarts;
    295   delete [] values;
    296284  // Should be sets
    297285  model.rhs_=rhs;
  • branches/pre/Samples/myPdco.hpp

    r215 r217  
    5959      The data members are protected to allow access for derived classes. */
    6060   //@{
     61  int * rowIndex_;
    6162  int numlinks_;
    6263  int numnodes_;
  • branches/pre/Samples/pdco.cpp

    r215 r217  
    22// Corporation and others.  All Rights Reserved.
    33
    4 
    5 // The point of this example is to show how to create a model without
    6 // using mps files.
    74
    85// It also tests pdco
  • branches/pre/Test/ClpMain.cpp

    r212 r217  
    15691569                // primal
    15701570                if (doCrash) {
    1571                   solveOptions.setSpecialOption(0,1); // crash
     1571                  solveOptions.setSpecialOption(1,1); // crash
    15721572                } else if (doSprint>0) {
    15731573                  // sprint overrides idiot
Note: See TracChangeset for help on using the changeset viewer.