| |
- Func1
-
- Arrhenius
- ComboFunc1
-
- CompositeFunction
- DiffFunction
- ProdFunction
- RatioFunction
- SumFunction
- Const
- Cos
- DerivativeFunction
- Exp
- Fourier
- Gaussian
- PeriodicFunction
- Polynomial
- Pow
- Sin
class Arrhenius(Func1) |
|
Sum of modified Arrhenius terms. Instances of class 'Arrhenius' evaluate
[
f(T) = \sum_{n=1}^N A_n T^{b_n}\exp(-E_n/T)
]
Example:
>>> f = Arrhenius([(a0, b0, e0), (a1, b1, e1)]) |
|
Methods defined here:
- __init__(self, coefficients)
- coefficients - sequence of $(A, b, E)$ triplets.
Methods inherited from Func1:
- __add__(self, other)
- Overloads operator '+'
Returns a new function self(t) + other(t)
- __call__(self, t)
- Implements function syntax, so that F(t) is equivalent to
F.value(t).
- __del__(self)
- __div__(self, other)
- Overloads operator '/'
Returns a new function self(t)/other(t)
- __mul__(self, other)
- Overloads operator '*'
Return a new function self(t)*other(t)
- __radd__(self, other)
- Overloads operator '+'
Returns a new function other(t) + self(t)
- __rdiv__(self, other)
- Overloads operator '/'
Returns a new function other(t)/self(t)
- __repr__(self)
- __rmul__(self, other)
- Overloads operator '*'
Returns a new function other(t)*self(t)
- __rsub__(self, other)
- Overloads operator '-'
Returns a new function other(t) - self(t)
- __sub__(self, other)
- Overloads operator '-'
Returns a new function self(t) - other(t)
- func_id(self)
- Internal. Return the integer index used internally to access the
kernel-level object.
- write(self, arg='x', length=1000)
|
class ComboFunc1(Func1) |
|
Combines two functions.
This class is the base class for functors that combine two
other functors in a binary operation. |
|
Methods defined here:
- __init__(self, typ, f1, f2)
Methods inherited from Func1:
- __add__(self, other)
- Overloads operator '+'
Returns a new function self(t) + other(t)
- __call__(self, t)
- Implements function syntax, so that F(t) is equivalent to
F.value(t).
- __del__(self)
- __div__(self, other)
- Overloads operator '/'
Returns a new function self(t)/other(t)
- __mul__(self, other)
- Overloads operator '*'
Return a new function self(t)*other(t)
- __radd__(self, other)
- Overloads operator '+'
Returns a new function other(t) + self(t)
- __rdiv__(self, other)
- Overloads operator '/'
Returns a new function other(t)/self(t)
- __repr__(self)
- __rmul__(self, other)
- Overloads operator '*'
Returns a new function other(t)*self(t)
- __rsub__(self, other)
- Overloads operator '-'
Returns a new function other(t) - self(t)
- __sub__(self, other)
- Overloads operator '-'
Returns a new function self(t) - other(t)
- func_id(self)
- Internal. Return the integer index used internally to access the
kernel-level object.
- write(self, arg='x', length=1000)
|
class CompositeFunction(ComboFunc1) |
| |
- Method resolution order:
- CompositeFunction
- ComboFunc1
- Func1
Methods defined here:
- __init__(self, f1, f2)
- f1 - first functor.
f2 - second functor.
Methods inherited from Func1:
- __add__(self, other)
- Overloads operator '+'
Returns a new function self(t) + other(t)
- __call__(self, t)
- Implements function syntax, so that F(t) is equivalent to
F.value(t).
- __del__(self)
- __div__(self, other)
- Overloads operator '/'
Returns a new function self(t)/other(t)
- __mul__(self, other)
- Overloads operator '*'
Return a new function self(t)*other(t)
- __radd__(self, other)
- Overloads operator '+'
Returns a new function other(t) + self(t)
- __rdiv__(self, other)
- Overloads operator '/'
Returns a new function other(t)/self(t)
- __repr__(self)
- __rmul__(self, other)
- Overloads operator '*'
Returns a new function other(t)*self(t)
- __rsub__(self, other)
- Overloads operator '-'
Returns a new function other(t) - self(t)
- __sub__(self, other)
- Overloads operator '-'
Returns a new function self(t) - other(t)
- func_id(self)
- Internal. Return the integer index used internally to access the
kernel-level object.
- write(self, arg='x', length=1000)
|
class Const(Func1) |
|
Constant function.
Objects created by function Const
act as functions that have a constant value.
These are used internally whenever a statement like
>>> f = Gausian(2.0, 1.0, 0.1) + 4.0
is encountered. The addition operator of class Func1 is defined
so that this is equivalent to
>>> f = SumFunction(Gaussian(2.0, 1.0, 0.1), Const(4.0))
Function Const returns instances of class Polynomial that have
degree zero, with the constant term set to the desired value. |
|
Methods defined here:
- __init__(self, value)
Methods inherited from Func1:
- __add__(self, other)
- Overloads operator '+'
Returns a new function self(t) + other(t)
- __call__(self, t)
- Implements function syntax, so that F(t) is equivalent to
F.value(t).
- __del__(self)
- __div__(self, other)
- Overloads operator '/'
Returns a new function self(t)/other(t)
- __mul__(self, other)
- Overloads operator '*'
Return a new function self(t)*other(t)
- __radd__(self, other)
- Overloads operator '+'
Returns a new function other(t) + self(t)
- __rdiv__(self, other)
- Overloads operator '/'
Returns a new function other(t)/self(t)
- __repr__(self)
- __rmul__(self, other)
- Overloads operator '*'
Returns a new function other(t)*self(t)
- __rsub__(self, other)
- Overloads operator '-'
Returns a new function other(t) - self(t)
- __sub__(self, other)
- Overloads operator '-'
Returns a new function self(t) - other(t)
- func_id(self)
- Internal. Return the integer index used internally to access the
kernel-level object.
- write(self, arg='x', length=1000)
|
class Cos(Func1) |
| |
Methods defined here:
- __init__(self, omega=1.0)
Methods inherited from Func1:
- __add__(self, other)
- Overloads operator '+'
Returns a new function self(t) + other(t)
- __call__(self, t)
- Implements function syntax, so that F(t) is equivalent to
F.value(t).
- __del__(self)
- __div__(self, other)
- Overloads operator '/'
Returns a new function self(t)/other(t)
- __mul__(self, other)
- Overloads operator '*'
Return a new function self(t)*other(t)
- __radd__(self, other)
- Overloads operator '+'
Returns a new function other(t) + self(t)
- __rdiv__(self, other)
- Overloads operator '/'
Returns a new function other(t)/self(t)
- __repr__(self)
- __rmul__(self, other)
- Overloads operator '*'
Returns a new function other(t)*self(t)
- __rsub__(self, other)
- Overloads operator '-'
Returns a new function other(t) - self(t)
- __sub__(self, other)
- Overloads operator '-'
Returns a new function self(t) - other(t)
- func_id(self)
- Internal. Return the integer index used internally to access the
kernel-level object.
- write(self, arg='x', length=1000)
|
class DerivativeFunction(Func1) |
| |
Methods defined here:
- __init__(self, f)
Methods inherited from Func1:
- __add__(self, other)
- Overloads operator '+'
Returns a new function self(t) + other(t)
- __call__(self, t)
- Implements function syntax, so that F(t) is equivalent to
F.value(t).
- __del__(self)
- __div__(self, other)
- Overloads operator '/'
Returns a new function self(t)/other(t)
- __mul__(self, other)
- Overloads operator '*'
Return a new function self(t)*other(t)
- __radd__(self, other)
- Overloads operator '+'
Returns a new function other(t) + self(t)
- __rdiv__(self, other)
- Overloads operator '/'
Returns a new function other(t)/self(t)
- __repr__(self)
- __rmul__(self, other)
- Overloads operator '*'
Returns a new function other(t)*self(t)
- __rsub__(self, other)
- Overloads operator '-'
Returns a new function other(t) - self(t)
- __sub__(self, other)
- Overloads operator '-'
Returns a new function self(t) - other(t)
- func_id(self)
- Internal. Return the integer index used internally to access the
kernel-level object.
- write(self, arg='x', length=1000)
|
class DiffFunction(ComboFunc1) |
|
Difference of two functions.
Instances of class DiffFunction evaluate the difference of two supplied
functors. It is not necessary to explicitly create an instance of
DiffFunction, since the subtraction operator of the base class is
overloaded to return a DiffFunction instance.
>>> f1 = Polynomial([2.0, 1.0])
>>> f2 = Polynomial([3.0, -5.0])
>>> f3 = f1 - f2 # functor to evaluate (2t + 1) - (3t - 5)
In this example, object 'f3' is a functor of class'DiffFunction' that
calls f1 and f2 and returns their difference. |
|
- Method resolution order:
- DiffFunction
- ComboFunc1
- Func1
Methods defined here:
- __init__(self, f1, f2)
- f1 - first functor.
f2 - second functor.
Methods inherited from Func1:
- __add__(self, other)
- Overloads operator '+'
Returns a new function self(t) + other(t)
- __call__(self, t)
- Implements function syntax, so that F(t) is equivalent to
F.value(t).
- __del__(self)
- __div__(self, other)
- Overloads operator '/'
Returns a new function self(t)/other(t)
- __mul__(self, other)
- Overloads operator '*'
Return a new function self(t)*other(t)
- __radd__(self, other)
- Overloads operator '+'
Returns a new function other(t) + self(t)
- __rdiv__(self, other)
- Overloads operator '/'
Returns a new function other(t)/self(t)
- __repr__(self)
- __rmul__(self, other)
- Overloads operator '*'
Returns a new function other(t)*self(t)
- __rsub__(self, other)
- Overloads operator '-'
Returns a new function other(t) - self(t)
- __sub__(self, other)
- Overloads operator '-'
Returns a new function self(t) - other(t)
- func_id(self)
- Internal. Return the integer index used internally to access the
kernel-level object.
- write(self, arg='x', length=1000)
|
class Exp(Func1) |
| |
Methods defined here:
- __init__(self, A=1.0)
Methods inherited from Func1:
- __add__(self, other)
- Overloads operator '+'
Returns a new function self(t) + other(t)
- __call__(self, t)
- Implements function syntax, so that F(t) is equivalent to
F.value(t).
- __del__(self)
- __div__(self, other)
- Overloads operator '/'
Returns a new function self(t)/other(t)
- __mul__(self, other)
- Overloads operator '*'
Return a new function self(t)*other(t)
- __radd__(self, other)
- Overloads operator '+'
Returns a new function other(t) + self(t)
- __rdiv__(self, other)
- Overloads operator '/'
Returns a new function other(t)/self(t)
- __repr__(self)
- __rmul__(self, other)
- Overloads operator '*'
Returns a new function other(t)*self(t)
- __rsub__(self, other)
- Overloads operator '-'
Returns a new function other(t) - self(t)
- __sub__(self, other)
- Overloads operator '-'
Returns a new function self(t) - other(t)
- func_id(self)
- Internal. Return the integer index used internally to access the
kernel-level object.
- write(self, arg='x', length=1000)
|
class Fourier(Func1) |
|
Fourier series. Instances of class 'Fourier' evaluate the Fourier series
[
f(t) = rac{a_0}{2} + \sum_{n=1}^N [a_n \cos(n\omega t) + b_n \sin(n \omega t)]
]
where
[
a_n = rac{\omega}{\pi}
\int_{-\pi/\omega}^{\pi/\omega} f(t) \cos(n \omega t) dt
]
and
[
b_n = rac{\omega}{\pi}
\int_{-\pi/\omega}^{\pi/\omega} f(t) \sin(n \omega t) dt.
]
The function $ f(t) $ is periodic, with period $ T = 2\pi/\omega $.
As an example, a function with Fourier components up to the second harmonic
is constructed as follows:
>>> coeffs = [(a0, b0), (a1, b1), (a2, b2)]
>>> f = Fourier(omega, coeffs)
Note that 'b0' must be specified, but is not
used. The value of 'b0' is arbitrary. |
|
Methods defined here:
- __init__(self, omega, coefficients)
- omega - fundamental frequency [radians/sec].
coefficients - List of (a,b) pairs, beginning with $n = 0$.
Methods inherited from Func1:
- __add__(self, other)
- Overloads operator '+'
Returns a new function self(t) + other(t)
- __call__(self, t)
- Implements function syntax, so that F(t) is equivalent to
F.value(t).
- __del__(self)
- __div__(self, other)
- Overloads operator '/'
Returns a new function self(t)/other(t)
- __mul__(self, other)
- Overloads operator '*'
Return a new function self(t)*other(t)
- __radd__(self, other)
- Overloads operator '+'
Returns a new function other(t) + self(t)
- __rdiv__(self, other)
- Overloads operator '/'
Returns a new function other(t)/self(t)
- __repr__(self)
- __rmul__(self, other)
- Overloads operator '*'
Returns a new function other(t)*self(t)
- __rsub__(self, other)
- Overloads operator '-'
Returns a new function other(t) - self(t)
- __sub__(self, other)
- Overloads operator '-'
Returns a new function self(t) - other(t)
- func_id(self)
- Internal. Return the integer index used internally to access the
kernel-level object.
- write(self, arg='x', length=1000)
|
class Func1 |
|
Functors of one variable.
A Functor is an object that behaves like a function. Class 'Func1'
is the base class from which several functor classes derive. These
classes are designed to allow specifying functions of time from Python
that can be used by the C++ kernel.
Functors can be added, multiplied, and divided to yield new functors.
>>> f1 = Polynomial([1.0, 0.0, 3.0]) # 3*t*t + 1
>>> f1(2.0)
___13
>>> f2 = Polynomial([-1.0, 2.0]) # 2*t - 1
>>> f2(2.0)
___5
>>> f3 = f1/f2 # (3*t*t + 1)/(2*t - 1)
>>> f3(2.0)
___4.3333333 |
|
Methods defined here:
- __add__(self, other)
- Overloads operator '+'
Returns a new function self(t) + other(t)
- __call__(self, t)
- Implements function syntax, so that F(t) is equivalent to
F.value(t).
- __del__(self)
- __div__(self, other)
- Overloads operator '/'
Returns a new function self(t)/other(t)
- __init__(self, typ, n, coeffs=[])
- The constructor is
meant to be called from constructors of subclasses of Func1.
See: Polynomial, Gaussian, Arrhenius, Fourier, Const,
PeriodicFunction
- __mul__(self, other)
- Overloads operator '*'
Return a new function self(t)*other(t)
- __radd__(self, other)
- Overloads operator '+'
Returns a new function other(t) + self(t)
- __rdiv__(self, other)
- Overloads operator '/'
Returns a new function other(t)/self(t)
- __repr__(self)
- __rmul__(self, other)
- Overloads operator '*'
Returns a new function other(t)*self(t)
- __rsub__(self, other)
- Overloads operator '-'
Returns a new function other(t) - self(t)
- __sub__(self, other)
- Overloads operator '-'
Returns a new function self(t) - other(t)
- func_id(self)
- Internal. Return the integer index used internally to access the
kernel-level object.
- write(self, arg='x', length=1000)
|
class Gaussian(Func1) |
|
A Gaussian pulse. Instances of class 'Gaussian' evaluate
[
f(t) = A \exp[-(t - t_0) / au]
]
where
[
au = rac{\mbox{FWHM}}{2.0\sqrt{\ln(2.0)}}
]
'FWHM' denotes the full width at half maximum.
As an example, here is how to create
a Gaussian pulse with peak amplitude 10.0, centered at time 2.0,
with full-width at half max = 0.2:
>>> f = Gaussian(A = 10.0, t0 = 2.0, FWHM = 0.2)
>>> f(2.0)
___10
>>> f(1.9)
___5
>>> f(2.1)
___5 |
|
Methods defined here:
- __init__(self, A, t0, FWHM)
Methods inherited from Func1:
- __add__(self, other)
- Overloads operator '+'
Returns a new function self(t) + other(t)
- __call__(self, t)
- Implements function syntax, so that F(t) is equivalent to
F.value(t).
- __del__(self)
- __div__(self, other)
- Overloads operator '/'
Returns a new function self(t)/other(t)
- __mul__(self, other)
- Overloads operator '*'
Return a new function self(t)*other(t)
- __radd__(self, other)
- Overloads operator '+'
Returns a new function other(t) + self(t)
- __rdiv__(self, other)
- Overloads operator '/'
Returns a new function other(t)/self(t)
- __repr__(self)
- __rmul__(self, other)
- Overloads operator '*'
Returns a new function other(t)*self(t)
- __rsub__(self, other)
- Overloads operator '-'
Returns a new function other(t) - self(t)
- __sub__(self, other)
- Overloads operator '-'
Returns a new function self(t) - other(t)
- func_id(self)
- Internal. Return the integer index used internally to access the
kernel-level object.
- write(self, arg='x', length=1000)
|
class PeriodicFunction(Func1) |
|
Converts a function into a periodic function with period T. |
|
Methods defined here:
- __init__(self, func, T)
- func - initial non-periodic function
T - period [s]
Methods inherited from Func1:
- __add__(self, other)
- Overloads operator '+'
Returns a new function self(t) + other(t)
- __call__(self, t)
- Implements function syntax, so that F(t) is equivalent to
F.value(t).
- __del__(self)
- __div__(self, other)
- Overloads operator '/'
Returns a new function self(t)/other(t)
- __mul__(self, other)
- Overloads operator '*'
Return a new function self(t)*other(t)
- __radd__(self, other)
- Overloads operator '+'
Returns a new function other(t) + self(t)
- __rdiv__(self, other)
- Overloads operator '/'
Returns a new function other(t)/self(t)
- __repr__(self)
- __rmul__(self, other)
- Overloads operator '*'
Returns a new function other(t)*self(t)
- __rsub__(self, other)
- Overloads operator '-'
Returns a new function other(t) - self(t)
- __sub__(self, other)
- Overloads operator '-'
Returns a new function self(t) - other(t)
- func_id(self)
- Internal. Return the integer index used internally to access the
kernel-level object.
- write(self, arg='x', length=1000)
|
class Polynomial(Func1) |
|
A polynomial.
Instances of class 'Polynomial' evaluate
[
f(t) = \sum_{n = 0}^N a_n t^n.
]
The coefficients are supplied as a list, beginning with
$a_N$ and ending with $a_0$.
>>> p1 = Polynomial([1.0, -2.0, 3.0]) # 3t^2 - 2t + 1
>>> p2 = Polynomial([6.0, 8.0]) # 8t + 6 |
|
Methods defined here:
- __init__(self, coeffs=[])
- coeffs - polynomial coefficients
Methods inherited from Func1:
- __add__(self, other)
- Overloads operator '+'
Returns a new function self(t) + other(t)
- __call__(self, t)
- Implements function syntax, so that F(t) is equivalent to
F.value(t).
- __del__(self)
- __div__(self, other)
- Overloads operator '/'
Returns a new function self(t)/other(t)
- __mul__(self, other)
- Overloads operator '*'
Return a new function self(t)*other(t)
- __radd__(self, other)
- Overloads operator '+'
Returns a new function other(t) + self(t)
- __rdiv__(self, other)
- Overloads operator '/'
Returns a new function other(t)/self(t)
- __repr__(self)
- __rmul__(self, other)
- Overloads operator '*'
Returns a new function other(t)*self(t)
- __rsub__(self, other)
- Overloads operator '-'
Returns a new function other(t) - self(t)
- __sub__(self, other)
- Overloads operator '-'
Returns a new function self(t) - other(t)
- func_id(self)
- Internal. Return the integer index used internally to access the
kernel-level object.
- write(self, arg='x', length=1000)
|
class Pow(Func1) |
| |
Methods defined here:
- __init__(self, n)
Methods inherited from Func1:
- __add__(self, other)
- Overloads operator '+'
Returns a new function self(t) + other(t)
- __call__(self, t)
- Implements function syntax, so that F(t) is equivalent to
F.value(t).
- __del__(self)
- __div__(self, other)
- Overloads operator '/'
Returns a new function self(t)/other(t)
- __mul__(self, other)
- Overloads operator '*'
Return a new function self(t)*other(t)
- __radd__(self, other)
- Overloads operator '+'
Returns a new function other(t) + self(t)
- __rdiv__(self, other)
- Overloads operator '/'
Returns a new function other(t)/self(t)
- __repr__(self)
- __rmul__(self, other)
- Overloads operator '*'
Returns a new function other(t)*self(t)
- __rsub__(self, other)
- Overloads operator '-'
Returns a new function other(t) - self(t)
- __sub__(self, other)
- Overloads operator '-'
Returns a new function self(t) - other(t)
- func_id(self)
- Internal. Return the integer index used internally to access the
kernel-level object.
- write(self, arg='x', length=1000)
|
class ProdFunction(ComboFunc1) |
|
Product of two functions. Instances of class ProdFunction
evaluate the product of two supplied functors. It is not
necessary to explicitly create an instance of 'ProdFunction',
since the multiplication operator of the base class is overloaded
to return a 'ProdFunction' instance.
>>> f1 = Polynomial([2.0, 1.0])
>>> f2 = Polynomial([3.0, -5.0])
>>> f3 = f1 * f2 # functor to evaluate (2t + 1)*(3t - 5)
In this example, object 'f3' is a functor of class'ProdFunction'
that calls f1 and f2 and returns their product. |
|
- Method resolution order:
- ProdFunction
- ComboFunc1
- Func1
Methods defined here:
- __init__(self, f1, f2)
- f1 - first functor.
f2 - second functor.
Methods inherited from Func1:
- __add__(self, other)
- Overloads operator '+'
Returns a new function self(t) + other(t)
- __call__(self, t)
- Implements function syntax, so that F(t) is equivalent to
F.value(t).
- __del__(self)
- __div__(self, other)
- Overloads operator '/'
Returns a new function self(t)/other(t)
- __mul__(self, other)
- Overloads operator '*'
Return a new function self(t)*other(t)
- __radd__(self, other)
- Overloads operator '+'
Returns a new function other(t) + self(t)
- __rdiv__(self, other)
- Overloads operator '/'
Returns a new function other(t)/self(t)
- __repr__(self)
- __rmul__(self, other)
- Overloads operator '*'
Returns a new function other(t)*self(t)
- __rsub__(self, other)
- Overloads operator '-'
Returns a new function other(t) - self(t)
- __sub__(self, other)
- Overloads operator '-'
Returns a new function self(t) - other(t)
- func_id(self)
- Internal. Return the integer index used internally to access the
kernel-level object.
- write(self, arg='x', length=1000)
|
class RatioFunction(ComboFunc1) |
|
Ratio of two functions.
Instances of class RatioFunction evaluate the ratio of two supplied functors.
It is not necessary to explicitly create an instance of 'RatioFunction', since
the division operator of the base class is overloaded to return a RatioFunction
instance.
>>> f1 = Polynomial([2.0, 1.0])
>>> f2 = Polynomial([3.0, -5.0])
>>> f3 = f1 / f2 # functor to evaluate (2t + 1)/(3t - 5)
In this example, object 'f3' is a functor of class'RatioFunction' that calls f1 and f2
and returns their ratio. |
|
- Method resolution order:
- RatioFunction
- ComboFunc1
- Func1
Methods defined here:
- __init__(self, f1, f2)
- f1 - first functor.
f2 - second functor.
Methods inherited from Func1:
- __add__(self, other)
- Overloads operator '+'
Returns a new function self(t) + other(t)
- __call__(self, t)
- Implements function syntax, so that F(t) is equivalent to
F.value(t).
- __del__(self)
- __div__(self, other)
- Overloads operator '/'
Returns a new function self(t)/other(t)
- __mul__(self, other)
- Overloads operator '*'
Return a new function self(t)*other(t)
- __radd__(self, other)
- Overloads operator '+'
Returns a new function other(t) + self(t)
- __rdiv__(self, other)
- Overloads operator '/'
Returns a new function other(t)/self(t)
- __repr__(self)
- __rmul__(self, other)
- Overloads operator '*'
Returns a new function other(t)*self(t)
- __rsub__(self, other)
- Overloads operator '-'
Returns a new function other(t) - self(t)
- __sub__(self, other)
- Overloads operator '-'
Returns a new function self(t) - other(t)
- func_id(self)
- Internal. Return the integer index used internally to access the
kernel-level object.
- write(self, arg='x', length=1000)
|
class Sin(Func1) |
| |
Methods defined here:
- __init__(self, omega=1.0)
Methods inherited from Func1:
- __add__(self, other)
- Overloads operator '+'
Returns a new function self(t) + other(t)
- __call__(self, t)
- Implements function syntax, so that F(t) is equivalent to
F.value(t).
- __del__(self)
- __div__(self, other)
- Overloads operator '/'
Returns a new function self(t)/other(t)
- __mul__(self, other)
- Overloads operator '*'
Return a new function self(t)*other(t)
- __radd__(self, other)
- Overloads operator '+'
Returns a new function other(t) + self(t)
- __rdiv__(self, other)
- Overloads operator '/'
Returns a new function other(t)/self(t)
- __repr__(self)
- __rmul__(self, other)
- Overloads operator '*'
Returns a new function other(t)*self(t)
- __rsub__(self, other)
- Overloads operator '-'
Returns a new function other(t) - self(t)
- __sub__(self, other)
- Overloads operator '-'
Returns a new function self(t) - other(t)
- func_id(self)
- Internal. Return the integer index used internally to access the
kernel-level object.
- write(self, arg='x', length=1000)
|
class SumFunction(ComboFunc1) |
|
Sum of two functions.
Instances of class SumFunction evaluate the sum of two supplied functors.
It is not necessary to explicitly create an instance of SumFunction, since
the addition operator of the base class is overloaded to return a SumFunction
instance.
>>> f1 = Polynomial([2.0, 1.0])
>>> f2 = Polynomial([3.0, -5.0])
>>> f3 = f1 + f2 # functor to evaluate (2t + 1) + (3t - 5)
In this example, object 'f3' is a functor of class'SumFunction' that calls f1 and f2
and returns their sum. |
|
- Method resolution order:
- SumFunction
- ComboFunc1
- Func1
Methods defined here:
- __init__(self, f1, f2)
- f1 - first functor.
f2 - second functor.
Methods inherited from Func1:
- __add__(self, other)
- Overloads operator '+'
Returns a new function self(t) + other(t)
- __call__(self, t)
- Implements function syntax, so that F(t) is equivalent to
F.value(t).
- __del__(self)
- __div__(self, other)
- Overloads operator '/'
Returns a new function self(t)/other(t)
- __mul__(self, other)
- Overloads operator '*'
Return a new function self(t)*other(t)
- __radd__(self, other)
- Overloads operator '+'
Returns a new function other(t) + self(t)
- __rdiv__(self, other)
- Overloads operator '/'
Returns a new function other(t)/self(t)
- __repr__(self)
- __rmul__(self, other)
- Overloads operator '*'
Returns a new function other(t)*self(t)
- __rsub__(self, other)
- Overloads operator '-'
Returns a new function other(t) - self(t)
- __sub__(self, other)
- Overloads operator '-'
Returns a new function self(t) - other(t)
- func_id(self)
- Internal. Return the integer index used internally to access the
kernel-level object.
- write(self, arg='x', length=1000)
| |