carapace_core/analysis/tangent_strategy.rs
1/// Which tangent stiffness an `Algorithm::Newton`/`KrylovNewton` iteration
2/// solves against. Closed enum — mirrors Xara's `TangentFlagType`
3/// (`CURRENT_TANGENT` / `INITIAL_TANGENT` / `PREDICTOR_TANGENT`), which
4/// every Newton-family algorithm class there takes as a constructor
5/// argument rather than hard-coding (`docs/algorithms.md` §3).
6#[derive(Debug, Clone, Copy, PartialEq, Eq)]
7pub enum TangentStrategy {
8 /// Re-form and re-factor the tangent at the *current* trial state,
9 /// every iteration. Full Newton-Raphson — today's only behavior before
10 /// this type existed.
11 Current,
12 /// Form the tangent once, at the state the step *started* from, and
13 /// reuse it (still factored once) for every iteration of that step.
14 /// Xara's `ModifiedNewton` with `CURRENT_TANGENT` passed at
15 /// construction (misleadingly named from the caller's perspective —
16 /// it means "current as of step start," not "current every
17 /// iteration").
18 ReuseAtStepStart,
19 /// Form the tangent once, from the model's very first (undeformed)
20 /// state, ever — reused for every iteration of every step. Xara's
21 /// `ModifiedNewton` with `INITIAL_TANGENT`. Cheapest, worst
22 /// convergence rate (linear, not quadratic); pairs naturally with
23 /// `Algorithm::KrylovNewton`'s acceleration to claw the convergence
24 /// rate back without paying for re-factorization.
25 Initial,
26}