00001 /* PIP_Tree related class implementation: inline functions. 00002 Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it> 00003 Copyright (C) 2010-2011 BUGSENG srl (http://bugseng.com) 00004 00005 This file is part of the Parma Polyhedra Library (PPL). 00006 00007 The PPL is free software; you can redistribute it and/or modify it 00008 under the terms of the GNU General Public License as published by the 00009 Free Software Foundation; either version 3 of the License, or (at your 00010 option) any later version. 00011 00012 The PPL is distributed in the hope that it will be useful, but WITHOUT 00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00014 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00015 for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software Foundation, 00019 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA. 00020 00021 For the most up-to-date information see the Parma Polyhedra Library 00022 site: http://www.cs.unipr.it/ppl/ . */ 00023 00024 #ifndef PPL_PIP_Tree_inlines_hh 00025 #define PPL_PIP_Tree_inlines_hh 1 00026 00027 namespace Parma_Polyhedra_Library { 00028 00029 inline 00030 PIP_Solution_Node::Tableau::Tableau() 00031 : s(), t(), denom(1) { 00032 PPL_ASSERT(OK()); 00033 } 00034 00035 inline 00036 PIP_Solution_Node::Tableau::Tableau(const Tableau& y) 00037 : s(y.s), t(y.t), denom(y.denom) { 00038 PPL_ASSERT(OK()); 00039 } 00040 00041 inline 00042 PIP_Solution_Node::Tableau::~Tableau() { 00043 } 00044 00045 inline bool 00046 PIP_Solution_Node::Tableau::is_integer() const { 00047 return denom == 1; 00048 } 00049 00050 inline Coefficient_traits::const_reference 00051 PIP_Solution_Node::Tableau::denominator() const { 00052 return denom; 00053 } 00054 00055 inline 00056 PIP_Tree_Node::~PIP_Tree_Node() { 00057 } 00058 00059 inline void 00060 PIP_Tree_Node::set_parent(const PIP_Decision_Node* p) { 00061 parent_ = p; 00062 } 00063 00064 inline const PIP_Decision_Node* 00065 PIP_Tree_Node::parent() const { 00066 return parent_; 00067 } 00068 00069 inline const PIP_Problem* 00070 PIP_Tree_Node::get_owner() const { 00071 return owner_; 00072 } 00073 00074 inline const Constraint_System& 00075 PIP_Tree_Node::constraints() const { 00076 return constraints_; 00077 } 00078 00079 inline PIP_Tree_Node::Artificial_Parameter_Sequence::const_iterator 00080 PIP_Tree_Node::art_parameter_begin() const { 00081 return artificial_parameters.begin(); 00082 } 00083 00084 inline PIP_Tree_Node::Artificial_Parameter_Sequence::const_iterator 00085 PIP_Tree_Node::art_parameter_end() const { 00086 return artificial_parameters.end(); 00087 } 00088 00089 inline dimension_type 00090 PIP_Tree_Node::art_parameter_count() const { 00091 return artificial_parameters.size(); 00092 } 00093 00094 inline 00095 const PIP_Tree_Node* 00096 PIP_Decision_Node::child_node(bool v) const { 00097 return v ? true_child : false_child; 00098 } 00099 00100 inline 00101 PIP_Tree_Node* 00102 PIP_Decision_Node::child_node(bool v) { 00103 return v ? true_child : false_child; 00104 } 00105 00106 inline 00107 PIP_Tree_Node::Artificial_Parameter::Artificial_Parameter() 00108 : Linear_Expression(), denom(1) { 00109 PPL_ASSERT(OK()); 00110 } 00111 00112 inline 00113 PIP_Tree_Node::Artificial_Parameter 00114 ::Artificial_Parameter(const Artificial_Parameter& y) 00115 : Linear_Expression(y), denom(y.denom) { 00116 PPL_ASSERT(OK()); 00117 } 00118 00119 inline Coefficient_traits::const_reference 00120 PIP_Tree_Node::Artificial_Parameter::denominator() const { 00121 return denom; 00122 } 00123 00124 inline void 00125 PIP_Tree_Node::Artificial_Parameter::swap(Artificial_Parameter& y) { 00126 Linear_Expression::swap(y); 00127 std::swap(denom, y.denom); 00128 } 00129 00130 } // namespace Parma_Polyhedra_Library 00131 00132 #endif // !defined(PPL_PIP_Tree_inlines_hh)
1.6.3