Corrector Stepping

The stepping module provides step-size control interfaces for Newton-type correction algorithms.

Base Step Interface

_CorrectorStepBase()

Abstract base class for step-size control strategy interfaces.

class hiten.algorithms.corrector.stepping._CorrectorStepBase(**kwargs)[source]

Bases: ABC

Provide an abstract base class for step-size control strategy interfaces.

This class provides the foundation for implementing different step-size control strategies in Newton-type correction algorithms. It defines the interface that correction algorithms use to obtain step transformation functions tailored to specific problems.

The interface follows the strategy pattern, allowing correction algorithms to be parameterized with different stepping behaviors without changing their core logic. This enables flexible combinations of:

  • Different Newton variants (standard, damped, quasi-Newton)

  • Different step control strategies (full steps, line search, trust region)

  • Different problem-specific constraints and safeguards

Subclasses must implement the step transformation logic while this base class handles common initialization patterns and ensures compatibility with multiple inheritance chains commonly used in the correction framework.

Parameters:

**kwargs – Additional keyword arguments passed to parent classes. This enables clean cooperation in multiple-inheritance chains.

Notes

The interface is designed to work seamlessly with multiple inheritance, allowing correction algorithms to mix step interfaces with other capabilities (convergence monitoring, Jacobian computation, etc.).

The abstract method _build_line_searcher() is responsible for creating CorrectorStepProtocol objects that encapsulate the step transformation logic for specific problems.

Examples

>>> class CustomStepInterface(_CorrectorStepBase):
...     def _build_line_searcher(self, residual_fn, norm_fn, max_delta):
...         def custom_step(x, delta, current_norm):
...             # Custom step logic here
...             alpha = compute_step_size(x, delta, current_norm)
...             x_new = x + alpha * delta
...             r_norm_new = norm_fn(residual_fn(x_new))
...             return x_new, r_norm_new, alpha
...         return custom_step

See also

_CorrectorPlainStep

Concrete implementation for simple Newton steps.

_ArmijoStep

Concrete implementation with Armijo line search.

CorrectorStepProtocol

Protocol for step transformation functions.

Plain Stepping

_CorrectorPlainStep()

Step interface for plain Newton updates with safeguards.

class hiten.algorithms.corrector.stepping._CorrectorPlainStep(**kwargs)[source]

Bases: _CorrectorStepBase

Provide a step interface for plain Newton updates with safeguards.

This class implements the simplest step-size control strategy: taking full Newton steps with optional step size capping for numerical stability. It provides a robust baseline stepping strategy suitable for well-behaved problems where the Newton method converges reliably.

The interface includes an infinity-norm safeguard that prevents excessively large steps, which can cause numerical overflow or instability. This makes it suitable for a wide range of problems while maintaining the simplicity of the basic Newton method.

See also

_ArmijoStep

More sophisticated interface with line search capabilities.

_CorrectorStepBase

Abstract base class that this class extends.

Factory Functions

make_plain_stepper()

Factory function for creating plain Newton steppers.

hiten.algorithms.corrector.stepping.make_plain_stepper()[source]

Return a factory that builds a plain capped stepper per problem.

Return type:

Callable[[Callable[[ndarray], ndarray], Callable[[ndarray], float], float | None], CorrectorStepProtocol]

make_armijo_stepper()

Factory function for creating Armijo line search steppers.

hiten.algorithms.corrector.stepping.make_armijo_stepper(config)[source]

Return a factory that builds an Armijo stepper per problem.

Parameters:

config (_LineSearchConfig) – Configuration for Armijo line search.

Return type:

Callable[[Callable[[ndarray], ndarray], Callable[[ndarray], float], float | None], CorrectorStepProtocol]

Utility Functions

_default_norm()

Compute L2 norm of residual vector.

_infinity_norm()

Compute infinity norm of residual vector.