Package teamwork :: Package math :: Module Interval :: Class Interval
[hide private]
[frames] | no frames]

Class Interval

source code

Interval representation

Instance Methods [hide private]
 
__init__(self, lo=-1.0, hi=1.0)
Interval constructor...creates an interval [lo,hi]
source code
 
mean(self)
Returns the midpoint of this interval
source code
 
__add__(self, other)
Enables I1+I2 and I1+x
source code
 
__neg__(self)
Enables -I1
source code
 
__sub__(self, other)
Enables I1-I2 and I1-x
source code
 
__mul__(self, other)
Enables I1*I2 and I1*x
source code
 
__div__(self, other)
Enables I1/I2 and I1/x
source code
 
__lt__(self, other)
Enables I1<I2 and I1<x
source code
 
__gt__(self, other)
Enables I1>I2 and I1>x
source code
 
__eq__(self, other)
Enables I1==I2 and I1==x
source code
 
__ne__(self, other)
Enables I1!=I2 and I1!=x
source code
 
__le__(self, other)
Enables I1<=I2 and I1<=x
source code
 
__ge__(self, other)
Enables I1>=I2 and I1>=x
source code
 
__contains__(self, other)
Enables I2 in I1 and x in I1
source code
 
__abs__(self)
Enables abs(I1)
source code
 
__repr__(self) source code
 
__getitem__(self, index)
Allows indexing to get the bounds of this interval
source code
 
__setitem__(self, index, value)
Allows indexing to set the bounds of this interval
source code
 
__float__(self) source code
 
__xml__(self) source code
 
parse(self, node) source code
 
isPoint(self)
Returns true iff the interval is a point interval
source code
 
width(self)
Returns the float width of this interval
source code
Class Variables [hide private]
  FLOOR = -1.0
  CEILING = 1.0
  QUANTUM = 0.0001
Method Details [hide private]

__getitem__(self, index)
(Indexing operator)

source code 

Allows indexing to get the bounds of this interval

I['lo'] or I[0] returns the low bound of I; I['hi'] or I[1] returns its high bound

__setitem__(self, index, value)
(Index assignment operator)

source code 

Allows indexing to set the bounds of this interval

I['lo']= or I[0]= sets the low bound of I; I['hi']= or I[1]= sets its high bound