Internal utilities.
Robert Clewley, September 2005.
|
API_class
Adapted from .
|
|
Struct
The args class is a more sophisticated type of Struct.
|
|
DefaultDict
Dictionary with a default value for unknown keys.
|
|
predicate_op
|
|
and_op
|
|
or_op
|
|
not_op
|
|
predicate
|
|
null_predicate_class
|
|
metric
Abstract metric class for quantitatively comparing scalar or vector
quantities.
|
|
metric_float
Simple metric between two real-valued floats.
|
|
metric_float_1D
Simple metric between two real-valued floats.
|
|
metric_L2
Measures the standard "distance" between two 1D pointsets
or arrays using the L-2 norm.
|
|
metric_L2_1D
Measures the standard "distance" between two 1D pointsets
or arrays using the L-2 norm.
|
|
metric_weighted_L2
Measures the standard "distance" between two 1D pointsets
or arrays using the L-2 norm, after weighting by weights attribute
(must set weights after creation, e.g.
|
|
metric_weighted_deadzone_L2
Measures the standard "distance" between two 1D pointsets
or arrays using the L-2 norm, after weighting by weights attribute.
|
|
args
Mapping object class for building arguments for class
initialization calls.
|
|
Diagnostics
General purpose diagnostics manager.
|
|
Utility
Utility abstract class for manipulating and analyzing dynamical systems.
|
|
interpclass
Abstract class for interpolators.
|
|
interp0d
Design of this class based on SciPy's interp1d
|
|
interp1d
|
|
KroghInterpolator
The interpolating polynomial for a set of points
|
|
BarycentricInterpolator
The interpolating polynomial for a set of points
|
|
PiecewisePolynomial
Piecewise polynomial curve specified by points and derivatives.
|
|
fit_function
Abstract super-class for fitting explicit functions to 1D arrays of data
using least squares.
|
|
fit_quadratic
Fit a quadratic function y=a*x^2+b*x+c to the (x,y) array data.
|
|
fit_quadratic_at_vertex
Fit a quadratic function y=a*(x+h)**2+k to the (x,y) array data,
constrained to have a vertex at (h, k), leaving only the free
parameter a for the curvature.
|
|
fit_cubic
Fit a cubic function y=a*x^3+b*x^2+c*x+d to the (x,y) array data.
|
|
fit_exponential
Fit an exponential function y=a*exp(b*x) to the (x,y) array data.
|
|
fit_diff_of_exp
Fit a 'difference of two exponentials' function y =
k*a*b*(exp(-a*x)-exp(-b*x))/(b-a) to the (x,y) array data.
|
|
fit_linear
Fit a linear function y=a*x+b to the (x,y) array data.
|
|
DomainType
|
|
Verbose
A class to handle reporting.
|
|
n_sigdigs_str(x,
n)
Return a string representation of float x with n significant digits,
where n > 0 is an integer. |
source code
|
|
|
get_opt(argopt,
attr,
default=None)
Get option from args object otherwise default to the given value. |
source code
|
|
|
|
|
filteredDict(d,
keys,
neg=False)
returns filtered dictionary containing specified keys, or *not*
containing the specified keys if option neg=True. |
source code
|
|
|
concatStrDict(d,
order=[ ] )
Concatenates all entries of a dictionary (assumed to be lists of
strings), in optionally specified order. |
source code
|
|
|
|
|
insertInOrder(sourcelist,
inslist,
return_ixs=False,
abseps=0)
Insert elements of inslist into sourcelist, sorting these
lists in case they are not already in increasing order. |
source code
|
|
|
arraymax(a1,
a2,
t=<type 'numpy.float64'>)
Element-wise comparison of maximum values for two arrays. |
source code
|
|
|
simplifyMatrixRepr(m)
Convert matrix object to a compact array representation or numeric
value. |
source code
|
|
|
makeMultilinearRegrFn(arg,
xs,
ys)
Convert two lists or arrays mapping x intervals to y intervals into a
string function definition of a multilinear regression scalar
function that these define. |
source code
|
|
|
|
|
diff(func,
x0,
vars=None,
axes=None,
eps=None,
output=None)
Numerical 1st derivative of R^N -> R^M scalar or array function
about x0 by central finite differences. |
source code
|
|
|
diff2(func,
x0,
vars=None,
axes=None,
dir=1,
eps=None)
Numerical 1st derivative of R^N -> R^M scalar or array function
about x0 by forward or backward finite differences. |
source code
|
|
|
|
|
verify_values(name,
value,
values,
list_ok=False,
list_len=None)
Use list_ok if a list of values of these types is acceptable. |
source code
|
|
|
verify_intbool(name,
value,
list_ok=False,
list_len=None)
Use list_ok if a list of values of these types is acceptable. |
source code
|
|
|
verify_nonneg(name,
value,
types,
list_ok=False,
list_len=None)
Use list_ok if a list of values of these types is acceptable. |
source code
|
|
|
verify_pos(name,
value,
types,
list_ok=False,
list_len=None)
Use list_ok if a list of values of these types is acceptable. |
source code
|
|
|
array_bounds_check(a,
bounds,
dirn=1)
Internal utility function to test a 1D array for staying within given
bounds (min val, max val). |
source code
|
|
|
linearInterp(y0,
ygoal,
y1,
x0,
x1)
Internal utility function to linearly interpolate between two data
points. |
source code
|
|
|
|
|
|
|
isUniqueSeq(objlist)
Check that list contains items only once |
source code
|
|
|
|
|
object2str(x)
Convert occurrences of types / classes, to pretty-printable strings. |
source code
|
|
|
|
|
compareClassAndBases(input,
arg)
arg can be a single or sequence of classes |
source code
|
|
|
getSuperClasses(obj,
limitClasses=None)
Return string names of all super classes of a given object |
source code
|
|
|
className(obj,
addPrefix=False)
Return human-readable string of class name. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ismonotonic(theseq,
withVal=False)
Check whether a sequence is in strictly increasing or decreasing
order. |
source code
|
|
|
extent(data)
Returns a pair of the min and max values of a dataset, or just a
numeric type if these are equal. |
source code
|
|
|
uniquePoints(ar)
For an n by m array input, return only points that are unique |
source code
|
|
|
|
|
|
|
sortedDictLists(d,
byvalue=True,
onlykeys=None,
reverse=False)
Return (key list, value list) pair from a dictionary, sorted by value
(default) or key. |
source code
|
|
|
sortedDictItems(d,
byvalue=True,
onlykeys=None,
reverse=False)
Return list of (key, value) pairs of a dictionary, sorted by value
(default) or key. |
source code
|
|
|
|
|
|
|
simple_bisection(tlo,
thi,
f,
tol,
imax=100) |
source code
|
|
|
make_poly_interpolated_curve(pts,
coord,
model)
Only for a 1D curve from a Model object (that has an associated
vector field for defining 1st derivative of curve). |
source code
|
|
|
smooth_pts(t,
x,
q=None)
Use a local quadratic fit on a set of nearby 1D points and obtain a
function that represents that fit in that neighbourhood. |
source code
|
|
|
nearest_2n_indices(x,
i,
n)
Calculates the nearest 2n indices centred at i in an array x, or as
close as possible to i, taking into account that i might be within n
indices of an endpoint of x. |
source code
|
|
|
Inf = inf
|
|
NaN = nan
|
|
less = <ufunc 'less'>
|
|
greater = <ufunc 'greater'>
|
|
logical_or = <ufunc 'logical_or'>
|
|
isfinite = <ufunc 'isfinite'>
|
|
sign = <ufunc 'sign'>
|
|
exp = <ufunc 'exp'>
|
|
log = <ufunc 'log'>
|
|
less_equal = <ufunc 'less_equal'>
|
|
float96
|
|
_all_numpy_float = ( <type 'numpy.float64'>, <type 'numpy.float...
|
|
complex192
|
|
_all_numpy_complex = ( <type 'numpy.complex128'>, <type 'numpy....
|
|
_classes = [ ' Verbose ' , ' interpclass ' , ' interp0d ' , ' interp1d ' , ...
|
|
_mappings = [ ' _num_type2name ' , ' _num_name2type ' , ' _num_equivty ...
|
|
_functions = [ ' isUniqueSeq ' , ' makeArrayIxMap ' , ' className ' , ' c ...
|
|
_constants = [ ' Continuous ' , ' Discrete ' , ' targetLangs ' , ' _seq_t ...
|
|
targetLangs = [ ' c ' , ' python ' , ' matlab ' ]
|
|
_num_types = ( <type 'float'>, <type 'int'>, <type 'numpy.float...
|
|
_int_types = ( <type 'int'>, <type 'numpy.integer'>)
|
|
_float_types = ( <type 'float'>, <type 'numpy.floating'>)
|
|
_complex_types = ( <type 'complex'>, <type 'numpy.complexfloati...
|
|
_real_types = ( <type 'int'>, <type 'numpy.integer'>, <type 'fl...
|
|
_seq_types = ( <type 'list'>, <type 'tuple'>, <type 'numpy.ndar...
|
|
_all_numpy_int = ( <type 'numpy.int32'>, <type 'numpy.int32'>, ...
|
|
_all_int = ( <type 'int'>, <type 'numpy.integer'>, <type 'numpy...
|
|
_all_float = ( <type 'float'>, <type 'numpy.floating'>, <type '...
|
|
_all_complex = ( <type 'complex'>, <type 'numpy.complexfloating...
|
|
LargestInt32 = 2147483647
|
|
Macheps = 2.2204460492503131e-16
|
|
_num_type2name = { <type 'float'>: ' float ' , <type 'int'>: ' int ' ...
|
|
_num_equivtype = { <type 'float'>: <type 'numpy.float64'>, <typ...
|
|
_num_name2equivtypes = { ' float ' : ( <type 'float'>, <type 'numpy...
|
|
_num_name2type = { ' float ' : <type 'numpy.float64'>, ' int ' : <typ...
|
|
_num_maxmin = { <type 'numpy.int32'>: [ -2147483648, 2147483647] ...
|
|
_typefrompytype = { <type 'float'>: <type 'numpy.float64'>, <ty...
|
|
_pytypefromtype = { <type 'numpy.int32'>: <type 'int'>, <type '...
|
|
API = API_class()
|
|
null_predicate = null_predicate_class(None)
|
|
_verify_type_names = { ( <type 'complex'>, <type 'numpy.complexf...
|
|
Continuous = Continuous Domain
|
|
Discrete = Discrete Domain
|