pub trait ManifoldVariable:
Send
+ Sync
+ 'static {
Show 18 methods
// Required methods
fn as_param_slice(&self) -> &[f64];
fn dof(&self) -> usize;
fn apply_tangent_step(&mut self, step: &[f64]);
fn set_fixed_indices(&mut self, indices: HashSet<usize>);
fn get_fixed_indices(&self) -> &HashSet<usize>;
fn set_bounds(&mut self, bounds: HashMap<usize, (f64, f64)>);
fn get_bounds(&self) -> &HashMap<usize, (f64, f64)>;
fn manifold_type_name(&self) -> &'static str;
fn set_covariance(&mut self, cov: Mat<f64>);
fn covariance(&self) -> Option<&Mat<f64>>;
fn clear_covariance(&mut self);
fn to_dvector(&self) -> DVector<f64>;
fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any;
fn clone_box(&self) -> Box<dyn ManifoldVariable>;
// Provided methods
fn free_dof(&self) -> usize { ... }
fn local_free_offset(&self, local: usize) -> Option<usize> { ... }
fn expand_free_step(&self, free_step: &[f64], out: &mut [f64]) { ... }
}Expand description
Object-safe trait covering all manifold variable types.
Replaces VariableEnum as the common type for HashMap<String, Box<dyn ManifoldVariable>>.
One blanket impl covers all 8 manifold types; no per-manifold match arms needed.
§Hot-path contract
as_param_slice, dof, and apply_tangent_step must never heap-allocate.
Required Methods§
Sourcefn as_param_slice(&self) -> &[f64]
fn as_param_slice(&self) -> &[f64]
Zero-copy borrow of the parameter storage backing this variable.
Sourcefn apply_tangent_step(&mut self, step: &[f64])
fn apply_tangent_step(&mut self, step: &[f64])
Apply a tangent-space step in-place: x ← x ⊞ δx. Fixed indices are zeroed before the retraction.
fn set_fixed_indices(&mut self, indices: HashSet<usize>)
fn get_fixed_indices(&self) -> &HashSet<usize>
fn set_bounds(&mut self, bounds: HashMap<usize, (f64, f64)>)
fn get_bounds(&self) -> &HashMap<usize, (f64, f64)>
Sourcefn manifold_type_name(&self) -> &'static str
fn manifold_type_name(&self) -> &'static str
Static name of the underlying manifold type (“SE3”, “SO3”, …).
fn set_covariance(&mut self, cov: Mat<f64>)
fn covariance(&self) -> Option<&Mat<f64>>
fn clear_covariance(&mut self)
fn to_dvector(&self) -> DVector<f64>
fn as_any(&self) -> &dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
fn clone_box(&self) -> Box<dyn ManifoldVariable>
Provided Methods§
Sourcefn local_free_offset(&self, local: usize) -> Option<usize>
fn local_free_offset(&self, local: usize) -> Option<usize>
Map a local tangent index (0..dof()) to its offset within this
variable’s free-column block, or None if that index is fixed.
Sourcefn expand_free_step(&self, free_step: &[f64], out: &mut [f64])
fn expand_free_step(&self, free_step: &[f64], out: &mut [f64])
Expand a free-space step (length free_dof()) into a dof()-length
buffer, writing 0.0 at every fixed local index in ascending order.
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".