Hermes
hermes::Interval< T > Class Template Reference

Represents a numeric interval that supports interval arithmetic. More...

+ Inheritance diagram for hermes::Interval< T >:

Public Member Functions

HERMES_DEVICE_CALLABLE Interval ()
 Default constructor.
 
HERMES_DEVICE_CALLABLE Interval (T v)
 Constructs from center value. More...
 
HERMES_DEVICE_CALLABLE Interval (T l, T h)
 Construct from interval values. More...
 
HERMES_DEVICE_CALLABLE operator T () const
 Gets interval center value. More...
 
HERMES_DEVICE_CALLABLE Interval operator- () const
 Negates interval. More...
 
HERMES_DEVICE_CALLABLE Interval operator+ (const Interval &i) const
 Uses interval arithmetic addition. More...
 
HERMES_DEVICE_CALLABLE Interval operator- (const Interval &i) const
 Uses interval arithmetic subtraction. More...
 
HERMES_DEVICE_CALLABLE Interval operator* (const Interval &i) const
 Uses interval arithmetic multiplication. More...
 
HERMES_DEVICE_CALLABLE Interval operator/ (const Interval &i) const
 Uses interval arithmetic division. More...
 
HERMES_DEVICE_CALLABLE bool operator== (const Interval< T > &b) const
 
HERMES_DEVICE_CALLABLE bool contains (T v) const
 Checks if this interval contains v. More...
 
HERMES_DEVICE_CALLABLEcenter () const
 Gets interval center value. More...
 
HERMES_DEVICE_CALLABLEradius () const
 Gets interval radius. More...
 
HERMES_DEVICE_CALLABLEwidth () const
 Gets interval diameter. More...
 
HERMES_DEVICE_CALLABLE bool isExact () const
 Checks if interval contains a single value. More...
 
HERMES_DEVICE_CALLABLE Interval sqr () const
 Computes arithmetic interval square. More...
 
HERMES_DEVICE_CALLABLE Interval sqrt () const
 Computes arithmetic interval square root. More...
 

Static Public Member Functions

static HERMES_DEVICE_CALLABLE Interval withRadius (real_t c, real_t r)
 Constructs interval from center and radius. More...
 
- Static Public Member Functions inherited from hermes::MathElement< T, 2u >
static constexpr u64 componentCount ()
 Gets the number of dimensional components. More...
 
static constexpr u64 numericTypeSizeInBytes ()
 Gets the size in bytes of underlying data type. More...
 
static MemoryDumper::RegionLayout memoryDumpLayout ()
 Gets memory layout. More...
 

Public Attributes

low {0}
 lowest interval value
 
high {0}
 greatest interval value
 

Additional Inherited Members

- Static Public Attributes inherited from hermes::MathElement< T, 2u >
static T numeric_data
 Underlying data type.
 

Detailed Description

template<typename T>
class hermes::Interval< T >

Represents a numeric interval that supports interval arithmetic.

Constructor & Destructor Documentation

◆ Interval() [1/2]

template<typename T >
HERMES_DEVICE_CALLABLE hermes::Interval< T >::Interval ( v)
inline

Constructs from center value.

Parameters
v

◆ Interval() [2/2]

template<typename T >
HERMES_DEVICE_CALLABLE hermes::Interval< T >::Interval ( l,
h 
)
inline

Construct from interval values.

Parameters
l
h

Member Function Documentation

◆ center()

template<typename T >
HERMES_DEVICE_CALLABLE T hermes::Interval< T >::center ( ) const
inline

Gets interval center value.

Returns

◆ contains()

template<typename T >
HERMES_DEVICE_CALLABLE bool hermes::Interval< T >::contains ( v) const
inline

Checks if this interval contains v.

Parameters
v
Returns

◆ isExact()

template<typename T >
HERMES_DEVICE_CALLABLE bool hermes::Interval< T >::isExact ( ) const
inline

Checks if interval contains a single value.

Returns

◆ operator T()

template<typename T >
HERMES_DEVICE_CALLABLE hermes::Interval< T >::operator T ( ) const
inlineexplicit

Gets interval center value.

Returns

◆ operator*()

template<typename T >
HERMES_DEVICE_CALLABLE Interval hermes::Interval< T >::operator* ( const Interval< T > &  i) const
inline

Uses interval arithmetic multiplication.

Parameters
i
Returns

◆ operator+()

template<typename T >
HERMES_DEVICE_CALLABLE Interval hermes::Interval< T >::operator+ ( const Interval< T > &  i) const
inline

Uses interval arithmetic addition.

Parameters
i
Returns

◆ operator-() [1/2]

template<typename T >
HERMES_DEVICE_CALLABLE Interval hermes::Interval< T >::operator- ( ) const
inline

Negates interval.

Returns

◆ operator-() [2/2]

template<typename T >
HERMES_DEVICE_CALLABLE Interval hermes::Interval< T >::operator- ( const Interval< T > &  i) const
inline

Uses interval arithmetic subtraction.

Parameters
i
Returns

◆ operator/()

template<typename T >
HERMES_DEVICE_CALLABLE Interval hermes::Interval< T >::operator/ ( const Interval< T > &  i) const
inline

Uses interval arithmetic division.

Parameters
i
Returns

◆ radius()

template<typename T >
HERMES_DEVICE_CALLABLE T hermes::Interval< T >::radius ( ) const
inline

Gets interval radius.

Returns

◆ sqr()

template<typename T >
HERMES_DEVICE_CALLABLE Interval hermes::Interval< T >::sqr ( ) const
inline

Computes arithmetic interval square.

Returns

◆ sqrt()

template<typename T >
HERMES_DEVICE_CALLABLE Interval hermes::Interval< T >::sqrt ( ) const
inline

Computes arithmetic interval square root.

Returns

◆ width()

template<typename T >
HERMES_DEVICE_CALLABLE T hermes::Interval< T >::width ( ) const
inline

Gets interval diameter.

Returns

◆ withRadius()

template<typename T >
static HERMES_DEVICE_CALLABLE Interval hermes::Interval< T >::withRadius ( real_t  c,
real_t  r 
)
inlinestatic

Constructs interval from center and radius.

Parameters
c
r
Returns

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