1 /* Test Octagonal_Shape::max_space_dimension().
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 #include "ppl_test.hh"
25 
26 namespace {
27 
28 bool
test01()29 test01() {
30   nout << Octagonal_Shape<signed char>::max_space_dimension()
31        << " (signed char)"
32        << endl
33        << Octagonal_Shape<short>::max_space_dimension() << " (short)"
34        << endl
35        << Octagonal_Shape<int>::max_space_dimension() << " (int)"
36        << endl
37        << Octagonal_Shape<long>::max_space_dimension() << " (long)"
38        << endl
39        << Octagonal_Shape<long long>::max_space_dimension() << " (long long)"
40        << endl
41 #if PPL_SUPPORTED_FLOAT
42        << Octagonal_Shape<float>::max_space_dimension() << " (float)"
43        << endl
44 #endif
45 #if PPL_SUPPORTED_DOUBLE
46        << Octagonal_Shape<double>::max_space_dimension() << " (double)"
47        << endl
48 #endif
49 #if PPL_SUPPORTED_LONG_DOUBLE
50        << Octagonal_Shape<long double>::max_space_dimension()
51        << " (long double)"
52        << endl
53 #endif
54        << Octagonal_Shape<mpz_class>::max_space_dimension() << " (mpz_class)"
55        << endl
56        << Octagonal_Shape<mpq_class>::max_space_dimension() << " (mpq_class)"
57        << endl;
58 
59   if (Octagonal_Shape<signed char>::max_space_dimension()
60       < Octagonal_Shape<short>::max_space_dimension())
61     return false;
62 
63   if (Octagonal_Shape<short>::max_space_dimension()
64       < Octagonal_Shape<int>::max_space_dimension())
65     return false;
66 
67   if (Octagonal_Shape<int>::max_space_dimension()
68       < Octagonal_Shape<long>::max_space_dimension())
69     return false;
70 
71   if (Octagonal_Shape<long>::max_space_dimension()
72       < Octagonal_Shape<long long>::max_space_dimension())
73     return false;
74 
75 #if PPL_SUPPORTED_FLOAT && PPL_SUPPORTED_DOUBLE
76   if (Octagonal_Shape<float>::max_space_dimension()
77       < Octagonal_Shape<double>::max_space_dimension())
78     return false;
79 #endif
80 
81 #if PPL_SUPPORTED_DOUBLE && PPL_SUPPORTED_LONG_DOUBLE
82   if (Octagonal_Shape<double>::max_space_dimension()
83       < Octagonal_Shape<long double>::max_space_dimension())
84     return false;
85 #endif
86 
87   if (2*Octagonal_Shape<mpz_class>::max_space_dimension()
88       < Octagonal_Shape<mpq_class>::max_space_dimension())
89     return false;
90 
91   return true;
92 }
93 
94 } // namespace
95 
96 BEGIN_MAIN
97   DO_TEST(test01);
98 END_MAIN
99 
100