pub enum RootStatus {
Converged,
MaxIterations,
NotBracketed,
InvalidBracket,
NotFinite,
}Expand description
How one lane of a batch ended.
Only Converged means the lane produced a root. Every
other variant is a failure that a caller must handle; see the module-level
“Non-convergence is reported, never swallowed” section for the accessors
that make it hard to skip.
| Variant | last_iterate | Meaning |
|---|---|---|
Converged | the root | a tolerance was met |
MaxIterations | best iterate so far — not a root | ran out of iterations |
NotBracketed | NaN | residual has the same sign at both bracket ends |
InvalidBracket | NaN | a bracket end is not finite |
NotFinite | the abscissa where it happened | the residual (or derivative) evaluated to NaN/infinity |
§Units
Dimensionless — a status tag.
Variants§
Converged
A root was found to the requested tolerance.
MaxIterations
max_iterations was reached with no tolerance met. The reported iterate
is the best one seen, and is not claimed to be a root.
NotBracketed
The residual has the same (nonzero) sign at both ends of the bracket, so no root of a continuous residual is guaranteed to lie inside it. The solver refuses to guess and reports this instead of returning an endpoint.
InvalidBracket
A bracket end was infinite or NaN, so there is no interval to search.
NotFinite
The residual — or, for Newton, the value half of the residual/derivative
pair — evaluated to a non-finite number. Iteration stops immediately,
because continuing would propagate the NaN into a plausible-looking
answer.
Implementations§
Source§impl RootStatus
impl RootStatus
Sourcepub fn is_converged(self) -> bool
pub fn is_converged(self) -> bool
Whether this status means the lane produced a usable root.
§Example
use outram_foam_basic_lib::math::parallel::RootStatus;
assert!(RootStatus::Converged.is_converged());
assert!(!RootStatus::MaxIterations.is_converged());