Changeset 338


Ignore:
Timestamp:
Mar 22, 2004 2:37:35 PM (16 years ago)
Author:
forrest
Message:

NO_RTTI coding

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpFactorization.cpp

    r336 r338  
    146146      assert (numberBasic<=model->maximumBasic());
    147147      // see if matrix a network
     148#ifndef NO_RTTI
    148149      ClpNetworkMatrix* networkMatrix =
    149150        dynamic_cast< ClpNetworkMatrix*>(model->clpMatrix());
     151#else
     152      ClpNetworkMatrix* networkMatrix = NULL;
     153      if (model->clpMatrix()->type()==11)
     154        networkMatrix =
     155        static_cast< ClpNetworkMatrix*>(model->clpMatrix());
     156#endif
    150157      // If network - still allow ordinary factorization first time for laziness
    151158      int saveMaximumPivots = maximumPivots();
  • trunk/ClpGubMatrix.cpp

    r336 r338  
    5858    gubType_(0)
    5959{
    60   setType(11);
     60  setType(16);
    6161}
    6262
     
    148148    gubType_(0)
    149149
    150   setType(11);
     150  setType(16);
    151151}
    152152
     
    277277    gubType_(0)
    278278
    279   setType(11);
     279  setType(16);
    280280 
    281281}
     
    509509    gubType_(0)
    510510{
    511   setType(11);
     511  setType(16);
    512512}
    513513/* Return <code>x * A + y</code> in <code>z</code>.
  • trunk/ClpNetworkMatrix.cpp

    r336 r338  
    374374  double zeroTolerance = model->factorization()->zeroTolerance();
    375375  int numberRows = model->numberRows();
     376#ifndef NO_RTTI
    376377  ClpPlusMinusOneMatrix* rowCopy =
    377378    dynamic_cast< ClpPlusMinusOneMatrix*>(model->rowCopy());
     379#else
     380  ClpPlusMinusOneMatrix* rowCopy =
     381    static_cast< ClpPlusMinusOneMatrix*>(model->rowCopy());
     382#endif
    378383  bool packed = rowArray->packedMode();
    379384  double factor = 0.3;
  • trunk/ClpPackedMatrix.cpp

    r336 r338  
    285285  double zeroTolerance = model->factorization()->zeroTolerance();
    286286  int numberRows = model->numberRows();
     287#ifndef NO_RTTI
    287288  ClpPackedMatrix* rowCopy =
    288289    dynamic_cast< ClpPackedMatrix*>(model->rowCopy());
     290#else
     291  ClpPackedMatrix* rowCopy =
     292    static_cast< ClpPackedMatrix*>(model->rowCopy());
     293#endif
    289294  bool packed = rowArray->packedMode();
    290295  double factor = 0.3;
     
    12461251    rowCopyBase = reverseOrderedCopy();
    12471252  }
     1253#ifndef NO_RTTI
    12481254  ClpPackedMatrix* rowCopy =
    12491255    dynamic_cast< ClpPackedMatrix*>(rowCopyBase);
    1250 
    12511256  // Make sure it is really a ClpPackedMatrix
    12521257  assert (rowCopy!=NULL);
     1258#else
     1259  ClpPackedMatrix* rowCopy =
     1260    static_cast< ClpPackedMatrix*>(rowCopyBase);
     1261#endif
     1262
    12531263  const int * column = rowCopy->getIndices();
    12541264  const CoinBigIndex * rowStart = rowCopy->getVectorStarts();
     
    15371547    // If quadratic then make symmetric
    15381548    ClpObjective * obj = model->objectiveAsObject();
     1549#ifndef NO_RTTI
    15391550    ClpQuadraticObjective * quadraticObj = (dynamic_cast< ClpQuadraticObjective*>(obj));
     1551#else
     1552    ClpQuadraticObjective * quadraticObj = NULL;
     1553    if (obj->type()==2)
     1554      quadraticObj = (static_cast< ClpQuadraticObjective*>(obj));
     1555#endif
    15401556    if (quadraticObj) {
    15411557      CoinPackedMatrix * quadratic = quadraticObj->quadraticObjective();
  • trunk/ClpPlusMinusOneMatrix.cpp

    r336 r338  
    473473  int numberRows = model->numberRows();
    474474  bool packed = rowArray->packedMode();
     475#ifndef NO_RTTI
    475476  ClpPlusMinusOneMatrix* rowCopy =
    476477    dynamic_cast< ClpPlusMinusOneMatrix*>(model->rowCopy());
     478#else
     479  ClpPlusMinusOneMatrix* rowCopy =
     480    static_cast< ClpPlusMinusOneMatrix*>(model->rowCopy());
     481#endif
    477482  double factor = 0.3;
    478483  // We may not want to do by row if there may be cache problems
  • trunk/ClpSolve.cpp

    r328 r338  
    8484  int savePerturbation=perturbation_;
    8585  int saveScaling = scalingFlag_;
     86#ifndef NO_RTTI
    8687  if (dynamic_cast< ClpNetworkMatrix*>(matrix_)) {
    8788    // network - switch off stuff
    8889    presolve = ClpSolve::presolveOff;
    8990  }
     91#else
     92  if (matrix_->type()==11) {
     93    // network - switch off stuff
     94    presolve = ClpSolve::presolveOff;
     95  }
     96#endif
    9097  // For below >0 overrides
    9198  // 0 means no, -1 means maybe
     
    219226  bool plusMinus=false;
    220227  int numberElements=model2->getNumElements();
     228#ifndef NO_RTTI
    221229  if (dynamic_cast< ClpNetworkMatrix*>(matrix_)) {
    222230    // network - switch off stuff
     
    224232    doSprint=0;
    225233  }
     234#else
     235  if (matrix_->type()==11) {
     236    // network - switch off stuff
     237    doIdiot=0;
     238    doSprint=0;
     239  }
     240#endif
    226241  int numberColumns = model2->numberColumns();
    227242  int numberRows = model2->numberRows();
     
    245260  if (plusMinus) {
    246261    saveMatrix = model2->clpMatrix();
     262#ifndef NO_RTTI
    247263    ClpPackedMatrix* clpMatrix =
    248264      dynamic_cast< ClpPackedMatrix*>(saveMatrix);
     265#else
     266    ClpPackedMatrix* clpMatrix = NULL;
     267    if (saveMatrix->type()==1)
     268      clpMatrix =
     269        dynamic_cast< ClpPackedMatrix*>(saveMatrix);
     270#endif
    249271    if (clpMatrix) {
    250272      ClpPlusMinusOneMatrix * newMatrix = new ClpPlusMinusOneMatrix(*(clpMatrix->matrix()));
  • trunk/include/ClpMatrixBase.hpp

    r336 r338  
    258258                                       int numberColumns, const int * whichColumns) const;
    259259 
    260   /// Returns type
     260  /** Returns type.
     261      The types which code may need to know about are:
     262      1  - ClpPackedMatrix
     263      11 - ClpNetworkMatrix
     264      12 - ClpPlusMinusOneMatrix
     265  */
    261266  inline int type() const
    262267  { return type_;};
Note: See TracChangeset for help on using the changeset viewer.