1 /* Sum_Floating_Point_Expression class implementation: inline
2 functions.
3 Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
4 Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com)
5
6 This file is part of the Parma Polyhedra Library (PPL).
7
8 The PPL is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the
10 Free Software Foundation; either version 3 of the License, or (at your
11 option) any later version.
12
13 The PPL is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software Foundation,
20 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
21
22 For the most up-to-date information see the Parma Polyhedra Library
23 site: http://bugseng.com/products/ppl/ . */
24
25 #ifndef PPL_Sum_Floating_Point_Expression_inlines_hh
26 #define PPL_Sum_Floating_Point_Expression_inlines_hh 1
27
28 #include "globals_defs.hh"
29
30 namespace Parma_Polyhedra_Library {
31
32 template <typename FP_Interval_Type, typename FP_Format>
33 inline
34 Sum_Floating_Point_Expression<FP_Interval_Type, FP_Format>
Sum_Floating_Point_Expression(Floating_Point_Expression<FP_Interval_Type,FP_Format> * const x,Floating_Point_Expression<FP_Interval_Type,FP_Format> * const y)35 ::Sum_Floating_Point_Expression(
36 Floating_Point_Expression<FP_Interval_Type, FP_Format>* const x,
37 Floating_Point_Expression<FP_Interval_Type, FP_Format>* const y)
38 : first_operand(x), second_operand(y) {
39 assert(x != 0);
40 assert(y != 0);
41 }
42
43 template <typename FP_Interval_Type, typename FP_Format>
44 inline
45 Sum_Floating_Point_Expression<FP_Interval_Type, FP_Format>
~Sum_Floating_Point_Expression()46 ::~Sum_Floating_Point_Expression() {
47 delete first_operand;
48 delete second_operand;
49 }
50
51 template <typename FP_Interval_Type, typename FP_Format>
52 inline void
53 Sum_Floating_Point_Expression<FP_Interval_Type, FP_Format>
m_swap(Sum_Floating_Point_Expression<FP_Interval_Type,FP_Format> & y)54 ::m_swap(Sum_Floating_Point_Expression<FP_Interval_Type, FP_Format>& y) {
55 using std::swap;
56 swap(first_operand, y.first_operand);
57 swap(second_operand, y.second_operand);
58 }
59
60 /*! \relates Sum_Floating_Point_Expression */
61 template <typename FP_Interval_Type, typename FP_Format>
62 inline void
swap(Sum_Floating_Point_Expression<FP_Interval_Type,FP_Format> & x,Sum_Floating_Point_Expression<FP_Interval_Type,FP_Format> & y)63 swap(Sum_Floating_Point_Expression<FP_Interval_Type, FP_Format>& x,
64 Sum_Floating_Point_Expression<FP_Interval_Type, FP_Format>& y) {
65 x.m_swap(y);
66 }
67
68 } // namespace Parma_Polyhedra_Library
69
70 #endif // !defined(PPL_Sum_Floating_Point_Expression_inlines_hh)
71