PPL  1.2
Result_defs.hh
Go to the documentation of this file.
1 /* Result enum and supporting function declarations.
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_Result_defs_hh
25 #define PPL_Result_defs_hh 1
26 
27 namespace Parma_Polyhedra_Library {
28 
31  VC_NORMAL = 0U << 4,
32 
34  VC_MINUS_INFINITY = 1U << 4,
35 
37  VC_PLUS_INFINITY = 2U << 4,
38 
40  VC_NAN = 3U << 4,
41 
43 };
44 
45 // This must be kept in sync with Relation_Symbol
48  VR_EMPTY = 0U,
49 
51  VR_EQ = 1U,
52 
54  VR_LT = 2U,
55 
57  VR_GT = 4U,
58 
61 
64 
67 
70 
72 };
73 
75 
76 enum Result {
79 
81  V_EQ = static_cast<unsigned>(VR_EQ),
82 
84  V_LT = static_cast<unsigned>(VR_LT),
85 
87  V_GT = static_cast<unsigned>(VR_GT),
88 
91 
94 
97 
100 
102  V_OVERFLOW = 1U << 6,
103 
106 
109 
111  V_LT_PLUS_INFINITY = V_LT | static_cast<unsigned>(VC_PLUS_INFINITY),
112 
114  V_GT_MINUS_INFINITY = V_GT | static_cast<unsigned>(VC_MINUS_INFINITY),
115 
117  V_EQ_MINUS_INFINITY = V_EQ | static_cast<unsigned>(VC_MINUS_INFINITY),
118 
120  V_EQ_PLUS_INFINITY = V_EQ | static_cast<unsigned>(VC_PLUS_INFINITY),
121 
123  V_NAN = static_cast<unsigned>(VC_NAN),
124 
126  V_CVT_STR_UNK = V_NAN | (1U << 8),
127 
129  V_DIV_ZERO = V_NAN | (2U << 8),
130 
132  V_INF_ADD_INF = V_NAN | (3U << 8),
133 
135  V_INF_DIV_INF = V_NAN | (4U << 8),
136 
138  V_INF_MOD = V_NAN | (5U << 8),
139 
141  V_INF_MUL_ZERO = V_NAN | (6U << 8),
142 
144  V_INF_SUB_INF = V_NAN | (7U << 8),
145 
147  V_MOD_ZERO = V_NAN | (8U << 8),
148 
150  V_SQRT_NEG = V_NAN | (9U << 8),
151 
154 
157 
160 
161 };
162 
164 
165 
168 
171 
174 
180 
185 
188 
190 
191 } // namespace Parma_Polyhedra_Library
192 
193 #include "Result_inlines.hh"
194 
195 #endif // !defined(PPL_Result_defs_hh)
A positive integer overflow occurred (rounding down).
Definition: Result_defs.hh:108
The computed result is exact.
Definition: Result_defs.hh:81
Taking the square root of a negative number.
Definition: Result_defs.hh:150
The exact result is a number out of finite bounds.
Definition: Result_defs.hh:102
Unknown result due to intermediate positive overflow.
Definition: Result_defs.hh:156
All values satisfy the relation.
Definition: Result_defs.hh:69
A positive integer overflow occurred (rounding up).
Definition: Result_defs.hh:111
Computing a remainder modulo zero.
Definition: Result_defs.hh:147
Result
Possible outcomes of a checked arithmetic computation.
Definition: Result_defs.hh:76
Negative infinity result class.
Definition: Result_defs.hh:34
Less or equal. This need to be accompanied by a value.
Definition: Result_defs.hh:63
Not a number result class.
Definition: Result_defs.hh:40
Result_Relation result_relation(Result r)
Not a number result.
Definition: Result_defs.hh:123
Taking the modulus of an infinity.
Definition: Result_defs.hh:138
The computed result is inexact and rounded down.
Definition: Result_defs.hh:87
Not equal. This need to be accompanied by a value.
Definition: Result_defs.hh:60
The exact result is not comparable.
Definition: Result_defs.hh:78
I_Result operator&(I_Result a, I_Result b)
Positive infinity result class.
Definition: Result_defs.hh:37
Result_Class result_class(Result r)
Unknown result due to intermediate negative overflow.
Definition: Result_defs.hh:153
The computed result is not representable.
Definition: Result_defs.hh:159
Representable number result class.
Definition: Result_defs.hh:31
Equal. This need to be accompanied by a value.
Definition: Result_defs.hh:51
Less than. This need to be accompanied by a value.
Definition: Result_defs.hh:54
I_Result operator|(I_Result a, I_Result b)
The computed result is inexact.
Definition: Result_defs.hh:90
Result result_relation_class(Result r)
Converting from unknown string.
Definition: Result_defs.hh:126
Greater or equal. This need to be accompanied by a value.
Definition: Result_defs.hh:66
The computed result may be inexact and rounded up.
Definition: Result_defs.hh:93
The entire library is confined to this namespace.
Definition: version.hh:61
Adding two infinities having opposite signs.
Definition: Result_defs.hh:132
Greater than. This need to be accompanied by a value.
Definition: Result_defs.hh:57
The computed result may be inexact and rounded down.
Definition: Result_defs.hh:96
Subtracting two infinities having the same sign.
Definition: Result_defs.hh:144
No values satisfies the relation.
Definition: Result_defs.hh:48
Enable_If< Is_Singleton< T >::value, Interval< B, Info > >::type operator-(const Interval< B, Info > &x, const T &y)
A negative integer overflow occurred (rounding down).
Definition: Result_defs.hh:114
The computed result is inexact and rounded up.
Definition: Result_defs.hh:84
The computed result may be inexact.
Definition: Result_defs.hh:99
Multiplying an infinity by zero.
Definition: Result_defs.hh:141
A negative integer overflow occurred (rounding up).
Definition: Result_defs.hh:105