5.1.4.1. numdifftools.limits.CStepGenerator¶
- class CStepGenerator(base_step=None, step_ratio=4.0, num_steps=None, step_nom=None, offset=0, scale=1.2, **options)[source]¶
Generates a sequence of steps
- where
steps = base_step * step_nom * (exp(1j*dtheta) * step_ratio) ** (i + offset)
for i = 0, 1, …, num_steps-1
- Parameters
- base_stepfloat, array-like, default None
Defines the minimum step, if None, the value is set to EPS**(1/scale)
- step_ratioreal scalar, optional, default 4.0
Ratio between sequential steps generated.
- num_stepsscalar integer, optional,
defines number of steps generated. If None the value is 2 * int(round(16.0/log(abs(step_ratio)))) + 1
- step_nomdefault maximum(log(exp(1)+|x|), 1)
Nominal step where x is supplied at runtime through the __call__ method.
- offsetreal scalar, optional, default 0
offset to the base step
- use_exact_stepsboolean, default True.
If true make sure exact steps are generated.
- scalereal scalar, default 1.2
scale used in base step.
- path‘radial’ or ‘spiral’
Specifies the type of path to take the limit along. Default ‘radial’.
- dtheta: real scalar, default pi/8
If the path is ‘spiral’ it will follow an exponential spiral into the limit, with angular steps at dtheta radians.
- __init__(base_step=None, step_ratio=4.0, num_steps=None, step_nom=None, offset=0, scale=1.2, **options)[source]¶
Methods
__init__
([base_step, step_ratio, num_steps, ...])step_generator_function
(x[, method, n, order])Step generator function
Attributes
base_step
Base step defines the minimum or maximum step when offset==0.
Angular steps in radians used for the exponential spiral path.
min_num_steps
Minimum number of steps required given the differentiation method and order.
The number of steps generated
scale
Scale used in base step.
step_nom
Nominal step
Ratio between sequential steps generated.