Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

CoinPresolveEmpty.hpp

00001 // Copyright (C) 2002, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 
00004 #ifndef CoinPresolveEmpty_H
00005 #define CoinPresolveEmpty_H
00006 // Drop all empty rows/cols from the problem.
00007 // 
00008 // This should only be done once, after all other presolving actions have
00009 // been done.  
00010 
00011 const int DROP_ROW = 3;
00012 const int DROP_COL = 4;
00013 
00014 class drop_empty_cols_action : public CoinPresolveAction {
00015 private:
00016   const int nactions_;
00017 
00018   struct action {
00019     double clo;
00020     double cup;
00021     double cost;
00022     double sol;
00023     int jcol;
00024   };
00025   const action *const actions_;
00026 
00027   drop_empty_cols_action(int nactions,
00028                          const action *const actions,
00029                          const CoinPresolveAction *next) :
00030     CoinPresolveAction(next),
00031     nactions_(nactions), 
00032     actions_(actions)
00033   {}
00034 
00035  public:
00036   const char *name() const { return ("drop_empty_cols_action"); }
00037 
00038   static const CoinPresolveAction *presolve(CoinPresolveMatrix *,
00039                                          int *ecols,
00040                                          int necols,
00041                                          const CoinPresolveAction*);
00042 
00043   static const CoinPresolveAction *presolve(CoinPresolveMatrix *prob,
00044                                          const CoinPresolveAction *next);
00045 
00046   void postsolve(CoinPostsolveMatrix *prob) const;
00047 
00048   ~drop_empty_cols_action() { deleteAction(actions_,action*); }
00049 };
00050 
00051 
00052 
00053 class drop_empty_rows_action : public CoinPresolveAction {
00054 private:
00055   struct action {
00056     double rlo;
00057     double rup;
00058     int row;
00059     int fill_row;       // which row was moved into position row to fill it
00060   };
00061 
00062   const int nactions_;
00063   const action *const actions_;
00064 
00065   drop_empty_rows_action(int nactions,
00066                          const action *actions,
00067                          const CoinPresolveAction *next) :
00068     CoinPresolveAction(next),
00069     nactions_(nactions), actions_(actions)
00070 {}
00071 
00072  public:
00073   const char *name() const { return ("drop_empty_rows_action"); }
00074 
00075   static const CoinPresolveAction *presolve(CoinPresolveMatrix *prob,
00076                                             const CoinPresolveAction *next);
00077 
00078   void postsolve(CoinPostsolveMatrix *prob) const;
00079 
00080   ~drop_empty_rows_action() { deleteAction(actions_,action*); }
00081 };
00082 #endif
00083 

Generated on Wed Dec 3 14:34:22 2003 for Coin by doxygen 1.3.5