Changeset 2184


Ignore:
Timestamp:
May 5, 2015 8:35:39 AM (4 years ago)
Author:
stefan
Message:

take out call to setPriorities() at end of copy constructor

  • fixes an issue where priorities are passed in an original model, but presolve removes an integer variable
  • JJF: Objects and integers were set up - then preprocessing deleted one, but the objects were not deleted. All will be cured by CbcModel::synchronize model which calls setModel which calls setPriorities with correct objects.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcHeuristicDive.cpp

    r2128 r2184  
    7474    decayFactor_ = 1.0;
    7575    smallObjective_ = 1.0e-10;
    76     setPriorities();
    7776}
    7877
     
    234233  if (gotPriorities || priority1>priority2) {
    235234    priority_ = new PriorityType [numberIntegers];
     235    int nInteger=0;
    236236    for (int i = 0; i < numberObjects; i++) {
    237237      OsiObject * object = model_->modifiableObject(i);
     
    241241      int level=thisOne->priority()-priority2;
    242242      assert (level<(1<<29));
    243       priority_[i].priority=static_cast<unsigned int>(level);
     243      assert (nInteger<numberIntegers);
     244      priority_[nInteger].priority=static_cast<unsigned int>(level);
    244245      int direction=0;
    245246      if (thisOne->preferredWay()<0)
     
    248249        direction=1|1;
    249250        // at present don't try other way is not used
    250       priority_[i].direction=static_cast<unsigned char>(direction);
    251     }
     251      priority_[nInteger++].direction=static_cast<unsigned char>(direction);
     252    }
     253    assert (nInteger==numberIntegers);
    252254  }
    253255}
Note: See TracChangeset for help on using the changeset viewer.