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_step (float, array-like, default None) – Defines the minimum step, if None, the value is set to EPS**(1/scale)

  • step_ratio (real scalar, optional, default 4.0) – Ratio between sequential steps generated.

  • num_steps (scalar integer, optional,) – defines number of steps generated. If None the value is 2 * int(round(16.0/log(abs(step_ratio)))) + 1

  • step_nom (default maximum(log(exp(1)+|x|), 1)) – Nominal step where x is supplied at runtime through the __call__ method.

  • offset (real scalar, optional, default 0) – offset to the base step

  • use_exact_steps (boolean, default True.) – If true make sure exact steps are generated.

  • scale (real 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.

dtheta

Angular steps in radians used for the exponential spiral path.

min_num_steps

Minimum number of steps required given the differentiation method and order.

num_steps

The number of steps generated

scale

Scale used in base step.

step_nom

Nominal step

step_ratio

Ratio between sequential steps generated.