00001 //===========================================================================// 00002 // This file is part of the DIP Solver Framework. // 00003 // // 00004 // DIP is distributed under the Eclipse Public License as part of the // 00005 // COIN-OR repository (http://www.coin-or.org). // 00006 // // 00007 // Author: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com) // 00008 // // 00009 // Conceptual Design: Matthew Galati, SAS Institute Inc. // 00010 // Ted Ralphs, Lehigh University // 00011 // // 00012 // Copyright (C) 2002-2013, Lehigh University, Matthew Galati, Ted Ralphs // 00013 // All Rights Reserved. // 00014 //===========================================================================// 00015 00016 00017 #ifndef DECOMP_WAITING_ROW_INCLUDE 00018 #define DECOMP_WAITING_ROW_INCLUDE 00019 00020 //class DecompCut; 00021 #include "DecompCut.h" 00022 00023 //TODO? use to have DecompRow = CoinPackedVector 00024 00025 // ---------------------------------------------------------------------- // 00026 class DecompWaitingRow { 00027 private: 00028 DecompCut* m_cut; //the cut 00029 CoinPackedVector* m_row; //the row (in terms of x) 00030 CoinPackedVector* m_rowReform; //the row (in terms of reformulation) 00031 00032 public: 00033 inline DecompCut* getCutPtr() const { 00034 return m_cut; 00035 } 00036 inline CoinPackedVector* getRowPtr() const { 00037 return m_row; 00038 } 00039 inline CoinPackedVector* getRowReformPtr() const { 00040 return m_rowReform; 00041 } 00042 inline const double getViolation() const { 00043 return m_cut->getViolation(); 00044 } 00045 inline const double getLowerBound() const { 00046 return m_cut->getLowerBound(); 00047 } 00048 inline const double getUpperBound() const { 00049 return m_cut->getUpperBound(); 00050 } 00051 00052 inline void deleteCut() { 00053 UTIL_DELPTR(m_cut); 00054 } 00055 inline void deleteRow() { 00056 UTIL_DELPTR(m_row); 00057 } 00058 inline void deleteRowReform() { 00059 UTIL_DELPTR(m_rowReform); 00060 } 00061 inline void clearCut() { 00062 m_cut = 0; 00063 } 00064 inline void setRow(CoinPackedVector* row) { 00065 m_row = row; 00066 } 00067 inline void setRowReform(CoinPackedVector* rowReform) { 00068 m_rowReform = rowReform; 00069 } 00070 00071 bool setViolation(const double* x); 00072 00073 public: 00074 DecompWaitingRow(const DecompWaitingRow& x) { 00075 m_cut = x.m_cut; 00076 m_row = x.m_row; 00077 m_rowReform = x.m_rowReform; 00078 } 00079 00080 DecompWaitingRow(DecompCut* cut, 00081 CoinPackedVector* row, 00082 CoinPackedVector* rowReform = 0) : 00083 m_cut(cut), 00084 m_row(row), 00085 m_rowReform(rowReform) {} 00086 00087 ~DecompWaitingRow() {} 00088 }; 00089 00090 #endif 00091