Changeset 35 for branches


Ignore:
Timestamp:
Oct 9, 2002 4:14:58 PM (17 years ago)
Author:
forrest
Message:

out CoinCopy? and CoinFill?

Location:
branches/devel-1
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • branches/devel-1/ClpDualRowSteepest.cpp

    r29 r35  
    5151    int number = model_->numberRows();
    5252    weights_= new double[number];
    53     CoinDisjointCopyN(rhs.weights_,number,weights_);
     53    ClpDisjointCopyN(rhs.weights_,number,weights_);
    5454  } else {
    5555    weights_=NULL;
     
    102102      int number = model_->numberRows();
    103103      weights_= new double[number];
    104       CoinDisjointCopyN(rhs.weights_,number,weights_);
     104      ClpDisjointCopyN(rhs.weights_,number,weights_);
    105105    } else {
    106106      weights_=NULL;
  • branches/devel-1/ClpFactorization.cpp

    r19 r35  
    124124        // these arrays start off as copies of permute
    125125        // (and we could use permute_ instead of pivotColumn (not back though))
    126         CoinDisjointCopyN ( permute_, numberRows_ , pivotColumn_  );
    127         CoinDisjointCopyN ( permuteBack_, numberRows_ , pivotColumnBack_  );
     126        ClpDisjointCopyN ( permute_, numberRows_ , pivotColumn_  );
     127        ClpDisjointCopyN ( permuteBack_, numberRows_ , pivotColumnBack_  );
    128128      }
    129129    } else {
  • branches/devel-1/ClpModel.cpp

    r33 r35  
    2525#include "ClpMessage.hpp"
    2626
    27 // This returns a non const array filled with input from scalar
    28 // or actual array
    29 template <class T> inline T*
    30 copyOfArray( const T * array, const int size, T value)
    31 {
    32   T * arrayNew = new T[size];
    33   if (array)
    34     CoinDisjointCopyN(array,size,arrayNew);
    35   else
    36     CoinFillN ( arrayNew, size,value);
    37   return arrayNew;
    38 }
    39 
    40 // This returns a non const array filled with actual array (or NULL)
    41 template <class T> inline T*
    42 copyOfArray( const T * array, const int size)
    43 {
    44   if (array) {
    45     T * arrayNew = new T[size];
    46     CoinDisjointCopyN(array,size,arrayNew);
    47     return arrayNew;
    48   } else {
    49     return NULL;
    50   }
    51 }
    5227static double cpuTime()
    5328{
     
    187162  reducedCost_=new double[numberColumns_];
    188163
    189   CoinFillN(dual_,numberRows_,0.0);
    190   CoinFillN(reducedCost_,numberColumns_,0.0);
     164  ClpFillN(dual_,numberRows_,0.0);
     165  ClpFillN(reducedCost_,numberColumns_,0.0);
    191166  int iRow,iColumn;
    192167
    193   rowLower_=copyOfArray(rowlb,numberRows_,-DBL_MAX);
    194   rowUpper_=copyOfArray(rowub,numberRows_,DBL_MAX);
    195   objective_=copyOfArray(obj,numberColumns_,0.0);
    196   rowObjective_=copyOfArray(rowObjective,numberRows_);
    197   columnLower_=copyOfArray(collb,numberColumns_,0.0);
    198   columnUpper_=copyOfArray(colub,numberColumns_,DBL_MAX);
     168  rowLower_=ClpCopyOfArray(rowlb,numberRows_,-DBL_MAX);
     169  rowUpper_=ClpCopyOfArray(rowub,numberRows_,DBL_MAX);
     170  objective_=ClpCopyOfArray(obj,numberColumns_,0.0);
     171  rowObjective_=ClpCopyOfArray(rowObjective,numberRows_);
     172  columnLower_=ClpCopyOfArray(collb,numberColumns_,0.0);
     173  columnUpper_=ClpCopyOfArray(colub,numberColumns_,DBL_MAX);
    199174  // set default solution
    200175  for (iRow=0;iRow<numberRows_;iRow++) {
     
    367342      dual_=new double[numberRows_];
    368343      reducedCost_=new double[numberColumns_];
    369       CoinDisjointCopyN ( rhs.rowActivity_, numberRows_ ,
     344      ClpDisjointCopyN ( rhs.rowActivity_, numberRows_ ,
    370345                          rowActivity_);
    371       CoinDisjointCopyN ( rhs.columnActivity_, numberColumns_ ,
     346      ClpDisjointCopyN ( rhs.columnActivity_, numberColumns_ ,
    372347                          columnActivity_);
    373       CoinDisjointCopyN ( rhs.dual_, numberRows_ ,
     348      ClpDisjointCopyN ( rhs.dual_, numberRows_ ,
    374349                          dual_);
    375       CoinDisjointCopyN ( rhs.reducedCost_, numberColumns_ ,
     350      ClpDisjointCopyN ( rhs.reducedCost_, numberColumns_ ,
    376351                          reducedCost_);
    377352    } else {
     
    381356      reducedCost_=NULL;
    382357    }
    383     rowLower_ = copyOfArray ( rhs.rowLower_, numberRows_ );
    384     rowUpper_ = copyOfArray ( rhs.rowUpper_, numberRows_ );
    385     columnLower_ = copyOfArray ( rhs.columnLower_, numberColumns_ );
    386     columnUpper_ = copyOfArray ( rhs.columnUpper_, numberColumns_ );
    387     objective_ = copyOfArray ( rhs.objective_, numberColumns_ );
    388     rowObjective_ = copyOfArray ( rhs.rowObjective_, numberRows_ );
     358    rowLower_ = ClpCopyOfArray ( rhs.rowLower_, numberRows_ );
     359    rowUpper_ = ClpCopyOfArray ( rhs.rowUpper_, numberRows_ );
     360    columnLower_ = ClpCopyOfArray ( rhs.columnLower_, numberColumns_ );
     361    columnUpper_ = ClpCopyOfArray ( rhs.columnUpper_, numberColumns_ );
     362    objective_ = ClpCopyOfArray ( rhs.objective_, numberColumns_ );
     363    rowObjective_ = ClpCopyOfArray ( rhs.rowObjective_, numberRows_ );
    389364    if (rhs.status_)
    390       status_ = copyOfArray( rhs.status_,numberColumns_+numberRows_);
     365      status_ = ClpCopyOfArray( rhs.status_,numberColumns_+numberRows_);
    391366    else
    392367      status_ = NULL;
    393368    ray_ = NULL;
    394369    if (problemStatus_==1)
    395       ray_ = copyOfArray (rhs.ray_,numberRows_);
     370      ray_ = ClpCopyOfArray (rhs.ray_,numberRows_);
    396371    else if (problemStatus_==2)
    397       ray_ = copyOfArray (rhs.ray_,numberColumns_);
     372      ray_ = ClpCopyOfArray (rhs.ray_,numberColumns_);
    398373    if (rhs.rowCopy_) {
    399374      rowCopy_ = rhs.rowCopy_->clone();
     
    776751  double * array = NULL;
    777752  if (problemStatus_==1)
    778     array = copyOfArray(ray_,numberRows_);
     753    array = ClpCopyOfArray(ray_,numberRows_);
    779754  return array;
    780755}
     
    784759  double * array = NULL;
    785760  if (problemStatus_==2)
    786     array = copyOfArray(ray_,numberColumns_);
     761    array = ClpCopyOfArray(ray_,numberColumns_);
    787762  return array;
    788763}
     
    952927ClpModel::statusCopy() const
    953928{
    954   return copyOfArray(status_,numberRows_+numberColumns_);
     929  return ClpCopyOfArray(status_,numberRows_+numberColumns_);
    955930}
    956931// Copy in status vector
  • branches/devel-1/ClpPackedMatrix.cpp

    r34 r35  
    604604      }
    605605    }
    606     CoinFillN ( rowScale, numberRows,1.0);
    607     CoinFillN ( columnScale, numberColumns,1.0);
     606    ClpFillN ( rowScale, numberRows,1.0);
     607    ClpFillN ( columnScale, numberColumns,1.0);
    608608    int numberPass=3;
    609609    double overallLargest;
  • branches/devel-1/ClpPrimalColumnSteepest.cpp

    r29 r35  
    6161    int number = model_->numberRows()+model_->numberColumns();
    6262    weights_= new double[number];
    63     CoinDisjointCopyN(rhs.weights_,number,weights_);
     63    ClpDisjointCopyN(rhs.weights_,number,weights_);
    6464    savedWeights_= new double[number];
    65     CoinDisjointCopyN(rhs.savedWeights_,number,savedWeights_);
     65    ClpDisjointCopyN(rhs.savedWeights_,number,savedWeights_);
    6666    if (!mode_) {
    6767      reference_ = new unsigned int[(number+31)>>5];
     
    122122      int number = model_->numberRows()+model_->numberColumns();
    123123      weights_= new double[number];
    124       CoinDisjointCopyN(rhs.weights_,number,weights_);
     124      ClpDisjointCopyN(rhs.weights_,number,weights_);
    125125      savedWeights_= new double[number];
    126       CoinDisjointCopyN(rhs.savedWeights_,number,savedWeights_);
     126      ClpDisjointCopyN(rhs.savedWeights_,number,savedWeights_);
    127127      if (!mode_) {
    128128        reference_ = new unsigned int[(number+31)>>5];
  • branches/devel-1/ClpSimplex.cpp

    r33 r35  
    2727#include <stdio.h>
    2828#include <iostream>
    29 // This returns a non const array filled with input from scalar
    30 // or actual array
    31 template <class T> inline T*
    32 copyOfArray( const T * array, const int size, T value)
    33 {
    34   T * arrayNew = new T[size];
    35   if (array)
    36     CoinDisjointCopyN(array,size,arrayNew);
    37   else
    38     CoinFillN ( arrayNew, size,value);
    39   return arrayNew;
    40 }
    41 
    42 // This returns a non const array filled with actual array (or NULL)
    43 template <class T> inline T*
    44 copyOfArray( const T * array, const int size)
    45 {
    46   if (array) {
    47     T * arrayNew = new T[size];
    48     CoinDisjointCopyN(array,size,arrayNew);
    49     return arrayNew;
    50   } else {
    51     return NULL;
    52   }
    53 }
    54 
    5529//#############################################################################
    5630
     
    273247
    274248  // accumulate non basic stuff
    275   CoinFillN(array,numberRows_,0.0);
     249  ClpFillN(array,numberRows_,0.0);
    276250
    277251  int iRow;
     
    280254  // So zero out basic
    281255  if (columnActivities!=columnActivityWork_)
    282     CoinDisjointCopyN(columnActivities,numberColumns_,columnActivityWork_);
     256    ClpDisjointCopyN(columnActivities,numberColumns_,columnActivityWork_);
    283257  if (rowActivities!=rowActivityWork_)
    284     CoinDisjointCopyN(rowActivities,numberRows_,rowActivityWork_);
     258    ClpDisjointCopyN(rowActivities,numberRows_,rowActivityWork_);
    285259  for (iRow=0;iRow<numberRows_;iRow++) {
    286260    int iPivot=pivotVariable_[iRow];
     
    301275  for (iRefine=0;iRefine<numberRefinements_+1;iRefine++) {
    302276    // save in case we want to restore
    303     CoinDisjointCopyN ( array, numberRows_ , save);
     277    ClpDisjointCopyN ( array, numberRows_ , save);
    304278
    305279    // put solution in correct place
     
    350324
    351325  // solution as accurate as we are going to get
    352   CoinFillN(work,numberRows_,0.0);
     326  ClpFillN(work,numberRows_,0.0);
    353327  // put solution in correct place
    354328  for (iRow=0;iRow<numberRows_;iRow++) {
     
    386360    }
    387361  }
    388   CoinDisjointCopyN ( array, numberRows_ , save);
     362  ClpDisjointCopyN ( array, numberRows_ , save);
    389363
    390364  // Btran basic costs and get as accurate as possible
     
    397371    largestDualError_=0.0;
    398372    // would be faster to do just for basic but this reduces code
    399     CoinDisjointCopyN(objectiveWork_,numberColumns_,reducedCostWork_);
     373    ClpDisjointCopyN(objectiveWork_,numberColumns_,reducedCostWork_);
    400374    transposeTimes(-1.0,array,reducedCostWork_);
    401375    for (iRow=0;iRow<numberRows_;iRow++) {
     
    442416    }
    443417  }
    444   CoinFillN(work,numberRows_,0.0);
     418  ClpFillN(work,numberRows_,0.0);
    445419  // now look at dual solution
    446420  for (iRow=0;iRow<numberRows_;iRow++) {
     
    451425    rowReducedCost_[iRow]=value;
    452426  }
    453   CoinDisjointCopyN(objectiveWork_,numberColumns_,reducedCostWork_);
     427  ClpDisjointCopyN(objectiveWork_,numberColumns_,reducedCostWork_);
    454428  transposeTimes(-1.0,dual_,reducedCostWork_);
    455429  delete [] previous;
     
    480454  double * rowActivities = new double[numberRows_];
    481455  double * columnActivities = new double[numberColumns_];
    482   CoinDisjointCopyN ( rowActivityWork_, numberRows_ , rowActivities);
    483   CoinDisjointCopyN ( columnActivityWork_, numberColumns_ , columnActivities);
     456  ClpDisjointCopyN ( rowActivityWork_, numberRows_ , rowActivities);
     457  ClpDisjointCopyN ( columnActivityWork_, numberColumns_ , columnActivities);
    484458  int status = getSolution( rowActivities, columnActivities);
    485459  delete [] rowActivities;
     
    12541228ClpSimplex::gutsOfCopy(const ClpSimplex & rhs)
    12551229{
    1256   lower_ = copyOfArray(rhs.lower_,numberColumns_+numberRows_);
     1230  lower_ = ClpCopyOfArray(rhs.lower_,numberColumns_+numberRows_);
    12571231  rowLowerWork_ = lower_+numberColumns_;
    12581232  columnLowerWork_ = lower_;
    1259   upper_ = copyOfArray(rhs.upper_,numberColumns_+numberRows_);
     1233  upper_ = ClpCopyOfArray(rhs.upper_,numberColumns_+numberRows_);
    12601234  rowUpperWork_ = upper_+numberColumns_;
    12611235  columnUpperWork_ = upper_;
    1262   cost_ = copyOfArray(rhs.cost_,(numberColumns_+numberRows_));
     1236  cost_ = ClpCopyOfArray(rhs.cost_,(numberColumns_+numberRows_));
    12631237  objectiveWork_ = cost_;
    12641238  rowObjectiveWork_ = cost_+numberColumns_;
    1265   dj_ = copyOfArray(rhs.dj_,numberRows_+numberColumns_);
     1239  dj_ = ClpCopyOfArray(rhs.dj_,numberRows_+numberColumns_);
    12661240  if (dj_) {
    12671241    reducedCostWork_ = dj_;
    12681242    rowReducedCost_ = dj_+numberColumns_;
    12691243  }
    1270   solution_ = copyOfArray(rhs.solution_,numberRows_+numberColumns_);
     1244  solution_ = ClpCopyOfArray(rhs.solution_,numberRows_+numberColumns_);
    12711245  if (solution_) {
    12721246    columnActivityWork_ = solution_;
     
    12751249  if (rhs.pivotVariable_) {
    12761250    pivotVariable_ = new int[numberRows_];
    1277     CoinDisjointCopyN ( rhs.pivotVariable_, numberRows_ , pivotVariable_);
     1251    ClpDisjointCopyN ( rhs.pivotVariable_, numberRows_ , pivotVariable_);
    12781252  } else {
    12791253    pivotVariable_=NULL;
     
    12841258    factorization_=NULL;
    12851259  }
    1286   rowScale_ = copyOfArray(rhs.rowScale_,numberRows_);
    1287   savedSolution_ = copyOfArray(rhs.savedSolution_,numberColumns_+numberRows_);
    1288   columnScale_ = copyOfArray(rhs.columnScale_,numberColumns_);
     1260  rowScale_ = ClpCopyOfArray(rhs.rowScale_,numberRows_);
     1261  savedSolution_ = ClpCopyOfArray(rhs.savedSolution_,numberColumns_+numberRows_);
     1262  columnScale_ = ClpCopyOfArray(rhs.columnScale_,numberColumns_);
    12891263  int i;
    12901264  for (i=0;i<6;i++) {
     
    12971271  }
    12981272  if (rhs.saveStatus_) {
    1299     saveStatus_ = copyOfArray( rhs.saveStatus_,numberColumns_+numberRows_);
     1273    saveStatus_ = ClpCopyOfArray( rhs.saveStatus_,numberColumns_+numberRows_);
    13001274  }
    13011275  columnPrimalInfeasibility_ = rhs.columnPrimalInfeasibility_;
  • branches/devel-1/ClpSimplexDual.cpp

    r29 r35  
    108108#include <iostream>
    109109#define CHECK_DJ
    110 // This returns a non const array filled with input from scalar
    111 // or actual array
    112 template <class T> inline T*
    113 copyOfArray( const T * array, const int size, T value)
    114 {
    115   T * arrayNew = new T[size];
    116   if (array)
    117     CoinDisjointCopyN(array,size,arrayNew);
    118   else
    119     CoinFillN ( arrayNew, size,value);
    120   return arrayNew;
    121 }
    122 
    123 // This returns a non const array filled with actual array (or NULL)
    124 template <class T> inline T*
    125 copyOfArray( const T * array, const int size)
    126 {
    127   if (array) {
    128     T * arrayNew = new T[size];
    129     CoinDisjointCopyN(array,size,arrayNew);
    130     return arrayNew;
    131   } else {
    132     return NULL;
    133   }
    134 }
    135110// dual
    136111int ClpSimplexDual::dual ( )
     
    662637          delete [] ray_;
    663638          ray_ = new double [ numberRows_];
    664           CoinDisjointCopyN(rowArray_[0]->denseVector(),numberRows_,ray_);
     639          ClpDisjointCopyN(rowArray_[0]->denseVector(),numberRows_,ray_);
    665640        }
    666641        rowArray_[0]->clear();
     
    694669          delete [] ray_;
    695670          ray_ = new double [ numberRows_];
    696           CoinDisjointCopyN(rowArray_[0]->denseVector(),numberRows_,ray_);
     671          ClpDisjointCopyN(rowArray_[0]->denseVector(),numberRows_,ray_);
    697672        }
    698673      }
     
    17421717    delete [] ray_;
    17431718    ray_ = new double [numberColumns_];
    1744     CoinFillN(ray_,numberColumns_,0.0);
     1719    ClpFillN(ray_,numberColumns_,0.0);
    17451720    for (i=0;i<number;i++) {
    17461721      int iRow=index[i];
     
    18191794  if (!rowScale_&&(handler_->logLevel()&32)) {
    18201795    double * objectiveSimplex
    1821       = copyOfArray(objective_,numberColumns_,0.0);
     1796      = ClpCopyOfArray(objective_,numberColumns_,0.0);
    18221797    double * rowObjectiveSimplex
    1823       = copyOfArray(rowObjective_,numberRows_,0.0);
     1798      = ClpCopyOfArray(rowObjective_,numberRows_,0.0);
    18241799    int i;
    18251800    double largest;
     
    18781853          <<CoinMessageEol;
    18791854        // save solution in case unbounded
    1880         CoinDisjointCopyN(columnActivityWork_,numberColumns_,
     1855        ClpDisjointCopyN(columnActivityWork_,numberColumns_,
    18811856                          columnArray_[0]->denseVector());
    1882         CoinDisjointCopyN(rowActivityWork_,numberRows_,
     1857        ClpDisjointCopyN(rowActivityWork_,numberRows_,
    18831858                          rowArray_[2]->denseVector());
    18841859        numberChangedBounds=changeBounds(false,rowArray_[0],changeCost);
     
    19191894                columnActivityWork_[iColumn] = original[iColumn];
    19201895              }
    1921               CoinDisjointCopyN(rowArray_[2]->denseVector(),numberRows_,
     1896              ClpDisjointCopyN(rowArray_[2]->denseVector(),numberRows_,
    19221897                                rowActivityWork_);
    19231898            }
     
    19271902          }
    19281903        }
    1929         CoinFillN(columnArray_[0]->denseVector(),numberColumns_,0.0);
    1930         CoinFillN(rowArray_[2]->denseVector(),numberRows_,0.0);
     1904        ClpFillN(columnArray_[0]->denseVector(),numberColumns_,0.0);
     1905        ClpFillN(rowArray_[2]->denseVector(),numberRows_,0.0);
    19311906      }
    19321907      if (problemStatus_==-4) {
  • branches/devel-1/ClpSimplexPrimal.cpp

    r27 r35  
    9898#include <stdio.h>
    9999#include <iostream>
    100 // This returns a non const array filled with input from scalar
    101 // or actual array
    102 template <class T> inline T*
    103 copyOfArray( const T * array, const int size, T value)
    104 {
    105   T * arrayNew = new T[size];
    106   if (array)
    107     CoinDisjointCopyN(array,size,arrayNew);
    108   else
    109     CoinFillN ( arrayNew, size,value);
    110   return arrayNew;
    111 }
    112 
    113 // This returns a non const array filled with actual array (or NULL)
    114 template <class T> inline T*
    115 copyOfArray( const T * array, const int size)
    116 {
    117   if (array) {
    118     T * arrayNew = new T[size];
    119     CoinDisjointCopyN(array,size,arrayNew);
    120     return arrayNew;
    121   } else {
    122     return NULL;
    123   }
    124 }
    125100// primal
    126101int ClpSimplexPrimal::primal (int ifValuesPass )
     
    605580            delete [] ray_;
    606581            ray_ = new double [numberColumns_];
    607             CoinFillN(ray_,numberColumns_,0.0);
     582            ClpFillN(ray_,numberColumns_,0.0);
    608583            int number=rowArray_[1]->getNumElements();
    609584            int * index = rowArray_[1]->getIndices();
  • branches/devel-1/Presolve.cpp

    r34 r35  
    428428
    429429    for (iLoop=0;iLoop<numberPasses_;iLoop++) {
     430#ifdef PRESOLVE_SUMMARY
    430431      printf("Starting major pass %d\n",iLoop+1);
     432#endif
    431433      const PresolveAction * const paction0 = paction_;
    432434      // look for substitutions with no fill
     
    535537      // now expensive things
    536538      // this caused world.mps to run into numerical difficulties
     539#ifdef PRESOLVE_SUMMARY
    537540      printf("Starting expensive\n");
     541#endif
    538542
    539543      if (dual) {
  • branches/devel-1/PresolveDoubleton.cpp

    r29 r35  
    779779#endif
    780780    action *actions1 = new action[nactions];
    781     CoinDisjointCopyN(actions, nactions, actions1);
     781    ClpDisjointCopyN(actions, nactions, actions1);
    782782
    783783    next = new doubleton_action(nactions, actions1, next);
  • branches/devel-1/PresolveMatrix.cpp

    r34 r35  
    292292  int nrows = si.getNumRows();
    293293
    294   CoinDisjointCopyN(si.getColLower(), ncols, clo_);
    295   CoinDisjointCopyN(si.getColUpper(), ncols, cup_);
    296   CoinDisjointCopyN(si.getObjCoefficients(), ncols, cost_);
    297   CoinDisjointCopyN(si.getRowLower(), nrows,  rlo_);
    298   CoinDisjointCopyN(si.getRowUpper(), nrows,  rup_);
     294  ClpDisjointCopyN(si.getColLower(), ncols, clo_);
     295  ClpDisjointCopyN(si.getColUpper(), ncols, cup_);
     296  ClpDisjointCopyN(si.getObjCoefficients(), ncols, cost_);
     297  ClpDisjointCopyN(si.getRowLower(), nrows,  rlo_);
     298  ClpDisjointCopyN(si.getRowUpper(), nrows,  rup_);
    299299  int i;
    300300  for (i=0;i<ncols_in;i++)
     
    455455  }
    456456  assert(mcstrt_[ncols_] == nelems_);
    457   CoinDisjointCopyN(m->getVectorLengths(),ncols_,  hincol_);
     457  ClpDisjointCopyN(m->getVectorLengths(),ncols_,  hincol_);
    458458
    459459  // same thing for row rep
     
    463463
    464464
    465   CoinDisjointCopyN(m->getVectorStarts(),  nrows_,  mrstrt_);
     465  ClpDisjointCopyN(m->getVectorStarts(),  nrows_,  mrstrt_);
    466466  mrstrt_[nrows_] = nelems_;
    467   CoinDisjointCopyN(m->getVectorLengths(), nrows_,  hinrow_);
    468   CoinDisjointCopyN(m->getIndices(),       nelems_, hcol_);
    469   CoinDisjointCopyN(m->getElements(),      nelems_, rowels_);
     467  ClpDisjointCopyN(m->getVectorLengths(), nrows_,  hinrow_);
     468  ClpDisjointCopyN(m->getIndices(),       nelems_, hcol_);
     469  ClpDisjointCopyN(m->getElements(),      nelems_, rowels_);
    470470
    471471  delete m;
     
    473473    memcpy(integerType_,si.integerInformation(),ncols_*sizeof(char));
    474474  } else {
    475     CoinFillN<char>(integerType_, ncols_, 0);
     475    ClpFillN<char>(integerType_, ncols_, 0);
    476476  }
    477477
     
    698698  const int nelemsr = m->getNumElements();
    699699
    700   CoinDisjointCopyN(m->getVectorStarts(), ncols1, mcstrt_);
     700  ClpDisjointCopyN(m->getVectorStarts(), ncols1, mcstrt_);
    701701  mcstrt_[ncols_] = nelems0;    // ??
    702   CoinDisjointCopyN(m->getVectorLengths(),ncols1,  hincol_);
    703   CoinDisjointCopyN(m->getIndices(),      nelemsr, hrow_);
    704   CoinDisjointCopyN(m->getElements(),     nelemsr, colels_);
     702  ClpDisjointCopyN(m->getVectorLengths(),ncols1,  hincol_);
     703  ClpDisjointCopyN(m->getIndices(),      nelemsr, hrow_);
     704  ClpDisjointCopyN(m->getElements(),     nelemsr, colels_);
    705705
    706706
     
    727727
    728728  rowduals_ = new double[nrows0_];
    729   CoinDisjointCopyN(si.getRowPrice(), nrows1, rowduals_);
     729  ClpDisjointCopyN(si.getRowPrice(), nrows1, rowduals_);
    730730
    731731  rcosts_ = new double[ncols0_];
    732   CoinDisjointCopyN(si.getReducedCost(), ncols1, rcosts_);
     732  ClpDisjointCopyN(si.getReducedCost(), ncols1, rcosts_);
    733733  if (maxmin_<0.0) {
    734734    // change so will look as if minimize
     
    741741  }
    742742
    743   //CoinDisjointCopyN(si.getRowUpper(), nrows1, rup_);
    744   //CoinDisjointCopyN(si.getRowLower(), nrows1, rlo_);
    745 
    746   CoinDisjointCopyN(si.getColSolution(), ncols1, sol_);
     743  //ClpDisjointCopyN(si.getRowUpper(), nrows1, rup_);
     744  //ClpDisjointCopyN(si.getRowLower(), nrows1, rlo_);
     745
     746  ClpDisjointCopyN(si.getColSolution(), ncols1, sol_);
    747747  si.setDblParam(ClpObjOffset,originalOffset_);
    748748
  • branches/devel-1/PresolveSingleton.cpp

    r31 r35  
    207207#endif
    208208    action *save_actions = new action[nactions];
    209     CoinDisjointCopyN(actions, nactions, save_actions);
     209    ClpDisjointCopyN(actions, nactions, save_actions);
    210210    next = new slack_doubleton_action(nactions, save_actions, next);
    211211
  • branches/devel-1/PresolveZeros.cpp

    r29 r35  
    124124
    125125    dropped_zero *zeros1 = new dropped_zero[nzeros];
    126     CoinDisjointCopyN(zeros, nzeros, zeros1);
     126    ClpDisjointCopyN(zeros, nzeros, zeros1);
    127127
    128128    delete [] zeros;
  • branches/devel-1/include/ClpParameters.hpp

    r19 r35  
    1 // Copyright (C) 2000, International Business Machines
     1// Copyright (C) 2000, 2002, International Business Machines
    22// Corporation and others.  All Rights Reserved.
    33
     
    55#define _ClpParameters_H
    66
     7/** This is where to put any useful stuff.
     8
     9*/
    710enum ClpIntParam {
    811   /** The maximum number of iterations Clp can execute in the simplex methods
     
    5053};
    5154
     55/// Copy (I don't like complexity of Coin version)
     56template <class T> inline void
     57ClpDisjointCopyN( const T * array, const int size, T * newArray)
     58{
     59  memcpy(newArray,array,size*sizeof(T));
     60}
     61/// And set
     62template <class T> inline void
     63ClpFillN( T * array, const int size, T value)
     64{
     65  int i;
     66  for (i=0;i<size;i++)
     67    array[i]=value;
     68}
     69/// This returns a non const array filled with input from scalar or actual array
     70template <class T> inline T*
     71ClpCopyOfArray( const T * array, const int size, T value)
     72{
     73  T * arrayNew = new T[size];
     74  if (array)
     75    ClpDisjointCopyN(array,size,arrayNew);
     76  else
     77    ClpFillN ( arrayNew, size,value);
     78  return arrayNew;
     79}
     80
     81/// This returns a non const array filled with actual array (or NULL)
     82template <class T> inline T*
     83ClpCopyOfArray( const T * array, const int size)
     84{
     85  if (array) {
     86    T * arrayNew = new T[size];
     87    ClpDisjointCopyN(array,size,arrayNew);
     88    return arrayNew;
     89  } else {
     90    return NULL;
     91  }
     92}
    5293#endif
Note: See TracChangeset for help on using the changeset viewer.