Changeset 743 for branches


Ignore:
Timestamp:
Aug 10, 2007 7:09:08 PM (12 years ago)
Author:
jpfasano
Message:

Changed to remove MS compiler messages:
CbcFathomDynamicProgramming?.cpp(483) : warning C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data
CbcFathomDynamicProgramming?.cpp(557) : warning C4244: '+=' : conversion from 'double' to 'float', possible loss of data
CbcFathomDynamicProgramming?.cpp(583) : warning C4244: '=' : conversion from 'const double' to 'float', possible loss of data
CbcFathomDynamicProgramming?.cpp(831) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data

Location:
branches/BSP/trunk/Cbc/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/BSP/trunk/Cbc/src/CbcFathomDynamicProgramming.cpp

    r702 r743  
    259259    numberActive_=numberActive;
    260260    indices_ = new int [numberActive_];
    261     cost_ = new float [size_];
    262     CoinFillN(cost_,size_,FLT_MAX);
     261    cost_ = new double [size_];
     262    CoinFillN(cost_,size_,DBL_MAX);
    263263    // but do nothing is okay
    264264    cost_[0]=0.0;
     
    475475    int i;
    476476    // may be possible
    477     double bestAtTarget = FLT_MAX;
     477    double bestAtTarget = DBL_MAX;
    478478    for (i=0;i<numberColumns;i++) {
    479479      if (size_>10000000&&(i%100)==0)
     
    481481      double lowerValue = lower[i];
    482482      assert (lowerValue==floor(lowerValue));
    483       float cost = direction * objective[i];
     483      double cost = direction * objective[i];
    484484      fixedObj += lowerValue*cost;
    485485      int gap = (int) (upper[i]-lowerValue);
     
    494494    returnCode=1;
    495495    int needed=0;
    496     float bestValue=FLT_MAX;
     496    double bestValue=DBL_MAX;
    497497    int iBest=-1;
    498498    if (algorithm_==0) {
     
    554554      delete [] lower;
    555555    }
    556     if (bestValue<FLT_MAX) {
     556    if (bestValue<DBL_MAX) {
    557557      bestValue += fixedObj;
    558558      if (model_->messageHandler()->logLevel()>1)
     
    565565          int n=decodeBitPattern(iBest-back_[iBest],indices_,numberRows);
    566566          // Search for cheapest
    567           float bestCost=FLT_MAX;
     567          double bestCost=DBL_MAX;
    568568          int iColumn=-1;
    569569          for (i=0;i<numberColumns;i++) {
     
    632632bool
    633633CbcFathomDynamicProgramming::tryColumn(int numberElements, const int * rows,
    634                                           const double * coefficients, float cost,
     634                                          const double * coefficients, double cost,
    635635                                          int upper)
    636636{
     
    693693bool
    694694CbcFathomDynamicProgramming::addOneColumn0(int numberElements, const int * rows,
    695                      float cost)
     695                     double cost)
    696696{
    697697  // build up mask
     
    708708    int kMask = i&mask;
    709709    if (kMask==0) {
    710       float thisCost = cost_[i];
    711       if (thisCost!=FLT_MAX) {
     710      double thisCost = cost_[i];
     711      if (thisCost!=DBL_MAX) {
    712712        // possible
    713         float newCost=thisCost+cost;
     713        double newCost=thisCost+cost;
    714714        int next = i + mask;
    715715        if (cost_[next]>newCost) {
     
    740740bool
    741741CbcFathomDynamicProgramming::addOneColumn1(int numberElements, const int * rows,
    742                                            const int * coefficients, float cost)
     742                                           const int * coefficients, double cost)
    743743{
    744744  /* build up masks.
     
    824824      if (good) {
    825825        double thisCost = cost_[i];
    826         if (thisCost!=FLT_MAX) {
     826        if (thisCost!=DBL_MAX) {
    827827          // possible
    828828          double newCost=thisCost+cost;
     
    858858bool
    859859CbcFathomDynamicProgramming::addOneColumn1A(int numberElements, const int * rows,
    860                                            const int * coefficients, float cost)
     860                                           const int * coefficients, double cost)
    861861{
    862862  /* build up masks.
     
    899899      int kMask = i&maskA;
    900900      if (kMask==0) {
    901         float thisCost = cost_[i];
    902         if (thisCost!=FLT_MAX) {
     901        double thisCost = cost_[i];
     902        if (thisCost!=DBL_MAX) {
    903903          // possible
    904           float newCost=thisCost+cost;
     904          double newCost=thisCost+cost;
    905905          int next = i + maskAdd;
    906906          if (cost_[next]>newCost) {
     
    926926        added &= (~maskD);
    927927        if (added == 0) {
    928           float thisCost = cost_[i];
    929           if (thisCost!=FLT_MAX) {
     928          double thisCost = cost_[i];
     929          if (thisCost!=DBL_MAX) {
    930930            // possible
    931             float newCost=thisCost+cost;
     931            double newCost=thisCost+cost;
    932932            int next = i + maskAdd;
    933933            if (cost_[next]>newCost) {
  • branches/BSP/trunk/Cbc/src/CbcFathomDynamicProgramming.hpp

    r706 r743  
    6868  */
    6969  bool tryColumn(int numberElements, const int * rows,
    70                     const double * coefficients, float cost,
     70                    const double * coefficients, double cost,
    7171                    int upper=COIN_INT_MAX);
    7272  /// Returns cost array
    73   inline const float * cost() const
     73  inline const double * cost() const
    7474  { return cost_;}
    7575  /// Returns back array
     
    9090  */
    9191  bool addOneColumn0(int numberElements, const int * rows,
    92                      float cost);
     92                     double cost);
    9393  /** Adds one attempt of one column of type 1,
    9494      returns true if was used in making any changes.
     
    9696  */
    9797  bool addOneColumn1(int numberElements, const int * rows,
    98                      const int * coefficients, float cost);
     98                     const int * coefficients, double cost);
    9999  /** Adds one attempt of one column of type 1,
    100100      returns true if was used in making any changes.
     
    103103  */
    104104  bool addOneColumn1A(int numberElements, const int * rows,
    105                      const int * coefficients, float cost);
     105                     const int * coefficients, double cost);
    106106  /// Gets bit pattern from original column
    107107  int bitPattern(int numberElements, const int * rows,
     
    121121  */
    122122  int type_;
    123   /// Space for states (float as who cares)
    124   float * cost_;
     123  /// Space for states
     124  double * cost_;
    125125  /// Which state produced this cheapest one
    126126  int * back_;
Note: See TracChangeset for help on using the changeset viewer.