pysolver_view.roots.solvers.trial_step module

pysolver_view.roots.solvers.trial_step module#

Construct trial coordinates and audit their actual scaled displacement.

pysolver_view.roots.solvers.trial_step.prepare_equilibrated_trial(x, scale, factors, numerical_step, radius)[source]#

Honor both numerical trust geometry and the caller’s physical step cap.

Convert the equilibrated direction to physical scaled coordinates and shorten it along the same ray if necessary. Audit both norms after actual coordinate rounding. The returned numerical displacement is the one used for the predicted reduction and any Broyden update, not an unclipped step.

pysolver_view.roots.solvers.trial_step.prepare_trial(x, scale, direction, fraction, step_limit)[source]#

Construct a trial and audit its actual rounded scaled displacement.

Keep the requested direction while reserving coordinate ulps when rounding would exceed a finite envelope. Return coordinates, physical/scaled steps, scaled norm and effective fraction. ValueError identifies numerical geometry failure before calling the model; it does not hide application exceptions.

pysolver_view.roots.solvers.trial_step.prepare_trust_region_trial(x, scale, scaled_step, radius)[source]#

Apply the trust-region radius before evaluation, including coordinate rounding.

Preserve the driver’s subproblem-first clipping order; line-search fractions use prepare_trial() so their rounded directional decrease stays consistent.