1 /* PIP_Problem 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_Problem_inlines_hh
25 #define PPL_PIP_Problem_inlines_hh 1
26
27 namespace Parma_Polyhedra_Library {
28
29 inline dimension_type
space_dimension() const30 PIP_Problem::space_dimension() const {
31 return external_space_dim;
32 }
33
34 inline dimension_type
max_space_dimension()35 PIP_Problem::max_space_dimension() {
36 return Constraint::max_space_dimension();
37 }
38
39 inline PIP_Problem::const_iterator
constraints_begin() const40 PIP_Problem::constraints_begin() const {
41 return input_cs.begin();
42 }
43
44 inline PIP_Problem::const_iterator
constraints_end() const45 PIP_Problem::constraints_end() const {
46 return input_cs.end();
47 }
48
49 inline const Variables_Set&
parameter_space_dimensions() const50 PIP_Problem::parameter_space_dimensions() const {
51 return parameters;
52 }
53
54 inline void
m_swap(PIP_Problem & y)55 PIP_Problem::m_swap(PIP_Problem& y) {
56 using std::swap;
57 swap(external_space_dim, y.external_space_dim);
58 swap(internal_space_dim, y.internal_space_dim);
59 swap(status, y.status);
60 swap(current_solution, y.current_solution);
61 swap(input_cs, y.input_cs);
62 swap(first_pending_constraint, y.first_pending_constraint);
63 swap(parameters, y.parameters);
64 swap(initial_context, y.initial_context);
65 for (dimension_type i = CONTROL_PARAMETER_NAME_SIZE; i-- > 0; ) {
66 swap(control_parameters[i], y.control_parameters[i]);
67 }
68 swap(big_parameter_dimension, y.big_parameter_dimension);
69 }
70
71 inline PIP_Problem&
operator =(const PIP_Problem & y)72 PIP_Problem::operator=(const PIP_Problem& y) {
73 PIP_Problem tmp(y);
74 m_swap(tmp);
75 return *this;
76 }
77
78 inline PIP_Problem::Control_Parameter_Value
get_control_parameter(Control_Parameter_Name name) const79 PIP_Problem::get_control_parameter(Control_Parameter_Name name) const {
80 PPL_ASSERT(name >= 0 && name < CONTROL_PARAMETER_NAME_SIZE);
81 return control_parameters[name];
82 }
83
84 inline dimension_type
get_big_parameter_dimension() const85 PIP_Problem::get_big_parameter_dimension() const {
86 return big_parameter_dimension;
87 }
88
89 /*! \relates PIP_Problem */
90 inline void
swap(PIP_Problem & x,PIP_Problem & y)91 swap(PIP_Problem& x, PIP_Problem& y) {
92 x.m_swap(y);
93 }
94
95 } // namespace Parma_Polyhedra_Library
96
97 #endif // !defined(PPL_PIP_Problem_inlines_hh)
98