pub struct FeatureCount(/* private fields */);Expand description
Type-safe feature count
Implementations§
Source§impl FeatureCount
impl FeatureCount
Sourcepub fn new(count: usize) -> Result<FeatureCount, SklearsError>
pub fn new(count: usize) -> Result<FeatureCount, SklearsError>
Create a new feature count, must be positive
pub fn as_f64(self) -> f64
Sourcepub fn is_power_of_two(self) -> bool
pub fn is_power_of_two(self) -> bool
Check if this count is a power of 2 (useful for some algorithms)
Sourcepub fn next_power_of_two(self) -> FeatureCount
pub fn next_power_of_two(self) -> FeatureCount
Get the next power of 2 greater than or equal to this count
Trait Implementations§
Source§impl Add<usize> for FeatureCount
impl Add<usize> for FeatureCount
Source§impl Clone for FeatureCount
impl Clone for FeatureCount
Source§fn clone(&self) -> FeatureCount
fn clone(&self) -> FeatureCount
Returns a duplicate of the value. Read more
1.0.0 · 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 FeatureCount
impl Debug for FeatureCount
Source§impl Display for FeatureCount
impl Display for FeatureCount
Source§impl Hash for FeatureCount
impl Hash for FeatureCount
Source§impl Ord for FeatureCount
impl Ord for FeatureCount
Source§fn cmp(&self, other: &FeatureCount) -> Ordering
fn cmp(&self, other: &FeatureCount) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for FeatureCount
impl PartialEq for FeatureCount
Source§impl PartialOrd for FeatureCount
impl PartialOrd for FeatureCount
Source§impl Sub<usize> for FeatureCount
impl Sub<usize> for FeatureCount
Source§type Output = Result<FeatureCount, SklearsError>
type Output = Result<FeatureCount, SklearsError>
The resulting type after applying the
- operator.impl Copy for FeatureCount
impl Eq for FeatureCount
impl StructuralPartialEq for FeatureCount
Auto Trait Implementations§
impl Freeze for FeatureCount
impl RefUnwindSafe for FeatureCount
impl Send for FeatureCount
impl Sync for FeatureCount
impl Unpin for FeatureCount
impl UnwindSafe for FeatureCount
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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