codac 1.5.6
Loading...
Searching...
No Matches
codac2_Interval_impl.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

Interval codac2::operator& (const Interval &x, const Interval &y)
 Returns the intersection of two intervals: \([x]\cap[y]\).
 
Interval codac2::operator| (const Interval &x, const Interval &y)
 Returns the squared-union of two intervals: \([x]\sqcup[y]\).
 
const Intervalcodac2::operator+ (const Interval &x)
 Returns this.
 
Interval codac2::operator+ (const Interval &x, double y)
 Returns \([x]+y\) with \(y\in\mathbb{R}\).
 
Interval codac2::operator+ (double x, const Interval &y)
 Returns \(x+[y]\) with \(x\in\mathbb{R}\).
 
Interval codac2::operator+ (const Interval &x, const Interval &y)
 Returns \([x]+[y]\).
 
Interval codac2::operator- (const Interval &x, double y)
 Returns \([x]-y\) with \(y\in\mathbb{R}\).
 
Interval codac2::operator- (double x, const Interval &y)
 Returns \(x-[y]\) with \(x\in\mathbb{R}\).
 
Interval codac2::operator- (const Interval &x, const Interval &y)
 Returns \([x]-[y]\).
 
Interval codac2::operator* (const Interval &x, double y)
 Returns \([x]*y\) with \(y\in\mathbb{R}\).
 
Interval codac2::operator* (double x, const Interval &y)
 Returns \(x*[y]\) with \(x\in\mathbb{R}\).
 
Interval codac2::operator* (const Interval &x, const Interval &y)
 Returns \([x]*[y]\).
 
Interval codac2::operator/ (const Interval &x, double y)
 Returns \([x]/y\) with \(y\in\mathbb{R}\).
 
Interval codac2::operator/ (double x, const Interval &y)
 Returns \(x/[y]\) with \(x\in\mathbb{R}\).
 
Interval codac2::operator/ (const Interval &x, const Interval &y)
 Returns \([x]/[y]\).
 
std::ostream & codac2::operator<< (std::ostream &os, const Interval &x)
 Streams out this.
 
Interval codac2::operator""_i (long double x)
 Codac defined literals allowing to produce an interval from a double.
 

Detailed Description

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


Date
2024
Author
Gilles Chabert, Simon Rohou
License: GNU Lesser General Public License (LGPL)

Function Documentation

◆ operator&()

Interval codac2::operator& ( const Interval & x,
const Interval & y )
inline

Returns the intersection of two intervals: \([x]\cap[y]\).

Note
Returns an empty interval if there is no intersection.
Parameters
xinterval value
yinterval value
Returns
intersection result
348 {
349 if(x.is_empty() || y.is_empty() || x.ub() < y.lb())
350 return Interval::empty();
351
352 else
353 return gaol::operator&(x,y);
354 }
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
static Interval empty()
Provides an empty interval.
Definition codac2_Interval_impl.h:535

◆ operator|()

Interval codac2::operator| ( const Interval & x,
const Interval & y )
inline

Returns the squared-union of two intervals: \([x]\sqcup[y]\).

Note
The squared-union is defined as: \([x]\sqcup[y]=\left[[x]\cup[y]\right]\)
Parameters
xinterval value
yinterval value
Returns
squared-union result
357 {
358 return gaol::operator|(x,y);
359 }

◆ operator+() [1/4]

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

Returns this.

Note
This operator is only provided for consistency purposes.
Parameters
xinterval value
Returns
the same interval
362 {
363 return x;
364 }

◆ operator+() [2/4]

Interval codac2::operator+ ( const Interval & x,
double y )
inline

Returns \([x]+y\) with \(y\in\mathbb{R}\).

Parameters
xinterval value
yreal value
Returns
the addition result
367 {
368 if(y == -oo || y == oo)
369 return Interval::empty();
370
371 else
372 return gaol::operator+(x,y);
373 }

◆ operator+() [3/4]

Interval codac2::operator+ ( double x,
const Interval & y )
inline

Returns \(x+[y]\) with \(x\in\mathbb{R}\).

Parameters
xreal value
yinterval value
Returns
the addition result
376 {
377 if(x == -oo || x == oo)
378 return Interval::empty();
379
380 else
381 return gaol::operator+(x,y);
382 }

◆ operator+() [4/4]

Interval codac2::operator+ ( const Interval & x,
const Interval & y )
inline

Returns \([x]+[y]\).

Parameters
xinterval value
yinterval value
Returns
the addition result
385 {
386 return gaol::operator+(x,y);
387 }

◆ operator-() [1/3]

Interval codac2::operator- ( const Interval & x,
double y )
inline

Returns \([x]-y\) with \(y\in\mathbb{R}\).

Parameters
xinterval value
yreal value
Returns
the substraction result
390 {
391 if(y == -oo || y == oo)
392 return Interval::empty();
393
394 else
395 return gaol::operator-(x, y);
396 }

◆ operator-() [2/3]

Interval codac2::operator- ( double x,
const Interval & y )
inline

Returns \(x-[y]\) with \(x\in\mathbb{R}\).

Parameters
xreal value
yinterval value
Returns
the substraction result
399 {
400 if(x == -oo || x == oo)
401 return Interval::empty();
402
403 else
404 return gaol::operator-(x, y);
405 }

◆ operator-() [3/3]

Interval codac2::operator- ( const Interval & x,
const Interval & y )
inline

Returns \([x]-[y]\).

Parameters
xinterval value
yinterval value
Returns
the substraction result
408 {
409 return gaol::operator-(x, y);
410 }

◆ operator*() [1/3]

Interval codac2::operator* ( const Interval & x,
double y )
inline

Returns \([x]*y\) with \(y\in\mathbb{R}\).

Parameters
xinterval value
yreal value
Returns
the multiplication result
413 {
414 if(y == -oo || y == oo)
415 return Interval::empty();
416
417 else
418 return gaol::operator*(x,y);
419 }

◆ operator*() [2/3]

Interval codac2::operator* ( double x,
const Interval & y )
inline

Returns \(x*[y]\) with \(x\in\mathbb{R}\).

Parameters
xreal value
yinterval value
Returns
the multiplication result
422 {
423 if(x == -oo || x == oo)
424 return Interval::empty();
425
426 else
427 return gaol::operator*(x,y);
428 }

◆ operator*() [3/3]

Interval codac2::operator* ( const Interval & x,
const Interval & y )
inline

Returns \([x]*[y]\).

Parameters
xinterval value
yinterval value
Returns
the multiplication result
431 {
432 return gaol::operator*(x,y);
433 }

◆ operator/() [1/3]

Interval codac2::operator/ ( const Interval & x,
double y )
inline

Returns \([x]/y\) with \(y\in\mathbb{R}\).

Parameters
xinterval value
yreal value
Returns
the division result
436 {
437 if(y == -oo || y == oo)
438 return Interval::empty();
439
440 else
441 return gaol::operator/(x,y);
442 }

◆ operator/() [2/3]

Interval codac2::operator/ ( double x,
const Interval & y )
inline

Returns \(x/[y]\) with \(x\in\mathbb{R}\).

Parameters
xreal value
yinterval value
Returns
the division result
445 {
446 if(x == -oo || x == oo)
447 return Interval::empty();
448
449 else
450 return gaol::operator/(x,y);
451 }

◆ operator/() [3/3]

Interval codac2::operator/ ( const Interval & x,
const Interval & y )
inline

Returns \([x]/[y]\).

Parameters
xinterval value
yinterval value
Returns
the division result
454 {
455 return gaol::operator/(x,y);
456 }

◆ operator<<()

std::ostream & codac2::operator<< ( std::ostream & os,
const Interval & x )
inline

Streams out this.

Parameters
osthe stream to be updated
xthe interval to stream out
Returns
a reference to the updated stream
566 {
567 gaol::interval::precision(os.precision());
568 gaol::operator<<(os,x);
569 return os;
570 }

◆ operator""_i()

Interval codac2::operator""_i ( long double x)
inline

Codac defined literals allowing to produce an interval from a double.

Parameters
xvalue to convert into an interval object
Returns
the interval \([x]\)
577 {
578 return Interval(x);
579 }
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:62