Ignore:
Timestamp:
Jan 14, 2009 4:14:09 PM (11 years ago)
Author:
forrest
Message:

out compiler warnings and stability improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/ClpModel.cpp

    r1314 r1321  
    192192{
    193193  if (!savedRowScale_) {
    194     delete [] (double *) rowScale_;
     194    delete [] reinterpret_cast<double *> (rowScale_);
    195195    rowScale_ = scale;
    196196  } else {
     
    203203{
    204204  if (!savedColumnScale_) {
    205     delete [] (double *) columnScale_;
     205    delete [] reinterpret_cast<double *> (columnScale_);
    206206    columnScale_ = scale;
    207207  } else {
     
    330330    matrix_=new ClpPackedMatrix(matrix);
    331331    if (special) {
    332       clpMatrix = dynamic_cast< ClpPackedMatrix*>(matrix_);
     332      clpMatrix = static_cast< ClpPackedMatrix*>(matrix_);
    333333      clpMatrix->makeSpecialColumnCopy();
    334334    }
     
    406406  gutsOfLoadModel(numberRows, numberColumns,
    407407                  columnLower, columnUpper, objective, rowLower, rowUpper, NULL);
     408  setObjectiveOffset(modelObject.objectiveOffset());
    408409  CoinBigIndex * startPositive = NULL;
    409410  CoinBigIndex * startNegative = NULL;
     
    14091410    if (status_) {
    14101411      if (numberColumns_+newSize) {
    1411         unsigned char * tempR  = (unsigned char *) deleteChar((char *)status_+numberColumns_,
    1412                                                               numberRows_,
    1413                                                               number, which, newSize,false);
     1412        unsigned char * tempR  = reinterpret_cast<unsigned char *>
     1413          (deleteChar(reinterpret_cast<char *>(status_)+numberColumns_,
     1414                      numberRows_,
     1415                      number, which, newSize,false));
    14141416        unsigned char * tempC = new unsigned char [numberColumns_+newSize];
    14151417        CoinMemcpyN(status_,numberColumns_,tempC);
     
    15191521  if (status_) {
    15201522    if (numberRows_+newSize) {
    1521       unsigned char * tempC  = (unsigned char *) deleteChar((char *)status_,
    1522                                                             numberColumns_,
    1523                                                             number, which, newSize,false);
     1523      unsigned char * tempC  = reinterpret_cast<unsigned char *>
     1524        (deleteChar(reinterpret_cast<char *>(status_),
     1525                    numberColumns_,
     1526                    number, which, newSize,false));
    15241527      unsigned char * temp = new unsigned char [numberRows_+newSize];
    15251528      CoinMemcpyN(tempC,newSize,temp);
     
    27512754      for (iRow=0;iRow<numberRows_;iRow++) {
    27522755        const char * name = m.rowName(iRow);
    2753         maxLength = CoinMax(maxLength,(unsigned int) strlen(name));
     2756        maxLength = CoinMax(maxLength,static_cast<unsigned int> (strlen(name)));
    27542757          rowNames_.push_back(name);
    27552758      }
     
    27592762      for (iColumn=0;iColumn<numberColumns_;iColumn++) {
    27602763        const char * name = m.columnName(iColumn);
    2761         maxLength = CoinMax(maxLength,(unsigned int) strlen(name));
     2764        maxLength = CoinMax(maxLength,static_cast<unsigned int> (strlen(name)));
    27622765        columnNames_.push_back(name);
    27632766      }
    2764       lengthNames_=(int) maxLength;
     2767      lengthNames_=static_cast<int> (maxLength);
    27652768    } else {
    27662769      lengthNames_=0;
     
    28352838      for (iRow=0;iRow<numberRows_;iRow++) {
    28362839        const char * name = m.rowName(iRow);
    2837         maxLength = CoinMax(maxLength,(unsigned int) strlen(name));
     2840        maxLength = CoinMax(maxLength,static_cast<unsigned int> (strlen(name)));
    28382841          rowNames_.push_back(name);
    28392842      }
     
    28432846      for (iColumn=0;iColumn<numberColumns_;iColumn++) {
    28442847        const char * name = m.columnName(iColumn);
    2845         maxLength = CoinMax(maxLength,(unsigned int) strlen(name));
     2848        maxLength = CoinMax(maxLength,static_cast<unsigned int> (strlen(name)));
    28462849        columnNames_.push_back(name);
    28472850      }
    2848       lengthNames_=(int) maxLength;
     2851      lengthNames_=static_cast<int> (maxLength);
    28492852    } else {
    28502853      lengthNames_=0;
     
    31683171    for (iRow=0;iRow<numberRows_;iRow++) {
    31693172      rowNames_.push_back(rhs->rowNames_[whichRow[iRow]]);
    3170       maxLength = CoinMax(maxLength,(unsigned int) strlen(rowNames_[iRow].c_str()));
     3173      maxLength = CoinMax(maxLength,static_cast<unsigned int> (strlen(rowNames_[iRow].c_str())));
    31713174    }
    31723175    int iColumn;
     
    31743177    for (iColumn=0;iColumn<numberColumns_;iColumn++) {
    31753178      columnNames_.push_back(rhs->columnNames_[whichColumn[iColumn]]);
    3176       maxLength = CoinMax(maxLength,(unsigned int) strlen(columnNames_[iColumn].c_str()));
    3177     }
    3178     lengthNames_=(int) maxLength;
     3179      maxLength = CoinMax(maxLength,static_cast<unsigned int> (strlen(columnNames_[iColumn].c_str())));
     3180    }
     3181    lengthNames_=static_cast<int> (maxLength);
    31793182  } else {
    31803183    lengthNames_ = 0;
     
    32523255  for (iRow=0;iRow<numberRows_;iRow++) {
    32533256    rowNames_.push_back(rowNames[iRow]);
    3254     maxLength = CoinMax(maxLength,(unsigned int) strlen(rowNames_[iRow].c_str()));
     3257    maxLength = CoinMax(maxLength,static_cast<unsigned int> (strlen(rowNames_[iRow].c_str())));
    32553258  }
    32563259  int iColumn;
     
    32583261  for (iColumn=0;iColumn<numberColumns_;iColumn++) {
    32593262    columnNames_.push_back(columnNames[iColumn]);
    3260     maxLength = CoinMax(maxLength,(unsigned int) strlen(columnNames_[iColumn].c_str()));
    3261   }
    3262   lengthNames_=(int) maxLength;
     3263    maxLength = CoinMax(maxLength,static_cast<unsigned int> (strlen(columnNames_[iColumn].c_str())));
     3264  }
     3265  lengthNames_=static_cast<int> (maxLength);
    32633266}
    32643267// Return name or Rnnnnnnn
     
    32953298    rowNames_.resize(iRow+1);
    32963299  rowNames_[iRow]= name;
    3297   maxLength = CoinMax(maxLength,(unsigned int) strlen(name.c_str()));
     3300  maxLength = CoinMax(maxLength,static_cast<unsigned int> (strlen(name.c_str())));
    32983301  // May be too big - but we would have to check both rows and columns to be exact
    3299   lengthNames_=(int) maxLength;
     3302  lengthNames_=static_cast<int> (maxLength);
    33003303}
    33013304// Return name or Cnnnnnnn
     
    33323335    columnNames_.resize(iColumn+1);
    33333336  columnNames_[iColumn]= name;
    3334   maxLength = CoinMax(maxLength,(unsigned int) strlen(name.c_str()));
     3337  maxLength = CoinMax(maxLength,static_cast<unsigned int> (strlen(name.c_str())));
    33353338  // May be too big - but we would have to check both columns and columns to be exact
    3336   lengthNames_=(int) maxLength;
     3339  lengthNames_=static_cast<int> (maxLength);
    33373340}
    33383341// Copies in Row names - modifies names first .. last-1
     
    33473350  for (iRow=first; iRow<last;iRow++) {
    33483351    rowNames_[iRow]= rowNames[iRow-first];
    3349     maxLength = CoinMax(maxLength,(unsigned int) strlen(rowNames_[iRow-first].c_str()));
     3352    maxLength = CoinMax(maxLength,static_cast<unsigned int> (strlen(rowNames_[iRow-first].c_str())));
    33503353  }
    33513354  // May be too big - but we would have to check both rows and columns to be exact
    3352   lengthNames_=(int) maxLength;
     3355  lengthNames_=static_cast<int> (maxLength);
    33533356}
    33543357// Copies in Column names - modifies names first .. last-1
     
    33633366  for (iColumn=first; iColumn<last;iColumn++) {
    33643367    columnNames_[iColumn]= columnNames[iColumn-first];
    3365     maxLength = CoinMax(maxLength,(unsigned int) strlen(columnNames_[iColumn-first].c_str()));
     3368    maxLength = CoinMax(maxLength,static_cast<unsigned int> (strlen(columnNames_[iColumn-first].c_str())));
    33663369  }
    33673370  // May be too big - but we would have to check both rows and columns to be exact
    3368   lengthNames_=(int) maxLength;
     3371  lengthNames_=static_cast<int> (maxLength);
    33693372}
    33703373// Copies in Row names - modifies names first .. last-1
     
    33803383    if (rowNames[iRow-first]&&strlen(rowNames[iRow-first])) {
    33813384      rowNames_[iRow]= rowNames[iRow-first];
    3382       maxLength = CoinMax(maxLength,(unsigned int) strlen(rowNames[iRow-first]));
     3385      maxLength = CoinMax(maxLength,static_cast<unsigned int> (strlen(rowNames[iRow-first])));
    33833386    } else {
    3384       maxLength = CoinMax(maxLength,(unsigned int) 8);
     3387      maxLength = CoinMax(maxLength,static_cast<unsigned int> (8));
    33853388      char name[9];
    33863389      sprintf(name,"R%7.7d",iRow);
     
    33893392  }
    33903393  // May be too big - but we would have to check both rows and columns to be exact
    3391   lengthNames_=(int) maxLength;
     3394  lengthNames_=static_cast<int> (maxLength);
    33923395}
    33933396// Copies in Column names - modifies names first .. last-1
     
    34033406    if (columnNames[iColumn-first]&&strlen(columnNames[iColumn-first])) {
    34043407      columnNames_[iColumn]= columnNames[iColumn-first];
    3405       maxLength = CoinMax(maxLength,(unsigned int) strlen(columnNames[iColumn-first]));
     3408      maxLength = CoinMax(maxLength,static_cast<unsigned int> (strlen(columnNames[iColumn-first])));
    34063409    } else {
    3407       maxLength = CoinMax(maxLength,(unsigned int) 8);
     3410      maxLength = CoinMax(maxLength,static_cast<unsigned int> (8));
    34083411      char name[9];
    34093412      sprintf(name,"C%7.7d",iColumn);
     
    34123415  }
    34133416  // May be too big - but we would have to check both rows and columns to be exact
    3414   lengthNames_=(int) maxLength;
     3417  lengthNames_=static_cast<int> (maxLength);
    34153418}
    34163419#endif
     
    35953598                    getColLower(), getColUpper(),
    35963599                    objective,
    3597                     (const char*) 0 /*integrality*/,
     3600                    reinterpret_cast<const char*> (NULL) /*integrality*/,
    35983601                    getRowLower(), getRowUpper(),
    35993602                    columnNames, rowNames);
     
    41104113            assert (!OK||!reflectionOK||!numberIn);
    41114114            //if (!numberLast) merit=1;
    4112             count[numberLeft++]=(rowStart[iRow+1]-rowStart[iRow]-1)*((double)merit);
     4115            count[numberLeft++]=(rowStart[iRow+1]-rowStart[iRow]-1)*
     4116              (static_cast<double>(merit));
    41134117            if (OK)
    41144118              rotate[iRow]=0;
     
    42184222  sparseThreshold_ = 0;
    42194223  pivotTolerance_=0.0;
     4224  zeroFactorizationTolerance_=1.0e13;
     4225  zeroSimplexTolerance_=1.0e-13;
    42204226  acceptablePivot_ = 0.0;
    42214227  objectiveScale_ = 1.0;
     
    42344240  infeasibilityCost_ = rhs.infeasibilityCost_;
    42354241  pivotTolerance_ = rhs.pivotTolerance_;
     4242  zeroFactorizationTolerance_= rhs.zeroFactorizationTolerance_;
     4243  zeroSimplexTolerance_= rhs.zeroSimplexTolerance_;
    42364244  acceptablePivot_ = rhs.acceptablePivot_;
    42374245  objectiveScale_ = rhs.objectiveScale_;
     
    42604268    infeasibilityCost_ = rhs.infeasibilityCost_;
    42614269    pivotTolerance_ = rhs.pivotTolerance_;
     4270    zeroFactorizationTolerance_=zeroFactorizationTolerance_;
     4271    zeroSimplexTolerance_=zeroSimplexTolerance_;
    42624272    acceptablePivot_ = rhs.acceptablePivot_;
    42634273    objectiveScale_ = rhs.objectiveScale_;
Note: See TracChangeset for help on using the changeset viewer.