/home/coin/SVN-release/Bcp-1.2.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 // But use a different one if we are doing doubletons etc
00038 const double ZTOLDP2      = 1e-10;
00039 //#define PRESOLVE_DEBUG 1
00040 // Debugging macros/functions
00041 
00042 #if PRESOLVE_DEBUG || PRESOLVE_CONSISTENCY
00043 #define PRESOLVE_STMT(s)        s
00044 #define PRESOLVEASSERT(x) \
00045   ((x) ? 1 : \
00046         ((std::cerr << "FAILED ASSERTION at line " \
00047                     << __LINE__ << ":  " #x "\n"), abort(), 0))
00048 
00049 inline void DIE(const char *s)  { std::cout<<s; abort(); }
00050 
00051 // This code is used in [cr]done for columns and rows that are present in
00052 // the presolved system.
00053 #define PRESENT_IN_REDUCED      '\377'
00054 
00055 #else
00056 
00057 #define PRESOLVEASSERT(x) 
00058 #define PRESOLVE_STMT(s)
00059 
00060 inline void DIE(const char *s)  {}
00061 
00062 #endif
00063 
00064 inline int ALIGN(int n, int m)  { return (((n + m - 1) / m) * m); }
00065 inline int ALIGN_DOUBLE(int n)  { return ALIGN(n,sizeof(double)); }
00066 
00067 // Plus infinity
00068 #ifndef COIN_DBL_MAX
00069 #define COIN_DBL_MAX DBL_MAX
00070 #endif
00071 #define PRESOLVE_INF COIN_DBL_MAX
00072 
00073 class CoinPostsolveMatrix;
00074 
00075 // Note 77
00076 // "Members and bases are constructed in order of declaration
00077 //  in the class and destroyed in the reverse order."  C++PL 3d Ed. p. 307
00078 //
00079 // That's why I put integer members (such as ncols) before the array members;
00080 // I like to use those integer values during initialization.
00081 // NOT ANYMORE
00082 
00132 class CoinPresolveAction
00133 {
00134  public:
00141   static void throwCoinError(const char *error, const char *ps_routine)
00142   { throw CoinError(error, ps_routine, "CoinPresolve"); } 
00143 
00144 
00149   const CoinPresolveAction *next;
00150   
00156   CoinPresolveAction(const CoinPresolveAction *next) : next(next) {}
00157 
00162   virtual const char *name() const = 0;
00163 
00167   virtual void postsolve(CoinPostsolveMatrix *prob) const = 0;
00168 
00170   virtual ~CoinPresolveAction() {}
00171 };
00172 
00173 /*
00174   These are needed for OSI-aware constructors associated with
00175   CoinPrePostsolveMatrix, CoinPresolveMatrix, and CoinPostsolveMatrix.
00176 */
00177   class ClpSimplex;
00178   class OsiSolverInterface;
00179 
00180 /*
00181   CoinWarmStartBasis is required for methods in CoinPrePostsolveMatrix
00182   that accept/return a CoinWarmStartBasis object.
00183 */
00184   class CoinWarmStartBasis ;
00185 
00236 class CoinPrePostsolveMatrix
00237 {
00238  public:
00239 
00249   CoinPrePostsolveMatrix(int ncols_alloc, int nrows_alloc,
00250                          CoinBigIndex nelems_alloc) ;
00251 
00256   CoinPrePostsolveMatrix(const OsiSolverInterface * si,
00257                         int ncols_,
00258                         int nrows_,
00259                         CoinBigIndex nelems_);
00260 
00265   CoinPrePostsolveMatrix(const ClpSimplex * si,
00266                         int ncols_,
00267                         int nrows_,
00268                         CoinBigIndex nelems_,
00269                          double bulkRatio);
00270 
00272   ~CoinPrePostsolveMatrix();
00274 
00284   enum Status {
00285     isFree = 0x00,
00286     basic = 0x01,
00287     atUpperBound = 0x02,
00288     atLowerBound = 0x03,
00289     superBasic = 0x04
00290   };
00291 
00298   
00300   inline void setRowStatus(int sequence, Status status)
00301   {
00302     unsigned char & st_byte = rowstat_[sequence];
00303     st_byte = static_cast<unsigned char>(st_byte & (~7)) ;
00304     st_byte = static_cast<unsigned char>(st_byte | status) ;
00305   }
00307   inline Status getRowStatus(int sequence) const
00308   {return static_cast<Status> (rowstat_[sequence]&7);}
00310   inline bool rowIsBasic(int sequence) const
00311   {return (static_cast<Status> (rowstat_[sequence]&7)==basic);}
00313   inline void setColumnStatus(int sequence, Status status)
00314   {
00315     unsigned char & st_byte = colstat_[sequence];
00316     st_byte = static_cast<unsigned char>(st_byte & (~7)) ;
00317     st_byte = static_cast<unsigned char>(st_byte | status) ;
00318 
00319 #   ifdef PRESOLVE_DEBUG
00320     switch (status)
00321     { case isFree:
00322       { if (clo_[sequence] > -PRESOLVE_INF || cup_[sequence] < PRESOLVE_INF)
00323         { std::cout << "Bad status: Var " << sequence
00324                     << " isFree, lb = " << clo_[sequence]
00325                     << ", ub = " << cup_[sequence] << std::endl ; }
00326         break ; }
00327       case basic:
00328       { break ; }
00329       case atUpperBound:
00330       { if (cup_[sequence] >= PRESOLVE_INF)
00331         { std::cout << "Bad status: Var " << sequence
00332                     << " atUpperBound, lb = " << clo_[sequence]
00333                     << ", ub = " << cup_[sequence] << std::endl ; }
00334         break ; }
00335       case atLowerBound:
00336       { if (clo_[sequence] <= -PRESOLVE_INF)
00337         { std::cout << "Bad status: Var " << sequence
00338                     << " atLowerBound, lb = " << clo_[sequence]
00339                     << ", ub = " << cup_[sequence] << std::endl ; }
00340         break ; }
00341       case superBasic:
00342       { if (clo_[sequence] <= -PRESOLVE_INF && cup_[sequence] >= PRESOLVE_INF)
00343         { std::cout << "Bad status: Var " << sequence
00344                     << " superBasic, lb = " << clo_[sequence]
00345                     << ", ub = " << cup_[sequence] << std::endl ; }
00346         break ; }
00347       default:
00348       { assert(false) ;
00349         break ; } }
00350 #   endif
00351   }
00353   inline Status getColumnStatus(int sequence) const
00354   {return static_cast<Status> (colstat_[sequence]&7);}
00356   inline bool columnIsBasic(int sequence) const
00357   {return (static_cast<Status> (colstat_[sequence]&7)==basic);}
00361   void setRowStatusUsingValue(int iRow);
00365   void setColumnStatusUsingValue(int iColumn);
00367   void setStructuralStatus(const char *strucStatus, int lenParam) ;
00369   void setArtificialStatus(const char *artifStatus, int lenParam) ;
00371   void setStatus(const CoinWarmStartBasis *basis) ;
00373   CoinWarmStartBasis *getStatus() ;
00377   const char *columnStatusString(int j) const ;
00381   const char *rowStatusString(int i) const ;
00383 
00391 
00392   void setObjOffset(double offset) ;
00397   void setObjSense(double objSense) ;
00399   void setPrimalTolerance(double primTol) ;
00401   void setDualTolerance(double dualTol) ;
00403   void setColLower(const double *colLower, int lenParam) ;
00405   void setColUpper(const double *colUpper, int lenParam) ;
00407   void setColSolution(const double *colSol, int lenParam) ;
00409   void setCost(const double *cost, int lenParam) ;
00411   void setReducedCost(const double *redCost, int lenParam) ;
00413   void setRowLower(const double *rowLower, int lenParam) ;
00415   void setRowUpper(const double *rowUpper, int lenParam) ;
00417   void setRowPrice(const double *rowSol, int lenParam) ;
00419   void setRowActivity(const double *rowAct, int lenParam) ;
00421 
00424 
00425   inline int getNumCols()
00426   { return (ncols_) ; } 
00428   inline int getNumRows()
00429   { return (nrows_) ; } 
00431   inline int getNumElems()
00432   { return (nelems_) ; } 
00434   inline const CoinBigIndex *getColStarts() const
00435   { return (mcstrt_) ; } 
00437   inline const int *getColLengths() const
00438   { return (hincol_) ; } 
00440   inline const int *getRowIndicesByCol() const
00441   { return (hrow_) ; } 
00443   inline const double *getElementsByCol() const
00444   { return (colels_) ; } 
00446   inline const double *getColLower() const
00447   { return (clo_) ; } 
00449   inline const double *getColUpper() const
00450   { return (cup_) ; } 
00452   inline const double *getCost() const
00453   { return (cost_) ; } 
00455   inline const double *getRowLower() const
00456   { return (rlo_) ; } 
00458   inline const double *getRowUpper() const
00459   { return (rup_) ; } 
00461   inline const double *getColSolution() const
00462   { return (sol_) ; }
00464   inline const double *getRowActivity() const
00465   { return (acts_) ; }
00467   inline const double *getRowPrice() const
00468   { return (rowduals_) ; }
00470   inline const double *getReducedCost() const
00471   { return (rcosts_) ; }
00473   inline int countEmptyCols()
00474   { int empty = 0 ;
00475     for (int i = 0 ; i < ncols_ ; i++) if (hincol_[i] == 0) empty++ ;
00476     return (empty) ; }
00478 
00479 
00482 
00483   inline CoinMessageHandler *messageHandler() const 
00484   { return handler_; }
00490   inline void setMessageHandler(CoinMessageHandler *handler)
00491   { if (defaultHandler_ == true)
00492     { delete handler_ ;
00493       defaultHandler_ = false ; }
00494     handler_ = handler ; }
00496   inline CoinMessages messages() const 
00497   { return messages_; }
00499 
00509 
00511   int ncols_;
00513   int nrows_;
00515   CoinBigIndex nelems_;
00516 
00518   int ncols0_;
00520   int nrows0_ ;
00522   CoinBigIndex nelems0_ ;
00531   CoinBigIndex bulk0_ ;
00533   double bulkRatio_;
00535 
00544 
00545   CoinBigIndex *mcstrt_;
00547   int *hincol_;
00549   int *hrow_;
00551   double *colels_;
00552 
00554   double *cost_;
00556   double originalOffset_;
00557 
00559   double *clo_;
00561   double *cup_;
00562 
00564   double *rlo_;
00566   double *rup_;
00567 
00569   int * originalColumn_;
00571   int * originalRow_;
00572 
00574   double ztolzb_;
00576   double ztoldj_;
00577 
00579   double maxmin_;
00581 
00602   double *sol_;
00608   double *rowduals_;
00614   double *acts_;
00620   double *rcosts_;
00621 
00628   unsigned char *colstat_;
00629 
00636   unsigned char *rowstat_;
00638 
00647 
00648   CoinMessageHandler *handler_; 
00650   bool defaultHandler_;
00652   CoinMessage messages_; 
00654 
00655 };
00656 
00657 
00682 class presolvehlink
00683 { public:
00684   int pre, suc;
00685 } ;
00686 
00687 #define NO_LINK -66666666
00688 
00694 inline void PRESOLVE_REMOVE_LINK(presolvehlink *link, int i)
00695 { 
00696   int ipre = link[i].pre;
00697   int isuc = link[i].suc;
00698   if (ipre >= 0) {
00699     link[ipre].suc = isuc;
00700   }
00701   if (isuc >= 0) {
00702     link[isuc].pre = ipre;
00703   }
00704   link[i].pre = NO_LINK, link[i].suc = NO_LINK;
00705 }
00706 
00712 inline void PRESOLVE_INSERT_LINK(presolvehlink *link, int i, int j)
00713 {
00714   int isuc = link[j].suc;
00715   link[j].suc = i;
00716   link[i].pre = j;
00717   if (isuc >= 0) {
00718     link[isuc].pre = i;
00719   }
00720   link[i].suc = isuc;
00721 }
00722 
00734 inline void PRESOLVE_MOVE_LINK(presolvehlink *link, int i, int j)
00735 { 
00736   int ipre = link[i].pre;
00737   int isuc = link[i].suc;
00738   if (ipre >= 0) {
00739     link[ipre].suc = j;
00740   }
00741   if (isuc >= 0) {
00742     link[isuc].pre = j;
00743   }
00744   link[i].pre = NO_LINK, link[i].suc = NO_LINK;
00745 }
00746 
00747 
00769 class CoinPresolveMatrix : public CoinPrePostsolveMatrix
00770 {
00771  public:
00772 
00779   CoinPresolveMatrix(int ncols_alloc, int nrows_alloc,
00780                      CoinBigIndex nelems_alloc) ;
00781 
00786   CoinPresolveMatrix(int ncols0,
00787                     double maxmin,
00788                     // end prepost members
00789 
00790                     ClpSimplex * si,
00791 
00792                     // rowrep
00793                     int nrows,
00794                     CoinBigIndex nelems,
00795                  bool doStatus,
00796                  double nonLinearVariable,
00797                      double bulkRatio);
00798 
00800   void update_model(ClpSimplex * si,
00801                             int nrows0,
00802                             int ncols0,
00803                             CoinBigIndex nelems0);
00808   CoinPresolveMatrix(int ncols0,
00809                     double maxmin,
00810                     // end prepost members
00811 
00812                     OsiSolverInterface * si,
00813 
00814                     // rowrep
00815                     int nrows,
00816                     CoinBigIndex nelems,
00817                  bool doStatus,
00818                  double nonLinearVariable,
00819                      const char * prohibited);
00820 
00822   void update_model(OsiSolverInterface * si,
00823                             int nrows0,
00824                             int ncols0,
00825                             CoinBigIndex nelems0);
00826 
00828   ~CoinPresolveMatrix();
00829 
00835   friend void assignPresolveToPostsolve (CoinPresolveMatrix *&preObj) ;
00836 
00845   void setMatrix(const CoinPackedMatrix *mtx) ;
00846 
00848   inline int countEmptyRows()
00849   { int empty = 0 ;
00850     for (int i = 0 ; i < nrows_ ; i++) if (hinrow_[i] == 0) empty++ ;
00851     return (empty) ; }
00852 
00858   inline void setVariableType(int i, int variableType)
00859   { if (integerType_ == 0) integerType_ = new unsigned char [ncols0_] ;
00860     integerType_[i] = static_cast<unsigned char>(variableType) ; }
00861 
00867   void setVariableType(const unsigned char *variableType, int lenParam) ;
00868 
00874   void setVariableType (bool allIntegers, int lenParam) ;
00875 
00877   inline void setAnyInteger (bool anyInteger = true)
00878   { anyInteger_ = anyInteger ; }
00880 
00884 
00886   inline const CoinBigIndex *getRowStarts() const
00887   { return (mrstrt_) ; }
00889   inline const int *getColIndicesByRow() const
00890   { return (hcol_) ; }
00892   inline const double *getElementsByRow() const
00893   { return (rowels_) ; }
00894 
00900   inline bool isInteger (int i) const
00901   { if (integerType_ == 0)
00902     { return (anyInteger_) ; }
00903     else
00904     if (integerType_[i] == 1)
00905     { return (true) ; }
00906     else
00907     { return (false) ; } }
00908 
00913   inline bool anyInteger () const
00914   { return (anyInteger_) ; }
00916   inline int presolveOptions() const
00917   { return presolveOptions_;}
00919   inline void setPresolveOptions(int value)
00920   { presolveOptions_=value;}
00922 
00930 
00931   presolvehlink *clink_;
00933   presolvehlink *rlink_;
00935 
00937   double dobias_;
00938 
00940   inline void change_bias(double change_amount)
00941   {
00942     dobias_ += change_amount;
00943   #if PRESOLVE_DEBUG
00944     assert(fabs(change_amount)<1.0e50);
00945   #endif
00946     if (change_amount)
00947       PRESOLVE_STMT(printf("changing bias by %g to %g\n",
00948                       change_amount, dobias_));  
00949   }
00950 
00959 
00960   CoinBigIndex *mrstrt_;
00962   int *hinrow_;
00964   double *rowels_;
00966   int *hcol_;
00968 
00970   unsigned char *integerType_;
00976   bool anyInteger_ ;
00978   bool tuning_;
00980   void statistics();
00982   double startTime_;
00983 
00985   double feasibilityTolerance_;
00987   inline double feasibilityTolerance()
00988   { return (feasibilityTolerance_) ; }
00990   inline void setFeasibilityTolerance (double val)
00991   { feasibilityTolerance_ = val ; }
00992 
00998   int status_;
01000   inline int status()
01001   { return (status_) ; }
01003   inline void setStatus(int status)
01004   { status_ = (status&0x3) ; }
01005 
01011   int pass_;
01013   inline void setPass (int pass = 0)
01014   { pass_ = pass ; }
01015 
01020   int maxSubstLevel_;
01022   inline void setMaximumSubstitutionLevel (int level)
01023   { maxSubstLevel_ = level ; }
01024 
01025 
01048   unsigned char * colChanged_;
01050   int * colsToDo_;
01052   int numberColsToDo_;
01054   int * nextColsToDo_;
01056   int numberNextColsToDo_;
01057 
01067   unsigned char * rowChanged_;
01069   int * rowsToDo_;
01071   int numberRowsToDo_;
01073   int * nextRowsToDo_;
01075   int numberNextRowsToDo_;
01081   int presolveOptions_;
01087   bool anyProhibited_;
01089 
01092 
01098   void initColsToDo () ;
01099 
01105   int stepColsToDo () ;
01106 
01108   inline int numberColsToDo()
01109   { return (numberColsToDo_) ; }
01110 
01112   inline bool colChanged(int i) const {
01113     return (colChanged_[i]&1)!=0;
01114   }
01116   inline void unsetColChanged(int i) {
01117     colChanged_[i] = static_cast<unsigned char>(colChanged_[i] & (~1)) ;
01118   }
01120   inline void setColChanged(int i) {
01121     colChanged_[i] = static_cast<unsigned char>(colChanged_[i] | (1)) ;
01122   }
01124   inline void addCol(int i) {
01125     if ((colChanged_[i]&1)==0) {
01126       colChanged_[i] = static_cast<unsigned char>(colChanged_[i] | (1)) ;
01127       nextColsToDo_[numberNextColsToDo_++] = i;
01128     }
01129   }
01131   inline bool colProhibited(int i) const {
01132     return (colChanged_[i]&2)!=0;
01133   }
01140   inline bool colProhibited2(int i) const {
01141     if (!anyProhibited_)
01142       return false;
01143     else
01144       return (colChanged_[i]&2)!=0;
01145   }
01147   inline void setColProhibited(int i) {
01148     colChanged_[i] = static_cast<unsigned char>(colChanged_[i] | (2)) ;
01149   }
01155   inline bool colUsed(int i) const {
01156     return (colChanged_[i]&4)!=0;
01157   }
01159   inline void setColUsed(int i) {
01160     colChanged_[i] = static_cast<unsigned char>(colChanged_[i] | (4)) ;
01161   }
01163   inline void unsetColUsed(int i) {
01164     colChanged_[i] = static_cast<unsigned char>(colChanged_[i] & (~4)) ;
01165   }
01166 
01172   void initRowsToDo () ;
01173 
01179   int stepRowsToDo () ;
01180 
01182   inline int numberRowsToDo()
01183   { return (numberRowsToDo_) ; }
01184 
01186   inline bool rowChanged(int i) const {
01187     return (rowChanged_[i]&1)!=0;
01188   }
01190   inline void unsetRowChanged(int i) {
01191     rowChanged_[i] = static_cast<unsigned char>(rowChanged_[i] & (~1)) ;
01192   }
01194   inline void setRowChanged(int i) {
01195     rowChanged_[i] = static_cast<unsigned char>(rowChanged_[i] | (1)) ;
01196   }
01198   inline void addRow(int i) {
01199     if ((rowChanged_[i]&1)==0) {
01200       rowChanged_[i] = static_cast<unsigned char>(rowChanged_[i] | (1)) ;
01201       nextRowsToDo_[numberNextRowsToDo_++] = i;
01202     }
01203   }
01205   inline bool rowProhibited(int i) const {
01206     return (rowChanged_[i]&2)!=0;
01207   }
01214   inline bool rowProhibited2(int i) const {
01215     if (!anyProhibited_)
01216       return false;
01217     else
01218       return (rowChanged_[i]&2)!=0;
01219   }
01221   inline void setRowProhibited(int i) {
01222     rowChanged_[i] = static_cast<unsigned char>(rowChanged_[i] | (2)) ;
01223   }
01229   inline bool rowUsed(int i) const {
01230     return (rowChanged_[i]&4)!=0;
01231   }
01233   inline void setRowUsed(int i) {
01234     rowChanged_[i] = static_cast<unsigned char>(rowChanged_[i] | (4)) ;
01235   }
01237   inline void unsetRowUsed(int i) {
01238     rowChanged_[i] = static_cast<unsigned char>(rowChanged_[i] & (~4)) ;
01239   }
01240 
01241 
01243   inline bool anyProhibited() const
01244   { return anyProhibited_;}
01246   inline void setAnyProhibited(bool val = true)
01247   { anyProhibited_ = val ; }
01249 
01250 };
01251 
01276 class CoinPostsolveMatrix : public CoinPrePostsolveMatrix
01277 {
01278  public:
01279 
01286   CoinPostsolveMatrix(int ncols_alloc, int nrows_alloc,
01287                       CoinBigIndex nelems_alloc) ;
01288 
01289 
01294   CoinPostsolveMatrix(ClpSimplex * si,
01295 
01296                    int ncols0,
01297                    int nrows0,
01298                    CoinBigIndex nelems0,
01299                      
01300                    double maxmin_,
01301                    // end prepost members
01302 
01303                    double *sol,
01304                    double *acts,
01305 
01306                    unsigned char *colstat,
01307                    unsigned char *rowstat);
01308 
01313   CoinPostsolveMatrix(OsiSolverInterface * si,
01314 
01315                    int ncols0,
01316                    int nrows0,
01317                    CoinBigIndex nelems0,
01318                      
01319                    double maxmin_,
01320                    // end prepost members
01321 
01322                    double *sol,
01323                    double *acts,
01324 
01325                    unsigned char *colstat,
01326                    unsigned char *rowstat);
01327 
01338   void assignPresolveToPostsolve (CoinPresolveMatrix *&preObj) ;
01339 
01341   ~CoinPostsolveMatrix();
01342 
01354 
01356   CoinBigIndex free_list_;
01358   int maxlink_;
01363   CoinBigIndex *link_;
01364 
01366 
01374   char *cdone_;
01375   char *rdone_;
01377 
01379   void check_nbasic();
01380 
01381 };
01382 
01383 
01384 #define PRESOLVEFINITE(n)       (-PRESOLVE_INF < (n) && (n) < PRESOLVE_INF)
01385 
01392 
01397 void presolve_make_memlists(CoinBigIndex *starts, int *lengths,
01398                             presolvehlink *link, int n);
01399 
01407 bool presolve_expand_major(CoinBigIndex *majstrts, double *majels,
01408                            int *minndxs, int *majlens,
01409                            presolvehlink *majlinks, int nmaj, int k) ;
01410 
01416 inline bool presolve_expand_col(CoinBigIndex *mcstrt, double *colels,
01417                                 int *hrow, int *hincol,
01418                                 presolvehlink *clink, int ncols, int colx)
01419 { return presolve_expand_major(mcstrt,colels,
01420                                hrow,hincol,clink,ncols,colx) ; }
01421 
01427 inline bool presolve_expand_row(CoinBigIndex *mrstrt, double *rowels,
01428                                 int *hcol, int *hinrow,
01429                                 presolvehlink *rlink, int nrows, int rowx)
01430 { return presolve_expand_major(mrstrt,rowels,
01431                                hcol,hinrow,rlink,nrows,rowx) ; }
01432 
01433 
01442 CoinBigIndex presolve_find_minor(int tgt, CoinBigIndex ks, CoinBigIndex ke,
01443                                  const int *minndxs);
01444 
01451 inline CoinBigIndex presolve_find_row(int row, CoinBigIndex kcs,
01452                                       CoinBigIndex kce, const int *hrow)
01453 { return presolve_find_minor(row,kcs,kce,hrow) ; }
01454 
01461 inline CoinBigIndex presolve_find_col(int col, CoinBigIndex krs,
01462                                       CoinBigIndex kre, const int *hcol)
01463 { return presolve_find_minor(col,krs,kre,hcol) ; }
01464 
01465 
01474 CoinBigIndex presolve_find_minor1(int tgt, CoinBigIndex ks, CoinBigIndex ke,
01475                                   const int *minndxs);
01476 
01483 inline CoinBigIndex presolve_find_row1(int row, CoinBigIndex kcs,
01484                                        CoinBigIndex kce, const int *hrow)
01485 { return presolve_find_minor1(row,kcs,kce,hrow) ; } 
01486 
01493 inline CoinBigIndex presolve_find_col1(int col, CoinBigIndex krs,
01494                                        CoinBigIndex kre, const int *hcol)
01495 { return presolve_find_minor1(col,krs,kre,hcol) ; } 
01496 
01505 CoinBigIndex presolve_find_minor2(int tgt, CoinBigIndex ks, int majlen,
01506                                   const int *minndxs,
01507                                   const CoinBigIndex *majlinks) ;
01508 
01516 inline CoinBigIndex presolve_find_row2(int row, CoinBigIndex kcs, int collen,
01517                                        const int *hrow,
01518                                        const CoinBigIndex *clinks)
01519 { return presolve_find_minor2(row,kcs,collen,hrow,clinks) ; }
01520 
01529 CoinBigIndex presolve_find_minor3(int tgt, CoinBigIndex ks, int majlen,
01530                                   const int *minndxs,
01531                                   const CoinBigIndex *majlinks) ;
01532 
01540 inline CoinBigIndex presolve_find_row3(int row, CoinBigIndex kcs, int collen,
01541                                        const int *hrow,
01542                                        const CoinBigIndex *clinks)
01543 { return presolve_find_minor3(row,kcs,collen,hrow,clinks) ; }
01544 
01554 void presolve_delete_from_major(int majndx, int minndx,
01555                                 const CoinBigIndex *majstrts,
01556                                 int *majlens, int *minndxs, double *els) ;
01557 // Delete all marked from major (and zero marked)
01558 void presolve_delete_many_from_major(int majndx, char * marked,
01559                                 const CoinBigIndex *majstrts,
01560                                 int *majlens, int *minndxs, double *els) ;
01561 
01572 inline void presolve_delete_from_col(int row, int col,
01573                                      const CoinBigIndex *mcstrt,
01574                                      int *hincol, int *hrow, double *colels)
01575 { presolve_delete_from_major(col,row,mcstrt,hincol,hrow,colels) ; }
01576 
01587 inline void presolve_delete_from_row(int row, int col,
01588                                      const CoinBigIndex *mrstrt,
01589                                      int *hinrow, int *hcol, double *rowels)
01590 { presolve_delete_from_major(row,col,mrstrt,hinrow,hcol,rowels) ; }
01591 
01602 void presolve_delete_from_major2 (int majndx, int minndx,
01603                                   CoinBigIndex *majstrts, int *majlens,
01604                                   int *minndxs, double *els, int *majlinks,
01605                                    CoinBigIndex *free_listp) ;
01606 
01617 inline void presolve_delete_from_col2(int row, int col, CoinBigIndex *mcstrt,
01618                                       int *hincol, int *hrow,
01619                                       double *colels, int *clinks,
01620                                       CoinBigIndex *free_listp)
01621 { presolve_delete_from_major2(col,row,mcstrt,hincol,hrow,colels,clinks,
01622                               free_listp) ; }
01623 
01625 
01631 
01643 double *presolve_dupmajor(const double *elems, const int *indices,
01644                           int length, CoinBigIndex offset, int tgt = -1);
01645 
01647 
01648 
01649 #endif

Generated on Thu Jan 15 03:01:01 2009 for coin-Bcp by  doxygen 1.4.7