PPL  1.2
PIP_Tree_inlines.hh
Go to the documentation of this file.
1 /* PIP_Tree related class implementation: inline functions.
2  Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
3  Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com)
4 
5 This file is part of the Parma Polyhedra Library (PPL).
6 
7 The PPL is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 The PPL is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software Foundation,
19 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
20 
21 For the most up-to-date information see the Parma Polyhedra Library
22 site: http://bugseng.com/products/ppl/ . */
23 
24 #ifndef PPL_PIP_Tree_inlines_hh
25 #define PPL_PIP_Tree_inlines_hh 1
26 
27 namespace Parma_Polyhedra_Library {
28 
29 inline
31  : s(), t(), denom(1) {
32  PPL_ASSERT(OK());
33 }
34 
35 inline
37  : s(y.s), t(y.t), denom(y.denom) {
38  PPL_ASSERT(OK());
39 }
40 
41 inline
43 }
44 
45 inline bool
47  return denom == 1;
48 }
49 
50 inline Coefficient_traits::const_reference
52  return denom;
53 }
54 
55 inline void
57  parent_ = p;
58 }
59 
60 inline const PIP_Decision_Node*
62  return parent_;
63 }
64 
65 inline const PIP_Problem*
67  return owner_;
68 }
69 
70 inline const Constraint_System&
72  return constraints_;
73 }
74 
75 inline PIP_Tree_Node::Artificial_Parameter_Sequence::const_iterator
77  return artificial_parameters.begin();
78 }
79 
80 inline PIP_Tree_Node::Artificial_Parameter_Sequence::const_iterator
82  return artificial_parameters.end();
83 }
84 
85 inline dimension_type
87  return artificial_parameters.size();
88 }
89 
90 inline
91 const PIP_Tree_Node*
93  return b ? true_child : false_child;
94 }
95 
96 inline
99  return b ? true_child : false_child;
100 }
101 
102 inline
104  : Linear_Expression(), denom(1) {
105  PPL_ASSERT(OK());
106 }
107 
108 inline
111  : Linear_Expression(y), denom(y.denom) {
112  PPL_ASSERT(OK());
113 }
114 
115 inline Coefficient_traits::const_reference
117  return denom;
118 }
119 
120 inline void
123  using std::swap;
124  swap(denom, y.denom);
125 }
126 
128 inline void
131  x.m_swap(y);
132 }
133 
134 } // namespace Parma_Polyhedra_Library
135 
136 #endif // !defined(PPL_PIP_Tree_inlines_hh)
Artificial_Parameter_Sequence::const_iterator art_parameter_begin() const
Returns a const_iterator to the beginning of local artificial parameters.
const PIP_Problem * owner_
A pointer to the PIP_Problem object owning this node.
Coefficient denom
The normalized (i.e., positive) denominator.
Artificial parameters in PIP solution trees.
void swap(CO_Tree &x, CO_Tree &y)
size_t dimension_type
An unsigned integral type for representing space dimensions.
const PIP_Decision_Node * parent() const
Returns a pointer to this node's parent.
const PIP_Problem * get_owner() const
Returns a pointer to the PIP_Problem owning object.
A Parametric Integer (linear) Programming problem.
Artificial_Parameter_Sequence::const_iterator art_parameter_end() const
Returns a const_iterator to the end of local artificial parameters.
A tree node representing a decision in the space of solutions.
dimension_type art_parameter_count() const
Returns the number of local artificial parameters.
bool OK() const
Returns true if and only if *this is well formed.
Definition: PIP_Tree.cc:1168
Coefficient_traits::const_reference denominator() const
Returns the value of the denominator.
bool OK() const
Returns true if and only if the parameter is well-formed.
Definition: PIP_Tree.cc:997
const Constraint_System & constraints() const
Returns the system of parameter constraints controlling *this.
void set_parent(const PIP_Decision_Node *p)
Set this node's parent to *p.
Coefficient_traits::const_reference denominator() const
Returns the normalized (i.e., positive) denominator.
bool is_integer() const
Tests whether the matrix is integer, i.e., the denominator is 1.
const PIP_Tree_Node * child_node(bool b) const
Returns a const pointer to the b (true or false) branch of *this.
const PIP_Decision_Node * parent_
A pointer to the parent of *this, null if *this is the root.
Artificial_Parameter()
Default constructor: builds a zero artificial parameter.
The entire library is confined to this namespace.
Definition: version.hh:61
Artificial_Parameter_Sequence artificial_parameters
The local sequence of expressions for local artificial parameters.
void swap(PIP_Tree_Node::Artificial_Parameter &x, PIP_Tree_Node::Artificial_Parameter &y)
void m_swap(Artificial_Parameter &y)
Swaps *this with y.
Constraint_System constraints_
The local system of parameter constraints.
A node of the PIP solution tree.
void m_swap(Linear_Expression &y)
Swaps *this with y.
The type for parametric simplex tableau.