Changeset 1256


Ignore:
Timestamp:
Jul 29, 2008 5:34:40 PM (12 years ago)
Author:
lou
Message:

Quash a bunch of GCC 4.3 type conversion warnings.

Location:
stable/BSP/Clp/src
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • stable/BSP/Clp/src/ClpCholeskyBase.cpp

    r1197 r1256  
    17181718        newDropped=0;
    17191719        for (int i=0;i<numberRows_;i++) {
    1720           char dropped = rowsDropped[i];
     1720          char dropped = static_cast<char>(rowsDropped[i]);
    17211721          rowsDropped_[i]=dropped;
    17221722          rowsDropped_[i]=0;
     
    17341734        newDropped=0;
    17351735        for (int i=0;i<numberRows_;i++) {
    1736           char dropped = rowsDropped[i];
     1736          char dropped = static_cast<char>(rowsDropped[i]);
    17371737          rowsDropped_[i]=dropped;
    17381738          if (dropped==2) {
  • stable/BSP/Clp/src/ClpCholeskyDense.cpp

    r1197 r1256  
    259259      newDropped=0;
    260260      for (int i=0;i<numberRows_;i++) {
    261         char dropped = rowsDropped[i];
     261        char dropped = static_cast<char>(rowsDropped[i]);
    262262        rowsDropped_[i]=dropped;
    263263        if (dropped==2) {
  • stable/BSP/Clp/src/ClpDynamicExampleMatrix.hpp

    r1088 r1256  
    124124  {
    125125    unsigned char & st_byte = dynamicStatusGen_[sequence];
    126     st_byte &= ~7;
    127     st_byte |= status;
     126    st_byte = static_cast<unsigned char>(st_byte & ~7);
     127    st_byte = static_cast<unsigned char>(st_byte | status);
    128128  }
    129129  inline DynamicStatus getDynamicStatusGen(int sequence) const
     
    134134  }
    135135  inline void setFlaggedGen(int i) {
    136     dynamicStatusGen_[i] |= 8;
     136    dynamicStatusGen_[i] = static_cast<unsigned char>(dynamicStatusGen_[i] | 8);
    137137  }
    138138  inline void unsetFlagged(int i) {
    139     dynamicStatusGen_[i]  &= ~8;;
     139    dynamicStatusGen_[i] = static_cast<unsigned char>(dynamicStatusGen_[i] & ~8);
    140140  }
    141141   //@}
  • stable/BSP/Clp/src/ClpDynamicMatrix.hpp

    r1088 r1256  
    156156  {
    157157    unsigned char & st_byte = status_[sequence];
    158     st_byte &= ~7;
    159     st_byte |= status;
     158    st_byte = static_cast<unsigned char>(st_byte & ~7);
     159    st_byte = static_cast<unsigned char>(st_byte | status);
    160160  }
    161161  /// Number of sets (dynamic rows)
     
    167167  }
    168168  inline void setFlagged(int i) {
    169     dynamicStatus_[i] |= 8;
     169    dynamicStatus_[i] = static_cast<unsigned char>(dynamicStatus_[i] | 8);
    170170  }
    171171  inline void unsetFlagged(int i) {
    172     dynamicStatus_[i]  &= ~8;;
     172    dynamicStatus_[i] = static_cast<unsigned char>(dynamicStatus_[i] & ~8);
    173173  }
    174174  inline void setDynamicStatus(int sequence, DynamicStatus status)
    175175  {
    176176    unsigned char & st_byte = dynamicStatus_[sequence];
    177     st_byte &= ~7;
    178     st_byte |= status;
     177    st_byte = static_cast<unsigned char>(st_byte & ~7);
     178    st_byte = static_cast<unsigned char>(st_byte | status);
    179179  }
    180180  inline DynamicStatus getDynamicStatus(int sequence) const
  • stable/BSP/Clp/src/ClpGubDynamicMatrix.hpp

    r1088 r1256  
    105105  }
    106106  inline void setFlagged(int i) {
    107     dynamicStatus_[i] |= 8;
     107    dynamicStatus_[i] = static_cast<unsigned char>(dynamicStatus_[i] | 8);
    108108  }
    109109  inline void unsetFlagged(int i) {
    110     dynamicStatus_[i]  &= ~8;;
     110    dynamicStatus_[i] = static_cast<unsigned char>(dynamicStatus_[i] & ~8);
    111111  }
    112112  inline void setDynamicStatus(int sequence, DynamicStatus status)
    113113  {
    114114    unsigned char & st_byte = dynamicStatus_[sequence];
    115     st_byte &= ~7;
    116     st_byte |= status;
     115    st_byte = static_cast<unsigned char>(st_byte & ~7);
     116    st_byte = static_cast<unsigned char>(st_byte | status);
    117117  }
    118118  inline DynamicStatus getDynamicStatus(int sequence) const
  • stable/BSP/Clp/src/ClpGubMatrix.hpp

    r1088 r1256  
    212212  {
    213213    unsigned char & st_byte = status_[sequence];
    214     st_byte &= ~7;
    215     st_byte |= status;
     214    st_byte = static_cast<unsigned char>(st_byte & ~7);
     215    st_byte = static_cast<unsigned char>(st_byte | status);
    216216  }
    217217  /// To flag a variable
    218218  inline void setFlagged( int sequence)
    219219  {
    220     status_[sequence] |= 64;
     220    status_[sequence] = static_cast<unsigned char>(status_[sequence] | 64);
    221221  }
    222222  inline void clearFlagged( int sequence)
    223223  {
    224     status_[sequence] &= ~64;
     224    status_[sequence] = static_cast<unsigned char>(status_[sequence] & ~64);
    225225  }
    226226  inline bool flagged(int sequence) const
     
    230230  {
    231231    unsigned char iStat = status_[sequence];
    232     iStat &= ~24;
    233     status_[sequence] = iStat|16;
     232    iStat = static_cast<unsigned char>(iStat & ~24);
     233    status_[sequence] = static_cast<unsigned char>(iStat|16);
    234234  }
    235235  /// To say key is feasible
     
    237237  {
    238238    unsigned char iStat = status_[sequence];
    239     iStat &= ~24;
    240     status_[sequence] = iStat|8;
     239    iStat = static_cast<unsigned char>(iStat & ~24);
     240    status_[sequence] = static_cast<unsigned char>(iStat|8);
    241241  }
    242242  /// To say key is below lb
     
    244244  {
    245245    unsigned char iStat = status_[sequence];
    246     iStat &= ~24;
     246    iStat = static_cast<unsigned char>(iStat & ~24);
    247247    status_[sequence] = iStat;
    248248  }
  • stable/BSP/Clp/src/ClpInterior.hpp

    r1171 r1256  
    278278  inline void setFixed( int sequence)
    279279  {
    280     status_[sequence] |= 1;
     280    status_[sequence] = static_cast<unsigned char>(status_[sequence] | 1) ;
    281281  }
    282282  inline void clearFixed( int sequence)
    283283  {
    284     status_[sequence] &= ~1;
     284    status_[sequence] = static_cast<unsigned char>(status_[sequence] & ~1) ;
    285285  }
    286286  inline bool fixed(int sequence) const
     
    290290  inline void setFlagged( int sequence)
    291291  {
    292     status_[sequence] |= 2;
     292    status_[sequence] = static_cast<unsigned char>(status_[sequence] | 2) ;
    293293  }
    294294  inline void clearFlagged( int sequence)
    295295  {
    296     status_[sequence] &= ~2;
     296    status_[sequence] = static_cast<unsigned char>(status_[sequence] & ~2) ;
    297297  }
    298298  inline bool flagged(int sequence) const
     
    302302  inline void setFixedOrFree( int sequence)
    303303  {
    304     status_[sequence] |= 4;
     304    status_[sequence] = static_cast<unsigned char>(status_[sequence] | 4) ;
    305305  }
    306306  inline void clearFixedOrFree( int sequence)
    307307  {
    308     status_[sequence] &= ~4;
     308    status_[sequence] = static_cast<unsigned char>(status_[sequence] & ~4) ;
    309309  }
    310310  inline bool fixedOrFree(int sequence) const
     
    314314  inline void setLowerBound( int sequence)
    315315  {
    316     status_[sequence] |= 8;
     316    status_[sequence] = static_cast<unsigned char>(status_[sequence] | 8) ;
    317317  }
    318318  inline void clearLowerBound( int sequence)
    319319  {
    320     status_[sequence] &= ~8;
     320    status_[sequence] = static_cast<unsigned char>(status_[sequence] & ~8) ;
    321321  }
    322322  inline bool lowerBound(int sequence) const
     
    326326  inline void setUpperBound( int sequence)
    327327  {
    328     status_[sequence] |= 16;
     328    status_[sequence] = static_cast<unsigned char>(status_[sequence] | 16) ;
    329329  }
    330330  inline void clearUpperBound( int sequence)
    331331  {
    332     status_[sequence] &= ~16;
     332    status_[sequence] = static_cast<unsigned char>(status_[sequence] & ~16) ;
    333333  }
    334334  inline bool upperBound(int sequence) const
     
    338338  inline void setFakeLower( int sequence)
    339339  {
    340     status_[sequence] |= 32;
     340    status_[sequence] = static_cast<unsigned char>(status_[sequence] | 32) ;
    341341  }
    342342  inline void clearFakeLower( int sequence)
    343343  {
    344     status_[sequence] &= ~32;
     344    status_[sequence] = static_cast<unsigned char>(status_[sequence] & ~32) ;
    345345  }
    346346  inline bool fakeLower(int sequence) const
     
    350350  inline void setFakeUpper( int sequence)
    351351  {
    352     status_[sequence] |= 64;
     352    status_[sequence] = static_cast<unsigned char>(status_[sequence] | 64) ;
    353353  }
    354354  inline void clearFakeUpper( int sequence)
    355355  {
    356     status_[sequence] &= ~64;
     356    status_[sequence] = static_cast<unsigned char>(status_[sequence] & ~64) ;
    357357  }
    358358  inline bool fakeUpper(int sequence) const
  • stable/BSP/Clp/src/ClpModel.cpp

    r1230 r1256  
    39043904  if ((specialOptions_&65536)!=0) {
    39053905    if (numberRows_>maximumRows_||numberColumns_>maximumColumns_) {
    3906       if (numberRows_>maximumRows_)
    3907         if (maximumRows_>0)
     3906      if (numberRows_>maximumRows_) {
     3907        if (maximumRows_>0)
    39083908          maximumRows_ = numberRows_+10+numberRows_/100;
    39093909        else
    39103910          maximumRows_ = numberRows_;
    3911       if (numberColumns_>maximumColumns_)
     3911      }
     3912      if (numberColumns_>maximumColumns_) {
    39123913        if (maximumColumns_>0)
    39133914          maximumColumns_ = numberColumns_+10+numberColumns_/100;
    39143915        else
    39153916          maximumColumns_ = numberColumns_;
     3917      }
    39163918      // need to make sure numberRows_ OK and size of matrices
    39173919      resize(maximumRows_,maximumColumns_);
     
    41134115        }
    41144116        if (possible) {
    4115           rotate[jRow]+=2;
     4117          rotate[jRow] = static_cast<char>(rotate[jRow]+2);
    41164118          eligible[numberIn++]=jRow;
    4117           char multiplier = (rotate[jRow]==2) ? 1 : -1;
     4119          char multiplier = static_cast<char>((rotate[jRow]==2) ? 1 : -1);
    41184120          for (CoinBigIndex j=rowStart[jRow];j<rowStart[jRow+1];j++) {
    41194121            iColumn = column[j];
     
    41224124            int absCount=CoinAbs(iCount);
    41234125            if (!absCount) {
    4124               columnCount[iColumn]=elementByRow[j]*multiplier;
     4126              columnCount[iColumn]=static_cast<char>(elementByRow[j]*multiplier);
    41254127            } else {
    41264128              columnCount[iColumn]=2;
     
    41384140    trueNetwork=true;
    41394141    for (iColumn=0;iColumn<numberColumns_;iColumn++) {
    4140       if (CoinAbs(columnCount[iColumn])==1) {
     4142      if (CoinAbs(static_cast<int>(columnCount[iColumn]))==1) {
    41414143        trueNetwork=false;
    41424144        break;
     
    41724174      else
    41734175        iState = -1;
    4174       rotate[iRow]=iState;
     4176      rotate[iRow]=static_cast<char>(iState);
    41754177    } else {
    41764178      rotate[iRow]=-1;
  • stable/BSP/Clp/src/ClpNonLinearCost.cpp

    r1197 r1256  
    784784    for (iSequence=0;iSequence<numberTotal;iSequence++) {
    785785      double value=solution[iSequence];
    786       int iStatus = status_[iSequence];
     786      unsigned char iStatus = status_[iSequence];
    787787      assert (currentStatus(iStatus)==CLP_SAME);
    788788      double lowerValue=lower[iSequence];
     
    989989    int numberTotal = numberColumns_+numberRows_;
    990990    for (iSequence=0;iSequence<numberTotal;iSequence++) {
    991       int iStatus = status_[iSequence];
     991      unsigned char iStatus = status_[iSequence];
    992992      assert (currentStatus(iStatus)==CLP_SAME);
    993993      double lowerValue=lower[iSequence];
     
    10601060      double alpha = multiplier*array[iRow];
    10611061      double value = solution[iSequence];
    1062       int iStatus = status_[iSequence];
     1062      unsigned char iStatus = status_[iSequence];
    10631063      int iWhere = currentStatus(iStatus);
    10641064      if (iWhere==CLP_SAME)
     
    11461146      int iSequence = pivotVariable[iRow];
    11471147      double value = solution[iSequence];
    1148       int iStatus = status_[iSequence];
     1148      unsigned char iStatus = status_[iSequence];
    11491149      int iWhere = currentStatus(iStatus);
    11501150      int original = originalStatus(iStatus);
     
    12561256      int iSequence = pivotVariable[iRow];
    12571257      double value=solution[iSequence];
    1258       int iStatus = status_[iSequence];
     1258      unsigned char iStatus = status_[iSequence];
    12591259      assert (currentStatus(iStatus)==CLP_SAME);
    12601260      double lowerValue=lower[iSequence];
     
    13691369      int iSequence = pivotVariable[iRow];
    13701370      double value=solution[iSequence];
    1371       int iStatus = status_[iSequence];
     1371      unsigned char iStatus = status_[iSequence];
    13721372      assert (currentStatus(iStatus)==CLP_SAME);
    13731373      double lowerValue=lower[iSequence];
     
    15121512    double * lower = model_->lowerRegion();
    15131513    double * cost = model_->costRegion();
    1514     int iStatus = status_[iSequence];
     1514    unsigned char iStatus = status_[iSequence];
    15151515    assert (currentStatus(iStatus)==CLP_SAME);
    15161516    double lowerValue=lower[iSequence];
     
    17131713    double * lower = model_->lowerRegion();
    17141714    double * cost = model_->costRegion();
    1715     int iStatus = status_[iSequence];
     1715    unsigned char iStatus = status_[iSequence];
    17161716    assert (currentStatus(iStatus)==CLP_SAME);
    17171717    double lowerValue=lower[iSequence];
  • stable/BSP/Clp/src/ClpNonLinearCost.hpp

    r1055 r1256  
    4242{ return (status>>4);}
    4343inline void setOriginalStatus(unsigned char & status,int value)
    44 { status &= ~15;status |= value;}
     44{
     45  status = static_cast<unsigned char>(status & ~15);
     46  status = static_cast<unsigned char>(status | value);
     47}
    4548inline void setCurrentStatus(unsigned char &status,int value)
    46 { status &= ~(15<<4);status |= (value<<4);}
     49{
     50  status = static_cast<unsigned char>(status & ~(15<<4));
     51  status = static_cast<unsigned char>(status | (value<<4));
     52}
    4753inline void setInitialStatus(unsigned char &status)
    48 { status = CLP_FEASIBLE | (CLP_SAME<<4);}
     54{ status = static_cast<unsigned char>(CLP_FEASIBLE | (CLP_SAME<<4)); }
    4955inline void setSameStatus(unsigned char &status)
    50 { status &= ~(15<<4);status |= (CLP_SAME<<4);}
     56{
     57  status = static_cast<unsigned char>(status & ~(15<<4));
     58  status = static_cast<unsigned char>(status | (CLP_SAME<<4));
     59}
    5160// Use second version to get more speed
    5261//#define FAST_CLPNON
     
    220229      rhs = saveRhs;
    221230#endif
    222       int iStatus = status_[sequence];
     231      unsigned char iStatus = status_[sequence];
    223232      int iWhere = currentStatus(iStatus);
    224233      if (iWhere==CLP_SAME)
  • stable/BSP/Clp/src/ClpPackedMatrix.cpp

    r1219 r1256  
    20712071          }
    20722072        }
    2073         usefulRow[iRow]=useful;
     2073        usefulRow[iRow]=static_cast<char>(useful);
    20742074      }
    20752075    }
     
    36223622              abort();
    36233623            }
    3624             column_[j]=iColumn-start;
     3624            column_[j]=static_cast<unsigned short>(iColumn-start);
    36253625            nFound++;
    36263626            if (lastFound) {
     
    36343634        }
    36353635      }
    3636       count_[iRow*numberBlocks_+iBlock]=nFound;
     3636      count_[iRow*numberBlocks_+iBlock]=static_cast<unsigned short>(nFound);
    36373637      if (!nFound)
    36383638        nZero++;
  • stable/BSP/Clp/src/ClpSimplex.hpp

    r1202 r1256  
    841841  {
    842842    unsigned char & st_byte = status_[sequence];
    843     st_byte &= ~7;
    844     st_byte |= status;
     843    st_byte = static_cast<unsigned char>(st_byte & ~7);
     844    st_byte = static_cast<unsigned char>(st_byte | status);
    845845  }
    846846  /// Start or reset using maximumRows_ and Columns_ - true if change
     
    941941  {
    942942    unsigned char & st_byte = status_[sequence];
    943     st_byte &= ~24;
    944     st_byte |= fakeBound<<3;
     943    st_byte = static_cast<unsigned char>(st_byte & ~24);
     944    st_byte = static_cast<unsigned char>(st_byte | (fakeBound<<3));
    945945  }
    946946  inline FakeBound getFakeBound(int sequence) const
     
    949949  {
    950950    unsigned char & st_byte = status_[sequence+numberColumns_];
    951     st_byte &= ~7;
    952     st_byte |= status;
     951    st_byte = static_cast<unsigned char>(st_byte & ~7);
     952    st_byte = static_cast<unsigned char>(st_byte | status);
    953953  }
    954954  inline Status getRowStatus(int sequence) const
     
    957957  {
    958958    unsigned char & st_byte = status_[sequence];
    959     st_byte &= ~7;
    960     st_byte |= status;
     959    st_byte = static_cast<unsigned char>(st_byte & ~7);
     960    st_byte = static_cast<unsigned char>(st_byte | status);
    961961  }
    962962  inline Status getColumnStatus(int sequence) const
    963963  {return static_cast<Status> (status_[sequence]&7);}
    964964  inline void setPivoted( int sequence)
    965   { status_[sequence] |= 32;}
     965  { status_[sequence] = static_cast<unsigned char>(status_[sequence] | 32);}
    966966  inline void clearPivoted( int sequence)
    967   { status_[sequence] &= ~32; }
     967  { status_[sequence] = static_cast<unsigned char>(status_[sequence] & ~32);}
    968968  inline bool pivoted(int sequence) const
    969969  {return (((status_[sequence]>>5)&1)!=0);}
     
    972972  inline void clearFlagged( int sequence)
    973973  {
    974     status_[sequence] &= ~64;
     974    status_[sequence] = static_cast<unsigned char>(status_[sequence] & ~64);
    975975  }
    976976  inline bool flagged(int sequence) const
     
    979979  inline void setActive( int iRow)
    980980  {
    981     status_[iRow] |= 128;
     981    status_[iRow] = static_cast<unsigned char>(status_[iRow] | 128);
    982982  }
    983983  inline void clearActive( int iRow)
    984984  {
    985     status_[iRow] &= ~128;
     985    status_[iRow] = static_cast<unsigned char>(status_[iRow] & ~128);
    986986  }
    987987  inline bool active(int iRow) const
  • stable/BSP/Clp/src/ClpSolve.cpp

    r1236 r1256  
    30943094  }
    30953095#endif
    3096   char way = 1-wayIn+4*(1-wayOut);
     3096  int way = 1-wayIn+4*(1-wayOut);
    30973097  //obj_[i]=model_->objectiveValue();
    30983098  in_[CLP_CYCLE-1]=in;
    30993099  out_[CLP_CYCLE-1]=out;
    3100   way_[CLP_CYCLE-1]=way;
     3100  way_[CLP_CYCLE-1]=static_cast<char>(way);
    31013101  return matched;
    31023102}
  • stable/BSP/Clp/src/Idiot.cpp

    r1251 r1256  
    11601160  }
    11611161  double fixTolerance=IDIOT_FIX_TOLERANCE;
    1162   double startTime = CoinCpuTime();
     1162  // double startTime = CoinCpuTime();          unused?
    11631163  ClpSimplex * saveModel=NULL;
    11641164  ClpMatrixBase * matrix = model_->clpMatrix();
Note: See TracChangeset for help on using the changeset viewer.