00001 //===========================================================================// 00002 // This file is part of the Decomp Solver Framework. // 00003 // // 00004 // Decomp is distributed under the Common 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 // Copyright (C) 2002-2007, Lehigh University, Matthew Galati, and Ted Ralphs// 00010 // All Rights Reserved. // 00011 //===========================================================================// 00012 00013 00014 #ifndef DECOMP_WAITING_ROW_INCLUDE 00015 #define DECOMP_WAITING_ROW_INCLUDE 00016 00017 //class DecompCut; 00018 #include "DecompCut.h" 00019 00020 //TODO? use to have DecompRow = CoinPackedVector 00021 00022 // ---------------------------------------------------------------------- // 00023 class DecompWaitingRow { 00024 private: 00025 //THINK 00026 //DecompWaitingRow & operator=(const DecompWaitingRow &); 00027 00028 private: 00029 DecompCut* m_cut; //the cut 00030 CoinPackedVector* m_row; //the row (in terms of x) 00031 CoinPackedVector* m_rowReform; //the row (in terms of reformulation) 00032 00033 public: 00034 inline DecompCut* getCutPtr() const { 00035 return m_cut; 00036 } 00037 inline CoinPackedVector* getRowPtr() const { 00038 return m_row; 00039 } 00040 inline CoinPackedVector* getRowReformPtr() const { 00041 return m_rowReform; 00042 } 00043 inline const double getViolation() const { 00044 return m_cut->getViolation(); 00045 } 00046 inline const double getLowerBound() const { 00047 return m_cut->getLowerBound(); 00048 } 00049 inline const double getUpperBound() const { 00050 return m_cut->getUpperBound(); 00051 } 00052 00053 inline void deleteCut() { 00054 //cout << "\ndelete m_cut: " << m_cut << "\n"; 00055 UTIL_DELPTR(m_cut); 00056 } 00057 inline void deleteRow() { 00058 UTIL_DELPTR(m_row); 00059 } 00060 inline void deleteRowReform() { 00061 UTIL_DELPTR(m_rowReform); 00062 } 00063 inline void clearCut() { 00064 m_cut = 0; 00065 } 00066 00067 inline void setRow(CoinPackedVector* row) { 00068 m_row = row; 00069 } 00070 inline void setRowReform(CoinPackedVector* rowReform) { 00071 m_rowReform = rowReform; 00072 } 00073 00074 bool setViolation(const double* x); 00075 00076 public: 00077 DecompWaitingRow(const DecompWaitingRow& x) { 00078 m_cut = x.m_cut; 00079 m_row = x.m_row; 00080 m_rowReform = x.m_rowReform; 00081 } 00082 00083 DecompWaitingRow(DecompCut* cut, 00084 CoinPackedVector* row, 00085 CoinPackedVector* rowReform = 0) : 00086 m_cut(cut), 00087 m_row(row), 00088 m_rowReform(rowReform) {} 00089 00090 ~DecompWaitingRow() {} 00091 }; 00092 00093 #endif 00094