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,59 @@
|
|
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_IO_IMPL_HPP
|
27
|
+
#define LIBIEEEP1788_P1788_INFSUP_BASE_INTERVAL_IO_IMPL_HPP
|
28
|
+
|
29
|
+
namespace p1788
|
30
|
+
{
|
31
|
+
|
32
|
+
namespace infsup
|
33
|
+
{
|
34
|
+
|
35
|
+
|
36
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval, typename CharT, typename Traits>
|
37
|
+
std::basic_ostream<CharT, Traits>& operator<<(
|
38
|
+
std::basic_ostream<CharT, Traits>& os,
|
39
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
40
|
+
{
|
41
|
+
return Flavor<T>::operator_interval_to_text(os, x.rep_);
|
42
|
+
}
|
43
|
+
|
44
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval, typename CharT, typename Traits>
|
45
|
+
std::basic_istream<CharT, Traits>& operator>>(
|
46
|
+
std::basic_istream<CharT, Traits>& is,
|
47
|
+
base_interval<T, Flavor, RepType, ConcreteInterval>& x)
|
48
|
+
{
|
49
|
+
return Flavor<T>::operator_text_to_interval(is, x.rep_);
|
50
|
+
}
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
} // namespace infsup
|
55
|
+
|
56
|
+
} // namespace p1788
|
57
|
+
|
58
|
+
|
59
|
+
#endif // LIBIEEEP1788_P1788_INFSUP_BASE_INTERVAL_IO_IMPL_HPP
|
@@ -0,0 +1,88 @@
|
|
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_MUL_REV_TO_PAIR_FUNC_HPP
|
27
|
+
#define LIBIEEEP1788_P1788_INFSUP_BASE_INTERVAL_MUL_REV_TO_PAIR_FUNC_HPP
|
28
|
+
|
29
|
+
namespace p1788
|
30
|
+
{
|
31
|
+
|
32
|
+
namespace infsup
|
33
|
+
{
|
34
|
+
|
35
|
+
// cancel_plus
|
36
|
+
|
37
|
+
// static
|
38
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
39
|
+
std::pair<ConcreteInterval, ConcreteInterval>
|
40
|
+
base_interval<T,Flavor,RepType,ConcreteInterval>::mul_rev_to_pair(base_interval<T, Flavor, RepType, ConcreteInterval> const& b,
|
41
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& c)
|
42
|
+
{
|
43
|
+
auto tmp = Flavor<T>::mul_rev_to_pair(b.rep_, c.rep_);
|
44
|
+
|
45
|
+
return std::pair<ConcreteInterval, ConcreteInterval>(concrete_interval(tmp.first), concrete_interval(tmp.second));
|
46
|
+
}
|
47
|
+
|
48
|
+
// static mixed type
|
49
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
50
|
+
template<typename T1, typename RepType1, class ConcreteInterval1, typename T2, typename RepType2, class ConcreteInterval2>
|
51
|
+
std::pair<ConcreteInterval, ConcreteInterval>
|
52
|
+
base_interval<T,Flavor,RepType,ConcreteInterval>::mul_rev_to_pair(base_interval<T1, Flavor, RepType1, ConcreteInterval1> const& b,
|
53
|
+
base_interval<T2, Flavor, RepType2, ConcreteInterval2> const& c)
|
54
|
+
{
|
55
|
+
// assert that only bare intervals or decorated intervals are used
|
56
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
57
|
+
&& std::is_same<typename Flavor<T1>::representation, RepType1>::value
|
58
|
+
&& std::is_same<typename Flavor<T2>::representation, RepType2>::value)
|
59
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
60
|
+
&& std::is_same<typename Flavor<T1>::representation_dec, RepType1>::value
|
61
|
+
&& std::is_same<typename Flavor<T2>::representation_dec, RepType2>::value),
|
62
|
+
"It is not supported by mixed type operations to use "
|
63
|
+
"interval and decorated_interval types together!"
|
64
|
+
);
|
65
|
+
|
66
|
+
// call of mixed-type version
|
67
|
+
auto tmp = Flavor<T>::mul_rev_to_pair(b.rep_, c.rep_);
|
68
|
+
|
69
|
+
return std::pair<ConcreteInterval, ConcreteInterval>(concrete_interval(tmp.first), concrete_interval(tmp.second));
|
70
|
+
}
|
71
|
+
|
72
|
+
// function
|
73
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
74
|
+
std::pair<ConcreteInterval, ConcreteInterval>
|
75
|
+
mul_rev_to_pair(base_interval<T, Flavor, RepType, ConcreteInterval> const& b,
|
76
|
+
base_interval<T, Flavor, RepType, ConcreteInterval> const& c)
|
77
|
+
{
|
78
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::mul_rev_to_pair(b, c);
|
79
|
+
}
|
80
|
+
|
81
|
+
|
82
|
+
} // namespace infsup
|
83
|
+
|
84
|
+
} // namespace p1788
|
85
|
+
|
86
|
+
|
87
|
+
#endif // LIBIEEEP1788_P1788_INFSUP_BASE_INTERVAL_MUL_REV_TO_PAIR_FUNC_HPP
|
88
|
+
|
@@ -0,0 +1,345 @@
|
|
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_NUM_FUNC_IMPL_HPP
|
27
|
+
#define LIBIEEEP1788_P1788_INFSUP_BASE_INTERVAL_NUM_FUNC_IMPL_HPP
|
28
|
+
|
29
|
+
namespace p1788
|
30
|
+
{
|
31
|
+
|
32
|
+
namespace infsup
|
33
|
+
{
|
34
|
+
|
35
|
+
// inf
|
36
|
+
|
37
|
+
// static
|
38
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
39
|
+
T base_interval<T,Flavor,RepType,ConcreteInterval>::inf(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
40
|
+
{
|
41
|
+
return Flavor<T>::inf(x.rep_);
|
42
|
+
}
|
43
|
+
|
44
|
+
// static mixed type
|
45
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
46
|
+
template<typename T_, typename RepType_, class ConcreteInterval_>
|
47
|
+
T base_interval<T,Flavor,RepType,ConcreteInterval>::inf(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
|
48
|
+
{
|
49
|
+
// assert that only bare intervals or decorated intervals are used
|
50
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
51
|
+
&& std::is_same<typename Flavor<T_>::representation, RepType_>::value)
|
52
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
53
|
+
&& std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
|
54
|
+
"It is not supported by mixed type operations to use "
|
55
|
+
"interval and decorated_interval types together!"
|
56
|
+
);
|
57
|
+
|
58
|
+
// call of mixed-type version
|
59
|
+
return Flavor<T>::inf(x.rep_);
|
60
|
+
}
|
61
|
+
|
62
|
+
|
63
|
+
// function
|
64
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
65
|
+
T inf(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
66
|
+
{
|
67
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::inf(x);
|
68
|
+
}
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
// sup
|
74
|
+
|
75
|
+
// static
|
76
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
77
|
+
T base_interval<T,Flavor,RepType,ConcreteInterval>::sup(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
78
|
+
{
|
79
|
+
return Flavor<T>::sup(x.rep_);
|
80
|
+
}
|
81
|
+
|
82
|
+
// static mixed type
|
83
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
84
|
+
template<typename T_, typename RepType_, class ConcreteInterval_>
|
85
|
+
T base_interval<T,Flavor,RepType,ConcreteInterval>::sup(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
|
86
|
+
{
|
87
|
+
// assert that only bare intervals or decorated intervals are used
|
88
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
89
|
+
&& std::is_same<typename Flavor<T_>::representation, RepType_>::value)
|
90
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
91
|
+
&& std::is_same<typename Flavor<T_>::representation_dec, RepType_>::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 Flavor<T>::sup(x.rep_);
|
98
|
+
}
|
99
|
+
|
100
|
+
|
101
|
+
// function
|
102
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
103
|
+
T sup(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
104
|
+
{
|
105
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::sup(x);
|
106
|
+
}
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
// mid
|
112
|
+
|
113
|
+
// static
|
114
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
115
|
+
T base_interval<T,Flavor,RepType,ConcreteInterval>::mid(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
116
|
+
{
|
117
|
+
return Flavor<T>::mid(x.rep_);
|
118
|
+
}
|
119
|
+
|
120
|
+
// static mixed type
|
121
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
122
|
+
template<typename T_, typename RepType_, class ConcreteInterval_>
|
123
|
+
T base_interval<T,Flavor,RepType,ConcreteInterval>::mid(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
|
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 Flavor<T>::mid(x.rep_);
|
136
|
+
}
|
137
|
+
|
138
|
+
|
139
|
+
// function
|
140
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
141
|
+
T mid(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
142
|
+
{
|
143
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::mid(x);
|
144
|
+
}
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
// rad
|
150
|
+
|
151
|
+
// static
|
152
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
153
|
+
T base_interval<T,Flavor,RepType,ConcreteInterval>::rad(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
154
|
+
{
|
155
|
+
return Flavor<T>::rad(x.rep_);
|
156
|
+
}
|
157
|
+
|
158
|
+
// static mixed type
|
159
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
160
|
+
template<typename T_, typename RepType_, class ConcreteInterval_>
|
161
|
+
T base_interval<T,Flavor,RepType,ConcreteInterval>::rad(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
|
162
|
+
{
|
163
|
+
// assert that only bare intervals or decorated intervals are used
|
164
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
165
|
+
&& std::is_same<typename Flavor<T_>::representation, RepType_>::value)
|
166
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
167
|
+
&& std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
|
168
|
+
"It is not supported by mixed type operations to use "
|
169
|
+
"interval and decorated_interval types together!"
|
170
|
+
);
|
171
|
+
|
172
|
+
// call of mixed-type version
|
173
|
+
return Flavor<T>::rad(x.rep_);
|
174
|
+
}
|
175
|
+
|
176
|
+
|
177
|
+
// function
|
178
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
179
|
+
T rad(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
180
|
+
{
|
181
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::rad(x);
|
182
|
+
}
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
// mid_rad
|
188
|
+
|
189
|
+
// static
|
190
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
191
|
+
std::pair<T,T> base_interval<T,Flavor,RepType,ConcreteInterval>::mid_rad(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
192
|
+
{
|
193
|
+
return Flavor<T>::mid_rad(x.rep_);
|
194
|
+
}
|
195
|
+
|
196
|
+
// static mixed type
|
197
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
198
|
+
template<typename T_, typename RepType_, class ConcreteInterval_>
|
199
|
+
std::pair<T,T> base_interval<T,Flavor,RepType,ConcreteInterval>::mid_rad(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
|
200
|
+
{
|
201
|
+
// assert that only bare intervals or decorated intervals are used
|
202
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
203
|
+
&& std::is_same<typename Flavor<T_>::representation, RepType_>::value)
|
204
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
205
|
+
&& std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
|
206
|
+
"It is not supported by mixed type operations to use "
|
207
|
+
"interval and decorated_interval types together!"
|
208
|
+
);
|
209
|
+
|
210
|
+
// call of mixed-type version
|
211
|
+
return Flavor<T>::mid_rad(x.rep_);
|
212
|
+
}
|
213
|
+
|
214
|
+
|
215
|
+
// function
|
216
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
217
|
+
std::pair<T,T> mid_rad(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
218
|
+
{
|
219
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::mid_rad(x);
|
220
|
+
}
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
// wid
|
226
|
+
|
227
|
+
// static
|
228
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
229
|
+
T base_interval<T,Flavor,RepType,ConcreteInterval>::wid(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
230
|
+
{
|
231
|
+
return Flavor<T>::wid(x.rep_);
|
232
|
+
}
|
233
|
+
|
234
|
+
// static mixed type
|
235
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
236
|
+
template<typename T_, typename RepType_, class ConcreteInterval_>
|
237
|
+
T base_interval<T,Flavor,RepType,ConcreteInterval>::wid(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
|
238
|
+
{
|
239
|
+
// assert that only bare intervals or decorated intervals are used
|
240
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
241
|
+
&& std::is_same<typename Flavor<T_>::representation, RepType_>::value)
|
242
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
243
|
+
&& std::is_same<typename Flavor<T_>::representation_dec, RepType_>::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 Flavor<T>::wid(x.rep_);
|
250
|
+
}
|
251
|
+
|
252
|
+
|
253
|
+
// function
|
254
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
255
|
+
T wid(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
256
|
+
{
|
257
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::wid(x);
|
258
|
+
}
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
// mag
|
264
|
+
|
265
|
+
// static
|
266
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
267
|
+
T base_interval<T,Flavor,RepType,ConcreteInterval>::mag(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
268
|
+
{
|
269
|
+
return Flavor<T>::mag(x.rep_);
|
270
|
+
}
|
271
|
+
|
272
|
+
// static mixed type
|
273
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
274
|
+
template<typename T_, typename RepType_, class ConcreteInterval_>
|
275
|
+
T base_interval<T,Flavor,RepType,ConcreteInterval>::mag(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
|
276
|
+
{
|
277
|
+
// assert that only bare intervals or decorated intervals are used
|
278
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
279
|
+
&& std::is_same<typename Flavor<T_>::representation, RepType_>::value)
|
280
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
281
|
+
&& std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
|
282
|
+
"It is not supported by mixed type operations to use "
|
283
|
+
"interval and decorated_interval types together!"
|
284
|
+
);
|
285
|
+
|
286
|
+
// call of mixed-type version
|
287
|
+
return Flavor<T>::mag(x.rep_);
|
288
|
+
}
|
289
|
+
|
290
|
+
|
291
|
+
// function
|
292
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
293
|
+
T mag(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
294
|
+
{
|
295
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::mag(x);
|
296
|
+
}
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
// mig
|
302
|
+
|
303
|
+
// static
|
304
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
305
|
+
T base_interval<T,Flavor,RepType,ConcreteInterval>::mig(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
306
|
+
{
|
307
|
+
return Flavor<T>::mig(x.rep_);
|
308
|
+
}
|
309
|
+
|
310
|
+
// static mixed type
|
311
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
312
|
+
template<typename T_, typename RepType_, class ConcreteInterval_>
|
313
|
+
T base_interval<T,Flavor,RepType,ConcreteInterval>::mig(base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& x)
|
314
|
+
{
|
315
|
+
// assert that only bare intervals or decorated intervals are used
|
316
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
317
|
+
&& std::is_same<typename Flavor<T_>::representation, RepType_>::value)
|
318
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
319
|
+
&& std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
|
320
|
+
"It is not supported by mixed type operations to use "
|
321
|
+
"interval and decorated_interval types together!"
|
322
|
+
);
|
323
|
+
|
324
|
+
// call of mixed-type version
|
325
|
+
return Flavor<T>::mig(x.rep_);
|
326
|
+
}
|
327
|
+
|
328
|
+
|
329
|
+
// function
|
330
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
331
|
+
T mig(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
332
|
+
{
|
333
|
+
return base_interval<T,Flavor,RepType,ConcreteInterval>::mig(x);
|
334
|
+
}
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
} // namespace infsup
|
341
|
+
|
342
|
+
} // namespace p1788
|
343
|
+
|
344
|
+
|
345
|
+
#endif // LIBIEEEP1788_P1788_INFSUP_BASE_INTERVAL_NUM_FUNC_IMPL_HPP
|
@@ -0,0 +1,92 @@
|
|
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_REC_BOOL_FUNC_IMPL_HPP
|
27
|
+
#define LIBIEEEP1788_P1788_INFSUP_BASE_INTERVAL_REC_BOOL_FUNC_IMPL_HPP
|
28
|
+
|
29
|
+
namespace p1788
|
30
|
+
{
|
31
|
+
|
32
|
+
namespace infsup
|
33
|
+
{
|
34
|
+
|
35
|
+
// is_common_interval
|
36
|
+
|
37
|
+
// static
|
38
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
39
|
+
bool base_interval<T, Flavor, RepType, ConcreteInterval>::is_common_interval(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
40
|
+
{
|
41
|
+
return Flavor<T>::is_common_interval(x.rep_);
|
42
|
+
}
|
43
|
+
|
44
|
+
// function
|
45
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
46
|
+
bool is_common_interval(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
47
|
+
{
|
48
|
+
return base_interval<T, Flavor, RepType, ConcreteInterval>::is_common_interval(x);
|
49
|
+
}
|
50
|
+
|
51
|
+
|
52
|
+
// is_singleton
|
53
|
+
|
54
|
+
// static
|
55
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
56
|
+
bool base_interval<T, Flavor, RepType, ConcreteInterval>::is_singleton(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
57
|
+
{
|
58
|
+
return Flavor<T>::is_singleton(x.rep_);
|
59
|
+
}
|
60
|
+
|
61
|
+
// function
|
62
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
63
|
+
bool is_singleton(base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
64
|
+
{
|
65
|
+
return base_interval<T, Flavor, RepType, ConcreteInterval>::is_singleton(x);
|
66
|
+
}
|
67
|
+
|
68
|
+
|
69
|
+
// is_member
|
70
|
+
|
71
|
+
// static
|
72
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
73
|
+
template<typename T_>
|
74
|
+
bool base_interval<T, Flavor, RepType, ConcreteInterval>::is_member(T_ m, base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
75
|
+
{
|
76
|
+
return Flavor<T>::is_member(m, x.rep_);
|
77
|
+
}
|
78
|
+
|
79
|
+
// function
|
80
|
+
template<typename T_, typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
81
|
+
bool is_member(T_ m, base_interval<T, Flavor, RepType, ConcreteInterval> const& x)
|
82
|
+
{
|
83
|
+
return base_interval<T, Flavor, RepType, ConcreteInterval>::is_member(m, x);
|
84
|
+
}
|
85
|
+
|
86
|
+
|
87
|
+
} // namespace infsup
|
88
|
+
|
89
|
+
} // namespace p1788
|
90
|
+
|
91
|
+
|
92
|
+
#endif // LIBIEEEP1788_P1788_INFSUP_BASE_INTERVAL_REC_BOOL_FUNC_IMPL_HPP
|
@@ -0,0 +1,72 @@
|
|
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_REC_OVERLAP_FUNC_HPP
|
27
|
+
#define LIBIEEEP1788_P1788_INFSUP_BASE_INTERVAL_REC_OVERLAP_FUNC_HPP
|
28
|
+
|
29
|
+
namespace p1788
|
30
|
+
{
|
31
|
+
|
32
|
+
namespace infsup
|
33
|
+
{
|
34
|
+
|
35
|
+
|
36
|
+
// overlap
|
37
|
+
|
38
|
+
// static
|
39
|
+
template<typename T, template<typename> class Flavor, typename RepType, class ConcreteInterval>
|
40
|
+
template<typename T_, typename RepType_, class ConcreteInterval_>
|
41
|
+
p1788::overlapping::overlapping_state
|
42
|
+
base_interval<T, Flavor, RepType, ConcreteInterval>::overlap(base_interval<T, Flavor, RepType, ConcreteInterval> const& x,
|
43
|
+
base_interval<T_, Flavor, RepType_, ConcreteInterval_> const& y)
|
44
|
+
{
|
45
|
+
// assert that only bare intervals or decorated intervals are used
|
46
|
+
static_assert( (std::is_same<typename Flavor<T>::representation, RepType>::value
|
47
|
+
&& std::is_same<typename Flavor<T_>::representation, RepType_>::value)
|
48
|
+
|| (std::is_same<typename Flavor<T>::representation_dec, RepType>::value
|
49
|
+
&& std::is_same<typename Flavor<T_>::representation_dec, RepType_>::value),
|
50
|
+
"It is not supported by mixed type operations to use "
|
51
|
+
"interval and decorated_interval types together!"
|
52
|
+
);
|
53
|
+
|
54
|
+
return Flavor<T>::overlap(x.rep_, y.rep_);
|
55
|
+
}
|
56
|
+
|
57
|
+
// function
|
58
|
+
template<typename T1, template<typename> class Flavor, typename RepType1, class ConcreteInterval1, typename T2, typename RepType2, class ConcreteInterval2>
|
59
|
+
p1788::overlapping::overlapping_state
|
60
|
+
overlap(base_interval<T1, Flavor, RepType1, ConcreteInterval1> const& x, base_interval<T2, Flavor, RepType2, ConcreteInterval2> const& y)
|
61
|
+
{
|
62
|
+
return base_interval<T1, Flavor, RepType1, ConcreteInterval1>::overlap(x, y);
|
63
|
+
}
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
} // namespace infsup
|
68
|
+
|
69
|
+
} // namespace p1788
|
70
|
+
|
71
|
+
|
72
|
+
#endif // LIBIEEEP1788_P1788_INFSUP_BASE_INTERVAL_REC_OVERLAP_FUNC_HPP
|