codac 1.5.6
Loading...
Searching...
No Matches
codac2::Interval Class Reference

Interval class, for representing closed and connected subsets of \(\mathbb{R}\). More...

#include <codac2_Interval.h>

Public Member Functions

 Interval ()
 Creates an interval \([-\infty,\infty]\).
 
 Interval (double a)
 Creates a degenerate interval \([a,a]\), \(a\in\mathbb{R}\).
 
 Interval (double a, double b)
 Creates an interval \([a,b]\), \(a\in\mathbb{R}, b\in\mathbb{R}\).
 
 Interval (const Interval &x)
 Creates an interval from another one.
 
 Interval (const std::array< double, 1 > &array)
 Create an interval \([a,a]\) from a fixed-sized array of size 1.
 
 Interval (const std::array< double, 2 > &array)
 Create an interval \([a,b]\) from a fixed-sized array of size 2.
 
 Interval (std::initializer_list< double > l)
 Create an interval as the hull of a list of values.
 
Intervalinit (const Interval &x)
 Sets the value of this interval to x.
 
Intervalinit_from_list (const std::list< double > &l)
 Sets the bounds as the hull of a list of values.
 
Intervaloperator= (double x)
 Sets this to x.
 
Intervaloperator= (const Interval &x)
 Sets this to x.
 
bool operator== (const Interval &x) const
 Comparison (equality) between two intervals.
 
bool operator!= (const Interval &x) const
 Comparison (non equality) between two intervals.
 
double lb () const
 Returns the lower bound of this.
 
double ub () const
 Returns the upper bound of this.
 
double mid () const
 Returns the midpoint of this.
 
double mag () const
 Returns the magnitude of this i.e. max(|lower bound|, |upper bound|).
 
double mig () const
 Returns the mignitude of this.
 
double rand () const
 Returns a random value inside the interval.
 
double rad () const
 Returns the radius of this.
 
double diam () const
 Returns the diameter of this.
 
double volume () const
 Returns the diameter of this.
 
Index size () const
 Returns the dimension of this (which is always )
 
void set_empty ()
 Sets this interval to the empty set.
 
bool is_empty () const
 Tests if this is empty.
 
bool contains (const double &x) const
 Tests if this contains x.
 
bool interior_contains (const double &x) const
 Tests if the interior of this contains x.
 
bool is_unbounded () const
 Tests if one of the bounds of this is infinite.
 
bool is_degenerated () const
 Tests if this is degenerated, that is, in the form of \([a,a]\).
 
bool intersects (const Interval &x) const
 Tests if this and x intersect.
 
bool is_disjoint (const Interval &x) const
 Tests if this and x do not intersect.
 
bool overlaps (const Interval &x) const
 Tests if this and x intersect and their intersection has a non-null volume.
 
bool is_subset (const Interval &x) const
 Tests if this is a subset of x.
 
bool is_strict_subset (const Interval &x) const
 Tests if this is a subset of x and not x itself.
 
bool is_interior_subset (const Interval &x) const
 Tests if this is in the interior of x.
 
bool is_strict_interior_subset (const Interval &x) const
 Tests if this is in the interior of x and different from x.
 
bool is_superset (const Interval &x) const
 Tests if this is a superset of x.
 
bool is_strict_superset (const Interval &x) const
 Tests if this is a superset of x and different from x.
 
Intervalinflate (const double &rad)
 Adds [-rad,+rad] to this.
 
bool is_bisectable () const
 Tests if this can be bisected into two non-degenerated intervals.
 
std::pair< Interval, Intervalbisect (float ratio=0.49) const
 Bisects this into two subintervals.
 
std::vector< Intervalcomplementary (bool compactness=true) const
 Computes the complementary of this.
 
std::vector< Intervaldiff (const Interval &y, bool compactness=true) const
 Computes the result of \([x]\[y]\).
 
Intervaloperator|= (const Interval &x)
 Self union of this and x.
 
Intervaloperator&= (const Interval &x)
 Self intersection of this and x.
 
Intervaloperator+= (double x)
 Self addition of this and a real x.
 
Intervaloperator+= (const Interval &x)
 Self addition of this and x.
 
Interval operator- () const
 Substraction of this.
 
Intervaloperator-= (double x)
 Self substraction of this and a real x.
 
Intervaloperator-= (const Interval &x)
 Self substraction of this and x.
 
Intervaloperator*= (double x)
 Self multiplication of this and a real x.
 
Intervaloperator*= (const Interval &x)
 Self multiplication of this and x.
 
Intervaloperator/= (double x)
 Self division of this and a real x.
 
Intervaloperator/= (const Interval &x)
 Self division of this and x.
 

Static Public Member Functions

static Interval empty ()
 Provides an empty interval.
 
static Interval zero ()
 Provides an interval for \([0]\).
 
static Interval one ()
 Provides an interval for \([1]\).
 
static Interval half_pi ()
 Provides an interval for \([\frac{\pi}{2}]\).
 
static Interval pi ()
 Provides an interval for \([\pi]\).
 
static Interval two_pi ()
 Provides an interval for \([2\pi]\).
 

Detailed Description

Interval class, for representing closed and connected subsets of \(\mathbb{R}\).

The class also encapsulates the interval representation provided by the Gaol library.

This class reuses several functions developed for ibex::Interval. See ibex::Interval (IBEX lib, main author: Gilles Chabert) https://ibex-lib.readthedocs.io

Constructor & Destructor Documentation

◆ Interval() [1/6]

codac2::Interval::Interval ( double a)
inline

Creates a degenerate interval \([a,a]\), \(a\in\mathbb{R}\).

Parameters
asingle value contained in the resulting interval
26 : gaol::interval(a)
27 {
28 if(a == -oo || a == oo)
29 set_empty();
30 }
void set_empty()
Sets this interval to the empty set.
Definition codac2_Interval_impl.h:182

◆ Interval() [2/6]

codac2::Interval::Interval ( double a,
double b )
inline

Creates an interval \([a,b]\), \(a\in\mathbb{R}, b\in\mathbb{R}\).

Parameters
alower bound of the interval
bupper bound of the interval
33 : gaol::interval(a,b)
34 { }

◆ Interval() [3/6]

codac2::Interval::Interval ( const Interval & x)
inline

Creates an interval from another one.

Parameters
xthe interval to be copied
37 : gaol::interval(x)
38 { }

◆ Interval() [4/6]

codac2::Interval::Interval ( const std::array< double, 1 > & array)
inlineexplicit

Create an interval \([a,a]\) from a fixed-sized array of size 1.

Parameters
arraythe array of doubles
41 : Interval(array[0])
42 { }
Interval()
Creates an interval .
Definition codac2_Interval_impl.h:21

◆ Interval() [5/6]

codac2::Interval::Interval ( const std::array< double, 2 > & array)
inlineexplicit

Create an interval \([a,b]\) from a fixed-sized array of size 2.

Parameters
arraythe array of doubles
45 : Interval(array[0],array[1])
46 { }

◆ Interval() [6/6]

codac2::Interval::Interval ( std::initializer_list< double > l)
inline

Create an interval as the hull of a list of values.

Parameters
llist of values contained in the resulting interval
49 : Interval()
50 {
52 }
Interval & init_from_list(const std::list< double > &l)
Sets the bounds as the hull of a list of values.
Definition codac2_Interval_impl.h:60

Member Function Documentation

◆ init()

Interval & codac2::Interval::init ( const Interval & x)
inline

Sets the value of this interval to x.

Note
This function is used for template purposes.
Parameters
xthe value for re-initialization
Returns
a reference to this
55 {
56 *this = x;
57 return *this;
58 }

◆ init_from_list()

Interval & codac2::Interval::init_from_list ( const std::list< double > & l)
inline

Sets the bounds as the hull of a list of values.

Note
This function is separated from the constructor for py binding purposes.
Parameters
llist of values contained in the resulting interval
Returns
a reference to this
61 {
62 if(l.size() == 1)
63 *this = Interval(*l.begin());
64
65 else if(l.size() == 2)
66 *this = Interval(*l.begin(),*std::prev(l.end()));
67
68 else
69 {
70 assert_release("'Interval' can only be defined by one or two 'double' values.");
71 }
72
73 return *this;
74 }

◆ operator=() [1/2]

Interval & codac2::Interval::operator= ( double x)
inline

Sets this to x.

Parameters
xreal to be intervalized
Returns
a reference to this
77 {
78 if(x == -oo || x == oo)
79 set_empty();
80 else
81 gaol::interval::operator=(x);
82
83 return *this;
84 }

◆ operator=() [2/2]

Interval & codac2::Interval::operator= ( const Interval & x)
inline

Sets this to x.

Parameters
xinterval to be copied
Returns
a reference to this
87 {
88 gaol::interval::operator=(x);
89 return *this;
90 }

◆ operator==()

bool codac2::Interval::operator== ( const Interval & x) const
inline

Comparison (equality) between two intervals.

Parameters
xinterval to be compared with
Returns
true iff this and x are exactly the same intervals
93 {
94 return (is_empty() && x.is_empty()) || (lb() == x.lb() && ub() == x.ub());
95 }
bool is_empty() const
Tests if this is empty.
Definition codac2_Interval_impl.h:187
double ub() const
Returns the upper bound of this.
Definition codac2_Interval_impl.h:107
double lb() const
Returns the lower bound of this.
Definition codac2_Interval_impl.h:102

◆ operator!=()

bool codac2::Interval::operator!= ( const Interval & x) const
inline

Comparison (non equality) between two intervals.

Parameters
xinterval to be compared with
Returns
true iff this and x are not exactly the same intervals
98 {
99 return !(*this == x);
100 }

◆ lb()

double codac2::Interval::lb ( ) const
inline

Returns the lower bound of this.

Returns
lower bound
103 {
104 return gaol::interval::left();
105 }

◆ ub()

double codac2::Interval::ub ( ) const
inline

Returns the upper bound of this.

Returns
upper bound
108 {
109 return gaol::interval::right();
110 }

◆ mid()

double codac2::Interval::mid ( ) const
inline

Returns the midpoint of this.

Note
The return point is guaranteed to be included in this but not necessarily to be the closest floating point from the real midpoint. In particular, cases are:
  • [empty] -> Quiet NaN
  • [-oo,+oo] -> mid = 0.0
  • [-oo,b] -> mid = -MAXREAL
  • [a,+oo] -> mid = MAXREAL
  • [a,b] -> mid ~ a + .5*(b-a)
Returns
midpoint
113 {
114 double m = gaol::interval::midpoint();
115 gaol::round_upward();
116 return m;
117 }

◆ mag()

double codac2::Interval::mag ( ) const
inline

Returns the magnitude of this i.e. max(|lower bound|, |upper bound|).

Returns
the magnitude of the interval
120 {
121 return gaol::interval::mag();
122 }

◆ mig()

double codac2::Interval::mig ( ) const
inline

Returns the mignitude of this.

+(lower bound) if lower_bound > 0 -(upper bound) if upper_bound < 0 0 otherwise.

Returns
the mignitude of the interval
125 {
126 return gaol::interval::mig();
127 }

◆ rand()

double codac2::Interval::rand ( ) const
inline

Returns a random value inside the interval.

Note
The seed of the pseudo-random number generator is voluntarily initialized outside this function, on demand.
In case of infinite bounds, only floating point values can be returned.
Returns
random value
130 {
131 if(is_empty())
132 return std::numeric_limits<double>::quiet_NaN();
133
134 double a = std::max<double>(next_float(-oo),lb());
135 double b = std::min<double>(previous_float(oo),ub());
136 double r = a + (((double)std::rand())/(double)RAND_MAX)*(b-a);
137 // The above operation may result in a floating point outside the bounds,
138 // due to floating-point errors. Such possible error is corrected below:
139 return std::max<double>(lb(),std::min<double>(r,ub()));
140 }

◆ rad()

double codac2::Interval::rad ( ) const
inline

Returns the radius of this.

Returns
the radius, or 0 if this is empty
143 {
144 if(is_empty())
145 return std::numeric_limits<double>::quiet_NaN();
146
147 else if(is_unbounded())
148 return oo;
149
150 else
151 {
152 double t = mid();
153 double t1 = (t-*this).ub();
154 double t2 = (*this-t).ub();
155 return (t1>t2) ? t1 : t2;
156 }
157 }
bool is_unbounded() const
Tests if one of the bounds of this is infinite.
Definition codac2_Interval_impl.h:202
double mid() const
Returns the midpoint of this.
Definition codac2_Interval_impl.h:112

◆ diam()

double codac2::Interval::diam ( ) const
inline

Returns the diameter of this.

Returns
the diameter, or 0 if this is empty
160 {
161 if(is_empty())
162 return std::numeric_limits<double>::quiet_NaN();
163
164 else
165 {
166 double d = gaol::interval::width();
167 gaol::round_upward();
168 return d;
169 }
170 }

◆ volume()

double codac2::Interval::volume ( ) const
inline

Returns the diameter of this.

Note
This function is used for template purposes. See diam()
Returns
the diameter, or 0 if this is empty
173 {
174 return diam();
175 }
double diam() const
Returns the diameter of this.
Definition codac2_Interval_impl.h:159

◆ size()

Index codac2::Interval::size ( ) const
inline

Returns the dimension of this (which is always )

Note
This function is used for template purposes.
Returns
1
178 {
179 return 1;
180 }

◆ is_empty()

bool codac2::Interval::is_empty ( ) const
inline

Tests if this is empty.

Returns
true in case of empty set
188 {
189 return gaol::interval::is_empty();
190 }

◆ contains()

bool codac2::Interval::contains ( const double & x) const
inline

Tests if this contains x.

Note
x can also be an "open bound", i.e., infinity. So this function is not restricted to a set-membership interpretation.
Parameters
xreal value
Returns
true if this contains x
193 {
194 return gaol::interval::set_contains(x);
195 }

◆ interior_contains()

bool codac2::Interval::interior_contains ( const double & x) const
inline

Tests if the interior of this contains x.

Parameters
xreal value
Returns
true if the interior of this contains x
198 {
199 return !is_empty() && x > lb() && x < ub();
200 }

◆ is_unbounded()

bool codac2::Interval::is_unbounded ( ) const
inline

Tests if one of the bounds of this is infinite.

Note
An empty interval is always bounded
Returns
true if of the bounds of this is infinite
203 {
204 return !gaol::interval::is_finite();
205 }

◆ is_degenerated()

bool codac2::Interval::is_degenerated ( ) const
inline

Tests if this is degenerated, that is, in the form of \([a,a]\).

Note
An empty interval is considered here as degenerated
Returns
true if this is degenerated
208 {
209 return is_empty() || gaol::interval::is_a_double();
210 }

◆ intersects()

bool codac2::Interval::intersects ( const Interval & x) const
inline

Tests if this and x intersect.

Parameters
xthe other interval
Returns
true if the intervals intersect
213 {
214 return !is_empty() && !x.is_empty() && lb() <= x.ub() && ub() >= x.lb();
215 }

◆ is_disjoint()

bool codac2::Interval::is_disjoint ( const Interval & x) const
inline

Tests if this and x do not intersect.

Parameters
xthe other interval
Returns
true if the intervals are disjoint
218 {
219 return is_empty() || x.is_empty() || lb() > x.ub() || ub() < x.lb();
220 }

◆ overlaps()

bool codac2::Interval::overlaps ( const Interval & x) const
inline

Tests if this and x intersect and their intersection has a non-null volume.

Parameters
xthe other interval
Returns
true if some interior points (of this or x) belong to their intersection
223 {
224 return !is_empty() && !x.is_empty() && ub() > x.lb() && x.ub() > lb();
225 }

◆ is_subset()

bool codac2::Interval::is_subset ( const Interval & x) const
inline

Tests if this is a subset of x.

Note
If this is empty, always returns true
Parameters
xthe other interval
Returns
true iff this interval is a subset of x
228 {
229 return is_empty() || (!x.is_empty() && x.lb() <= lb() && x.ub() >= ub());
230 }

◆ is_strict_subset()

bool codac2::Interval::is_strict_subset ( const Interval & x) const
inline

Tests if this is a subset of x and not x itself.

Note
In particular, \([-\infty,\infty]\) is not a strict subset of \([-\infty,\infty]\) and \(\varnothing\) is not a strict subset of \(\varnothing\), although in both cases, the first is inside the interior of the second.
Parameters
xthe other interval
Returns
true iff this interval is a strict subset of x
233 {
234 return !x.is_empty() && (is_empty() || (x.lb() < lb() && x.ub() >= ub()) || (x.ub() > ub() && x.lb() <= lb()));
235 }

◆ is_interior_subset()

bool codac2::Interval::is_interior_subset ( const Interval & x) const
inline

Tests if this is in the interior of x.

Note
In particular, \([-\infty,\infty]\) is in the interior of \([-\infty,\infty]\) and \(\varnothing\) is in the interior of \(\varnothing\).
Parameters
xthe other interval
Returns
true iff this interval is in the interior of x
238 {
239 return is_empty() || (!x.is_empty() && (x.lb() == -oo || x.lb() < lb()) && (x.ub() == oo || x.ub() > ub()));
240 }

◆ is_strict_interior_subset()

bool codac2::Interval::is_strict_interior_subset ( const Interval & x) const
inline

Tests if this is in the interior of x and different from x.

Note
In particular, \([-\infty,\infty]\) is not strictly in the interior of \([-\infty,\infty]\) and \(\varnothing\) is not strictly in the interior of \(\varnothing\).
Parameters
xthe other interval
Returns
true iff this interval is a strict interior subset of x
243 {
244 return !x.is_empty() && (is_empty() || (
245 (x.lb() < lb() && (x.ub() == oo || x.ub() > ub()))
246 || (x.ub() > ub() && (x.lb() == -oo || x.lb() < lb()))
247 ));
248 }

◆ is_superset()

bool codac2::Interval::is_superset ( const Interval & x) const
inline

Tests if this is a superset of x.

Note
If this is empty, always returns true
Parameters
xthe other interval
Returns
true iff this interval is a superset of x
251 {
252 return x.is_subset(*this);
253 }

◆ is_strict_superset()

bool codac2::Interval::is_strict_superset ( const Interval & x) const
inline

Tests if this is a superset of x and different from x.

See also
is_strict_subset()
Parameters
xthe other interval
Returns
true iff this interval is a strict superset of x
256 {
257 return x.is_strict_subset(*this);
258 }

◆ inflate()

Interval & codac2::Interval::inflate ( const double & rad)
inline

Adds [-rad,+rad] to this.

Parameters
radthe radius of the inflation
Returns
a reference to this
261 {
262 (*this) += Interval(-rad,rad);
263 return *this;
264 }
double rad() const
Returns the radius of this.
Definition codac2_Interval_impl.h:142

◆ is_bisectable()

bool codac2::Interval::is_bisectable ( ) const
inline

Tests if this can be bisected into two non-degenerated intervals.

Note
Examples of non bisectable intervals are [0,next_float(0)] or [DBL_MAX,+oo).
Returns
true iff this can be bisected
267 {
268 if(is_empty())
269 return false;
270 double m = mid();
271 return lb() < m && m < ub();
272 }

◆ bisect()

std::pair< Interval, Interval > codac2::Interval::bisect ( float ratio = 0.49) const
inline

Bisects this into two subintervals.

Precondition
is_bisectable() must be true
0 < ratio < 1
Parameters
ratiooptional proportion of split (0.5 corresponds to middle)
Returns
a pair of resulting subintervals
275 {
276 assert_release(is_bisectable());
277 assert_release(Interval(0,1).interior_contains(ratio));
278
279 if(lb() == -oo)
280 {
281 if(ub() == oo)
282 return { Interval(-oo,0), Interval(0,oo) };
283 else
284 return { Interval(-oo,-std::numeric_limits<double>::max()), Interval(-std::numeric_limits<double>::max(),ub()) };
285 }
286
287 else if(ub() == oo)
288 return { Interval(lb(),std::numeric_limits<double>::max()), Interval(std::numeric_limits<double>::max(),oo) };
289
290 else
291 {
292 double m;
293
294 if(ratio == 0.5)
295 m = mid();
296
297 else
298 {
299 m = lb() + ratio*diam();
300 if(m >= ub())
301 m = next_float(lb());
302
303 assert(m < ub());
304 }
305
306 return { Interval(lb(),m), Interval(m,ub()) };
307 }
308 }
bool is_bisectable() const
Tests if this can be bisected into two non-degenerated intervals.
Definition codac2_Interval_impl.h:266
bool interior_contains(const double &x) const
Tests if the interior of this contains x.
Definition codac2_Interval_impl.h:197

◆ complementary()

std::vector< Interval > codac2::Interval::complementary ( bool compactness = true) const
inline

Computes the complementary of this.

Parameters
compactnessoptional boolean to obtain or not disjoint intervals
Returns
a vector of complementary intervals
311 {
312 if(is_empty() || (compactness && is_degenerated()))
313 return { {-oo,oo} };
314
315 std::vector<Interval> l;
316
317 if(lb() > -oo)
318 l.push_back({-oo,lb()});
319
320 if(ub() < oo)
321 l.push_back({ub(),oo});
322
323 return l;
324 }
bool is_degenerated() const
Tests if this is degenerated, that is, in the form of .
Definition codac2_Interval_impl.h:207

◆ diff()

std::vector< Interval > codac2::Interval::diff ( const Interval & y,
bool compactness = true ) const
inline

Computes the result of \([x]\[y]\).

Parameters
yinterval to remove from this
compactnessoptional boolean to obtain or not disjoint intervals
Returns
a vector of resulting diff intervals
327 {
328 if(compactness && is_degenerated())
329 {
330 if(is_empty() || y.contains(lb()))
331 return {};
332 else
333 return { *this };
334 }
335
336 std::vector<Interval> l;
337 for(const auto& li : y.complementary(compactness))
338 {
339 Interval inter = li & *this;
340 if(!inter.is_degenerated())
341 l.push_back(inter);
342 }
343
344 return l;
345 }

◆ operator|=()

Interval & codac2::Interval::operator|= ( const Interval & x)
inline

Self union of this and x.

Parameters
xthe other interval
Returns
a reference to this
459 {
460 gaol::interval::operator|=(x);
461 return *this;
462 }

◆ operator&=()

Interval & codac2::Interval::operator&= ( const Interval & x)
inline

Self intersection of this and x.

Parameters
xthe other interval
Returns
a reference to this
465 {
466 gaol::interval::operator&=(x);
467 return *this;
468 }

◆ operator+=() [1/2]

Interval & codac2::Interval::operator+= ( double x)
inline

Self addition of this and a real x.

Parameters
xthe real to add
Returns
a reference to this
471 {
472 if(x == -oo || x == oo)
473 set_empty();
474 else
475 gaol::interval::operator+=(x);
476 return *this;
477 }

◆ operator+=() [2/2]

Interval & codac2::Interval::operator+= ( const Interval & x)
inline

Self addition of this and x.

Parameters
xthe other interval
Returns
a reference to this
480 {
481 gaol::interval::operator+=(x);
482 return *this;
483 }

◆ operator-()

Interval codac2::Interval::operator- ( ) const
inline

Substraction of this.

Returns
(- this)
486 {
487 return 0.-*this;
488 }

◆ operator-=() [1/2]

Interval & codac2::Interval::operator-= ( double x)
inline

Self substraction of this and a real x.

Parameters
xthe real to substract
Returns
a reference to this
491 {
492 if(x == -oo || x == oo)
493 set_empty();
494 else
495 gaol::interval::operator-=(x);
496 return *this;
497 }

◆ operator-=() [2/2]

Interval & codac2::Interval::operator-= ( const Interval & x)
inline

Self substraction of this and x.

Parameters
xthe other interval
Returns
a reference to this
500 {
501 gaol::interval::operator-=(x);
502 return *this;
503 }

◆ operator*=() [1/2]

Interval & codac2::Interval::operator*= ( double x)
inline

Self multiplication of this and a real x.

Parameters
xthe real to multiply
Returns
a reference to this
506 {
507 if(x == -oo || x == oo)
508 set_empty();
509 else
510 gaol::interval::operator*=(x);
511 return *this;
512 }

◆ operator*=() [2/2]

Interval & codac2::Interval::operator*= ( const Interval & x)
inline

Self multiplication of this and x.

Parameters
xthe other interval
Returns
a reference to this
515 {
516 gaol::interval::operator*=(x);
517 return *this;
518 }

◆ operator/=() [1/2]

Interval & codac2::Interval::operator/= ( double x)
inline

Self division of this and a real x.

Parameters
xthe real to divide
Returns
a reference to this
521 {
522 if(x == -oo || x == oo)
523 set_empty();
524 else
525 gaol::interval::operator/=(x);
526 return *this;
527 }

◆ operator/=() [2/2]

Interval & codac2::Interval::operator/= ( const Interval & x)
inline

Self division of this and x.

Note
This computation is more efficient than the non-self div operator, because it calculates the union of this/x as intermediate result.
Parameters
xthe other interval
Returns
a reference to this
530 {
531 gaol::interval::operator/=(x);
532 return *this;
533 }

◆ empty()

Interval codac2::Interval::empty ( )
inlinestatic

Provides an empty interval.

Returns
an empty set
536 {
537 return std::numeric_limits<double>::quiet_NaN();
538 }

◆ zero()

Interval codac2::Interval::zero ( )
inlinestatic

Provides an interval for \([0]\).

Returns
an interval containing \(0\)
541 {
542 return gaol::interval::zero();
543 }

◆ one()

Interval codac2::Interval::one ( )
inlinestatic

Provides an interval for \([1]\).

Returns
an interval containing \(1\)
546 {
547 return gaol::interval::one();
548 }

◆ half_pi()

Interval codac2::Interval::half_pi ( )
inlinestatic

Provides an interval for \([\frac{\pi}{2}]\).

Returns
an interval containing \(\frac{\pi}{2}\)
551 {
552 return gaol::interval::half_pi();
553 }

◆ pi()

Interval codac2::Interval::pi ( )
inlinestatic

Provides an interval for \([\pi]\).

Returns
an interval containing \(\pi\)
556 {
557 return gaol::interval::pi();
558 }

◆ two_pi()

Interval codac2::Interval::two_pi ( )
inlinestatic

Provides an interval for \([2\pi]\).

Returns
an interval containing \(2\pi\)
561 {
562 return gaol::interval::two_pi();
563 }

The documentation for this class was generated from the following files: