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.
- checksums.yaml +7 -0
- data/.yardopts +8 -0
- data/AUTHORS +6 -0
- data/LICENSE +201 -0
- data/NOTICE +29 -0
- data/README.md +65 -0
- data/ext/libieeep1788_copy/README +3 -0
- data/ext/libieeep1788_copy/p1788/AUTHORS +16 -0
- data/ext/libieeep1788_copy/p1788/LICENSE +202 -0
- data/ext/libieeep1788_copy/p1788/NOTICE +14 -0
- data/ext/libieeep1788_copy/p1788/decoration/decoration.hpp +265 -0
- data/ext/libieeep1788_copy/p1788/exception/exception.hpp +302 -0
- data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor.hpp +3443 -0
- data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_bool_func_impl.hpp +608 -0
- data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_cancel_func_impl.hpp +229 -0
- data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_class_impl.hpp +526 -0
- data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_elem_func_impl.hpp +4533 -0
- data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_io_impl.hpp +1421 -0
- data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_mul_rev_to_pair_func_impl.hpp +347 -0
- data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_num_func_impl.hpp +655 -0
- data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_rec_bool_func_impl.hpp +146 -0
- data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_rec_overlap_impl.hpp +188 -0
- data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_rev_func_impl.hpp +1674 -0
- data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_set_op_impl.hpp +216 -0
- data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_setup_func_impl.hpp +68 -0
- data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_util_func_impl.hpp +135 -0
- data/ext/libieeep1788_copy/p1788/flavor/infsup/setbased/mpfr_bin_ieee754_flavor_validation_func_impl.hpp +93 -0
- data/ext/libieeep1788_copy/p1788/infsup/base_interval.hpp +1529 -0
- data/ext/libieeep1788_copy/p1788/infsup/base_interval_bool_func_impl.hpp +481 -0
- data/ext/libieeep1788_copy/p1788/infsup/base_interval_cancel_func_impl.hpp +126 -0
- data/ext/libieeep1788_copy/p1788/infsup/base_interval_elem_func_impl.hpp +1581 -0
- data/ext/libieeep1788_copy/p1788/infsup/base_interval_io_impl.hpp +59 -0
- data/ext/libieeep1788_copy/p1788/infsup/base_interval_mul_rev_to_pair_func_impl.hpp +88 -0
- data/ext/libieeep1788_copy/p1788/infsup/base_interval_num_func_impl.hpp +345 -0
- data/ext/libieeep1788_copy/p1788/infsup/base_interval_rec_bool_func_impl.hpp +92 -0
- data/ext/libieeep1788_copy/p1788/infsup/base_interval_rec_overlap_impl.hpp +72 -0
- data/ext/libieeep1788_copy/p1788/infsup/base_interval_rev_func_impl.hpp +656 -0
- data/ext/libieeep1788_copy/p1788/infsup/base_interval_set_op_impl.hpp +126 -0
- data/ext/libieeep1788_copy/p1788/infsup/decorated_interval.hpp +464 -0
- data/ext/libieeep1788_copy/p1788/infsup/forward_declaration.hpp +66 -0
- data/ext/libieeep1788_copy/p1788/infsup/interval.hpp +275 -0
- data/ext/libieeep1788_copy/p1788/io/io_manip.hpp +531 -0
- data/ext/libieeep1788_copy/p1788/overlapping/overlapping.hpp +241 -0
- data/ext/libieeep1788_copy/p1788/p1788.hpp +45 -0
- data/ext/libieeep1788_copy/p1788/reduction/reduction.hpp +341 -0
- data/ext/libieeep1788_copy/p1788/util/io.hpp +63 -0
- data/ext/libieeep1788_copy/p1788/util/mixed_type_traits.hpp +140 -0
- data/ext/libieeep1788_copy/p1788/util/mpfr_util.hpp +77 -0
- data/ext/libieeep1788_copy/p1788/util/mpfr_var.hpp +119 -0
- data/ext/libieeep1788_copy/p1788/util/mpfr_var_impl.hpp +382 -0
- data/ext/libieeep1788_copy/p1788/version.hpp +34 -0
- data/ext/p1788/extconf.rb +49 -0
- data/ext/p1788/p1788.cc +3764 -0
- data/lib/p1788/version.rb +4 -0
- data/lib/p1788.rb +25 -0
- data/p1788.gemspec +72 -0
- metadata +99 -0
@@ -0,0 +1,656 @@
|
|
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_REV_ELEM_FUNC_IMPL_HPP
|
27
|
+
#define LIBIEEEP1788_P1788_INFSUP_BASE_INTERVAL_REV_ELEM_FUNC_IMPL_HPP
|
28
|
+
|
29
|
+
namespace p1788
|
30
|
+
{
|
31
|
+
|
32
|
+
namespace infsup
|
33
|
+
{
|
34
|
+
|
35
|
+
|
36
|
+
// sqr_rev
|
37
|
+
|
38
|
+
// static unary
|
39
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
40
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::sqr_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c)
|
41
|
+
{
|
42
|
+
return concrete_interval( Flavor<T>::sqr_rev(c.rep_) );
|
43
|
+
}
|
44
|
+
|
45
|
+
// static unary 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>::sqr_rev(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& c)
|
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>::sqr_rev(c.rep_) );
|
61
|
+
}
|
62
|
+
|
63
|
+
// function unary
|
64
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
65
|
+
ConcreteInterval sqr_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c)
|
66
|
+
{
|
67
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::sqr_rev(c);
|
68
|
+
}
|
69
|
+
|
70
|
+
|
71
|
+
// static binary
|
72
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
73
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::sqr_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c,
|
74
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
75
|
+
{
|
76
|
+
return concrete_interval( Flavor<T>::sqr_rev(c.rep_, x.rep_) );
|
77
|
+
}
|
78
|
+
|
79
|
+
// static binary mixed type
|
80
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
81
|
+
template<typename T1, typename RepType1, class ConcreteInterval1, typename T2, typename RepType2, class ConcreteInterval2>
|
82
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::sqr_rev(base_interval<T1, Flavor, RepType1, ConcreteInterval1> const& c,
|
83
|
+
base_interval<T2, Flavor, RepType2, ConcreteInterval2> const& x)
|
84
|
+
{
|
85
|
+
// assert that only bare intervals or decorated intervals are used
|
86
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
87
|
+
&& std::is_same<typename Flavor<T1>::representation, RepType1>::value
|
88
|
+
&& std::is_same<typename Flavor<T2>::representation, RepType2>::value)
|
89
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
90
|
+
&& std::is_same<typename Flavor<T1>::representation_dec, RepType1>::value
|
91
|
+
&& std::is_same<typename Flavor<T2>::representation_dec, RepType2>::value),
|
92
|
+
"It is not supported by mixed type operations to use "
|
93
|
+
"interval and decorated_interval types together!"
|
94
|
+
);
|
95
|
+
|
96
|
+
// call of mixed-type version
|
97
|
+
return concrete_interval( Flavor<T>::sqr_rev(c.rep_, x.rep_) );
|
98
|
+
}
|
99
|
+
|
100
|
+
// function binary
|
101
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
102
|
+
ConcreteInterval sqr_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c,
|
103
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
104
|
+
{
|
105
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::sqr_rev(c, x);
|
106
|
+
}
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
// abs_rev
|
112
|
+
|
113
|
+
// static unary
|
114
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
115
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::abs_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c)
|
116
|
+
{
|
117
|
+
return concrete_interval( Flavor<T>::abs_rev(c.rep_) );
|
118
|
+
}
|
119
|
+
|
120
|
+
// static unary mixed type
|
121
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
122
|
+
template<typename T_, typename RepType_, class ConcreteInterval_>
|
123
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::abs_rev(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& c)
|
124
|
+
{
|
125
|
+
// assert that only bare intervals or decorated intervals are used
|
126
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
127
|
+
&& std::is_same<typename Flavor<T_>::representation, RepType_>::value)
|
128
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
129
|
+
&& std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
|
130
|
+
"It is not supported by mixed type operations to use "
|
131
|
+
"interval and decorated_interval types together!"
|
132
|
+
);
|
133
|
+
|
134
|
+
// call of mixed-type version
|
135
|
+
return concrete_interval( Flavor<T>::abs_rev(c.rep_) );
|
136
|
+
}
|
137
|
+
|
138
|
+
// function unary
|
139
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
140
|
+
ConcreteInterval abs_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c)
|
141
|
+
{
|
142
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::abs_rev(c);
|
143
|
+
}
|
144
|
+
|
145
|
+
|
146
|
+
// static binary
|
147
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
148
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::abs_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c,
|
149
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
150
|
+
{
|
151
|
+
return concrete_interval( Flavor<T>::abs_rev(c.rep_, x.rep_) );
|
152
|
+
}
|
153
|
+
|
154
|
+
// static binary mixed type
|
155
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
156
|
+
template<typename T1, typename RepType1, class ConcreteInterval1, typename T2, typename RepType2, class ConcreteInterval2>
|
157
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::abs_rev(base_interval<T1, Flavor, RepType1, ConcreteInterval1> const& c,
|
158
|
+
base_interval<T2, Flavor, RepType2, ConcreteInterval2> const& x)
|
159
|
+
{
|
160
|
+
// assert that only bare intervals or decorated intervals are used
|
161
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
162
|
+
&& std::is_same<typename Flavor<T1>::representation, RepType1>::value
|
163
|
+
&& std::is_same<typename Flavor<T2>::representation, RepType2>::value)
|
164
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
165
|
+
&& std::is_same<typename Flavor<T1>::representation_dec, RepType1>::value
|
166
|
+
&& std::is_same<typename Flavor<T2>::representation_dec, RepType2>::value),
|
167
|
+
"It is not supported by mixed type operations to use "
|
168
|
+
"interval and decorated_interval types together!"
|
169
|
+
);
|
170
|
+
|
171
|
+
// call of mixed-type version
|
172
|
+
return concrete_interval( Flavor<T>::abs_rev(c.rep_, x.rep_) );
|
173
|
+
}
|
174
|
+
|
175
|
+
// function binary
|
176
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
177
|
+
ConcreteInterval abs_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c,
|
178
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
179
|
+
{
|
180
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::abs_rev(c, x);
|
181
|
+
}
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
// pown_rev
|
187
|
+
|
188
|
+
// static unary
|
189
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
190
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::pown_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c, int p)
|
191
|
+
{
|
192
|
+
return concrete_interval( Flavor<T>::pown_rev(c.rep_, p) );
|
193
|
+
}
|
194
|
+
|
195
|
+
// static unary mixed type
|
196
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
197
|
+
template<typename T_, typename RepType_, class ConcreteInterval_>
|
198
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::pown_rev(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& c, int p)
|
199
|
+
{
|
200
|
+
// assert that only bare intervals or decorated intervals are used
|
201
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
202
|
+
&& std::is_same<typename Flavor<T_>::representation, RepType_>::value)
|
203
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
204
|
+
&& std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
|
205
|
+
"It is not supported by mixed type operations to use "
|
206
|
+
"interval and decorated_interval types together!"
|
207
|
+
);
|
208
|
+
|
209
|
+
// call of mixed-type version
|
210
|
+
return concrete_interval( Flavor<T>::pown_rev(c.rep_, p) );
|
211
|
+
}
|
212
|
+
|
213
|
+
// function unary
|
214
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
215
|
+
ConcreteInterval pown_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c, int p)
|
216
|
+
{
|
217
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::pown_rev(c, p);
|
218
|
+
}
|
219
|
+
|
220
|
+
|
221
|
+
// static binary
|
222
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
223
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::pown_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c,
|
224
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
|
225
|
+
int p)
|
226
|
+
{
|
227
|
+
return concrete_interval( Flavor<T>::pown_rev(c.rep_, x.rep_, p) );
|
228
|
+
}
|
229
|
+
|
230
|
+
// static binary mixed type
|
231
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
232
|
+
template<typename T1, typename RepType1, class ConcreteInterval1, typename T2, typename RepType2, class ConcreteInterval2>
|
233
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::pown_rev(base_interval<T1, Flavor, RepType1, ConcreteInterval1> const& c,
|
234
|
+
base_interval<T2, Flavor, RepType2, ConcreteInterval2> const& x,
|
235
|
+
int p)
|
236
|
+
{
|
237
|
+
// assert that only bare intervals or decorated intervals are used
|
238
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
239
|
+
&& std::is_same<typename Flavor<T1>::representation, RepType1>::value
|
240
|
+
&& std::is_same<typename Flavor<T2>::representation, RepType2>::value)
|
241
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
242
|
+
&& std::is_same<typename Flavor<T1>::representation_dec, RepType1>::value
|
243
|
+
&& std::is_same<typename Flavor<T2>::representation_dec, RepType2>::value),
|
244
|
+
"It is not supported by mixed type operations to use "
|
245
|
+
"interval and decorated_interval types together!"
|
246
|
+
);
|
247
|
+
|
248
|
+
// call of mixed-type version
|
249
|
+
return concrete_interval( Flavor<T>::pown_rev(c.rep_, x.rep_, p) );
|
250
|
+
}
|
251
|
+
|
252
|
+
// function binary
|
253
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
254
|
+
ConcreteInterval pown_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c,
|
255
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
|
256
|
+
int p)
|
257
|
+
{
|
258
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::pown_rev(c, x, p);
|
259
|
+
}
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
// sin_rev
|
266
|
+
|
267
|
+
// static unary
|
268
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
269
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::sin_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c)
|
270
|
+
{
|
271
|
+
return concrete_interval( Flavor<T>::sin_rev(c.rep_) );
|
272
|
+
}
|
273
|
+
|
274
|
+
// static unary mixed type
|
275
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
276
|
+
template<typename T_, typename RepType_, class ConcreteInterval_>
|
277
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::sin_rev(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& c)
|
278
|
+
{
|
279
|
+
// assert that only bare intervals or decorated intervals are used
|
280
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
281
|
+
&& std::is_same<typename Flavor<T_>::representation, RepType_>::value)
|
282
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
283
|
+
&& std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
|
284
|
+
"It is not supported by mixed type operations to use "
|
285
|
+
"interval and decorated_interval types together!"
|
286
|
+
);
|
287
|
+
|
288
|
+
// call of mixed-type version
|
289
|
+
return concrete_interval( Flavor<T>::sin_rev(c.rep_) );
|
290
|
+
}
|
291
|
+
|
292
|
+
// function unary
|
293
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
294
|
+
ConcreteInterval sin_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c)
|
295
|
+
{
|
296
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::sin_rev(c);
|
297
|
+
}
|
298
|
+
|
299
|
+
|
300
|
+
// static binary
|
301
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
302
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::sin_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c,
|
303
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
304
|
+
{
|
305
|
+
return concrete_interval( Flavor<T>::sin_rev(c.rep_, x.rep_) );
|
306
|
+
}
|
307
|
+
|
308
|
+
// static binary mixed type
|
309
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
310
|
+
template<typename T1, typename RepType1, class ConcreteInterval1, typename T2, typename RepType2, class ConcreteInterval2>
|
311
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::sin_rev(base_interval<T1, Flavor, RepType1, ConcreteInterval1> const& c,
|
312
|
+
base_interval<T2, Flavor, RepType2, ConcreteInterval2> const& x)
|
313
|
+
{
|
314
|
+
// assert that only bare intervals or decorated intervals are used
|
315
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
316
|
+
&& std::is_same<typename Flavor<T1>::representation, RepType1>::value
|
317
|
+
&& std::is_same<typename Flavor<T2>::representation, RepType2>::value)
|
318
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
319
|
+
&& std::is_same<typename Flavor<T1>::representation_dec, RepType1>::value
|
320
|
+
&& std::is_same<typename Flavor<T2>::representation_dec, RepType2>::value),
|
321
|
+
"It is not supported by mixed type operations to use "
|
322
|
+
"interval and decorated_interval types together!"
|
323
|
+
);
|
324
|
+
|
325
|
+
// call of mixed-type version
|
326
|
+
return concrete_interval( Flavor<T>::sin_rev(c.rep_, x.rep_) );
|
327
|
+
}
|
328
|
+
|
329
|
+
// function binary
|
330
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
331
|
+
ConcreteInterval sin_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c,
|
332
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
333
|
+
{
|
334
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::sin_rev(c, x);
|
335
|
+
}
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
// cos_rev
|
341
|
+
|
342
|
+
// static unary
|
343
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
344
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::cos_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c)
|
345
|
+
{
|
346
|
+
return concrete_interval( Flavor<T>::cos_rev(c.rep_) );
|
347
|
+
}
|
348
|
+
|
349
|
+
// static unary mixed type
|
350
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
351
|
+
template<typename T_, typename RepType_, class ConcreteInterval_>
|
352
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::cos_rev(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& c)
|
353
|
+
{
|
354
|
+
// assert that only bare intervals or decorated intervals are used
|
355
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
356
|
+
&& std::is_same<typename Flavor<T_>::representation, RepType_>::value)
|
357
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
358
|
+
&& std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
|
359
|
+
"It is not supported by mixed type operations to use "
|
360
|
+
"interval and decorated_interval types together!"
|
361
|
+
);
|
362
|
+
|
363
|
+
// call of mixed-type version
|
364
|
+
return concrete_interval( Flavor<T>::cos_rev(c.rep_) );
|
365
|
+
}
|
366
|
+
|
367
|
+
// function unary
|
368
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
369
|
+
ConcreteInterval cos_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c)
|
370
|
+
{
|
371
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::cos_rev(c);
|
372
|
+
}
|
373
|
+
|
374
|
+
|
375
|
+
// static binary
|
376
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
377
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::cos_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c,
|
378
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
379
|
+
{
|
380
|
+
return concrete_interval( Flavor<T>::cos_rev(c.rep_, x.rep_) );
|
381
|
+
}
|
382
|
+
|
383
|
+
// static binary mixed type
|
384
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
385
|
+
template<typename T1, typename RepType1, class ConcreteInterval1, typename T2, typename RepType2, class ConcreteInterval2>
|
386
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::cos_rev(base_interval<T1, Flavor, RepType1, ConcreteInterval1> const& c,
|
387
|
+
base_interval<T2, Flavor, RepType2, ConcreteInterval2> const& x)
|
388
|
+
{
|
389
|
+
// assert that only bare intervals or decorated intervals are used
|
390
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
391
|
+
&& std::is_same<typename Flavor<T1>::representation, RepType1>::value
|
392
|
+
&& std::is_same<typename Flavor<T2>::representation, RepType2>::value)
|
393
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
394
|
+
&& std::is_same<typename Flavor<T1>::representation_dec, RepType1>::value
|
395
|
+
&& std::is_same<typename Flavor<T2>::representation_dec, RepType2>::value),
|
396
|
+
"It is not supported by mixed type operations to use "
|
397
|
+
"interval and decorated_interval types together!"
|
398
|
+
);
|
399
|
+
|
400
|
+
// call of mixed-type version
|
401
|
+
return concrete_interval( Flavor<T>::cos_rev(c.rep_, x.rep_) );
|
402
|
+
}
|
403
|
+
|
404
|
+
// function binary
|
405
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
406
|
+
ConcreteInterval cos_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c,
|
407
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
408
|
+
{
|
409
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::cos_rev(c, x);
|
410
|
+
}
|
411
|
+
|
412
|
+
|
413
|
+
|
414
|
+
// tan_rev
|
415
|
+
|
416
|
+
// static unary
|
417
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
418
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::tan_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c)
|
419
|
+
{
|
420
|
+
return concrete_interval( Flavor<T>::tan_rev(c.rep_) );
|
421
|
+
}
|
422
|
+
|
423
|
+
// static unary mixed type
|
424
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
425
|
+
template<typename T_, typename RepType_, class ConcreteInterval_>
|
426
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::tan_rev(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& c)
|
427
|
+
{
|
428
|
+
// assert that only bare intervals or decorated intervals are used
|
429
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
430
|
+
&& std::is_same<typename Flavor<T_>::representation, RepType_>::value)
|
431
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
432
|
+
&& std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
|
433
|
+
"It is not supported by mixed type operations to use "
|
434
|
+
"interval and decorated_interval types together!"
|
435
|
+
);
|
436
|
+
|
437
|
+
// call of mixed-type version
|
438
|
+
return concrete_interval( Flavor<T>::tan_rev(c.rep_) );
|
439
|
+
}
|
440
|
+
|
441
|
+
// function unary
|
442
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
443
|
+
ConcreteInterval tan_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c)
|
444
|
+
{
|
445
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::tan_rev(c);
|
446
|
+
}
|
447
|
+
|
448
|
+
|
449
|
+
// static binary
|
450
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
451
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::tan_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c,
|
452
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
453
|
+
{
|
454
|
+
return concrete_interval( Flavor<T>::tan_rev(c.rep_, x.rep_) );
|
455
|
+
}
|
456
|
+
|
457
|
+
// static binary mixed type
|
458
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
459
|
+
template<typename T1, typename RepType1, class ConcreteInterval1, typename T2, typename RepType2, class ConcreteInterval2>
|
460
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::tan_rev(base_interval<T1, Flavor, RepType1, ConcreteInterval1> const& c,
|
461
|
+
base_interval<T2, Flavor, RepType2, ConcreteInterval2> const& x)
|
462
|
+
{
|
463
|
+
// assert that only bare intervals or decorated intervals are used
|
464
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
465
|
+
&& std::is_same<typename Flavor<T1>::representation, RepType1>::value
|
466
|
+
&& std::is_same<typename Flavor<T2>::representation, RepType2>::value)
|
467
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
468
|
+
&& std::is_same<typename Flavor<T1>::representation_dec, RepType1>::value
|
469
|
+
&& std::is_same<typename Flavor<T2>::representation_dec, RepType2>::value),
|
470
|
+
"It is not supported by mixed type operations to use "
|
471
|
+
"interval and decorated_interval types together!"
|
472
|
+
);
|
473
|
+
|
474
|
+
// call of mixed-type version
|
475
|
+
return concrete_interval( Flavor<T>::tan_rev(c.rep_, x.rep_) );
|
476
|
+
}
|
477
|
+
|
478
|
+
// function binary
|
479
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
480
|
+
ConcreteInterval tan_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c,
|
481
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
482
|
+
{
|
483
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::tan_rev(c, x);
|
484
|
+
}
|
485
|
+
|
486
|
+
|
487
|
+
|
488
|
+
// cosh_rev
|
489
|
+
|
490
|
+
// static unary
|
491
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
492
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::cosh_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c)
|
493
|
+
{
|
494
|
+
return concrete_interval( Flavor<T>::cosh_rev(c.rep_) );
|
495
|
+
}
|
496
|
+
|
497
|
+
// static unary mixed type
|
498
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
499
|
+
template<typename T_, typename RepType_, class ConcreteInterval_>
|
500
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::cosh_rev(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& c)
|
501
|
+
{
|
502
|
+
// assert that only bare intervals or decorated intervals are used
|
503
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
504
|
+
&& std::is_same<typename Flavor<T_>::representation, RepType_>::value)
|
505
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
506
|
+
&& std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
|
507
|
+
"It is not supported by mixed type operations to use "
|
508
|
+
"interval and decorated_interval types together!"
|
509
|
+
);
|
510
|
+
|
511
|
+
// call of mixed-type version
|
512
|
+
return concrete_interval( Flavor<T>::cosh_rev(c.rep_) );
|
513
|
+
}
|
514
|
+
|
515
|
+
// function unary
|
516
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
517
|
+
ConcreteInterval cosh_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c)
|
518
|
+
{
|
519
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::cosh_rev(c);
|
520
|
+
}
|
521
|
+
|
522
|
+
|
523
|
+
// static binary
|
524
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
525
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::cosh_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c,
|
526
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
527
|
+
{
|
528
|
+
return concrete_interval( Flavor<T>::cosh_rev(c.rep_, x.rep_) );
|
529
|
+
}
|
530
|
+
|
531
|
+
// static binary mixed type
|
532
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
533
|
+
template<typename T1, typename RepType1, class ConcreteInterval1, typename T2, typename RepType2, class ConcreteInterval2>
|
534
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::cosh_rev(base_interval<T1, Flavor, RepType1, ConcreteInterval1> const& c,
|
535
|
+
base_interval<T2, Flavor, RepType2, ConcreteInterval2> const& x)
|
536
|
+
{
|
537
|
+
// assert that only bare intervals or decorated intervals are used
|
538
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
539
|
+
&& std::is_same<typename Flavor<T1>::representation, RepType1>::value
|
540
|
+
&& std::is_same<typename Flavor<T2>::representation, RepType2>::value)
|
541
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
542
|
+
&& std::is_same<typename Flavor<T1>::representation_dec, RepType1>::value
|
543
|
+
&& std::is_same<typename Flavor<T2>::representation_dec, RepType2>::value),
|
544
|
+
"It is not supported by mixed type operations to use "
|
545
|
+
"interval and decorated_interval types together!"
|
546
|
+
);
|
547
|
+
|
548
|
+
// call of mixed-type version
|
549
|
+
return concrete_interval( Flavor<T>::cosh_rev(c.rep_, x.rep_) );
|
550
|
+
}
|
551
|
+
|
552
|
+
// function binary
|
553
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
554
|
+
ConcreteInterval cosh_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& c,
|
555
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
556
|
+
{
|
557
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::cosh_rev(c, x);
|
558
|
+
}
|
559
|
+
|
560
|
+
|
561
|
+
|
562
|
+
|
563
|
+
|
564
|
+
|
565
|
+
|
566
|
+
// mul_rev
|
567
|
+
|
568
|
+
// static binary
|
569
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
570
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::mul_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& b,
|
571
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& c)
|
572
|
+
{
|
573
|
+
return concrete_interval( Flavor<T>::mul_rev(b.rep_, c.rep_) );
|
574
|
+
}
|
575
|
+
|
576
|
+
// static binary mixed type
|
577
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
578
|
+
template<typename T1, typename RepType1, class ConcreteInterval1, typename T2, typename RepType2, class ConcreteInterval2>
|
579
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::mul_rev(base_interval<T1, Flavor, RepType1, ConcreteInterval1> const& b,
|
580
|
+
base_interval<T2, Flavor, RepType2, ConcreteInterval2> const& c)
|
581
|
+
{
|
582
|
+
// assert that only bare intervals or decorated intervals are used
|
583
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
584
|
+
&& std::is_same<typename Flavor<T1>::representation, RepType1>::value
|
585
|
+
&& std::is_same<typename Flavor<T2>::representation, RepType2>::value)
|
586
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
587
|
+
&& std::is_same<typename Flavor<T1>::representation_dec, RepType1>::value
|
588
|
+
&& std::is_same<typename Flavor<T2>::representation_dec, RepType2>::value),
|
589
|
+
"It is not supported by mixed type operations to use "
|
590
|
+
"interval and decorated_interval types together!"
|
591
|
+
);
|
592
|
+
|
593
|
+
// call of mixed-type version
|
594
|
+
return concrete_interval( Flavor<T>::mul_rev(b.rep_, c.rep_) );
|
595
|
+
}
|
596
|
+
|
597
|
+
// function binary
|
598
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
599
|
+
ConcreteInterval mul_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& b,
|
600
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& c)
|
601
|
+
{
|
602
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::mul_rev(b, c);
|
603
|
+
}
|
604
|
+
|
605
|
+
|
606
|
+
// static ternary
|
607
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
608
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::mul_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& b,
|
609
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& c,
|
610
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
611
|
+
{
|
612
|
+
return concrete_interval( Flavor<T>::mul_rev(b.rep_, c.rep_, x.rep_) );
|
613
|
+
}
|
614
|
+
|
615
|
+
// static ternary mixed type
|
616
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
617
|
+
template<typename T1, typename RepType1, class ConcreteInterval1,
|
618
|
+
typename T2, typename RepType2, class ConcreteInterval2,
|
619
|
+
typename T3, typename RepType3, class ConcreteInterval3>
|
620
|
+
ConcreteInterval base_interval<T,Flavor,RepType,ConcreteInterval>::mul_rev(base_interval<T1, Flavor, RepType1, ConcreteInterval1> const& b,
|
621
|
+
base_interval<T2, Flavor, RepType2, ConcreteInterval2> const& c,
|
622
|
+
base_interval<T3, Flavor, RepType3, ConcreteInterval3> const& x)
|
623
|
+
{
|
624
|
+
// assert that only bare intervals or decorated intervals are used
|
625
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
626
|
+
&& std::is_same<typename Flavor<T1>::representation, RepType1>::value
|
627
|
+
&& std::is_same<typename Flavor<T2>::representation, RepType2>::value
|
628
|
+
&& std::is_same<typename Flavor<T3>::representation, RepType3>::value)
|
629
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
630
|
+
&& std::is_same<typename Flavor<T1>::representation_dec, RepType1>::value
|
631
|
+
&& std::is_same<typename Flavor<T2>::representation_dec, RepType2>::value
|
632
|
+
&& std::is_same<typename Flavor<T3>::representation_dec, RepType3>::value),
|
633
|
+
"It is not supported by mixed type operations to use "
|
634
|
+
"interval and decorated_interval types together!"
|
635
|
+
);
|
636
|
+
// call of mixed-type version
|
637
|
+
return concrete_interval( Flavor<T>::mul_rev(b.rep_, c.rep_, x.rep_) );
|
638
|
+
}
|
639
|
+
|
640
|
+
// function ternary
|
641
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
642
|
+
ConcreteInterval mul_rev(base_interval<T, Flavor, RepType, ConcreteInterval> const& b,
|
643
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& c,
|
644
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
645
|
+
{
|
646
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::mul_rev(b, c, x);
|
647
|
+
}
|
648
|
+
|
649
|
+
|
650
|
+
|
651
|
+
} // namespace infsup
|
652
|
+
|
653
|
+
} // namespace p1788
|
654
|
+
|
655
|
+
|
656
|
+
#endif // LIBIEEEP1788_P1788_INFSUP_BASE_INTERVAL_REV_ELEM_FUNC_IMPL_HPP
|