Skip to main content

Variable

Trait Variable 

Source
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§

Source

fn dimension(&self) -> usize

How many numbers a step of it takes. None, for a value no solve moves.

Source

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.

Source

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).

Source

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.

Source

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.

Source

fn same(&self, other: &Self) -> bool

Whether it is no different from other: a step that changed nothing.

Provided Methods§

Source

fn carried(&self, from: &Self, to: &Self) -> Option<Self>

Where it goes carried along by leader moving from from to to, as if fastened to it — a seed for a solve of what hangs off the leader (see Structure), a free choice, so sharp. None for a value nothing carries: a number.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Variable for Pose

Source§

impl Variable for Scalar

A number steps by what is added to it.