pub struct JacobianSolution { /* private fields */ }Expand description
One lane’s Jacobian, with the status needed to judge it.
§Units
Entry (i, j) of the matrix carries the units of f_i divided by the units
of x_j. See the module-level “Units” section for why the generic form is
not uom-typed.
Implementations§
Source§impl JacobianSolution
impl JacobianSolution
Sourcepub fn matrix(&self) -> Option<&SquareMatrix>
pub fn matrix(&self) -> Option<&SquareMatrix>
The Jacobian, only if every column of this lane succeeded.
Returns None for every non-DiffStatus::Ok status, so a caller
cannot accidentally factorise a partially-NaN matrix believing it to
be a Jacobian. The diagnostic matrix is behind the deliberately-named
Self::raw_matrix.
Sourcepub fn into_matrix(self) -> Option<SquareMatrix>
pub fn into_matrix(self) -> Option<SquareMatrix>
Consume the solution, yielding the Jacobian only if it succeeded.
Sourcepub fn raw_matrix(&self) -> &SquareMatrix
pub fn raw_matrix(&self) -> &SquareMatrix
The matrix as assembled, whatever the status — a diagnostic, not an
answer. Failed columns are filled with NaN.
Sourcepub fn status(&self) -> DiffStatus
pub fn status(&self) -> DiffStatus
Why this lane succeeded or failed.
Sourcepub fn first_bad_column(&self) -> usize
pub fn first_bad_column(&self) -> usize
The index of the first column that failed, or usize::MAX if none did.
“Column j” means the derivative with respect to x[j], so this points
straight at the offending variable rather than at the offending
equation — which is the useful direction, because a failed column
usually means the step took x[j] somewhere the function is not
defined.