Previous topic

optim

Next topic

table

This Page

piecewise

Id:piecewise.py
Author:Philippe Guglielmetti <drgoulu@gmail.com>
Copyright:2013 Philippe Guglielmetti
Licence:GNU Lesser General Public Licence (LGPL)
Synposis:Piecewise defined function
class piecewise.Piecewise(init=[], default=0, start=-inf)[source]

Bases: object

piecewise function defined by a sorted list of (startpoint,value)

__init__(init=[], default=0, start=-inf)[source]
__call__(x)[source]

returns value of function at point x

index(x, v=None)[source]

finds an existing point or insert one and returns index

append(item)[source]

appends a (x,y) item. In fact inserts it at correct position and returns the corresponding index

extend(iterable)[source]

appends an iterable of (x,y) values

__len__()[source]
__getitem__(i)[source]
__iter__()[source]
list()[source]
__str__()[source]
__add__(other)[source]
__sub__(other)[source]
__mul__(other)[source]
__div__(other)[source]
__and__(other)[source]
__or__(other)[source]
__xor__(other)[source]
apply(f)[source]

apply a function to each piece

__neg__()[source]
__not__()[source]
applx(f)[source]

apply a function to each x value

__lshift__(dx)[source]
__rshift__(dx)[source]
lines(min=0, max=None, eps=0)[source]

@return x and y for a line plot

__weakref__

list of weak references to the object (if defined)

class piecewise.TestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

setUp()[source]
runTest()[source]
tearDown()[source]