pub enum FunctionProperties {
Elementary(Box<ElementaryProperties>),
Special(Box<SpecialProperties>),
Polynomial(Box<PolynomialProperties>),
UserDefined(Box<UserProperties>),
}Expand description
Mathematical properties for all function types
Boxed variants to minimize memory footprint while providing comprehensive mathematical intelligence.
§Memory Layout Optimization
- Uses
Box<T>to keep enum size small (8 bytes per variant) - Reduces memory fragmentation through consistent allocation patterns
- Enables efficient cache utilization for hot path operations
Variants§
Elementary(Box<ElementaryProperties>)
Elementary functions: sin, cos, exp, log, etc.
Special(Box<SpecialProperties>)
Special functions: gamma, bessel, zeta, etc.
Polynomial(Box<PolynomialProperties>)
Polynomial families: legendre, hermite, laguerre, etc.
UserDefined(Box<UserProperties>)
User-defined functions: f, g, h, etc.
Implementations§
Source§impl FunctionProperties
impl FunctionProperties
Sourcepub fn has_derivative(&self) -> bool
pub fn has_derivative(&self) -> bool
Check if function has derivative rule
Hot path method for performance-critical operations
Sourcepub fn has_antiderivative(&self) -> bool
pub fn has_antiderivative(&self) -> bool
Check if function has antiderivative rule
Hot path method for performance-critical operations
Sourcepub fn get_derivative_rule(&self) -> Option<&DerivativeRule>
pub fn get_derivative_rule(&self) -> Option<&DerivativeRule>
Get derivative rule if available
Returns a reference to the derivative rule for registry-based differentiation
Sourcepub fn get_derivative_expression(&self, arg: &Expression) -> Option<Expression>
pub fn get_derivative_expression(&self, arg: &Expression) -> Option<Expression>
Get derivative expression using registry rules
Computes the derivative of f(arg) with respect to arg using the registered derivative rule. The chain rule (multiplying by d(arg)/dx) must be applied separately.
§Arguments
arg- The argument expression to the function
§Returns
Returns the derivative expression, or None if no derivative rule exists
§Examples
use mathhook_core::functions::intelligence::get_universal_registry;
use mathhook_core::{expr, symbol};
let registry = get_universal_registry();
let x = symbol!(x);
if let Some(props) = registry.get_properties("sin") {
let derivative = props.get_derivative_expression(&x.into());
}Sourcepub fn get_antiderivative_rule(&self) -> Option<&AntiderivativeRule>
pub fn get_antiderivative_rule(&self) -> Option<&AntiderivativeRule>
Get antiderivative rule if available
Returns a reference to the antiderivative rule for registry-based integration
Sourcepub fn special_value_count(&self) -> usize
pub fn special_value_count(&self) -> usize
Get special value count for caching optimization
Sourcepub fn family(&self) -> FunctionFamily
pub fn family(&self) -> FunctionFamily
Get function family for quick classification
Sourcepub fn wolfram_name(&self) -> Option<&'static str>
pub fn wolfram_name(&self) -> Option<&'static str>
Get Wolfram Language function name
Used for Wolfram formatting without hardcoded function name matching. Returns the Wolfram name if registered, otherwise None.
§Examples
use mathhook_core::functions::intelligence::get_universal_registry;
let registry = get_universal_registry();
if let Some(props) = registry.get_properties("sin") {
assert_eq!(props.wolfram_name(), Some("Sin"));
}
if let Some(props) = registry.get_properties("ln") {
assert_eq!(props.wolfram_name(), Some("Log"));
}Trait Implementations§
Source§impl Clone for FunctionProperties
impl Clone for FunctionProperties
Source§fn clone(&self) -> FunctionProperties
fn clone(&self) -> FunctionProperties
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FunctionProperties
impl !RefUnwindSafe for FunctionProperties
impl Send for FunctionProperties
impl Sync for FunctionProperties
impl Unpin for FunctionProperties
impl !UnwindSafe for FunctionProperties
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more