pub struct VariableRegistry { /* private fields */ }Expand description
Global variable registry for mapping between variable names and indices This allows user-facing string-based variable access while using efficient indices internally for performance-critical operations.
Implementations§
Source§impl VariableRegistry
impl VariableRegistry
Sourcepub fn register_variable(&mut self, name: &str) -> usize
pub fn register_variable(&mut self, name: &str) -> usize
Register a variable name and return its index If the variable already exists, returns its existing index
Sourcepub fn get_all_names(&self) -> &[String]
pub fn get_all_names(&self) -> &[String]
Get all registered variable names
Sourcepub fn create_variable_map(&self, values: &[(String, f64)]) -> Vec<f64>
pub fn create_variable_map(&self, values: &[(String, f64)]) -> Vec<f64>
Create a variable mapping for evaluation
Maps variable names to their values for use with eval_with_vars
Sourcepub fn create_ordered_variable_map(&self, values: &[f64]) -> Vec<f64>
pub fn create_ordered_variable_map(&self, values: &[f64]) -> Vec<f64>
Create a variable mapping from a slice of values in name order Assumes values are provided in the same order as variable registration
Trait Implementations§
Source§impl Clone for VariableRegistry
impl Clone for VariableRegistry
Source§fn clone(&self) -> VariableRegistry
fn clone(&self) -> VariableRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VariableRegistry
impl Debug for VariableRegistry
Auto Trait Implementations§
impl Freeze for VariableRegistry
impl RefUnwindSafe for VariableRegistry
impl Send for VariableRegistry
impl Sync for VariableRegistry
impl Unpin for VariableRegistry
impl UnsafeUnpin for VariableRegistry
impl UnwindSafe for VariableRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more