Expand description
Numeric types and iteration utilities for polynomial curves.
This module defines the Value trait, which abstracts the numeric
types that can be used in polynomial fitting and evaluation, ensuring
compatibility with nalgebra, floating-point operations, and formatting.
§Traits
Value: ExtendsFloat,Scalar, andComplexFieldto provide:- A canonical
two()constant. try_castfor safe type conversion with error handling.powifor integer exponentiation.
- A canonical
§Iterators
SteppedValues: A floating-point range iterator with a specified step, useful for generating evaluation points for polynomials.
§Example
use polyfit::value::{Value, SteppedValues};
// Create a range of f64 values from 0.0 to 1.0 in steps of 0.1
let range = SteppedValues::new(0.0..=1.0, 0.1);
for x in range {
println!("{x}");
}
// Using Value trait methods
let two = f64::two();
let squared = two.powi(2);Structs§
- Stepped
Values - Iterator over a range of floating-point values with a specified step.
Traits§
- Coord
Ext - Extension trait for accessing the
xandycoordinates of a type. - Float
Clamped Cast - Trait for infallible floating-point casting with clamping.
- IntClamped
Cast - Trait for infallible integer casting with clamping.
- Value
- Numeric type for curves