Derivative specification¶
- class lsqfitgp.Deriv(*args)[source]¶
Class for specifying derivatives. Behaves like a dictionary str -> int, where the keys represent variables and values the derivation order. An empty Deriv means no derivatives. A Deriv with one single key None means that the variable is implicit.
Deriv(int) -> specified order derivative
Deriv(str) -> first derivative w.r.t. specified variable
Deriv(iter of str) -> derivative w.r.t. specified variables
Deriv(iter of int, str) -> an int before a str acts as a multiplier
Deriv(Deriv) -> pass through
Deriv(None) -> Deriv(0)
Example: Deriv([‘a’, ‘b’, ‘b’, ‘c’]) is equivalent to Deriv([‘a’, 2, ‘b’, ‘c’]).
- Raises:
- TypeError
If
*args
is not of the specified form.- ValueError
If
*args
ends with an integer or if there are consecutive integers.
- Attributes:
implicit
True if the derivative is trivial or the variable is implicit.
order
The total derivation order, i.e., the sum of the values.
max
The maximum derivation order for any single variable.