pub struct PolynomialBasis {
pub degree: usize,
pub poly_type: PolynomialType,
pub clamp_range: Option<(f64, f64)>,
}Expand description
Standard Polynomial Basis (Power, Hermite, Chebyshev, etc.)
Includes:
- Full interactions up to degree 2 (Quadratic)
- Diagonal terms up to
degree
Fields§
§degree: usize§poly_type: PolynomialType§clamp_range: Option<(f64, f64)>Implementations§
Source§impl PolynomialBasis
impl PolynomialBasis
pub fn new(degree: usize, poly_type: PolynomialType) -> Self
pub fn with_clamp(self, min: f64, max: f64) -> Self
Trait Implementations§
Source§impl<const N: usize> Basis<N> for PolynomialBasis
impl<const N: usize> Basis<N> for PolynomialBasis
Source§fn num_features(&self) -> usize
fn num_features(&self) -> usize
Returns the number of basis functions (K).
Source§fn evaluate(&self, state: &[f64; N], buffer: &mut [f64])
fn evaluate(&self, state: &[f64; N], buffer: &mut [f64])
Evaluates all basis functions at
state and writes them into buffer.
buffer must have length at least num_features().Source§impl Clone for PolynomialBasis
impl Clone for PolynomialBasis
Source§fn clone(&self) -> PolynomialBasis
fn clone(&self) -> PolynomialBasis
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 moreAuto Trait Implementations§
impl Freeze for PolynomialBasis
impl RefUnwindSafe for PolynomialBasis
impl Send for PolynomialBasis
impl Sync for PolynomialBasis
impl Unpin for PolynomialBasis
impl UnsafeUnpin for PolynomialBasis
impl UnwindSafe for PolynomialBasis
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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