Dip  0.92.4
DecompWaitingRow.h
Go to the documentation of this file.
1 //===========================================================================//
2 // This file is part of the Decomp Solver Framework. //
3 // //
4 // Decomp is distributed under the Common Public License as part of the //
5 // COIN-OR repository (http://www.coin-or.org). //
6 // //
7 // Author: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com) //
8 // //
9 // Copyright (C) 2002-2007, Lehigh University, Matthew Galati, and Ted Ralphs//
10 // All Rights Reserved. //
11 //===========================================================================//
12 
13 
14 #ifndef DECOMP_WAITING_ROW_INCLUDE
15 #define DECOMP_WAITING_ROW_INCLUDE
16 
17 //class DecompCut;
18 #include "DecompCut.h"
19 
20 //TODO? use to have DecompRow = CoinPackedVector
21 
22 // ---------------------------------------------------------------------- //
23 class DecompWaitingRow {
24 private:
25  //THINK
26  //DecompWaitingRow & operator=(const DecompWaitingRow &);
27 
28 private:
29  DecompCut* m_cut; //the cut
30  CoinPackedVector* m_row; //the row (in terms of x)
31  CoinPackedVector* m_rowReform; //the row (in terms of reformulation)
32 
33 public:
34  inline DecompCut* getCutPtr() const {
35  return m_cut;
36  }
37  inline CoinPackedVector* getRowPtr() const {
38  return m_row;
39  }
40  inline CoinPackedVector* getRowReformPtr() const {
41  return m_rowReform;
42  }
43  inline const double getViolation() const {
44  return m_cut->getViolation();
45  }
46  inline const double getLowerBound() const {
47  return m_cut->getLowerBound();
48  }
49  inline const double getUpperBound() const {
50  return m_cut->getUpperBound();
51  }
52 
53  inline void deleteCut() {
54  //cout << "\ndelete m_cut: " << m_cut << "\n";
55  UTIL_DELPTR(m_cut);
56  }
57  inline void deleteRow() {
58  UTIL_DELPTR(m_row);
59  }
60  inline void deleteRowReform() {
61  UTIL_DELPTR(m_rowReform);
62  }
63  inline void clearCut() {
64  m_cut = 0;
65  }
66 
67  inline void setRow(CoinPackedVector* row) {
68  m_row = row;
69  }
70  inline void setRowReform(CoinPackedVector* rowReform) {
71  m_rowReform = rowReform;
72  }
73 
74  bool setViolation(const double* x);
75 
76 public:
78  m_cut = x.m_cut;
79  m_row = x.m_row;
80  m_rowReform = x.m_rowReform;
81  }
82 
84  CoinPackedVector* row,
85  CoinPackedVector* rowReform = 0) :
86  m_cut(cut),
87  m_row(row),
88  m_rowReform(rowReform) {}
89 
91 };
92 
93 #endif
94 
double getUpperBound() const
Definition: DecompCut.h:50
DecompCut * getCutPtr() const
void setRowReform(CoinPackedVector *rowReform)
const double getViolation() const
bool setViolation(const double *x)
DecompWaitingRow(DecompCut *cut, CoinPackedVector *row, CoinPackedVector *rowReform=0)
#define UTIL_DELPTR(x)
Definition: UtilMacros.h:28
double getLowerBound() const
Definition: DecompCut.h:47
DecompWaitingRow(const DecompWaitingRow &x)
CoinPackedVector * getRowPtr() const
CoinPackedVector * getRowReformPtr() const
void setRow(CoinPackedVector *row)
const double getUpperBound() const
double getViolation() const
Definition: DecompCut.h:53
const double getLowerBound() const