p1788 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +8 -0
  3. data/AUTHORS +6 -0
  4. data/LICENSE +201 -0
  5. data/NOTICE +29 -0
  6. data/README.md +65 -0
  7. data/ext/libieeep1788_copy/README +3 -0
  8. data/ext/libieeep1788_copy/p1788/AUTHORS +16 -0
  9. data/ext/libieeep1788_copy/p1788/LICENSE +202 -0
  10. data/ext/libieeep1788_copy/p1788/NOTICE +14 -0
  11. data/ext/libieeep1788_copy/p1788/decoration/decoration.hpp +265 -0
  12. data/ext/libieeep1788_copy/p1788/exception/exception.hpp +302 -0
  13. data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor.hpp +3443 -0
  14. data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_bool_func_impl.hpp +608 -0
  15. data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_cancel_func_impl.hpp +229 -0
  16. data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_class_impl.hpp +526 -0
  17. data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_elem_func_impl.hpp +4533 -0
  18. data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_io_impl.hpp +1421 -0
  19. data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_mul_rev_to_pair_func_impl.hpp +347 -0
  20. data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_num_func_impl.hpp +655 -0
  21. data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_rec_bool_func_impl.hpp +146 -0
  22. data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_rec_overlap_impl.hpp +188 -0
  23. data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_rev_func_impl.hpp +1674 -0
  24. data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_set_op_impl.hpp +216 -0
  25. data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_setup_func_impl.hpp +68 -0
  26. data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_util_func_impl.hpp +135 -0
  27. data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_validation_func_impl.hpp +93 -0
  28. data/ext/libieeep1788_copy/p1788/infsup/base_interval.hpp +1529 -0
  29. data/ext/libieeep1788_copy/p1788/infsup/base_interval_bool_func_impl.hpp +481 -0
  30. data/ext/libieeep1788_copy/p1788/infsup/base_interval_cancel_func_impl.hpp +126 -0
  31. data/ext/libieeep1788_copy/p1788/infsup/base_interval_elem_func_impl.hpp +1581 -0
  32. data/ext/libieeep1788_copy/p1788/infsup/base_interval_io_impl.hpp +59 -0
  33. data/ext/libieeep1788_copy/p1788/infsup/base_interval_mul_rev_to_pair_func_impl.hpp +88 -0
  34. data/ext/libieeep1788_copy/p1788/infsup/base_interval_num_func_impl.hpp +345 -0
  35. data/ext/libieeep1788_copy/p1788/infsup/base_interval_rec_bool_func_impl.hpp +92 -0
  36. data/ext/libieeep1788_copy/p1788/infsup/base_interval_rec_overlap_impl.hpp +72 -0
  37. data/ext/libieeep1788_copy/p1788/infsup/base_interval_rev_func_impl.hpp +656 -0
  38. data/ext/libieeep1788_copy/p1788/infsup/base_interval_set_op_impl.hpp +126 -0
  39. data/ext/libieeep1788_copy/p1788/infsup/decorated_interval.hpp +464 -0
  40. data/ext/libieeep1788_copy/p1788/infsup/forward_declaration.hpp +66 -0
  41. data/ext/libieeep1788_copy/p1788/infsup/interval.hpp +275 -0
  42. data/ext/libieeep1788_copy/p1788/io/io_manip.hpp +531 -0
  43. data/ext/libieeep1788_copy/p1788/overlapping/overlapping.hpp +241 -0
  44. data/ext/libieeep1788_copy/p1788/p1788.hpp +45 -0
  45. data/ext/libieeep1788_copy/p1788/reduction/reduction.hpp +341 -0
  46. data/ext/libieeep1788_copy/p1788/util/io.hpp +63 -0
  47. data/ext/libieeep1788_copy/p1788/util/mixed_type_traits.hpp +140 -0
  48. data/ext/libieeep1788_copy/p1788/util/mpfr_util.hpp +77 -0
  49. data/ext/libieeep1788_copy/p1788/util/mpfr_var.hpp +119 -0
  50. data/ext/libieeep1788_copy/p1788/util/mpfr_var_impl.hpp +382 -0
  51. data/ext/libieeep1788_copy/p1788/version.hpp +34 -0
  52. data/ext/p1788/extconf.rb +49 -0
  53. data/ext/p1788/p1788.cc +3764 -0
  54. data/lib/p1788/version.rb +4 -0
  55. data/lib/p1788.rb +25 -0
  56. data/p1788.gemspec +72 -0
  57. metadata +99 -0
@@ -0,0 +1,1581 @@
1
+ //
2
+ // libieeep1788
3
+ //
4
+ // An implementation of the preliminary IEEE P1788 standard for
5
+ // interval arithmetic
6
+ //
7
+ //
8
+ // Copyright 2013 - 2015
9
+ //
10
+ // Marco Nehmeier (nehmeier@informatik.uni-wuerzburg.de)
11
+ // Department of Computer Science,
12
+ // University of Wuerzburg, Germany
13
+ //
14
+ // Licensed under the Apache License, Version 2.0 (the "License");
15
+ // you may not use this file except in compliance with the License.
16
+ // You may obtain a copy of the License at
17
+ //
18
+ // http://www.apache.org/licenses/LICENSE-2.0
19
+ //
20
+ // Unless required by applicable law or agreed to in writing, software
21
+ // distributed under the License is distributed on an "AS IS" BASIS,
22
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23
+ // See the License for the specific language governing permissions and
24
+ // limitations under the License.
25
+
26
+ #ifndef LIBIEEEP1788_P1788_INFSUP_BASE_INTERVAL_ELEM_FUNC_IMPL_HPP
27
+ #define LIBIEEEP1788_P1788_INFSUP_BASE_INTERVAL_ELEM_FUNC_IMPL_HPP
28
+
29
+
30
+ namespace p1788
31
+ {
32
+
33
+ namespace infsup
34
+ {
35
+
36
+ // pos
37
+
38
+ // static
39
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
40
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::pos(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
41
+ {
42
+ return concrete_interval( Flavor<T>::pos(x.rep_) );
43
+ }
44
+
45
+ // static mixed type
46
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
47
+ template<typename T_, typename RepType_, class ConcreteInterval_>
48
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::pos(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
49
+ {
50
+ // assert that only bare intervals or decorated intervals are used
51
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
52
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
53
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
54
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
55
+ "It is not supported by mixed type operations to use "
56
+ "interval and decorated_interval types together!"
57
+ );
58
+
59
+ // call of mixed-type version
60
+ return concrete_interval( Flavor<T>::pos(x.rep_) );
61
+ }
62
+
63
+ // function
64
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
65
+ ConcreteInterval pos(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
66
+ {
67
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::pos(x);
68
+ }
69
+
70
+ // operator
71
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
72
+ ConcreteInterval operator+(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
73
+ {
74
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::pos(x);
75
+ }
76
+
77
+
78
+
79
+ // neg
80
+
81
+ // static
82
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
83
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::neg(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
84
+ {
85
+ return concrete_interval( Flavor<T>::neg(x.rep_) );
86
+ }
87
+
88
+ // static mixed type
89
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
90
+ template<typename T_, typename RepType_, class ConcreteInterval_>
91
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::neg(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
92
+ {
93
+ // assert that only bare intervals or decorated intervals are used
94
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
95
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
96
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
97
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
98
+ "It is not supported by mixed type operations to use "
99
+ "interval and decorated_interval types together!"
100
+ );
101
+
102
+ // call of mixed-type version
103
+ return concrete_interval( Flavor<T>::neg(x.rep_) );
104
+ }
105
+
106
+ // function
107
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
108
+ ConcreteInterval neg(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
109
+ {
110
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::neg(x);
111
+ }
112
+
113
+ // operator
114
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
115
+ ConcreteInterval operator-(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
116
+ {
117
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::neg(x);
118
+ }
119
+
120
+
121
+
122
+ // add
123
+
124
+ // static
125
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
126
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::add(base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
127
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& y)
128
+ {
129
+ return concrete_interval( Flavor<T>::add(x.rep_, y.rep_) );
130
+ }
131
+
132
+ // static mixed type
133
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
134
+ template<typename T1, typename RepType1, class ConcreteInterval1, typename T2, typename RepType2, class ConcreteInterval2>
135
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::add(base_interval<T1, Flavor, RepType1, ConcreteInterval1> const& x,
136
+ base_interval<T2, Flavor, RepType2, ConcreteInterval2> const& y)
137
+ {
138
+ // assert that only bare intervals or decorated intervals are used
139
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
140
+ && std::is_same<typename Flavor<T1>::representation, RepType1>::value
141
+ && std::is_same<typename Flavor<T2>::representation, RepType2>::value)
142
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
143
+ && std::is_same<typename Flavor<T1>::representation_dec, RepType1>::value
144
+ && std::is_same<typename Flavor<T2>::representation_dec, RepType2>::value),
145
+ "It is not supported by mixed type operations to use "
146
+ "interval and decorated_interval types together!"
147
+ );
148
+
149
+ // call of mixed-type version
150
+ return concrete_interval( Flavor<T>::add(x.rep_, y.rep_) );
151
+ }
152
+
153
+ // function
154
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
155
+ ConcreteInterval add(base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
156
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& y)
157
+ {
158
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::add(x, y);
159
+ }
160
+
161
+ // operator
162
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
163
+ ConcreteInterval operator+(base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
164
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& y)
165
+ {
166
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::add(x, y);
167
+ }
168
+
169
+
170
+ // sub
171
+
172
+ // static
173
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
174
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::sub(base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
175
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& y)
176
+ {
177
+ return concrete_interval( Flavor<T>::sub(x.rep_, y.rep_) );
178
+ }
179
+
180
+ // static mixed type
181
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
182
+ template<typename T1, typename RepType1, class ConcreteInterval1, typename T2, typename RepType2, class ConcreteInterval2>
183
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::sub(base_interval<T1, Flavor, RepType1, ConcreteInterval1> const& x,
184
+ base_interval<T2, Flavor, RepType2, ConcreteInterval2> const& y)
185
+ {
186
+ // assert that only bare intervals or decorated intervals are used
187
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
188
+ && std::is_same<typename Flavor<T1>::representation, RepType1>::value
189
+ && std::is_same<typename Flavor<T2>::representation, RepType2>::value)
190
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
191
+ && std::is_same<typename Flavor<T1>::representation_dec, RepType1>::value
192
+ && std::is_same<typename Flavor<T2>::representation_dec, RepType2>::value),
193
+ "It is not supported by mixed type operations to use "
194
+ "interval and decorated_interval types together!"
195
+ );
196
+
197
+ // call of mixed-type version
198
+ return concrete_interval( Flavor<T>::sub(x.rep_, y.rep_) );
199
+ }
200
+
201
+ // function
202
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
203
+ ConcreteInterval sub(base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
204
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& y)
205
+ {
206
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::sub(x, y);
207
+ }
208
+
209
+ // operator
210
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
211
+ ConcreteInterval operator-(base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
212
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& y)
213
+ {
214
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::sub(x, y);
215
+ }
216
+
217
+
218
+ // mul
219
+
220
+ // static
221
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
222
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::mul(base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
223
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& y)
224
+ {
225
+ return concrete_interval( Flavor<T>::mul(x.rep_, y.rep_) );
226
+ }
227
+
228
+ // static mixed type
229
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
230
+ template<typename T1, typename RepType1, class ConcreteInterval1, typename T2, typename RepType2, class ConcreteInterval2>
231
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::mul(base_interval<T1, Flavor, RepType1, ConcreteInterval1> const& x,
232
+ base_interval<T2, Flavor, RepType2, ConcreteInterval2> const& y)
233
+ {
234
+ // assert that only bare intervals or decorated intervals are used
235
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
236
+ && std::is_same<typename Flavor<T1>::representation, RepType1>::value
237
+ && std::is_same<typename Flavor<T2>::representation, RepType2>::value)
238
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
239
+ && std::is_same<typename Flavor<T1>::representation_dec, RepType1>::value
240
+ && std::is_same<typename Flavor<T2>::representation_dec, RepType2>::value),
241
+ "It is not supported by mixed type operations to use "
242
+ "interval and decorated_interval types together!"
243
+ );
244
+
245
+ // call of mixed-type version
246
+ return concrete_interval( Flavor<T>::mul(x.rep_, y.rep_) );
247
+ }
248
+
249
+ // function
250
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
251
+ ConcreteInterval mul(base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
252
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& y)
253
+ {
254
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::mul(x, y);
255
+ }
256
+
257
+ // operator
258
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
259
+ ConcreteInterval operator*(base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
260
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& y)
261
+ {
262
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::mul(x, y);
263
+ }
264
+
265
+
266
+
267
+ // div
268
+
269
+ // static
270
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
271
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::div(base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
272
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& y)
273
+ {
274
+ return concrete_interval( Flavor<T>::div(x.rep_, y.rep_) );
275
+ }
276
+
277
+ // static mixed type
278
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
279
+ template<typename T1, typename RepType1, class ConcreteInterval1, typename T2, typename RepType2, class ConcreteInterval2>
280
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::div(base_interval<T1, Flavor, RepType1, ConcreteInterval1> const& x,
281
+ base_interval<T2, Flavor, RepType2, ConcreteInterval2> const& y)
282
+ {
283
+ // assert that only bare intervals or decorated intervals are used
284
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
285
+ && std::is_same<typename Flavor<T1>::representation, RepType1>::value
286
+ && std::is_same<typename Flavor<T2>::representation, RepType2>::value)
287
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
288
+ && std::is_same<typename Flavor<T1>::representation_dec, RepType1>::value
289
+ && std::is_same<typename Flavor<T2>::representation_dec, RepType2>::value),
290
+ "It is not supported by mixed type operations to use "
291
+ "interval and decorated_interval types together!"
292
+ );
293
+
294
+ // call of mixed-type version
295
+ return concrete_interval( Flavor<T>::div(x.rep_, y.rep_) );
296
+ }
297
+
298
+ // function
299
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
300
+ ConcreteInterval div(base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
301
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& y)
302
+ {
303
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::div(x, y);
304
+ }
305
+
306
+ // operator
307
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
308
+ ConcreteInterval operator/(base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
309
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& y)
310
+ {
311
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::div(x, y);
312
+ }
313
+
314
+
315
+
316
+ // recip
317
+
318
+ // static
319
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
320
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::recip(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
321
+ {
322
+ return concrete_interval( Flavor<T>::recip(x.rep_) );
323
+ }
324
+
325
+ // static mixed type
326
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
327
+ template<typename T_, typename RepType_, class ConcreteInterval_>
328
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::recip(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
329
+ {
330
+ // assert that only bare intervals or decorated intervals are used
331
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
332
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
333
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
334
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
335
+ "It is not supported by mixed type operations to use "
336
+ "interval and decorated_interval types together!"
337
+ );
338
+
339
+ // call of mixed-type version
340
+ return concrete_interval( Flavor<T>::recip(x.rep_) );
341
+ }
342
+
343
+ // function
344
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
345
+ ConcreteInterval recip(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
346
+ {
347
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::recip(x);
348
+ }
349
+
350
+
351
+
352
+ // sqr
353
+
354
+ // static
355
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
356
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::sqr(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
357
+ {
358
+ return concrete_interval( Flavor<T>::sqr(x.rep_) );
359
+ }
360
+
361
+ // static mixed type
362
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
363
+ template<typename T_, typename RepType_, class ConcreteInterval_>
364
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::sqr(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
365
+ {
366
+ // assert that only bare intervals or decorated intervals are used
367
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
368
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
369
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
370
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
371
+ "It is not supported by mixed type operations to use "
372
+ "interval and decorated_interval types together!"
373
+ );
374
+
375
+ // call of mixed-type version
376
+ return concrete_interval( Flavor<T>::sqr(x.rep_) );
377
+ }
378
+
379
+ // function
380
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
381
+ ConcreteInterval sqr(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
382
+ {
383
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::sqr(x);
384
+ }
385
+
386
+
387
+
388
+ // sqrt
389
+
390
+ // static
391
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
392
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::sqrt(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
393
+ {
394
+ return concrete_interval( Flavor<T>::sqrt(x.rep_) );
395
+ }
396
+
397
+ // static mixed type
398
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
399
+ template<typename T_, typename RepType_, class ConcreteInterval_>
400
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::sqrt(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
401
+ {
402
+ // assert that only bare intervals or decorated intervals are used
403
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
404
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
405
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
406
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
407
+ "It is not supported by mixed type operations to use "
408
+ "interval and decorated_interval types together!"
409
+ );
410
+
411
+ // call of mixed-type version
412
+ return concrete_interval( Flavor<T>::sqrt(x.rep_) );
413
+ }
414
+
415
+ // function
416
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
417
+ ConcreteInterval sqrt(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
418
+ {
419
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::sqrt(x);
420
+ }
421
+
422
+
423
+
424
+ // fma
425
+
426
+ // static
427
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
428
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::fma(base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
429
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& y,
430
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& z)
431
+ {
432
+ return concrete_interval( Flavor<T>::fma(x.rep_, y.rep_, z.rep_) );
433
+ }
434
+
435
+ // static mixed type
436
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
437
+ template<typename T1, typename RepType1, class ConcreteInterval1,
438
+ typename T2, typename RepType2, class ConcreteInterval2,
439
+ typename T3, typename RepType3, class ConcreteInterval3>
440
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::fma(base_interval<T1, Flavor, RepType1, ConcreteInterval1> const& x,
441
+ base_interval<T2, Flavor, RepType2, ConcreteInterval2> const& y,
442
+ base_interval<T3, Flavor, RepType3, ConcreteInterval3> const& z)
443
+ {
444
+ // assert that only bare intervals or decorated intervals are used
445
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
446
+ && std::is_same<typename Flavor<T1>::representation, RepType1>::value
447
+ && std::is_same<typename Flavor<T2>::representation, RepType2>::value
448
+ && std::is_same<typename Flavor<T3>::representation, RepType3>::value)
449
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
450
+ && std::is_same<typename Flavor<T1>::representation_dec, RepType1>::value
451
+ && std::is_same<typename Flavor<T2>::representation_dec, RepType2>::value
452
+ && std::is_same<typename Flavor<T3>::representation_dec, RepType3>::value),
453
+ "It is not supported by mixed type operations to use "
454
+ "interval and decorated_interval types together!"
455
+ );
456
+
457
+ // call of mixed-type version
458
+ return concrete_interval( Flavor<T>::fma(x.rep_, y.rep_, z.rep_) );
459
+ }
460
+
461
+ // function
462
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
463
+ ConcreteInterval fma(base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
464
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& y,
465
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& z)
466
+ {
467
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::fma(x, y, z);
468
+ }
469
+
470
+
471
+
472
+ // pown
473
+
474
+ // static
475
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
476
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::pown(base_interval<T, Flavor, RepType, ConcreteInterval> const& x, int p)
477
+ {
478
+ return concrete_interval( Flavor<T>::pown(x.rep_, p) );
479
+ }
480
+
481
+ // static mixed type
482
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
483
+ template<typename T_, typename RepType_, class ConcreteInterval_>
484
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::pown(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x, int p)
485
+ {
486
+ // assert that only bare intervals or decorated intervals are used
487
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
488
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
489
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
490
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
491
+ "It is not supported by mixed type operations to use "
492
+ "interval and decorated_interval types together!"
493
+ );
494
+
495
+ // call of mixed-type version
496
+ return concrete_interval( Flavor<T>::pown(x.rep_, p) );
497
+ }
498
+
499
+ // function
500
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
501
+ ConcreteInterval pown(base_interval<T, Flavor, RepType, ConcreteInterval> const& x, int p)
502
+ {
503
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::pown(x, p);
504
+ }
505
+
506
+
507
+
508
+ // pow
509
+
510
+ // static
511
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
512
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::pow(base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
513
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& y)
514
+ {
515
+ return concrete_interval( Flavor<T>::pow(x.rep_, y.rep_) );
516
+ }
517
+
518
+ // static mixed type
519
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
520
+ template<typename T1, typename RepType1, class ConcreteInterval1, typename T2, typename RepType2, class ConcreteInterval2>
521
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::pow(base_interval<T1, Flavor, RepType1, ConcreteInterval1> const& x,
522
+ base_interval<T2, Flavor, RepType2, ConcreteInterval2> const& y)
523
+ {
524
+ // assert that only bare intervals or decorated intervals are used
525
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
526
+ && std::is_same<typename Flavor<T1>::representation, RepType1>::value
527
+ && std::is_same<typename Flavor<T2>::representation, RepType2>::value)
528
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
529
+ && std::is_same<typename Flavor<T1>::representation_dec, RepType1>::value
530
+ && std::is_same<typename Flavor<T2>::representation_dec, RepType2>::value),
531
+ "It is not supported by mixed type operations to use "
532
+ "interval and decorated_interval types together!"
533
+ );
534
+
535
+ // call of mixed-type version
536
+ return concrete_interval( Flavor<T>::pow(x.rep_, y.rep_) );
537
+ }
538
+
539
+ // function
540
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
541
+ ConcreteInterval pow(base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
542
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& y)
543
+ {
544
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::pow(x, y);
545
+ }
546
+
547
+
548
+
549
+ // exp
550
+
551
+ // static
552
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
553
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::exp(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
554
+ {
555
+ return concrete_interval( Flavor<T>::exp(x.rep_) );
556
+ }
557
+
558
+ // static mixed type
559
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
560
+ template<typename T_, typename RepType_, class ConcreteInterval_>
561
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::exp(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
562
+ {
563
+ // assert that only bare intervals or decorated intervals are used
564
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
565
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
566
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
567
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
568
+ "It is not supported by mixed type operations to use "
569
+ "interval and decorated_interval types together!"
570
+ );
571
+
572
+ // call of mixed-type version
573
+ return concrete_interval( Flavor<T>::exp(x.rep_) );
574
+ }
575
+
576
+ // function
577
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
578
+ ConcreteInterval exp(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
579
+ {
580
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::exp(x);
581
+ }
582
+
583
+
584
+
585
+ // exp2
586
+
587
+ // static
588
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
589
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::exp2(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
590
+ {
591
+ return concrete_interval( Flavor<T>::exp2(x.rep_) );
592
+ }
593
+
594
+ // static mixed type
595
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
596
+ template<typename T_, typename RepType_, class ConcreteInterval_>
597
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::exp2(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
598
+ {
599
+ // assert that only bare intervals or decorated intervals are used
600
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
601
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
602
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
603
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
604
+ "It is not supported by mixed type operations to use "
605
+ "interval and decorated_interval types together!"
606
+ );
607
+
608
+ // call of mixed-type version
609
+ return concrete_interval( Flavor<T>::exp2(x.rep_) );
610
+ }
611
+
612
+ // function
613
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
614
+ ConcreteInterval exp2(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
615
+ {
616
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::exp2(x);
617
+ }
618
+
619
+
620
+
621
+ // exp10
622
+
623
+ // static
624
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
625
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::exp10(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
626
+ {
627
+ return concrete_interval( Flavor<T>::exp10(x.rep_) );
628
+ }
629
+
630
+ // static mixed type
631
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
632
+ template<typename T_, typename RepType_, class ConcreteInterval_>
633
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::exp10(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
634
+ {
635
+ // assert that only bare intervals or decorated intervals are used
636
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
637
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
638
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
639
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
640
+ "It is not supported by mixed type operations to use "
641
+ "interval and decorated_interval types together!"
642
+ );
643
+
644
+ // call of mixed-type version
645
+ return concrete_interval( Flavor<T>::exp10(x.rep_) );
646
+ }
647
+
648
+ // function
649
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
650
+ ConcreteInterval exp10(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
651
+ {
652
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::exp10(x);
653
+ }
654
+
655
+
656
+ // log
657
+
658
+ // static
659
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
660
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::log(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
661
+ {
662
+ return concrete_interval( Flavor<T>::log(x.rep_) );
663
+ }
664
+
665
+ // static mixed type
666
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
667
+ template<typename T_, typename RepType_, class ConcreteInterval_>
668
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::log(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
669
+ {
670
+ // assert that only bare intervals or decorated intervals are used
671
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
672
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
673
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
674
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
675
+ "It is not supported by mixed type operations to use "
676
+ "interval and decorated_interval types together!"
677
+ );
678
+
679
+ // call of mixed-type version
680
+ return concrete_interval( Flavor<T>::log(x.rep_) );
681
+ }
682
+
683
+ // function
684
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
685
+ ConcreteInterval log(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
686
+ {
687
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::log(x);
688
+ }
689
+
690
+
691
+
692
+ // log2
693
+
694
+ // static
695
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
696
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::log2(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
697
+ {
698
+ return concrete_interval( Flavor<T>::log2(x.rep_) );
699
+ }
700
+
701
+ // static mixed type
702
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
703
+ template<typename T_, typename RepType_, class ConcreteInterval_>
704
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::log2(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
705
+ {
706
+ // assert that only bare intervals or decorated intervals are used
707
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
708
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
709
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
710
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
711
+ "It is not supported by mixed type operations to use "
712
+ "interval and decorated_interval types together!"
713
+ );
714
+
715
+ // call of mixed-type version
716
+ return concrete_interval( Flavor<T>::log2(x.rep_) );
717
+ }
718
+
719
+ // function
720
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
721
+ ConcreteInterval log2(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
722
+ {
723
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::log2(x);
724
+ }
725
+
726
+
727
+
728
+ // log10
729
+
730
+ // static
731
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
732
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::log10(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
733
+ {
734
+ return concrete_interval( Flavor<T>::log10(x.rep_) );
735
+ }
736
+
737
+ // static mixed type
738
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
739
+ template<typename T_, typename RepType_, class ConcreteInterval_>
740
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::log10(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
741
+ {
742
+ // assert that only bare intervals or decorated intervals are used
743
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
744
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
745
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
746
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
747
+ "It is not supported by mixed type operations to use "
748
+ "interval and decorated_interval types together!"
749
+ );
750
+
751
+ // call of mixed-type version
752
+ return concrete_interval( Flavor<T>::log10(x.rep_) );
753
+ }
754
+
755
+ // function
756
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
757
+ ConcreteInterval log10(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
758
+ {
759
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::log10(x);
760
+ }
761
+
762
+
763
+
764
+
765
+ // sin
766
+
767
+ // static
768
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
769
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::sin(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
770
+ {
771
+ return concrete_interval( Flavor<T>::sin(x.rep_) );
772
+ }
773
+
774
+ // static mixed type
775
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
776
+ template<typename T_, typename RepType_, class ConcreteInterval_>
777
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::sin(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
778
+ {
779
+ // assert that only bare intervals or decorated intervals are used
780
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
781
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
782
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
783
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
784
+ "It is not supported by mixed type operations to use "
785
+ "interval and decorated_interval types together!"
786
+ );
787
+
788
+ // call of mixed-type version
789
+ return concrete_interval( Flavor<T>::sin(x.rep_) );
790
+ }
791
+
792
+ // function
793
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
794
+ ConcreteInterval sin(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
795
+ {
796
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::sin(x);
797
+ }
798
+
799
+
800
+ // cos
801
+
802
+ // static
803
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
804
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::cos(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
805
+ {
806
+ return concrete_interval( Flavor<T>::cos(x.rep_) );
807
+ }
808
+
809
+ // static mixed type
810
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
811
+ template<typename T_, typename RepType_, class ConcreteInterval_>
812
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::cos(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
813
+ {
814
+ // assert that only bare intervals or decorated intervals are used
815
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
816
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
817
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
818
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
819
+ "It is not supported by mixed type operations to use "
820
+ "interval and decorated_interval types together!"
821
+ );
822
+
823
+ // call of mixed-type version
824
+ return concrete_interval( Flavor<T>::cos(x.rep_) );
825
+ }
826
+
827
+ // function
828
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
829
+ ConcreteInterval cos(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
830
+ {
831
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::cos(x);
832
+ }
833
+
834
+
835
+ // tan
836
+
837
+ // static
838
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
839
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::tan(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
840
+ {
841
+ return concrete_interval( Flavor<T>::tan(x.rep_) );
842
+ }
843
+
844
+ // static mixed type
845
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
846
+ template<typename T_, typename RepType_, class ConcreteInterval_>
847
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::tan(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
848
+ {
849
+ // assert that only bare intervals or decorated intervals are used
850
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
851
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
852
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
853
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
854
+ "It is not supported by mixed type operations to use "
855
+ "interval and decorated_interval types together!"
856
+ );
857
+
858
+ // call of mixed-type version
859
+ return concrete_interval( Flavor<T>::tan(x.rep_) );
860
+ }
861
+
862
+ // function
863
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
864
+ ConcreteInterval tan(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
865
+ {
866
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::tan(x);
867
+ }
868
+
869
+
870
+
871
+
872
+
873
+
874
+
875
+
876
+ // asin
877
+
878
+ // static
879
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
880
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::asin(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
881
+ {
882
+ return concrete_interval( Flavor<T>::asin(x.rep_) );
883
+ }
884
+
885
+ // static mixed type
886
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
887
+ template<typename T_, typename RepType_, class ConcreteInterval_>
888
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::asin(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
889
+ {
890
+ // assert that only bare intervals or decorated intervals are used
891
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
892
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
893
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
894
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
895
+ "It is not supported by mixed type operations to use "
896
+ "interval and decorated_interval types together!"
897
+ );
898
+
899
+ // call of mixed-type version
900
+ return concrete_interval( Flavor<T>::asin(x.rep_) );
901
+ }
902
+
903
+ // function
904
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
905
+ ConcreteInterval asin(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
906
+ {
907
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::asin(x);
908
+ }
909
+
910
+
911
+ // acos
912
+
913
+ // static
914
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
915
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::acos(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
916
+ {
917
+ return concrete_interval( Flavor<T>::acos(x.rep_) );
918
+ }
919
+
920
+ // static mixed type
921
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
922
+ template<typename T_, typename RepType_, class ConcreteInterval_>
923
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::acos(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
924
+ {
925
+ // assert that only bare intervals or decorated intervals are used
926
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
927
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
928
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
929
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
930
+ "It is not supported by mixed type operations to use "
931
+ "interval and decorated_interval types together!"
932
+ );
933
+
934
+ // call of mixed-type version
935
+ return concrete_interval( Flavor<T>::acos(x.rep_) );
936
+ }
937
+
938
+ // function
939
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
940
+ ConcreteInterval acos(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
941
+ {
942
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::acos(x);
943
+ }
944
+
945
+
946
+ // atan
947
+
948
+ // static
949
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
950
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::atan(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
951
+ {
952
+ return concrete_interval( Flavor<T>::atan(x.rep_) );
953
+ }
954
+
955
+ // static mixed type
956
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
957
+ template<typename T_, typename RepType_, class ConcreteInterval_>
958
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::atan(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
959
+ {
960
+ // assert that only bare intervals or decorated intervals are used
961
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
962
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
963
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
964
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
965
+ "It is not supported by mixed type operations to use "
966
+ "interval and decorated_interval types together!"
967
+ );
968
+
969
+ // call of mixed-type version
970
+ return concrete_interval( Flavor<T>::atan(x.rep_) );
971
+ }
972
+
973
+ // function
974
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
975
+ ConcreteInterval atan(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
976
+ {
977
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::atan(x);
978
+ }
979
+
980
+
981
+
982
+ // atan2
983
+
984
+ // static
985
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
986
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::atan2(base_interval<T, Flavor, RepType, ConcreteInterval> const& y,
987
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
988
+ {
989
+ return concrete_interval( Flavor<T>::atan2(y.rep_, x.rep_) );
990
+ }
991
+
992
+ // static mixed type
993
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
994
+ template<typename T1, typename RepType1, class ConcreteInterval1, typename T2, typename RepType2, class ConcreteInterval2>
995
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::atan2(base_interval<T1, Flavor, RepType1, ConcreteInterval1> const& y,
996
+ base_interval<T2, Flavor, RepType2, ConcreteInterval2> const& x)
997
+ {
998
+ // assert that only bare intervals or decorated intervals are used
999
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
1000
+ && std::is_same<typename Flavor<T1>::representation, RepType1>::value
1001
+ && std::is_same<typename Flavor<T2>::representation, RepType2>::value)
1002
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
1003
+ && std::is_same<typename Flavor<T1>::representation_dec, RepType1>::value
1004
+ && std::is_same<typename Flavor<T2>::representation_dec, RepType2>::value),
1005
+ "It is not supported by mixed type operations to use "
1006
+ "interval and decorated_interval types together!"
1007
+ );
1008
+
1009
+ // call of mixed-type version
1010
+ return concrete_interval( Flavor<T>::atan2(y.rep_, x.rep_) );
1011
+ }
1012
+
1013
+ // function
1014
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1015
+ ConcreteInterval atan2(base_interval<T, Flavor, RepType, ConcreteInterval> const& y,
1016
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1017
+ {
1018
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::atan2(y, x);
1019
+ }
1020
+
1021
+
1022
+
1023
+
1024
+ // sinh
1025
+
1026
+ // static
1027
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1028
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::sinh(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1029
+ {
1030
+ return concrete_interval( Flavor<T>::sinh(x.rep_) );
1031
+ }
1032
+
1033
+ // static mixed type
1034
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1035
+ template<typename T_, typename RepType_, class ConcreteInterval_>
1036
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::sinh(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
1037
+ {
1038
+ // assert that only bare intervals or decorated intervals are used
1039
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
1040
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
1041
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
1042
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
1043
+ "It is not supported by mixed type operations to use "
1044
+ "interval and decorated_interval types together!"
1045
+ );
1046
+
1047
+ // call of mixed-type version
1048
+ return concrete_interval( Flavor<T>::sinh(x.rep_) );
1049
+ }
1050
+
1051
+ // function
1052
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1053
+ ConcreteInterval sinh(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1054
+ {
1055
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::sinh(x);
1056
+ }
1057
+
1058
+
1059
+ // cosh
1060
+
1061
+ // static
1062
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1063
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::cosh(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1064
+ {
1065
+ return concrete_interval( Flavor<T>::cosh(x.rep_) );
1066
+ }
1067
+
1068
+ // static mixed type
1069
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1070
+ template<typename T_, typename RepType_, class ConcreteInterval_>
1071
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::cosh(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
1072
+ {
1073
+ // assert that only bare intervals or decorated intervals are used
1074
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
1075
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
1076
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
1077
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
1078
+ "It is not supported by mixed type operations to use "
1079
+ "interval and decorated_interval types together!"
1080
+ );
1081
+
1082
+ // call of mixed-type version
1083
+ return concrete_interval( Flavor<T>::cosh(x.rep_) );
1084
+ }
1085
+
1086
+ // function
1087
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1088
+ ConcreteInterval cosh(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1089
+ {
1090
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::cosh(x);
1091
+ }
1092
+
1093
+
1094
+ // tanh
1095
+
1096
+ // static
1097
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1098
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::tanh(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1099
+ {
1100
+ return concrete_interval( Flavor<T>::tanh(x.rep_) );
1101
+ }
1102
+
1103
+ // static mixed type
1104
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1105
+ template<typename T_, typename RepType_, class ConcreteInterval_>
1106
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::tanh(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
1107
+ {
1108
+ // assert that only bare intervals or decorated intervals are used
1109
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
1110
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
1111
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
1112
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
1113
+ "It is not supported by mixed type operations to use "
1114
+ "interval and decorated_interval types together!"
1115
+ );
1116
+
1117
+ // call of mixed-type version
1118
+ return concrete_interval( Flavor<T>::tanh(x.rep_) );
1119
+ }
1120
+
1121
+ // function
1122
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1123
+ ConcreteInterval tanh(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1124
+ {
1125
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::tanh(x);
1126
+ }
1127
+
1128
+
1129
+
1130
+ // asinh
1131
+
1132
+ // static
1133
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1134
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::asinh(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1135
+ {
1136
+ return concrete_interval( Flavor<T>::asinh(x.rep_) );
1137
+ }
1138
+
1139
+ // static mixed type
1140
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1141
+ template<typename T_, typename RepType_, class ConcreteInterval_>
1142
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::asinh(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
1143
+ {
1144
+ // assert that only bare intervals or decorated intervals are used
1145
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
1146
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
1147
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
1148
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
1149
+ "It is not supported by mixed type operations to use "
1150
+ "interval and decorated_interval types together!"
1151
+ );
1152
+
1153
+ // call of mixed-type version
1154
+ return concrete_interval( Flavor<T>::asinh(x.rep_) );
1155
+ }
1156
+
1157
+ // function
1158
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1159
+ ConcreteInterval asinh(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1160
+ {
1161
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::asinh(x);
1162
+ }
1163
+
1164
+
1165
+ // acosh
1166
+
1167
+ // static
1168
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1169
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::acosh(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1170
+ {
1171
+ return concrete_interval( Flavor<T>::acosh(x.rep_) );
1172
+ }
1173
+
1174
+ // static mixed type
1175
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1176
+ template<typename T_, typename RepType_, class ConcreteInterval_>
1177
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::acosh(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
1178
+ {
1179
+ // assert that only bare intervals or decorated intervals are used
1180
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
1181
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
1182
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
1183
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
1184
+ "It is not supported by mixed type operations to use "
1185
+ "interval and decorated_interval types together!"
1186
+ );
1187
+
1188
+ // call of mixed-type version
1189
+ return concrete_interval( Flavor<T>::acosh(x.rep_) );
1190
+ }
1191
+
1192
+ // function
1193
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1194
+ ConcreteInterval acosh(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1195
+ {
1196
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::acosh(x);
1197
+ }
1198
+
1199
+
1200
+ // atanh
1201
+
1202
+ // static
1203
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1204
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::atanh(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1205
+ {
1206
+ return concrete_interval( Flavor<T>::atanh(x.rep_) );
1207
+ }
1208
+
1209
+ // static mixed type
1210
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1211
+ template<typename T_, typename RepType_, class ConcreteInterval_>
1212
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::atanh(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
1213
+ {
1214
+ // assert that only bare intervals or decorated intervals are used
1215
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
1216
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
1217
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
1218
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
1219
+ "It is not supported by mixed type operations to use "
1220
+ "interval and decorated_interval types together!"
1221
+ );
1222
+
1223
+ // call of mixed-type version
1224
+ return concrete_interval( Flavor<T>::atanh(x.rep_) );
1225
+ }
1226
+
1227
+ // function
1228
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1229
+ ConcreteInterval atanh(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1230
+ {
1231
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::atanh(x);
1232
+ }
1233
+
1234
+
1235
+
1236
+ // sign
1237
+
1238
+ // static
1239
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1240
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::sign(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1241
+ {
1242
+ return concrete_interval( Flavor<T>::sign(x.rep_) );
1243
+ }
1244
+
1245
+ // static mixed type
1246
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1247
+ template<typename T_, typename RepType_, class ConcreteInterval_>
1248
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::sign(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
1249
+ {
1250
+ // assert that only bare intervals or decorated intervals are used
1251
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
1252
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
1253
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
1254
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
1255
+ "It is not supported by mixed type operations to use "
1256
+ "interval and decorated_interval types together!"
1257
+ );
1258
+
1259
+ // call of mixed-type version
1260
+ return concrete_interval( Flavor<T>::sign(x.rep_) );
1261
+ }
1262
+
1263
+ // function
1264
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1265
+ ConcreteInterval sign(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1266
+ {
1267
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::sign(x);
1268
+ }
1269
+
1270
+
1271
+
1272
+
1273
+ // ceil
1274
+
1275
+ // static
1276
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1277
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::ceil(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1278
+ {
1279
+ return concrete_interval( Flavor<T>::ceil(x.rep_) );
1280
+ }
1281
+
1282
+ // static mixed type
1283
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1284
+ template<typename T_, typename RepType_, class ConcreteInterval_>
1285
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::ceil(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
1286
+ {
1287
+ // assert that only bare intervals or decorated intervals are used
1288
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
1289
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
1290
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
1291
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
1292
+ "It is not supported by mixed type operations to use "
1293
+ "interval and decorated_interval types together!"
1294
+ );
1295
+
1296
+ // call of mixed-type version
1297
+ return concrete_interval( Flavor<T>::ceil(x.rep_) );
1298
+ }
1299
+
1300
+ // function
1301
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1302
+ ConcreteInterval ceil(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1303
+ {
1304
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::ceil(x);
1305
+ }
1306
+
1307
+
1308
+
1309
+
1310
+ // floor
1311
+
1312
+ // static
1313
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1314
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::floor(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1315
+ {
1316
+ return concrete_interval( Flavor<T>::floor(x.rep_) );
1317
+ }
1318
+
1319
+ // static mixed type
1320
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1321
+ template<typename T_, typename RepType_, class ConcreteInterval_>
1322
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::floor(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
1323
+ {
1324
+ // assert that only bare intervals or decorated intervals are used
1325
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
1326
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
1327
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
1328
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
1329
+ "It is not supported by mixed type operations to use "
1330
+ "interval and decorated_interval types together!"
1331
+ );
1332
+
1333
+ // call of mixed-type version
1334
+ return concrete_interval( Flavor<T>::floor(x.rep_) );
1335
+ }
1336
+
1337
+ // function
1338
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1339
+ ConcreteInterval floor(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1340
+ {
1341
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::floor(x);
1342
+ }
1343
+
1344
+
1345
+
1346
+
1347
+ // trunc
1348
+
1349
+ // static
1350
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1351
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::trunc(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1352
+ {
1353
+ return concrete_interval( Flavor<T>::trunc(x.rep_) );
1354
+ }
1355
+
1356
+ // static mixed type
1357
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1358
+ template<typename T_, typename RepType_, class ConcreteInterval_>
1359
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::trunc(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
1360
+ {
1361
+ // assert that only bare intervals or decorated intervals are used
1362
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
1363
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
1364
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
1365
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
1366
+ "It is not supported by mixed type operations to use "
1367
+ "interval and decorated_interval types together!"
1368
+ );
1369
+
1370
+ // call of mixed-type version
1371
+ return concrete_interval( Flavor<T>::trunc(x.rep_) );
1372
+ }
1373
+
1374
+ // function
1375
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1376
+ ConcreteInterval trunc(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1377
+ {
1378
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::trunc(x);
1379
+ }
1380
+
1381
+
1382
+
1383
+
1384
+ // round_ties_to_even
1385
+
1386
+ // static
1387
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1388
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::round_ties_to_even(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1389
+ {
1390
+ return concrete_interval( Flavor<T>::round_ties_to_even(x.rep_) );
1391
+ }
1392
+
1393
+ // static mixed type
1394
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1395
+ template<typename T_, typename RepType_, class ConcreteInterval_>
1396
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::round_ties_to_even(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
1397
+ {
1398
+ // assert that only bare intervals or decorated intervals are used
1399
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
1400
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
1401
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
1402
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
1403
+ "It is not supported by mixed type operations to use "
1404
+ "interval and decorated_interval types together!"
1405
+ );
1406
+
1407
+ // call of mixed-type version
1408
+ return concrete_interval( Flavor<T>::round_ties_to_even(x.rep_) );
1409
+ }
1410
+
1411
+ // function
1412
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1413
+ ConcreteInterval round_ties_to_even(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1414
+ {
1415
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::round_ties_to_even(x);
1416
+ }
1417
+
1418
+
1419
+
1420
+
1421
+ // round_ties_to_away
1422
+
1423
+ // static
1424
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1425
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::round_ties_to_away(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1426
+ {
1427
+ return concrete_interval( Flavor<T>::round_ties_to_away(x.rep_) );
1428
+ }
1429
+
1430
+ // static mixed type
1431
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1432
+ template<typename T_, typename RepType_, class ConcreteInterval_>
1433
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::round_ties_to_away(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
1434
+ {
1435
+ // assert that only bare intervals or decorated intervals are used
1436
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
1437
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
1438
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
1439
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
1440
+ "It is not supported by mixed type operations to use "
1441
+ "interval and decorated_interval types together!"
1442
+ );
1443
+
1444
+ // call of mixed-type version
1445
+ return concrete_interval( Flavor<T>::round_ties_to_away(x.rep_) );
1446
+ }
1447
+
1448
+ // function
1449
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1450
+ ConcreteInterval round_ties_to_away(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1451
+ {
1452
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::round_ties_to_away(x);
1453
+ }
1454
+
1455
+
1456
+
1457
+
1458
+ // abs
1459
+
1460
+ // static
1461
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1462
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::abs(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1463
+ {
1464
+ return concrete_interval( Flavor<T>::abs(x.rep_) );
1465
+ }
1466
+
1467
+ // static mixed type
1468
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1469
+ template<typename T_, typename RepType_, class ConcreteInterval_>
1470
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::abs(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
1471
+ {
1472
+ // assert that only bare intervals or decorated intervals are used
1473
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
1474
+ && std::is_same<typename Flavor<T_>::representation, RepType_>::value)
1475
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
1476
+ && std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
1477
+ "It is not supported by mixed type operations to use "
1478
+ "interval and decorated_interval types together!"
1479
+ );
1480
+
1481
+ // call of mixed-type version
1482
+ return concrete_interval( Flavor<T>::abs(x.rep_) );
1483
+ }
1484
+
1485
+ // function
1486
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1487
+ ConcreteInterval abs(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
1488
+ {
1489
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::abs(x);
1490
+ }
1491
+
1492
+
1493
+
1494
+
1495
+ // min
1496
+
1497
+ // static
1498
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1499
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::min(base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
1500
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& y)
1501
+ {
1502
+ return concrete_interval( Flavor<T>::min(x.rep_, y.rep_) );
1503
+ }
1504
+
1505
+ // static mixed type
1506
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1507
+ template<typename T1, typename RepType1, class ConcreteInterval1, typename T2, typename RepType2, class ConcreteInterval2>
1508
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::min(base_interval<T1, Flavor, RepType1, ConcreteInterval1> const& x,
1509
+ base_interval<T2, Flavor, RepType2, ConcreteInterval2> const& y)
1510
+ {
1511
+ // assert that only bare intervals or decorated intervals are used
1512
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
1513
+ && std::is_same<typename Flavor<T1>::representation, RepType1>::value
1514
+ && std::is_same<typename Flavor<T2>::representation, RepType2>::value)
1515
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
1516
+ && std::is_same<typename Flavor<T1>::representation_dec, RepType1>::value
1517
+ && std::is_same<typename Flavor<T2>::representation_dec, RepType2>::value),
1518
+ "It is not supported by mixed type operations to use "
1519
+ "interval and decorated_interval types together!"
1520
+ );
1521
+
1522
+ // call of mixed-type version
1523
+ return concrete_interval( Flavor<T>::min(x.rep_, y.rep_) );
1524
+ }
1525
+
1526
+ // function
1527
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1528
+ ConcreteInterval min(base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
1529
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& y)
1530
+ {
1531
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::min(x, y);
1532
+ }
1533
+
1534
+
1535
+ // max
1536
+
1537
+ // static
1538
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1539
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::max(base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
1540
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& y)
1541
+ {
1542
+ return concrete_interval( Flavor<T>::max(x.rep_, y.rep_) );
1543
+ }
1544
+
1545
+ // static mixed type
1546
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1547
+ template<typename T1, typename RepType1, class ConcreteInterval1, typename T2, typename RepType2, class ConcreteInterval2>
1548
+ ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::max(base_interval<T1, Flavor, RepType1, ConcreteInterval1> const& x,
1549
+ base_interval<T2, Flavor, RepType2, ConcreteInterval2> const& y)
1550
+ {
1551
+ // assert that only bare intervals or decorated intervals are used
1552
+ static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
1553
+ && std::is_same<typename Flavor<T1>::representation, RepType1>::value
1554
+ && std::is_same<typename Flavor<T2>::representation, RepType2>::value)
1555
+ || (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
1556
+ && std::is_same<typename Flavor<T1>::representation_dec, RepType1>::value
1557
+ && std::is_same<typename Flavor<T2>::representation_dec, RepType2>::value),
1558
+ "It is not supported by mixed type operations to use "
1559
+ "interval and decorated_interval types together!"
1560
+ );
1561
+
1562
+ // call of mixed-type version
1563
+ return concrete_interval( Flavor<T>::max(x.rep_, y.rep_) );
1564
+ }
1565
+
1566
+ // function
1567
+ template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
1568
+ ConcreteInterval max(base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
1569
+ base_interval<T, Flavor, RepType, ConcreteInterval> const& y)
1570
+ {
1571
+ return base_interval<T,Flavor,RepType,ConcreteInterval>::max(x, y);
1572
+ }
1573
+
1574
+
1575
+
1576
+ } // namespace infsup
1577
+
1578
+ } // namespace p1788
1579
+
1580
+
1581
+ #endif // LIBIEEEP1788_P1788_INFSUP_BASE_INTERVAL_ELEM_FUNC_IMPL_HPP