pub trait Variable: Clone + Debug {
// Required methods
fn dimension(&self) -> usize;
fn retract(&self, step: &[Scalar]) -> GeopResult<Self>;
fn retract_over(&self, step: &[Scalar]) -> GeopResult<Self>;
fn differential(
&self,
step: &[Scalar],
) -> GeopResult<Option<Vec<Vec<Scalar>>>>;
fn stay(&self, at: &Self, scale: Scalar) -> GeopResult<Rows>;
fn same(&self, other: &Self) -> bool;
// Provided method
fn carried(&self, from: &Self, to: &Self) -> Option<Self> { ... }
}Expand description
A value a solve moves: a block of variables, stepped along its own tangent space.
Required Methods§
Sourcefn dimension(&self) -> usize
fn dimension(&self) -> usize
How many numbers a step of it takes. None, for a value no solve moves.
Sourcefn retract(&self, step: &[Scalar]) -> GeopResult<Self>
fn retract(&self, step: &[Scalar]) -> GeopResult<Self>
Where step — Variable::dimension numbers — takes it: the value
a solver tries next, a free choice, so sharp.
Sourcefn retract_over(&self, step: &[Scalar]) -> GeopResult<Self>
fn retract_over(&self, step: &[Scalar]) -> GeopResult<Self>
Every value a step in the box step takes it to: an enclosure,
nothing sharpened — of the value it stands for, which a sharp value
may only approximate (a rotation’s unit quaternion).
Sourcefn differential(&self, step: &[Scalar]) -> GeopResult<Option<Vec<Vec<Scalar>>>>
fn differential(&self, step: &[Scalar]) -> GeopResult<Option<Vec<Vec<Scalar>>>>
The differential of the retraction over the box step: the matrix
D, one row per number of a step, such that for every δ in the box
a step dδ further, retract(δ + dδ), is to first order the step
D dδ from retract(δ) — an enclosure for every δ in the box.
None for the identity: a step that adds to the value.
Sourcefn stay(&self, at: &Self, scale: Scalar) -> GeopResult<Rows>
fn stay(&self, at: &Self, scale: Scalar) -> GeopResult<Rows>
What keeps it near at where nothing else decides where it goes:
residuals that vanish there, each a length — a turn measured where
it moves a point scale from its axis — and their derivatives by
its step.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".