library of assembled shared sources

http://lass.cocamware.com

lass::num::interval< C > Class Template Reference

Interval class. More...

#include <interval.h>


Public Types

typedef C baseType

Public Member Functions

 interval ()
 ~interval ()
 interval (typename util::CallTraits< baseType >::TParam iValue)
 interval (typename util::CallTraits< baseType >::TParam iInf, typename util::CallTraits< baseType >::TParam iSup)
intervaloperator= (const interval< C > &i)
const intervaloperator+ () const
interval operator- () const
void set (typename util::CallTraits< C >::TParam iInf, typename util::CallTraits< C >::TParam iSup)
 direct set of both infinum and supinum
bool isEmpty () const
 returns true for the empty interval
bool isSingleton () const
 return true for degenerated intervals
bool contains (typename util::CallTraits< baseType >::TParam ix) const
 returns true when ix is in the interval
baseTypeoperator[] (int i)
 indexed access, 0 = infinum, 1 = supinum
baseType operator[] (int i) const
 indexed access, 0 = infinum, 1 = supinum
baseType inf () const
 the infinum of the interval
baseType sup () const
 the supinum of the interval
baseTypeinf ()
 the infinum of the interval
baseTypesup ()
 the supinum of the interval
baseType mid () const
 the middle of the interval
baseType diam () const
 the difference between supinum and infinum
baseType ratio () const
 the ratio of the supinum over the infinum
bool operator> (const interval< C > &i) const
 certainly greater than
bool operator< (const interval< C > &i) const
 certainly less than
bool operator== (const interval< C > &i) const
 certainly equal
bool operator!= (const interval< C > &i) const
 certainly not equal
bool operator>= (const interval< C > &i) const
 certainly greater or equal than
bool operator<= (const interval< C > &i) const
 certainly less or equal than
bool pe (const interval< C > &i) const
 possibly equal
bool pne (const interval< C > &i) const
 possibly not equal
bool pg (const interval< C > &i) const
 possibly greater than
bool pge (const interval< C > &i) const
 possibly greater or equal than
bool pl (const interval< C > &i) const
 possibly less than
bool ple (const interval< C > &i) const
 possibly less or equal than
baseType fe (const interval< C > &i) const
 fuzzy equal
fne (const interval< C > &i) const
 fuzzy not equal
baseType fg (const interval< C > &i) const
 fuzzy greater than
baseType fge (const interval< C > &i) const
 fuzzy greater or equal than
baseType fl (const interval< C > &i) const
 fuzzy less than
baseType fle (const interval< C > &i) const
 fuzzy less or equal than
intervaloperator+= (const interval< C > &i)
intervaloperator-= (const interval< C > &i)
intervaloperator*= (const interval< C > &i)
intervaloperator/= (const interval< C > &i)
intervaloperator+= (typename util::CallTraits< baseType >::TParam s)
intervaloperator-= (typename util::CallTraits< baseType >::TParam s)
intervaloperator*= (typename util::CallTraits< baseType >::TParam s)
intervaloperator/= (typename util::CallTraits< baseType >::TParam s)

Static Public Attributes

static const interval< C > empty = interval<C>(NumTraits<C>::one, NumTraits<C>::zero)

Private Attributes

v [2]

Friends

void inpsqr (interval< C > &i)
void inpsqrt (interval< C > &i)
void inpexp (interval< C > &i)
void inplog (interval< C > &i)
void inpnorm (interval< C > &i)
void inpinv (interval< C > &i)
template<typename C2 , typename F >
interval< C2 > applyFunction (const interval< C2 > &iV, F func)


Detailed Description

template<typename C>
class lass::num::interval< C >

Interval class.

Class for interval arithmetic. The arithmetic is weak interval arithmetic: there is no rounding code, to speed up things. It should however be useful except for numerical stability studies on the bitlevel. If you wont strong interval arithmetic, look for the boost library.

Warning:
DO NOT derive a class from this one which uses dynamic memory management! destructor is not virtual. This is to avoid the functionptrtable to be stored in the objects. Therefor none of the methods are virtual
Author:
Tom De Muer
Date:
2003

Definition at line 78 of file interval.h.


Member Typedef Documentation

template<typename C >
typedef C lass::num::interval< C >::baseType

Definition at line 83 of file interval.h.


Constructor & Destructor Documentation

template<typename C >
lass::num::interval< C >::interval (  )  [inline]

Definition at line 87 of file interval.h.

References lass::stde::C, and lass::num::interval< C >::v.

template<typename C >
lass::num::interval< C >::~interval (  )  [inline]

Definition at line 88 of file interval.h.

template<typename C >
lass::num::interval< C >::interval ( typename util::CallTraits< baseType >::TParam  iValue  )  [inline, explicit]

Definition at line 299 of file interval.h.

template<typename C >
lass::num::interval< C >::interval ( typename util::CallTraits< baseType >::TParam  iInf,
typename util::CallTraits< baseType >::TParam  iSup 
) [inline, explicit]

Definition at line 306 of file interval.h.


Member Function Documentation

template<typename C >
interval< C > & lass::num::interval< C >::operator= ( const interval< C > &  i  )  [inline]

Definition at line 313 of file interval.h.

template<typename C >
const interval< C > & lass::num::interval< C >::operator+ (  )  const [inline]

Definition at line 321 of file interval.h.

template<typename C >
interval< C > lass::num::interval< C >::operator- (  )  const [inline]

Definition at line 564 of file interval.h.

template<typename C >
void lass::num::interval< C >::set ( typename util::CallTraits< C >::TParam  iInf,
typename util::CallTraits< C >::TParam  iSup 
) [inline]

direct set of both infinum and supinum

Definition at line 327 of file interval.h.

template<typename C >
bool lass::num::interval< C >::isEmpty (  )  const [inline]

returns true for the empty interval

Definition at line 334 of file interval.h.

template<typename C >
bool lass::num::interval< C >::isSingleton (  )  const [inline]

return true for degenerated intervals

Definition at line 341 of file interval.h.

template<typename C >
bool lass::num::interval< C >::contains ( typename util::CallTraits< baseType >::TParam  ix  )  const [inline]

returns true when ix is in the interval

Definition at line 348 of file interval.h.

template<typename C >
C & lass::num::interval< C >::operator[] ( int  i  )  [inline]

indexed access, 0 = infinum, 1 = supinum

Definition at line 354 of file interval.h.

template<typename C >
C lass::num::interval< C >::operator[] ( int  i  )  const [inline]

indexed access, 0 = infinum, 1 = supinum

Definition at line 360 of file interval.h.

template<typename C >
C lass::num::interval< C >::inf (  )  const [inline]

the infinum of the interval

Definition at line 366 of file interval.h.

template<typename C >
C lass::num::interval< C >::sup (  )  const [inline]

the supinum of the interval

Definition at line 372 of file interval.h.

template<typename C >
C & lass::num::interval< C >::inf (  )  [inline]

the infinum of the interval

Definition at line 378 of file interval.h.

template<typename C >
C & lass::num::interval< C >::sup (  )  [inline]

the supinum of the interval

Definition at line 384 of file interval.h.

template<typename C >
C lass::num::interval< C >::mid (  )  const [inline]

the middle of the interval

Definition at line 390 of file interval.h.

template<typename C >
C lass::num::interval< C >::diam (  )  const [inline]

the difference between supinum and infinum

Definition at line 396 of file interval.h.

template<typename C >
C lass::num::interval< C >::ratio (  )  const [inline]

the ratio of the supinum over the infinum

Definition at line 402 of file interval.h.

template<typename C >
bool lass::num::interval< C >::operator> ( const interval< C > &  i  )  const [inline]

certainly greater than

Definition at line 411 of file interval.h.

template<typename C >
bool lass::num::interval< C >::operator< ( const interval< C > &  i  )  const [inline]

certainly less than

Definition at line 417 of file interval.h.

template<typename C >
bool lass::num::interval< C >::operator== ( const interval< C > &  i  )  const [inline]

certainly equal

Definition at line 423 of file interval.h.

template<typename C >
bool lass::num::interval< C >::operator!= ( const interval< C > &  i  )  const [inline]

certainly not equal

Definition at line 429 of file interval.h.

template<typename C >
bool lass::num::interval< C >::operator>= ( const interval< C > &  i  )  const [inline]

certainly greater or equal than

Definition at line 435 of file interval.h.

template<typename C >
bool lass::num::interval< C >::operator<= ( const interval< C > &  i  )  const [inline]

certainly less or equal than

Definition at line 441 of file interval.h.

template<typename C >
bool lass::num::interval< C >::pe ( const interval< C > &  i  )  const [inline]

possibly equal

Definition at line 447 of file interval.h.

template<typename C >
bool lass::num::interval< C >::pne ( const interval< C > &  i  )  const [inline]

possibly not equal

Definition at line 453 of file interval.h.

template<typename C >
bool lass::num::interval< C >::pg ( const interval< C > &  i  )  const [inline]

possibly greater than

Definition at line 459 of file interval.h.

template<typename C >
bool lass::num::interval< C >::pge ( const interval< C > &  i  )  const [inline]

possibly greater or equal than

Definition at line 465 of file interval.h.

template<typename C >
bool lass::num::interval< C >::pl ( const interval< C > &  i  )  const [inline]

possibly less than

Definition at line 471 of file interval.h.

template<typename C >
bool lass::num::interval< C >::ple ( const interval< C > &  i  )  const [inline]

possibly less or equal than

Definition at line 477 of file interval.h.

template<typename C >
C lass::num::interval< C >::fe ( const interval< C > &  i  )  const [inline]

fuzzy equal

Definition at line 689 of file interval.h.

template<typename C >
C lass::num::interval< C >::fne ( const interval< C > &  i  )  const [inline]

fuzzy not equal

Definition at line 707 of file interval.h.

template<typename C >
C lass::num::interval< C >::fg ( const interval< C > &  i  )  const [inline]

fuzzy greater than

Definition at line 714 of file interval.h.

template<typename C >
C lass::num::interval< C >::fge ( const interval< C > &  i  )  const [inline]

fuzzy greater or equal than

Definition at line 725 of file interval.h.

template<typename C >
C lass::num::interval< C >::fl ( const interval< C > &  i  )  const [inline]

fuzzy less than

Definition at line 732 of file interval.h.

template<typename C >
C lass::num::interval< C >::fle ( const interval< C > &  i  )  const [inline]

fuzzy less or equal than

Definition at line 739 of file interval.h.

template<typename C >
interval< C > & lass::num::interval< C >::operator+= ( const interval< C > &  i  )  [inline]

Definition at line 570 of file interval.h.

template<typename C >
interval< C > & lass::num::interval< C >::operator-= ( const interval< C > &  i  )  [inline]

Definition at line 578 of file interval.h.

template<typename C >
interval< C > & lass::num::interval< C >::operator*= ( const interval< C > &  i  )  [inline]

Definition at line 586 of file interval.h.

template<typename C >
interval< C > & lass::num::interval< C >::operator/= ( const interval< C > &  i  )  [inline]

Definition at line 598 of file interval.h.

template<typename C >
interval< C > & lass::num::interval< C >::operator+= ( typename util::CallTraits< baseType >::TParam  s  )  [inline]

Definition at line 615 of file interval.h.

template<typename C >
interval< C > & lass::num::interval< C >::operator-= ( typename util::CallTraits< baseType >::TParam  s  )  [inline]

Definition at line 623 of file interval.h.

template<typename C >
interval< C > & lass::num::interval< C >::operator*= ( typename util::CallTraits< baseType >::TParam  s  )  [inline]

Definition at line 631 of file interval.h.

template<typename C >
interval< C > & lass::num::interval< C >::operator/= ( typename util::CallTraits< baseType >::TParam  s  )  [inline]

Definition at line 643 of file interval.h.


Friends And Related Function Documentation

template<typename C >
void inpsqr ( interval< C > &  i  )  [friend]

template<typename C >
void inpsqrt ( interval< C > &  i  )  [friend]

template<typename C >
void inpexp ( interval< C > &  i  )  [friend]

template<typename C >
void inplog ( interval< C > &  i  )  [friend]

template<typename C >
void inpnorm ( interval< C > &  i  )  [friend]

template<typename C >
void inpinv ( interval< C > &  i  )  [friend]

template<typename C >
template<typename C2 , typename F >
interval<C2> applyFunction ( const interval< C2 > &  iV,
func 
) [friend]


Field Documentation

template<typename C >
C lass::num::interval< C >::v[2] [private]

Definition at line 81 of file interval.h.

Referenced by lass::num::interval< C >::interval().

template<typename C >
const interval< C > lass::num::interval< C >::empty = interval<C>(NumTraits<C>::one, NumTraits<C>::zero) [inline, static]

Definition at line 85 of file interval.h.


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

Generated on Mon Nov 10 14:22:10 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo