- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# /home/coin/SVN-release/Osi-0.98.1/CoinUtils/src/CoinPresolveMatrix.hpp

Go to the documentation of this file.

    00001 // Copyright (C) 2002, International Business Machines
    00002 // Corporation and others.  All Rights Reserved.
    00003 #ifndef CoinPresolveMatrix_H
    00004 #define CoinPresolveMatrix_H
    00005
    00006 #include "CoinPragma.hpp"
    00007 #include "CoinPackedMatrix.hpp"
    00008 #include "CoinMessage.hpp"
    00009 #include "CoinTime.hpp"
    00010
    00011 #include <cmath>
    00012 #include <cassert>
    00013 #include <cfloat>
    00014 #include <cassert>
    00015
    00024 #if defined(_MSC_VER)
    00025 // Avoid MS Compiler problem in recognizing type to delete
    00026 // by casting to type.
    00027 #define deleteAction(array,type) delete [] ((type) array)
    00028 #else
    00029 #define deleteAction(array,type) delete [] array
    00030 #endif
    00031
    00036 const double ZTOLDP      = 1e-12;
    00037 //#define PRESOLVE_DEBUG 1
    00038 // Debugging macros/functions
    00039
    00040 #if PRESOLVE_DEBUG || PRESOLVE_CONSISTENCY
    00041 #define PRESOLVE_STMT(s)        s
    00042 #define PRESOLVEASSERT(x) \
    00043   ((x) ? 1 : \
    00044         ((std::cerr << "FAILED ASSERTION at line " \
    00045                     << __LINE__ << ":  " #x "\n"), abort(), 0))
    00046
    00047 inline void DIE(const char *s)  { std::cout<<s; abort(); }
    00048
    00049 // This code is used in [cr]done for columns and rows that are present in
    00050 // the presolved system.
    00051 #define PRESENT_IN_REDUCED      '\377'
    00052
    00053 #else
    00054
    00055 #define PRESOLVEASSERT(x)
    00056 #define PRESOLVE_STMT(s)
    00057
    00058 inline void DIE(const char *s)  {}
    00059
    00060 #endif
    00061
    00062 inline int ALIGN(int n, int m)  { return (((n + m - 1) / m) * m); }
    00063 inline int ALIGN_DOUBLE(int n)  { return ALIGN(n,sizeof(double)); }
    00064
    00065 // Plus infinity
    00066 #ifndef COIN_DBL_MAX
    00067 #define COIN_DBL_MAX DBL_MAX
    00068 #endif
    00069 #define PRESOLVE_INF COIN_DBL_MAX
    00070
    00071 class CoinPostsolveMatrix;
    00072
    00073 // Note 77
    00074 // "Members and bases are constructed in order of declation
    00075 //  in the class and destroyed in the reverse order."  C++PL 3d Ed. p. 307
    00076 //
    00077 // That's why I put integer members (such as ncols) before the array members;
    00078 // I like to use those integer values during initialization.
    00079 // NOT ANYMORE
    00080
    00130 class CoinPresolveAction
    00131 {
    00132  public:
    00139   static void throwCoinError(const char *error, const char *ps_routine)
    00140   { throw CoinError(error, ps_routine, "CoinPresolve"); }
    00141
    00142
    00147   const CoinPresolveAction *next;
    00148
    00154   CoinPresolveAction(const CoinPresolveAction *next) : next(next) {}
    00155
    00160   virtual const char *name() const = 0;
    00161
    00165   virtual void postsolve(CoinPostsolveMatrix *prob) const = 0;
    00166
    00168   virtual ~CoinPresolveAction() {}
    00169 };
    00170
    00171 /*
    00172   These are needed for OSI-aware constructors associated with
    00173   CoinPrePostsolveMatrix, CoinPresolveMatrix, and CoinPostsolveMatrix.
    00174 */
    00175   class ClpSimplex;
    00176   class OsiSolverInterface;
    00177
    00178 /*
    00179   CoinWarmStartBasis is required for methods in CoinPrePostsolveMatrix
    00180   that accept/return a CoinWarmStartBasis object.
    00181 */
    00182   class CoinWarmStartBasis ;
    00183
    00232 class CoinPrePostsolveMatrix
    00233 {
    00234  public:
    00235
    00245   CoinPrePostsolveMatrix(int ncols_alloc, int nrows_alloc,
    00246                          CoinBigIndex nelems_alloc) ;
    00247
    00252   CoinPrePostsolveMatrix(const OsiSolverInterface * si,
    00253                         int ncols_,
    00254                         int nrows_,
    00255                         CoinBigIndex nelems_);
    00256
    00261   CoinPrePostsolveMatrix(const ClpSimplex * si,
    00262                         int ncols_,
    00263                         int nrows_,
    00264                         CoinBigIndex nelems_,
    00265                          double bulkRatio);
    00266
    00268   ~CoinPrePostsolveMatrix();
    00270
    00280   enum Status {
    00281     isFree = 0x00,
    00282     basic = 0x01,
    00283     atUpperBound = 0x02,
    00284     atLowerBound = 0x03,
    00285     superBasic = 0x04
    00286   };
    00287
    00294
    00296   inline void setRowStatus(int sequence, Status status)
    00297   {
    00298     unsigned char & st_byte = rowstat_[sequence];
    00299     st_byte &= ~7;
    00300     st_byte |= status;
    00301   }
    00303   inline Status getRowStatus(int sequence) const
    00304   {return static_cast<Status> (rowstat_[sequence]&7);}
    00306   inline bool rowIsBasic(int sequence) const
    00307   {return (static_cast<Status> (rowstat_[sequence]&7)==basic);}
    00309   inline void setColumnStatus(int sequence, Status status)
    00310   {
    00311     unsigned char & st_byte = colstat_[sequence];
    00312     st_byte &= ~7;
    00313     st_byte |= status;
    00314
    00315 #   ifdef PRESOLVE_DEBUG
    00316     switch (status)
    00317     { case isFree:
    00318       { if (clo_[sequence] > -PRESOLVE_INF || cup_[sequence] < PRESOLVE_INF)
    00319         { std::cout << "Bad status: Var " << sequence
    00320                     << " isFree, lb = " << clo_[sequence]
    00321                     << ", ub = " << cup_[sequence] << std::endl ; }
    00322         break ; }
    00323       case basic:
    00324       { break ; }
    00325       case atUpperBound:
    00326       { if (cup_[sequence] >= PRESOLVE_INF)
    00327         { std::cout << "Bad status: Var " << sequence
    00328                     << " atUpperBound, lb = " << clo_[sequence]
    00329                     << ", ub = " << cup_[sequence] << std::endl ; }
    00330         break ; }
    00331       case atLowerBound:
    00332       { if (clo_[sequence] <= -PRESOLVE_INF)
    00333         { std::cout << "Bad status: Var " << sequence
    00334                     << " atLowerBound, lb = " << clo_[sequence]
    00335                     << ", ub = " << cup_[sequence] << std::endl ; }
    00336         break ; }
    00337       case superBasic:
    00338       { if (clo_[sequence] <= -PRESOLVE_INF && cup_[sequence] >= PRESOLVE_INF)
    00339         { std::cout << "Bad status: Var " << sequence
    00340                     << " superBasic, lb = " << clo_[sequence]
    00341                     << ", ub = " << cup_[sequence] << std::endl ; }
    00342         break ; }
    00343       default:
    00344       { assert(false) ;
    00345         break ; } }
    00346 #   endif
    00347   }
    00349   inline Status getColumnStatus(int sequence) const
    00350   {return static_cast<Status> (colstat_[sequence]&7);}
    00352   inline bool columnIsBasic(int sequence) const
    00353   {return (static_cast<Status> (colstat_[sequence]&7)==basic);}
    00357   void setRowStatusUsingValue(int iRow);
    00361   void setColumnStatusUsingValue(int iColumn);
    00363   void setStructuralStatus(const char *strucStatus, int lenParam) ;
    00365   void setArtificialStatus(const char *artifStatus, int lenParam) ;
    00367   void setStatus(const CoinWarmStartBasis *basis) ;
    00369   CoinWarmStartBasis *getStatus() ;
    00373   const char *columnStatusString(int j) const ;
    00377   const char *rowStatusString(int i) const ;
    00379
    00387
    00388   void setObjOffset(double offset) ;
    00393   void setObjSense(double objSense) ;
    00395   void setPrimalTolerance(double primTol) ;
    00397   void setDualTolerance(double dualTol) ;
    00399   void setColLower(const double *colLower, int lenParam) ;
    00401   void setColUpper(const double *colUpper, int lenParam) ;
    00403   void setColSolution(const double *colSol, int lenParam) ;
    00405   void setCost(const double *cost, int lenParam) ;
    00407   void setReducedCost(const double *redCost, int lenParam) ;
    00409   void setRowLower(const double *rowLower, int lenParam) ;
    00411   void setRowUpper(const double *rowUpper, int lenParam) ;
    00413   void setRowPrice(const double *rowSol, int lenParam) ;
    00415   void setRowActivity(const double *rowAct, int lenParam) ;
    00417
    00420
    00421   inline int getNumCols()
    00422   { return (ncols_) ; }
    00424   inline int getNumRows()
    00425   { return (nrows_) ; }
    00427   inline int getNumElems()
    00428   { return (nelems_) ; }
    00430   inline const CoinBigIndex *getColStarts() const
    00431   { return (mcstrt_) ; }
    00433   inline const int *getColLengths() const
    00434   { return (hincol_) ; }
    00436   inline const int *getRowIndicesByCol() const
    00437   { return (hrow_) ; }
    00439   inline const double *getElementsByCol() const
    00440   { return (colels_) ; }
    00442   inline const double *getColLower() const
    00443   { return (clo_) ; }
    00445   inline const double *getColUpper() const
    00446   { return (cup_) ; }
    00448   inline const double *getCost() const
    00449   { return (cost_) ; }
    00451   inline const double *getRowLower() const
    00452   { return (rlo_) ; }
    00454   inline const double *getRowUpper() const
    00455   { return (rup_) ; }
    00457   inline const double *getColSolution() const
    00458   { return (sol_) ; }
    00460   inline const double *getRowActivity() const
    00461   { return (acts_) ; }
    00463   inline const double *getRowPrice() const
    00464   { return (rowduals_) ; }
    00466   inline const double *getReducedCost() const
    00467   { return (rcosts_) ; }
    00469   inline int countEmptyCols()
    00470   { int empty = 0 ;
    00471     for (int i = 0 ; i < ncols_ ; i++) if (hincol_[i] == 0) empty++ ;
    00472     return (empty) ; }
    00474
    00475
    00478
    00479   inline CoinMessageHandler *messageHandler() const
    00480   { return handler_; }
    00486   inline void setMessageHandler(CoinMessageHandler *handler)
    00487   { if (defaultHandler_ == true)
    00488     { delete handler_ ;
    00489       defaultHandler_ = false ; }
    00490     handler_ = handler ; }
    00492   inline CoinMessages messages() const
    00493   { return messages_; }
    00495
    00505
    00507   int ncols_;
    00509   int nrows_;
    00511   CoinBigIndex nelems_;
    00512
    00514   int ncols0_;
    00516   int nrows0_ ;
    00518   CoinBigIndex nelems0_ ;
    00527   CoinBigIndex bulk0_ ;
    00529   double bulkRatio_;
    00531
    00540
    00541   CoinBigIndex *mcstrt_;
    00543   int *hincol_;
    00545   int *hrow_;
    00547   double *colels_;
    00548
    00550   double *cost_;
    00552   double originalOffset_;
    00553
    00555   double *clo_;
    00557   double *cup_;
    00558
    00560   double *rlo_;
    00562   double *rup_;
    00563
    00565   int * originalColumn_;
    00567   int * originalRow_;
    00568
    00570   double ztolzb_;
    00572   double ztoldj_;
    00573
    00575   double maxmin_;
    00577
    00598   double *sol_;
    00604   double *rowduals_;
    00610   double *acts_;
    00616   double *rcosts_;
    00617
    00624   unsigned char *colstat_;
    00625
    00632   unsigned char *rowstat_;
    00634
    00643
    00644   CoinMessageHandler *handler_;
    00646   bool defaultHandler_;
    00648   CoinMessage messages_;
    00650
    00651 };
    00652
    00653
    00678 class presolvehlink
    00679 { public:
    00680   int pre, suc;
    00681 } ;
    00682
    00683 #define NO_LINK -66666666
    00684
    00690 inline void PRESOLVE_REMOVE_LINK(presolvehlink *link, int i)
    00691 {
    00692   int ipre = link[i].pre;
    00693   int isuc = link[i].suc;
    00694   if (ipre >= 0) {
    00695     link[ipre].suc = isuc;
    00696   }
    00697   if (isuc >= 0) {
    00698     link[isuc].pre = ipre;
    00699   }
    00700   link[i].pre = NO_LINK, link[i].suc = NO_LINK;
    00701 }
    00702
    00708 inline void PRESOLVE_INSERT_LINK(presolvehlink *link, int i, int j)
    00709 {
    00710   int isuc = link[j].suc;
    00711   link[j].suc = i;
    00712   link[i].pre = j;
    00713   if (isuc >= 0) {
    00714     link[isuc].pre = i;
    00715   }
    00716   link[i].suc = isuc;
    00717 }
    00718
    00730 inline void PRESOLVE_MOVE_LINK(presolvehlink *link, int i, int j)
    00731 {
    00732   int ipre = link[i].pre;
    00733   int isuc = link[i].suc;
    00734   if (ipre >= 0) {
    00735     link[ipre].suc = j;
    00736   }
    00737   if (isuc >= 0) {
    00738     link[isuc].pre = j;
    00739   }
    00740   link[i].pre = NO_LINK, link[i].suc = NO_LINK;
    00741 }
    00742
    00743
    00765 class CoinPresolveMatrix : public CoinPrePostsolveMatrix
    00766 {
    00767  public:
    00768
    00775   CoinPresolveMatrix(int ncols_alloc, int nrows_alloc,
    00776                      CoinBigIndex nelems_alloc) ;
    00777
    00782   CoinPresolveMatrix(int ncols0,
    00783                     double maxmin,
    00784                     // end prepost members
    00785
    00786                     ClpSimplex * si,
    00787
    00788                     // rowrep
    00789                     int nrows,
    00790                     CoinBigIndex nelems,
    00791                  bool doStatus,
    00792                  double nonLinearVariable,
    00793                      double bulkRatio);
    00794
    00796   void update_model(ClpSimplex * si,
    00797                             int nrows0,
    00798                             int ncols0,
    00799                             CoinBigIndex nelems0);
    00804   CoinPresolveMatrix(int ncols0,
    00805                     double maxmin,
    00806                     // end prepost members
    00807
    00808                     OsiSolverInterface * si,
    00809
    00810                     // rowrep
    00811                     int nrows,
    00812                     CoinBigIndex nelems,
    00813                  bool doStatus,
    00814                  double nonLinearVariable,
    00815                      const char * prohibited);
    00816
    00818   void update_model(OsiSolverInterface * si,
    00819                             int nrows0,
    00820                             int ncols0,
    00821                             CoinBigIndex nelems0);
    00822
    00824   ~CoinPresolveMatrix();
    00825
    00831   friend void assignPresolveToPostsolve (CoinPresolveMatrix *&preObj) ;
    00832
    00841   void setMatrix(const CoinPackedMatrix *mtx) ;
    00842
    00844   inline int countEmptyRows()
    00845   { int empty = 0 ;
    00846     for (int i = 0 ; i < nrows_ ; i++) if (hinrow_[i] == 0) empty++ ;
    00847     return (empty) ; }
    00848
    00854   inline void setVariableType(int i, int variableType)
    00855   { if (integerType_ == 0) integerType_ = new unsigned char [ncols0_] ;
    00856     integerType_[i] = variableType ; }
    00857
    00863   void setVariableType(const unsigned char *variableType, int lenParam) ;
    00864
    00870   void setVariableType (bool allIntegers, int lenParam) ;
    00871
    00873   inline void setAnyInteger (bool anyInteger = true)
    00874   { anyInteger_ = anyInteger ; }
    00876
    00880
    00882   inline const CoinBigIndex *getRowStarts() const
    00883   { return (mrstrt_) ; }
    00885   inline const int *getColIndicesByRow() const
    00886   { return (hcol_) ; }
    00888   inline const double *getElementsByRow() const
    00889   { return (rowels_) ; }
    00890
    00896   inline bool isInteger (int i) const
    00897   { if (integerType_ == 0)
    00898     { return (anyInteger_) ; }
    00899     else
    00900     if (integerType_[i] == 1)
    00901     { return (true) ; }
    00902     else
    00903     { return (false) ; } }
    00904
    00909   inline bool anyInteger () const
    00910   { return (anyInteger_) ; }
    00912   inline int presolveOptions() const
    00913   { return presolveOptions_;}
    00915   inline void setPresolveOptions(int value)
    00916   { presolveOptions_=value;}
    00918
    00926
    00927   presolvehlink *clink_;
    00929   presolvehlink *rlink_;
    00931
    00933   double dobias_;
    00934
    00936   inline void change_bias(double change_amount)
    00937   {
    00938     dobias_ += change_amount;
    00939   #if PRESOLVE_DEBUG
    00940     assert(fabs(change_amount)<1.0e50);
    00941   #endif
    00942     if (change_amount)
    00943       PRESOLVE_STMT(printf("changing bias by %g to %g\n",
    00944                       change_amount, dobias_));
    00945   }
    00946
    00955
    00956   CoinBigIndex *mrstrt_;
    00958   int *hinrow_;
    00960   double *rowels_;
    00962   int *hcol_;
    00964
    00966   unsigned char *integerType_;
    00972   bool anyInteger_ ;
    00974   bool tuning_;
    00976   void statistics();
    00978   double startTime_;
    00979
    00981   double feasibilityTolerance_;
    00983   inline double feasibilityTolerance()
    00984   { return (feasibilityTolerance_) ; }
    00986   inline void setFeasibilityTolerance (double val)
    00987   { feasibilityTolerance_ = val ; }
    00988
    00994   int status_;
    00996   inline int status()
    00997   { return (status_) ; }
    00999   inline void setStatus(int status)
    01000   { status_ = (status&0x3) ; }
    01001
    01007   int pass_;
    01009   inline void setPass (int pass = 0)
    01010   { pass_ = pass ; }
    01011
    01016   int maxSubstLevel_;
    01018   inline void setMaximumSubstitutionLevel (int level)
    01019   { maxSubstLevel_ = level ; }
    01020
    01021
    01044   unsigned char * colChanged_;
    01046   int * colsToDo_;
    01048   int numberColsToDo_;
    01050   int * nextColsToDo_;
    01052   int numberNextColsToDo_;
    01053
    01063   unsigned char * rowChanged_;
    01065   int * rowsToDo_;
    01067   int numberRowsToDo_;
    01069   int * nextRowsToDo_;
    01071   int numberNextRowsToDo_;
    01077   int presolveOptions_;
    01083   bool anyProhibited_;
    01085
    01088
    01094   void initColsToDo () ;
    01095
    01101   int stepColsToDo () ;
    01102
    01104   inline int numberColsToDo()
    01105   { return (numberColsToDo_) ; }
    01106
    01108   inline bool colChanged(int i) const {
    01109     return (colChanged_[i]&1)!=0;
    01110   }
    01112   inline void unsetColChanged(int i) {
    01113     colChanged_[i]  &= ~1;;
    01114   }
    01116   inline void setColChanged(int i) {
    01117     colChanged_[i] |= 1;
    01118   }
    01120   inline void addCol(int i) {
    01121     if ((colChanged_[i]&1)==0) {
    01122       colChanged_[i] |= 1;
    01123       nextColsToDo_[numberNextColsToDo_++] = i;
    01124     }
    01125   }
    01127   inline bool colProhibited(int i) const {
    01128     return (colChanged_[i]&2)!=0;
    01129   }
    01136   inline bool colProhibited2(int i) const {
    01137     if (!anyProhibited_)
    01138       return false;
    01139     else
    01140       return (colChanged_[i]&2)!=0;
    01141   }
    01143   inline void setColProhibited(int i) {
    01144     colChanged_[i] |= 2;
    01145   }
    01151   inline bool colUsed(int i) const {
    01152     return (colChanged_[i]&4)!=0;
    01153   }
    01155   inline void setColUsed(int i) {
    01156     colChanged_[i] |= 4;
    01157   }
    01159   inline void unsetColUsed(int i) {
    01160     colChanged_[i]  &= ~4;;
    01161   }
    01162
    01168   void initRowsToDo () ;
    01169
    01175   int stepRowsToDo () ;
    01176
    01178   inline int numberRowsToDo()
    01179   { return (numberRowsToDo_) ; }
    01180
    01182   inline bool rowChanged(int i) const {
    01183     return (rowChanged_[i]&1)!=0;
    01184   }
    01186   inline void unsetRowChanged(int i) {
    01187     rowChanged_[i]  &= ~1;;
    01188   }
    01190   inline void setRowChanged(int i) {
    01191     rowChanged_[i] |= 1;
    01192   }
    01194   inline void addRow(int i) {
    01195     if ((rowChanged_[i]&1)==0) {
    01196       rowChanged_[i] |= 1;
    01197       nextRowsToDo_[numberNextRowsToDo_++] = i;
    01198     }
    01199   }
    01201   inline bool rowProhibited(int i) const {
    01202     return (rowChanged_[i]&2)!=0;
    01203   }
    01210   inline bool rowProhibited2(int i) const {
    01211     if (!anyProhibited_)
    01212       return false;
    01213     else
    01214       return (rowChanged_[i]&2)!=0;
    01215   }
    01217   inline void setRowProhibited(int i) {
    01218     rowChanged_[i] |= 2;
    01219   }
    01225   inline bool rowUsed(int i) const {
    01226     return (rowChanged_[i]&4)!=0;
    01227   }
    01229   inline void setRowUsed(int i) {
    01230     rowChanged_[i] |= 4;
    01231   }
    01233   inline void unsetRowUsed(int i) {
    01234     rowChanged_[i]  &= ~4;;
    01235   }
    01236
    01237
    01239   inline bool anyProhibited() const
    01240   { return anyProhibited_;}
    01242   inline void setAnyProhibited(bool val = true)
    01243   { anyProhibited_ = val ; }
    01245
    01246 };
    01247
    01272 class CoinPostsolveMatrix : public CoinPrePostsolveMatrix
    01273 {
    01274  public:
    01275
    01282   CoinPostsolveMatrix(int ncols_alloc, int nrows_alloc,
    01283                       CoinBigIndex nelems_alloc) ;
    01284
    01285
    01290   CoinPostsolveMatrix(ClpSimplex * si,
    01291
    01292                    int ncols0,
    01293                    int nrows0,
    01294                    CoinBigIndex nelems0,
    01295
    01296                    double maxmin_,
    01297                    // end prepost members
    01298
    01299                    double *sol,
    01300                    double *acts,
    01301
    01302                    unsigned char *colstat,
    01303                    unsigned char *rowstat);
    01304
    01309   CoinPostsolveMatrix(OsiSolverInterface * si,
    01310
    01311                    int ncols0,
    01312                    int nrows0,
    01313                    CoinBigIndex nelems0,
    01314
    01315                    double maxmin_,
    01316                    // end prepost members
    01317
    01318                    double *sol,
    01319                    double *acts,
    01320
    01321                    unsigned char *colstat,
    01322                    unsigned char *rowstat);
    01323
    01334   void assignPresolveToPostsolve (CoinPresolveMatrix *&preObj) ;
    01335
    01337   ~CoinPostsolveMatrix();
    01338
    01347
    01349   CoinBigIndex free_list_;
    01351   int maxlink_;
    01356   CoinBigIndex *link_;
    01357
    01359
    01367   char *cdone_;
    01368   char *rdone_;
    01370
    01372   void check_nbasic();
    01373
    01374 };
    01375
    01376
    01377 #define PRESOLVEFINITE(n)       (-PRESOLVE_INF < (n) && (n) < PRESOLVE_INF)
    01378
    01385
    01390 void presolve_make_memlists(CoinBigIndex *starts, int *lengths,
    01391                             presolvehlink *link, int n);
    01392
    01400 bool presolve_expand_major(CoinBigIndex *majstrts, double *majels,
    01401                            int *minndxs, int *majlens,
    01402                            presolvehlink *majlinks, int nmaj, int k) ;
    01403
    01409 inline bool presolve_expand_col(CoinBigIndex *mcstrt, double *colels,
    01410                                 int *hrow, int *hincol,
    01411                                 presolvehlink *clink, int ncols, int colx)
    01412 { return presolve_expand_major(mcstrt,colels,
    01413                                hrow,hincol,clink,ncols,colx) ; }
    01414
    01420 inline bool presolve_expand_row(CoinBigIndex *mrstrt, double *rowels,
    01421                                 int *hcol, int *hinrow,
    01422                                 presolvehlink *rlink, int nrows, int rowx)
    01423 { return presolve_expand_major(mrstrt,rowels,
    01424                                hcol,hinrow,rlink,nrows,rowx) ; }
    01425
    01426
    01435 CoinBigIndex presolve_find_minor(int tgt, CoinBigIndex ks, CoinBigIndex ke,
    01436                                  const int *minndxs);
    01437
    01444 inline CoinBigIndex presolve_find_row(int row, CoinBigIndex kcs,
    01445                                       CoinBigIndex kce, const int *hrow)
    01446 { return presolve_find_minor(row,kcs,kce,hrow) ; }
    01447
    01454 inline CoinBigIndex presolve_find_col(int col, CoinBigIndex krs,
    01455                                       CoinBigIndex kre, const int *hcol)
    01456 { return presolve_find_minor(col,krs,kre,hcol) ; }
    01457
    01458
    01467 CoinBigIndex presolve_find_minor1(int tgt, CoinBigIndex ks, CoinBigIndex ke,
    01468                                   const int *minndxs);
    01469
    01476 inline CoinBigIndex presolve_find_row1(int row, CoinBigIndex kcs,
    01477                                        CoinBigIndex kce, const int *hrow)
    01478 { return presolve_find_minor1(row,kcs,kce,hrow) ; }
    01479
    01486 inline CoinBigIndex presolve_find_col1(int col, CoinBigIndex krs,
    01487                                        CoinBigIndex kre, const int *hcol)
    01488 { return presolve_find_minor1(col,krs,kre,hcol) ; }
    01489
    01498 CoinBigIndex presolve_find_minor2(int tgt, CoinBigIndex ks, int majlen,
    01499                                   const int *minndxs,
    01500                                   const CoinBigIndex *majlinks) ;
    01501
    01509 inline CoinBigIndex presolve_find_row2(int row, CoinBigIndex kcs, int collen,
    01510                                        const int *hrow,
    01511                                        const CoinBigIndex *clinks)
    01512 { return presolve_find_minor2(row,kcs,collen,hrow,clinks) ; }
    01513
    01522 CoinBigIndex presolve_find_minor3(int tgt, CoinBigIndex ks, int majlen,
    01523                                   const int *minndxs,
    01524                                   const CoinBigIndex *majlinks) ;
    01525
    01533 inline CoinBigIndex presolve_find_row3(int row, CoinBigIndex kcs, int collen,
    01534                                        const int *hrow,
    01535                                        const CoinBigIndex *clinks)
    01536 { return presolve_find_minor3(row,kcs,collen,hrow,clinks) ; }
    01537
    01547 void presolve_delete_from_major(int majndx, int minndx,
    01548                                 const CoinBigIndex *majstrts,
    01549                                 int *majlens, int *minndxs, double *els) ;
    01550 // Delete all marked from major (and zero marked)
    01551 void presolve_delete_many_from_major(int majndx, char * marked,
    01552                                 const CoinBigIndex *majstrts,
    01553                                 int *majlens, int *minndxs, double *els) ;
    01554
    01565 inline void presolve_delete_from_col(int row, int col,
    01566                                      const CoinBigIndex *mcstrt,
    01567                                      int *hincol, int *hrow, double *colels)
    01568 { presolve_delete_from_major(col,row,mcstrt,hincol,hrow,colels) ; }
    01569
    01580 inline void presolve_delete_from_row(int row, int col,
    01581                                      const CoinBigIndex *mrstrt,
    01582                                      int *hinrow, int *hcol, double *rowels)
    01583 { presolve_delete_from_major(row,col,mrstrt,hinrow,hcol,rowels) ; }
    01584
    01595 void presolve_delete_from_major2 (int majndx, int minndx,
    01596                                   CoinBigIndex *majstrts, int *majlens,
    01597                                   int *minndxs, double *els, int *majlinks,
    01598                                    CoinBigIndex *free_listp) ;
    01599
    01610 inline void presolve_delete_from_col2(int row, int col, CoinBigIndex *mcstrt,
    01611                                       int *hincol, int *hrow,
    01612                                       double *colels, int *clinks,
    01613                                       CoinBigIndex *free_listp)
    01614 { presolve_delete_from_major2(col,row,mcstrt,hincol,hrow,colels,clinks,
    01615                               free_listp) ; }
    01616
    01618
    01624
    01636 double *presolve_dupmajor(const double *elems, const int *indices,
    01637                           int length, CoinBigIndex offset, int tgt = -1);
    01638
    01640
    01641
    01642 #endif