func
index
/usr/local/python/epics/func.py

# func.py: general function objects
# Author: Johann Hibschman <johann@physics.berkeley.edu>
#
# Copyright (C) Johann Hibschman 1997 
#

 
Modules
            
Numeric
copy
copy_reg
math
multiarray
operator
pickle
string
types
 
Classes
            
BinFuncOps
BinBinCompose
BinFuncBinder
BinUnCompose
BinVar1
BinVar2
UnBinCompose
FuncOps
BinCompose
Bind1st
Bind2nd
FuncBinder
Identity
UnCompose
UnConstant
 
class BinBinCompose(BinFuncOps)
      # compose two binary functions together, using a third binary function
# to make the composition: h(f(x,y), g(x,y))
 
   Methods defined here:
__call__(self, arg1, arg2)
__init__(self, a_h, a_f, a_g)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'func'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from BinFuncOps:
__add__(self, f)
__div__(self, f)
__mul__(self, f)
__neg__(self)
__pow__(self, f)
__sub__(self, f)
accumulate(self, a, axis=0)
compose(self, f, g)
# returns self(f(x), g(x)), a unary function
compose2(self, f, g)
# returns self(f(x), g(y)), a binary function
compose_by(self, f)
# returns f(self(x,y)), a binary function
outer(self, a, b)
reduce(self, a, axis=0)
 
class BinCompose(FuncOps)
       
   Methods defined here:
__call__(self, arg)
__init__(self, a_binop, a_f, a_g)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'func'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from FuncOps:
__add__(self, f)
__coerce__(self, x)
__div__(self, f)
__mul__(self, f)
__neg__(self)
__pow__(self, f)
__sub__(self, f)
compose(self, f)
exp(self)
log(self)
 
class BinFuncBinder(BinFuncOps)
      # bind a binary function
 
   Methods defined here:
__call__(self, arg1, arg2)
__init__(self, a_f)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'func'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from BinFuncOps:
__add__(self, f)
__div__(self, f)
__mul__(self, f)
__neg__(self)
__pow__(self, f)
__sub__(self, f)
accumulate(self, a, axis=0)
compose(self, f, g)
# returns self(f(x), g(x)), a unary function
compose2(self, f, g)
# returns self(f(x), g(y)), a binary function
compose_by(self, f)
# returns f(self(x,y)), a binary function
outer(self, a, b)
reduce(self, a, axis=0)
 
class BinFuncOps
       
   Methods defined here:
__add__(self, f)
__div__(self, f)
__mul__(self, f)
__neg__(self)
__pow__(self, f)
__sub__(self, f)
accumulate(self, a, axis=0)
compose(self, f, g)
# returns self(f(x), g(x)), a unary function
compose2(self, f, g)
# returns self(f(x), g(y)), a binary function
compose_by(self, f)
# returns f(self(x,y)), a binary function
outer(self, a, b)
reduce(self, a, axis=0)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'func'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
 
class BinUnCompose(BinFuncOps)
      # compose a two unary functions with a binary function to get a binary
# function: f(g(x), h(y))
 
   Methods defined here:
__call__(self, arg1, arg2)
__init__(self, a_f, a_g, a_h)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'func'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from BinFuncOps:
__add__(self, f)
__div__(self, f)
__mul__(self, f)
__neg__(self)
__pow__(self, f)
__sub__(self, f)
accumulate(self, a, axis=0)
compose(self, f, g)
# returns self(f(x), g(x)), a unary function
compose2(self, f, g)
# returns self(f(x), g(y)), a binary function
compose_by(self, f)
# returns f(self(x,y)), a binary function
outer(self, a, b)
reduce(self, a, axis=0)
 
class BinVar1(BinFuncOps)
      # bind single variables
 
   Methods defined here:
__call__(self, arg1, arg2)
__init__(self)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'func'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from BinFuncOps:
__add__(self, f)
__div__(self, f)
__mul__(self, f)
__neg__(self)
__pow__(self, f)
__sub__(self, f)
accumulate(self, a, axis=0)
compose(self, f, g)
# returns self(f(x), g(x)), a unary function
compose2(self, f, g)
# returns self(f(x), g(y)), a binary function
compose_by(self, f)
# returns f(self(x,y)), a binary function
outer(self, a, b)
reduce(self, a, axis=0)
 
class BinVar2(BinFuncOps)
       
   Methods defined here:
__call__(self, arg1, arg2)
__init__(self)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'func'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from BinFuncOps:
__add__(self, f)
__div__(self, f)
__mul__(self, f)
__neg__(self)
__pow__(self, f)
__sub__(self, f)
accumulate(self, a, axis=0)
compose(self, f, g)
# returns self(f(x), g(x)), a unary function
compose2(self, f, g)
# returns self(f(x), g(y)), a binary function
compose_by(self, f)
# returns f(self(x,y)), a binary function
outer(self, a, b)
reduce(self, a, axis=0)
 
class Bind1st(FuncOps)
      # bind individual variables within a binary function
 
   Methods defined here:
__call__(self, x)
__init__(self, a_f, an_arg1)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'func'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from FuncOps:
__add__(self, f)
__coerce__(self, x)
__div__(self, f)
__mul__(self, f)
__neg__(self)
__pow__(self, f)
__sub__(self, f)
compose(self, f)
exp(self)
log(self)
 
class Bind2nd(FuncOps)
       
   Methods defined here:
__call__(self, x)
__init__(self, a_f, an_arg2)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'func'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from FuncOps:
__add__(self, f)
__coerce__(self, x)
__div__(self, f)
__mul__(self, f)
__neg__(self)
__pow__(self, f)
__sub__(self, f)
compose(self, f)
exp(self)
log(self)
 
class FuncBinder(FuncOps)
      # Bind a normal function
# Should check if the argument is a function.
 
   Methods defined here:
__init__(self, a_f)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'func'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from FuncOps:
__add__(self, f)
__call__(self, arg)
Default call routine, used for ordinary functions.
__coerce__(self, x)
__div__(self, f)
__mul__(self, f)
__neg__(self)
__pow__(self, f)
__sub__(self, f)
compose(self, f)
exp(self)
log(self)
 
class FuncOps
      Common mix-in operations for function objects.
Normal function classes are assumed to implement a call routine,
which will be chained to in the __call__ method.
 
   Methods defined here:
__add__(self, f)
__call__(self, arg)
Default call routine, used for ordinary functions.
__coerce__(self, x)
__div__(self, f)
__mul__(self, f)
__neg__(self)
__pow__(self, f)
__sub__(self, f)
compose(self, f)
exp(self)
log(self)

Data and non-method functions defined here:
__doc__ = '\n Common mix-in operations for function objec...h will be chained to in the __call__ method.\n '
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
__module__ = 'func'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
 
class Identity(FuncOps)
      # just return the argument: f(x) = x
# This is used to build up more complex expressions.
 
   Methods defined here:
__call__(self, arg)
__init__(self)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'func'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from FuncOps:
__add__(self, f)
__coerce__(self, x)
__div__(self, f)
__mul__(self, f)
__neg__(self)
__pow__(self, f)
__sub__(self, f)
compose(self, f)
exp(self)
log(self)
 
class UnBinCompose(BinFuncOps)
       
   Methods defined here:
__call__(self, arg1, arg2)
__init__(self, a_f, a_g)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'func'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from BinFuncOps:
__add__(self, f)
__div__(self, f)
__mul__(self, f)
__neg__(self)
__pow__(self, f)
__sub__(self, f)
accumulate(self, a, axis=0)
compose(self, f, g)
# returns self(f(x), g(x)), a unary function
compose2(self, f, g)
# returns self(f(x), g(y)), a binary function
compose_by(self, f)
# returns f(self(x,y)), a binary function
outer(self, a, b)
reduce(self, a, axis=0)
 
class UnCompose(FuncOps)
      # compose two unary functions
 
   Methods defined here:
__call__(self, arg)
__init__(self, a_f, a_g)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'func'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from FuncOps:
__add__(self, f)
__coerce__(self, x)
__div__(self, f)
__mul__(self, f)
__neg__(self)
__pow__(self, f)
__sub__(self, f)
compose(self, f)
exp(self)
log(self)
 
class UnConstant(FuncOps)
      # wrap a constant in a Function class
 
   Methods defined here:
__call__(self, x)
__init__(self, x)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'func'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from FuncOps:
__add__(self, f)
__coerce__(self, x)
__div__(self, f)
__mul__(self, f)
__neg__(self)
__pow__(self, f)
__sub__(self, f)
compose(self, f)
exp(self)
log(self)
 
Functions
            
all_but_axis(i, axis, num_axes)
Return a slice covering all combinations with coordinate i along
axis.  (Effectively the hyperplane perpendicular to axis at i.)
arange(...)
arange(start, stop=None, step=1, typecode=None)
 
 Just like range() except it returns an array whose type can be
specified by the keyword argument typecode.
array(...)
array(sequence, typecode=None, copy=1, savespace=0) will return a new array formed from the given (potentially nested) sequence with type given by typecode.  If no typecode is given, then the type will be determined as the minimum type required to hold the objects in sequence.  If copy is zero and sequence is already an array, a reference will be returned.  If savespace is nonzero, the new array will maintain its precision in operations.
array_map(f, ar)
Apply an ordinary function to all values in an array.
array_map_2(f, a, b)
arrayrange = arange(...)
arange(start, stop=None, step=1, typecode=None)
 
 Just like range() except it returns an array whose type can be
specified by the keyword argument typecode.
choose(...)
choose(a, (b1,b2,...))
cross_correlate(...)
cross_correlate(a,v, mode=0)
fromstring(...)
fromstring(string, typecode='l', count=-1) returns a new 1d array initialized from the raw binary data in string.  If count is positive, the new array will have count elements, otherwise it's size is determined by the size of string.
reshape(...)
reshape(a, (d1, d2, ..., dn)).  Change the shape of a to be an n-dimensional array with dimensions given by d1...dn.  Note: the size specified for the new array must be exactly equal to the size of the  old one or an error will occur.
searchsorted = binarysearch(...)
binarysearch(a,v)
take(...)
take(a, indices, axis=0).  Selects the elements in indices from array a along the given axis.
zeros(...)
zeros((d1,...,dn),typecode='l',savespace=0) will return a new array of shape (d1,...,dn) and type typecode with all it's entries initialized to zero.  If savespace is nonzero the array will be a spacesaver array.
 
Data
             Character = 'c'
Complex = 'D'
Complex0 = 'F'
Complex16 = 'F'
Complex32 = 'F'
Complex64 = 'D'
Complex8 = 'F'
Float = 'd'
Float0 = 'f'
Float16 = 'f'
Float32 = 'f'
Float64 = 'd'
Float8 = 'f'
Int = 'l'
Int0 = '1'
Int16 = 's'
Int32 = 'i'
Int8 = '1'
LittleEndian = 1
NewAxis = None
PrecisionError = 'PrecisionError'
PyObject = 'O'
StringTypes = (<type 'str'>, <type 'unicode'>)
UInt = 'u'
UInt16 = 'w'
UInt32 = 'u'
UInt8 = 'b'
UnsignedInt16 = 'w'
UnsignedInt32 = 'u'
UnsignedInt8 = 'b'
UnsignedInteger = 'u'
__file__ = './func.pyc'
__name__ = 'func'
absolute = <ufunc 'absolute'>
add = <ufunc 'add'>
arccos = <ufunc 'arccos'>
arccosh = <ufunc 'arccosh'>
arcsin = <ufunc 'arcsin'>
arcsinh = <ufunc 'arcsinh'>
arctan = <ufunc 'arctan'>
arctan2 = <ufunc 'arctan2'>
arctanh = <ufunc 'arctanh'>
bitwise_and = <ufunc 'bitwise_and'>
bitwise_or = <ufunc 'bitwise_or'>
bitwise_xor = <ufunc 'bitwise_xor'>
ceil = <ufunc 'ceil'>
conjugate = <ufunc 'conjugate'>
cos = <ufunc 'cos'>
cosh = <ufunc 'cosh'>
divide = <ufunc 'divide'>
divide_safe = <ufunc 'divide_safe'>
e = 2.7182818284590451
equal = <ufunc 'equal'>
exp = <ufunc 'exp'>
fabs = <ufunc 'fabs'>
floor = <ufunc 'floor'>
floor_divide = <ufunc 'floor_divide'>
fmod = <ufunc 'fmod'>
greater = <ufunc 'greater'>
greater_equal = <ufunc 'greater_equal'>
hypot = <ufunc 'hypot'>
invert = <ufunc 'invert'>
left_shift = <ufunc 'left_shift'>
less = <ufunc 'less'>
less_equal = <ufunc 'less_equal'>
log = <ufunc 'log'>
log10 = <ufunc 'log10'>
logical_and = <ufunc 'logical_and'>
logical_not = <ufunc 'logical_not'>
logical_or = <ufunc 'logical_or'>
logical_xor = <ufunc 'logical_xor'>
maximum = <ufunc 'maximum'>
minimum = <ufunc 'minimum'>
multiply = <ufunc 'multiply'>
negative = <ufunc 'negative'>
not_equal = <ufunc 'not_equal'>
pi = 3.1415926535897931
power = <ufunc 'power'>
remainder = <ufunc 'remainder'>
right_shift = <ufunc 'right_shift'>
sin = <ufunc 'sin'>
sinh = <ufunc 'sinh'>
sqrt = <ufunc 'sqrt'>
subtract = <ufunc 'subtract'>
tan = <ufunc 'tan'>
tanh = <ufunc 'tanh'>
true_divide = <ufunc 'true_divide'>
typecodes = {'Character': 'c', 'Complex': 'FD', 'Float': 'fd', 'Integer': '1sil', 'UnsignedInteger': 'bwu'}