source: branches/devel-1/include/PresolveEmpty.hpp @ 29

Last change on this file since 29 was 29, checked in by forrest, 18 years ago

Presolve (no changes to Makefile)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1// Copyright (C) 2002, International Business Machines
2// Corporation and others.  All Rights Reserved.
3
4#ifndef PresolveEmpty_H
5#define PresolveEmpty_H
6// Drop all empty rows/cols from the problem.
7//
8// This should only be done once, after all other presolving actions have
9// been done. 
10
11const int DROP_ROW = 3;
12const int DROP_COL = 4;
13
14class drop_empty_cols_action : public PresolveAction {
15private:
16  const int nactions_;
17
18  struct action {
19    int jcol;
20    double clo;
21    double cup;
22    double cost;
23    double sol;
24  };
25  const action *const actions_;
26
27  drop_empty_cols_action(int nactions,
28                         const action *const actions,
29                         const PresolveAction *next) :
30    PresolveAction(next),
31    nactions_(nactions), 
32    actions_(actions)
33  {}
34
35 public:
36  const char *name() const { return ("drop_empty_cols_action"); }
37
38  static const PresolveAction *presolve(PresolveMatrix *,
39                                         int *ecols,
40                                         int necols,
41                                         const PresolveAction*);
42
43  static const PresolveAction *presolve(PresolveMatrix *prob,
44                                         const PresolveAction *next);
45
46  void postsolve(PostsolveMatrix *prob) const;
47
48  ~drop_empty_cols_action() { delete[]actions_; }
49};
50
51
52
53class drop_empty_rows_action : public PresolveAction {
54private:
55  struct action {
56    double rlo;
57    double rup;
58    int row;
59    int fill_row;       // which row was moved into position row to fill it
60  };
61
62  const int nactions_;
63  const action *const actions_;
64
65  drop_empty_rows_action(int nactions,
66                         const action *actions,
67                         const PresolveAction *next) :
68    PresolveAction(next),
69    nactions_(nactions), actions_(actions)
70{}
71
72 public:
73  const char *name() const { return ("drop_empty_rows_action"); }
74
75  static const PresolveAction *presolve(PresolveMatrix *prob,
76                                            const PresolveAction *next);
77
78  void postsolve(PostsolveMatrix *prob) const;
79
80  ~drop_empty_rows_action() { delete[]actions_; }
81};
82#endif
83
Note: See TracBrowser for help on using the repository browser.