Changeset 199 for branches


Ignore:
Timestamp:
Aug 18, 2003 4:19:21 AM (16 years ago)
Author:
forrest
Message:

Fixes

Location:
branches/pre
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/pre/ClpMatrixBase.cpp

    r180 r199  
    5656                     const double * columnScale) const
    5757{
    58   std::cerr<<"Scaling not supported - ClpMatrixBase"<<std::endl;
    59   abort();
     58  if (rowScale) {
     59    std::cerr<<"Scaling not supported - ClpMatrixBase"<<std::endl;
     60    abort();
     61  } else {
     62    times(scalar,x,y);
     63  }
    6064}
    6165// And for scaling - default aborts for when scaling not supported
     
    6670                                const double * columnScale) const
    6771{
    68   std::cerr<<"Scaling not supported - ClpMatrixBase"<<std::endl;
    69   abort();
     72  if (rowScale) {
     73    std::cerr<<"Scaling not supported - ClpMatrixBase"<<std::endl;
     74    abort();
     75  } else {
     76    transposeTimes(scalar,x,y);
     77  }
    7078}
    7179/* Subset clone (without gaps).  Duplicates are allowed
  • branches/pre/ClpModel.cpp

    r196 r199  
    12221222}
    12231223void
    1224 ClpModel::setObjective(const ClpObjective * objective)
     1224ClpModel::setObjective(ClpObjective * objective)
    12251225{
    12261226  delete objective_;
  • branches/pre/ClpPackedMatrix.cpp

    r180 r199  
    1111#include "ClpSimplex.hpp"
    1212#include "ClpFactorization.hpp"
     13#include "ClpQuadraticObjective.hpp"
    1314// at end to get min/max!
    1415#include "ClpPackedMatrix.hpp"
     
    189190                       const double * columnScale) const
    190191{
    191   int iRow,iColumn;
    192   // get matrix data pointers
    193   const int * row = matrix_->getIndices();
    194   const CoinBigIndex * columnStart = matrix_->getVectorStarts();
    195   const int * columnLength = matrix_->getVectorLengths();
    196   const double * elementByColumn = matrix_->getElements();
    197   int numberColumns = matrix_->getNumCols();
    198   //memset(y,0,matrix_->getNumRows()*sizeof(double));
    199   for (iColumn=0;iColumn<numberColumns;iColumn++) {
    200     CoinBigIndex j;
    201     double value = x[iColumn];
    202     if (value) {
    203       // scaled
    204       value *= scalar*columnScale[iColumn];
    205       for (j=columnStart[iColumn];
    206            j<columnStart[iColumn]+columnLength[iColumn];j++) {
    207         iRow=row[j];
    208         y[iRow] += value*elementByColumn[j];
    209       }
    210     }
    211   }
    212   int numberRows = getNumRows();
    213   for (iRow=0;iRow<numberRows;iRow++) {
    214     y[iRow] *= rowScale[iRow];
     192  if (rowScale) {
     193    int iRow,iColumn;
     194    // get matrix data pointers
     195    const int * row = matrix_->getIndices();
     196    const CoinBigIndex * columnStart = matrix_->getVectorStarts();
     197    const int * columnLength = matrix_->getVectorLengths();
     198    const double * elementByColumn = matrix_->getElements();
     199    int numberColumns = matrix_->getNumCols();
     200    //memset(y,0,matrix_->getNumRows()*sizeof(double));
     201    for (iColumn=0;iColumn<numberColumns;iColumn++) {
     202      CoinBigIndex j;
     203      double value = x[iColumn];
     204      if (value) {
     205        // scaled
     206        value *= scalar*columnScale[iColumn];
     207        for (j=columnStart[iColumn];
     208             j<columnStart[iColumn]+columnLength[iColumn];j++) {
     209          iRow=row[j];
     210          y[iRow] += value*elementByColumn[j];
     211        }
     212      }
     213    }
     214    int numberRows = getNumRows();
     215    for (iRow=0;iRow<numberRows;iRow++) {
     216      y[iRow] *= rowScale[iRow];
     217    }
     218  } else {
     219    times(scalar,x,y);
    215220  }
    216221}
     
    221226                                 const double * columnScale) const
    222227{
    223   int iColumn;
    224   // get matrix data pointers
    225   const int * row = matrix_->getIndices();
    226   const CoinBigIndex * columnStart = matrix_->getVectorStarts();
    227   const int * columnLength = matrix_->getVectorLengths();
    228   const double * elementByColumn = matrix_->getElements();
    229   int numberColumns = matrix_->getNumCols();
    230   //memset(y,0,numberColumns*sizeof(double));
    231   for (iColumn=0;iColumn<numberColumns;iColumn++) {
    232     CoinBigIndex j;
    233     double value=0.0;
    234     // scaled
    235     for (j=columnStart[iColumn];
    236          j<columnStart[iColumn]+columnLength[iColumn];j++) {
    237       int jRow=row[j];
     228  if (rowScale) {
     229    int iColumn;
     230    // get matrix data pointers
     231    const int * row = matrix_->getIndices();
     232    const CoinBigIndex * columnStart = matrix_->getVectorStarts();
     233    const int * columnLength = matrix_->getVectorLengths();
     234    const double * elementByColumn = matrix_->getElements();
     235    int numberColumns = matrix_->getNumCols();
     236    //memset(y,0,numberColumns*sizeof(double));
     237    for (iColumn=0;iColumn<numberColumns;iColumn++) {
     238      CoinBigIndex j;
     239      double value=0.0;
     240      // scaled
     241      for (j=columnStart[iColumn];
     242           j<columnStart[iColumn]+columnLength[iColumn];j++) {
     243        int jRow=row[j];
    238244      value += x[jRow]*elementByColumn[j]*rowScale[jRow];
    239     }
    240     y[iColumn] += value*scalar*columnScale[iColumn];
     245      }
     246      y[iColumn] += value*scalar*columnScale[iColumn];
     247    }
     248  } else {
     249    transposeTimes(scalar,x,y);
    241250  }
    242251}
     
    12441253    delete [] usefulRow;
    12451254    delete [] usefulColumn;
     1255    // If quadratic then make symmetric
     1256    ClpObjective * obj = model->objectiveAsObject();
     1257    ClpQuadraticObjective * quadraticObj = (dynamic_cast< ClpQuadraticObjective*>(obj));
     1258    if (quadraticObj) {
     1259      CoinPackedMatrix * quadratic = quadraticObj->quadraticObjective();
     1260      int numberXColumns = quadratic->getNumCols();
     1261      int numberXRows = numberRows-numberXColumns;
     1262      if (numberXColumns<numberColumns) {
     1263        int i;
     1264        for (i=0;i<numberXColumns;i++)
     1265          rowScale[i+numberXRows] = columnScale[i];
     1266        for (i=0;i<numberXRows;i++)
     1267          columnScale[i+numberXColumns] = rowScale[i];
     1268        // and make sure Sj okay
     1269        for (iColumn=numberRows;iColumn<numberColumns;iColumn++) {
     1270          CoinBigIndex j=columnStart[iColumn];
     1271          assert(columnLength[iColumn]==1);
     1272          int iRow=row[j];
     1273          double value = fabs(elementByColumn[j]*rowScale[iRow]);
     1274          columnScale[iColumn]=1.0/value;
     1275        }
     1276      }
     1277    }
    12461278    model->setRowScale(rowScale);
    12471279    model->setColumnScale(columnScale);
  • branches/pre/ClpQuadraticObjective.cpp

    r197 r199  
    2121  gradient_ = NULL;
    2222  numberColumns_=0;
     23  numberExtendedColumns_=0;
    2324}
    2425
     
    2930                                              int numberColumns,
    3031                                              const CoinBigIndex * start,
    31                                               const int * column, const double * element)
     32                                              const int * column, const double * element,
     33                                              int numberExtendedColumns)
    3234  : ClpObjective()
    3335{
    3436  type_=2;
    3537  numberColumns_ = numberColumns;
     38  if (numberExtendedColumns>=0)
     39    numberExtendedColumns_= max(numberColumns_,numberExtendedColumns);
     40  else
     41    numberExtendedColumns_= numberColumns_;
    3642  if (objective) {
    37     objective_ = new double [numberColumns_];
     43    objective_ = new double [numberExtendedColumns_];
    3844    memcpy(objective_,objective,numberColumns_*sizeof(double));
    39   } else {
    40     objective_ = new double [numberColumns_];
    41     memset(objective_,0,numberColumns_*sizeof(double));
     45    memset(objective_+numberColumns_,0,(numberExtendedColumns_-numberColumns_)*sizeof(double));
     46  } else {
     47    objective_ = new double [numberExtendedColumns_];
     48    memset(objective_,0,numberExtendedColumns_*sizeof(double));
    4249  }
    4350  if (start)
     
    5663
    5764  numberColumns_=rhs.numberColumns_;
     65  numberExtendedColumns_=rhs.numberExtendedColumns_;
    5866  if (rhs.objective_) {
    59     objective_ = new double [numberColumns_];
    60     memcpy(objective_,rhs.objective_,numberColumns_*sizeof(double));
     67    objective_ = new double [numberExtendedColumns_];
     68    memcpy(objective_,rhs.objective_,numberExtendedColumns_*sizeof(double));
    6169  } else {
    6270    objective_=NULL;
    6371  }
    6472  if (rhs.gradient_) {
    65     gradient_ = new double [numberColumns_];
    66     memcpy(gradient_,rhs.gradient_,numberColumns_*sizeof(double));
     73    gradient_ = new double [numberExtendedColumns_];
     74    memcpy(gradient_,rhs.gradient_,numberExtendedColumns_*sizeof(double));
    6775  } else {
    6876    gradient_=NULL;
     
    8290{
    8391  objective_=NULL;
     92  int extra = rhs.numberExtendedColumns_-rhs.numberColumns_;
    8493  numberColumns_=0;
    8594  if (numberColumns>0) {
     
    94103                      "ClpQuadraticObjective");
    95104    numberColumns_ = numberColumns;
    96     objective_ = new double[numberColumns_];
     105    numberExtendedColumns_ = numberColumns+extra;
     106    objective_ = new double[numberExtendedColumns_];
    97107    for (i=0;i<numberColumns_;i++)
    98108      objective_[i]=rhs.objective_[whichColumn[i]];
     109    memcpy(objective_+numberColumns_,rhs.objective_+rhs.numberColumns_,
     110           (numberExtendedColumns_-numberColumns_)*sizeof(double));
    99111    if (rhs.gradient_) {
    100       gradient_ = new double[numberColumns_];
     112      gradient_ = new double[numberExtendedColumns_];
    101113      for (i=0;i<numberColumns_;i++)
    102114        gradient_[i]=rhs.gradient_[whichColumn[i]];
     115      memcpy(gradient_+numberColumns_,rhs.gradient_+rhs.numberColumns_,
     116             (numberExtendedColumns_-numberColumns_)*sizeof(double));
    103117    }
    104118  }
     
    134148    ClpObjective::operator=(rhs);
    135149    numberColumns_=rhs.numberColumns_;
     150    numberExtendedColumns_=rhs.numberExtendedColumns_;
    136151    if (rhs.objective_) {
    137       objective_ = new double [numberColumns_];
    138       memcpy(objective_,rhs.objective_,numberColumns_*sizeof(double));
     152      objective_ = new double [numberExtendedColumns_];
     153      memcpy(objective_,rhs.objective_,numberExtendedColumns_*sizeof(double));
    139154    } else {
    140155      objective_=NULL;
    141156    }
    142157    if (rhs.gradient_) {
    143       gradient_ = new double [numberColumns_];
    144       memcpy(gradient_,rhs.gradient_,numberColumns_*sizeof(double));
     158      gradient_ = new double [numberExtendedColumns_];
     159      memcpy(gradient_,rhs.gradient_,numberExtendedColumns_*sizeof(double));
    145160    } else {
    146161      gradient_=NULL;
     
    164179  } else {
    165180    if (!gradient_)
    166       gradient_ = new double[numberColumns_];
     181      gradient_ = new double[numberExtendedColumns_];
    167182    const int * columnQuadratic = quadraticObjective_->getIndices();
    168183    const int * columnQuadraticStart = quadraticObjective_->getVectorStarts();
     
    170185    const double * quadraticElement = quadraticObjective_->getElements();
    171186    double offset=0.0;
    172     memcpy(gradient_,objective_,numberColumns_*sizeof(double));
     187    memcpy(gradient_,objective_,numberExtendedColumns_*sizeof(double));
    173188    int iColumn;
    174189    for (iColumn=0;iColumn<numberColumns_;iColumn++) {
     
    215230{
    216231  if (numberColumns_!=newNumberColumns) {
     232    int newExtended = newNumberColumns + (numberExtendedColumns_-numberColumns_);
    217233    int i;
    218     double * newArray = new double[newNumberColumns];
     234    double * newArray = new double[newExtended];
    219235    if (objective_)
    220236      memcpy(newArray,objective_,
    221              min(newNumberColumns,numberColumns_)*sizeof(double));
     237             min(newExtended,numberExtendedColumns_)*sizeof(double));
    222238    delete [] objective_;
    223239    objective_ = newArray;
     
    225241      objective_[i]=0.0;
    226242    if (gradient_) {
    227       newArray = new double[newNumberColumns];
     243      newArray = new double[newExtended];
    228244      if (gradient_)
    229245        memcpy(newArray,gradient_,
    230                min(newNumberColumns,numberColumns_)*sizeof(double));
     246               min(newExtended,numberExtendedColumns_)*sizeof(double));
    231247      delete [] gradient_;
    232248      gradient_ = newArray;
     
    248264    }
    249265    numberColumns_ = newNumberColumns;
     266    numberExtendedColumns_ = newExtended;
    250267  }
    251268 
     
    255272ClpQuadraticObjective::deleteSome(int numberToDelete, const int * which)
    256273{
     274  int newNumberColumns = numberColumns_-numberToDelete;
     275  int newExtended = numberExtendedColumns_ - numberToDelete;
    257276  if (objective_) {
    258277    int i ;
     
    267286      }
    268287    }
    269     int newNumberColumns = numberColumns_-numberDeleted;
    270     double * newArray = new double[newNumberColumns];
     288    newNumberColumns = numberColumns_-numberDeleted;
     289    newExtended = numberExtendedColumns_ - numberDeleted;
     290    double * newArray = new double[newExtended];
    271291    int put=0;
    272292    for (i=0;i<numberColumns_;i++) {
     
    278298    objective_ = newArray;
    279299    delete [] deleted;
    280     numberColumns_ = newNumberColumns;
     300    memcpy(objective_+newNumberColumns,objective_+numberColumns_,
     301           (numberExtendedColumns_-numberColumns_)*sizeof(double));
    281302  }
    282303  if (gradient_) {
     
    292313      }
    293314    }
    294     int newNumberColumns = numberColumns_-numberDeleted;
    295     double * newArray = new double[newNumberColumns];
     315    newNumberColumns = numberColumns_-numberDeleted;
     316    newExtended = numberExtendedColumns_ - numberDeleted;
     317    double * newArray = new double[newExtended];
    296318    int put=0;
    297319    for (i=0;i<numberColumns_;i++) {
     
    303325    gradient_ = newArray;
    304326    delete [] deleted;
    305     numberColumns_ = newNumberColumns;
    306   }
     327    memcpy(gradient_+newNumberColumns,gradient_+numberColumns_,
     328           (numberExtendedColumns_-numberColumns_)*sizeof(double));
     329  }
     330  numberColumns_ = newNumberColumns;
     331  numberExtendedColumns_ = newExtended;
    307332  if (quadraticObjective_) {
    308333    quadraticObjective_->deleteCols(numberToDelete,which);
     
    314339void
    315340ClpQuadraticObjective::loadQuadraticObjective(const int numberColumns, const CoinBigIndex * start,
    316                               const int * column, const double * element)
     341                              const int * column, const double * element,int numberExtended)
    317342{
    318343  delete quadraticObjective_;
    319344  quadraticObjective_ = new CoinPackedMatrix(true,numberColumns,numberColumns,
    320345                                             start[numberColumns],element,column,start,NULL);
     346  numberColumns_=numberColumns;
     347  if (numberExtended>numberExtendedColumns_) {
     348    if (objective_) {
     349      // make correct size
     350      double * newArray = new double[numberExtended];
     351      memcpy(newArray,objective_,numberColumns_*sizeof(double));
     352      delete [] objective_;
     353      objective_ = newArray;
     354      memset(objective_+numberColumns_,0,(numberExtended-numberColumns_)*sizeof(double));
     355    }
     356    if (gradient_) {
     357      // make correct size
     358      double * newArray = new double[numberExtended];
     359      memcpy(newArray,gradient_,numberColumns_*sizeof(double));
     360      delete [] gradient_;
     361      gradient_ = newArray;
     362      memset(gradient_+numberColumns_,0,(numberExtended-numberColumns_)*sizeof(double));
     363    }
     364    numberExtendedColumns_ = numberExtended;
     365  } else {
     366    numberExtendedColumns_ = numberColumns_;
     367  }
    321368}
    322369void
  • branches/pre/ClpSimplex.cpp

    r196 r199  
    32983298    <<smallestObj
    32993299    <<largestObj
    3300     <<CoinMessageEol;
    3301   if (largestBound)
     3300    <<CoinMessageEol;  if (largestBound)
    33023301    handler_->message(CLP_RIMSTATISTICS2,messages_)
    33033302      <<smallestBound
  • branches/pre/ClpSimplexPrimalQuadratic.cpp

    r197 r199  
    527527  //const int * back = info->backSequence();
    528528  // initialize - values pass coding and algorithm_ is +1
     529  // for moment just set objective for a bit
     530  ClpObjective * saveObj = objectiveAsObject();
     531  setObjectivePointer(info->originalObjective());
    529532  if (!startup(1)) {
    530533
     534    setObjectivePointer(saveObj);
    531535    // Setup useful stuff
    532536    info->setCurrentPhase(phase);
     
    561565        for (j=0;j<number;j++) {
    562566          int iColumn2 = columnsInThisColumn[j];
    563           newElement[j] = elementsInThisColumn[j]*scale*columnScale_[iColumn2];
     567          newElement[j] = elementsInThisColumn[j]*scale*rowScale_[iColumn2+numberXRows];
    564568        }
    565569        quadratic->replaceVector(iColumn,number,newElement);
     
    721725    }
    722726  }
     727  setObjectivePointer(saveObj);
    723728  // clean up
    724729  finish();
     
    817822      } else {
    818823        saveSequenceIn=sequenceIn_;
    819         createDjs(info,rowArray_[1],rowArray_[2]);
     824        createDjs(info,rowArray_[3],rowArray_[2]);
    820825        dualIn_=0.0; // so no updates
    821826        primalColumn(rowArray_[1],rowArray_[2],rowArray_[3],
     
    843848      // do second half of iteration
    844849      while (chosen>=0) {
     850        rowArray_[1]->clear();
    845851        checkComplementarity (info,rowArray_[3],rowArray_[1]);
    846852        printf("True objective is %g, infeas cost %g, sum %g\n",
     
    850856        pivotRow_=-1;
    851857        sequenceOut_=-1;
    852         rowArray_[1]->clear();
    853858        // we found a pivot column
    854859        // update the incoming column
     
    13821387      rhs[iPivot]=alpha;
    13831388      coeff1 += alpha*cost_[iPivot];
    1384       //printf("col %d alpha %g solution %g\n",iPivot,alpha,solution_[iPivot]);
     1389      //printf("col %d alpha %g solution %g cost %g scale %g\n",iPivot,alpha,solution_[iPivot],
     1390      //     cost_[iPivot],columnScale_[iPivot]);
    13851391    } else {
    13861392      if (iPivot>=numberColumns_) {
     
    14081414    index2[number2++]=sequenceIn_;
    14091415    rhs[sequenceIn_]=way;
    1410     //printf("incoming col %d alpha %g solution %g\n",sequenceIn_,way,valueIn_);
     1416    //printf("incoming col %d alpha %g solution %g cost %g scale %g\n",sequenceIn_,way,valueIn_,
     1417    //   cost_[sequenceIn_],columnScale_[sequenceIn_]);
    14111418    coeff1 += way*cost_[sequenceIn_];
    14121419  } else {
     
    14141421    coeffSlack += way*cost_[sequenceIn_];
    14151422  }
     1423  printf("coeff1 now %g\n",coeff1);
    14161424  rhsArray->setNumElements(number2);
     1425  double largestCoeff1=1.0e-20;
    14171426  for (iIndex=0;iIndex<number2;iIndex++) {
    14181427    int iColumn=index2[iIndex];
     
    14261435      double alphaJ = rhs[jColumn];
    14271436      double elementValue = quadraticElement[j];
    1428       coeff1 += (valueJ*alphaI)*elementValue;
     1437      double addValue = (valueJ*alphaI)*elementValue;
     1438      largestCoeff1 = max(largestCoeff1,fabs(addValue));
     1439      coeff1 += addValue;
    14291440      coeff2 += (alphaI*alphaJ)*elementValue;
    14301441    }
     
    14411452      coeff1=0.0;
    14421453    }
     1454    if (fabs(way*coeff1-dualIn_)>1.0e-2*(1.0+fabs(dualIn_)))
     1455      printf("primal error %g, largest %g, coeff1 %g, dualin %g\n",
     1456             largestPrimalError_,largestCoeff1,way*coeff1,dualIn_);
    14431457    assert (fabs(way*coeff1-dualIn_)<1.0e-1*(1.0+fabs(dualIn_)));
    14441458    assert (way*coeff1*dualIn_>=0.0);
     
    15121526  double upperTheta = maximumMovement;
    15131527  bool throwAway=false;
    1514   if (numberIterations_==106) {
     1528  if (numberIterations_==1395) {
    15151529    printf("Bad iteration coming up after iteration %d\n",numberIterations_);
    15161530  }
     
    15891603   
    15901604    while (tentativeTheta <= maximumMovement) {
     1605      double bestPivotBeforeInteresting=0.0;
    15911606      double thruThis = 0.0;
    15921607     
     
    16241639     
    16251640      maximumSwapped = max(maximumSwapped,numberSwapped);
     1641      bestPivotBeforeInteresting=bestPivot;
    16261642
    16271643      //double dualCheck = - 2.0*coeff2*tentativeTheta - coeff1 - 0.1*infeasibilityCost_;
     
    17101726          } else {
    17111727            dualCheck = - 2.0*coeff2*theta_ - coeff1;
     1728            if (bestPivotBeforeInteresting>1.0e-4&&bestPivot<1.0e-6)
     1729              dualCheck=1.0e7;
    17121730            if ((totalThru>=dualCheck||fake*bestPivot>1.0e-3)
    17131731                &&(sequenceIn_<numberXColumns||sequenceIn_>=numberColumns_)) {
     
    23812399        solution_[iRow+numberXColumns]=0.0;
    23822400    }
    2383     times(-1.0,columnActivityWork_,modifiedCost);
     2401    matrix_->times(-1.0,columnActivityWork_,modifiedCost,rowScale_,columnScale_);
    23842402   
    23852403    int number=0;
     
    24472465    }
    24482466    // check looks okay
    2449     matrix_->times(1.0,solution_,modifiedCost);
     2467    matrix_->times(1.0,solution_,modifiedCost,rowScale_,columnScale_);
    24502468    // Back to pi
    24512469    for (iRow=0;iRow<numberXRows;iRow++) {
     
    24692487  // fill in linear ones
    24702488  memcpy(dj_,cost_,numberXColumns*sizeof(double));
    2471   if (!rowScale_) {
    2472     matrix_->transposeTimes(-1.0,pi,dj_);
    2473   } else {
    2474     matrix_->transposeTimes(-1.0,pi,dj_,rowScale_,columnScale_);
    2475   }
     2489  matrix_->transposeTimes(-1.0,pi,dj_,rowScale_,columnScale_);
    24762490  memset(dj_+numberXColumns,0,(numberXRows+info->numberQuadraticColumns())*sizeof(double));
    24772491  for (iSequence=0;iSequence<numberXColumns;iSequence++) {
     
    29092923  }
    29102924  // and pad
    2911   for (;iColumn<newNumberColumns;iColumn++)
    2912     start2[iColumn+1]=numberElements;
    2913   // Load up objective
     2925  //for (;iColumn<newNumberColumns;iColumn++)
     2926  //start2[iColumn+1]=numberElements;
     2927  // Load up objective with expanded linear
    29142928  ClpQuadraticObjective * obj =
    2915     new ClpQuadraticObjective(objective2,newNumberColumns,
    2916                               start2,row2,elements2);
     2929    new ClpQuadraticObjective(objective2,numberColumns,
     2930                              start2,row2,elements2,newNumberColumns);
    29172931  delete [] objective2;
    29182932  info.setOriginalObjective(obj);
     
    29222936  delete [] elements2;
    29232937  model2->allSlackBasis();
    2924   model2->scaling(false);
     2938  //model2->scaling(false);
    29252939  model2->setLogLevel(this->logLevel());
    29262940  // Move solution across
  • branches/pre/Makefile.Clp

    r196 r199  
    66# between then specify the exact level you want, e.g., -O1 or -O2
    77OptLevel := -g
    8 OptLevel := -O3
     8#OptLevel := -O3
    99
    1010
  • branches/pre/Test/unitTest.cpp

    r196 r199  
    936936  }
    937937  // test network
    938   //#define QUADRATIC
     938#define QUADRATIC
    939939#ifndef QUADRATIC
    940940  if (1) {   
  • branches/pre/include/ClpMatrixBase.hpp

    r180 r199  
    131131  virtual void times(double scalar,
    132132                       const double * x, double * y) const=0;
    133   /// And for scaling - default aborts for when scaling not supported
     133  /** And for scaling - default aborts for when scaling not supported
     134      (unless pointers NULL when as normal)
     135  */
    134136  virtual void times(double scalar,
    135137                     const double * x, double * y,
     
    141143    virtual void transposeTimes(double scalar,
    142144                                const double * x, double * y) const = 0;
    143   /// And for scaling - default aborts for when scaling not supported
    144     virtual void transposeTimes(double scalar,
     145  /** And for scaling - default aborts for when scaling not supported
     146      (unless pointers NULL when as normal)
     147  */
     148  virtual void transposeTimes(double scalar,
    145149                                const double * x, double * y,
    146150                                const double * rowScale,
  • branches/pre/include/ClpModel.hpp

    r196 r199  
    369369  inline ClpObjective * objectiveAsObject() const
    370370  { return objective_;};
    371   void setObjective(const ClpObjective * objective);
     371  void setObjective(ClpObjective * objective);
     372  void setObjectivePointer(ClpObjective * objective)
     373  { objective_ = objective;};
    372374  //@}
    373375
  • branches/pre/include/ClpQuadraticObjective.hpp

    r197 r199  
    3939  /// Constructor from objective
    4040  ClpQuadraticObjective(const double * linearObjective, int numberColumns,
    41                               const CoinBigIndex * start,
    42                               const int * column, const double * element);
     41                        const CoinBigIndex * start,
     42                        const int * column, const double * element,
     43                        int numberExtendedColumns_=-1);
    4344 
    4445  /// Copy constructor
     
    6768  void loadQuadraticObjective(const int numberColumns,
    6869                              const CoinBigIndex * start,
    69                               const int * column, const double * element);
     70                              const int * column, const double * element,
     71                              int numberExtendedColumns=-1);
    7072  void loadQuadraticObjective (  const CoinPackedMatrix& matrix);
    7173  /// Get rid of quadratic objective
     
    7880   /// Linear objective
    7981   inline double * linearObjective() const     { return objective_; }
     82  /// Length of linear objective which could be bigger
     83  inline int numberExtendedColumns() const
     84  {return numberExtendedColumns_;};
     85  /// Number of columns in quadratic objective
     86  inline int numberColumns() const
     87  {return numberColumns_;};
    8088  //@}
    8189
     
    92100  /// Useful to have number of columns about
    93101  int numberColumns_;
     102  /// Also length of linear objective which could be bigger
     103  int numberExtendedColumns_;
    94104  //@}
    95105};
  • branches/pre/include/ClpSimplexPrimalQuadratic.hpp

    r196 r199  
    166166  {return backSequence_;};
    167167  /// Returns pointer to original objective
    168   inline const ClpQuadraticObjective * originalObjective() const
     168  inline ClpQuadraticObjective * originalObjective() const
    169169  { return originalObjective_;};
    170170  inline void setOriginalObjective( ClpQuadraticObjective * obj)
     
    192192  //@{
    193193  /// Objective
    194   const ClpQuadraticObjective * originalObjective_;
     194  ClpQuadraticObjective * originalObjective_;
    195195  /// Quadratic sequence
    196196  int * quadraticSequence_;
Note: See TracChangeset for help on using the changeset viewer.