[−][src]Struct swar::Bits128
This is used when every 128
bits is a number stored in parallel.
Methods
impl Bits128<u128>
[src]
pub fn any(self) -> Self
[src]
If any bit is set in each element, sets the element to 1, else 0.
use swar::*; let input = Bits128(0x8000_0000_0000_0000_0000_0000_0000_0000u128); let output = Bits128(0x0000_0000_0000_0000_0000_0000_0000_0001u128); assert_eq!(input.any(), output); let input = Bits128(0x0000_0000_0000_0000_0000_0000_0000_0000u128); let output = Bits128(0x0000_0000_0000_0000_0000_0000_0000_0000u128); assert_eq!(input.any(), output);
pub fn squash(self) -> Bits64<u128>
[src]
Squashes half-sized elements into half-sized spaces to the right and fills the left half of the number with zeros.
This is the same as union(0, n)
.
pub fn count_ones(self) -> u32
[src]
pub fn sum_weight(self) -> u128
[src]
pub fn minhwd(self, other: Self) -> Self
[src]
Trait Implementations
impl<N: Copy> Copy for Bits128<N>
[src]
impl<N: Debug> Debug for Bits128<N>
[src]
impl<N: PartialEq> PartialEq<Bits128<N>> for Bits128<N>
[src]
impl<N: Eq> Eq for Bits128<N>
[src]
impl Add<Bits128<u128>> for Bits128<u128>
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self
[src]
impl BitAnd<u128> for Bits128<u128>
[src]
type Output = Self
The resulting type after applying the &
operator.
fn bitand(self, rhs: u128) -> Self
[src]
impl Shr<u32> for Bits128<u128>
[src]
type Output = Self
The resulting type after applying the >>
operator.
fn shr(self, rhs: u32) -> Self
[src]
impl From<Bits128<u128>> for u128
[src]
impl<N: Clone> Clone for Bits128<N>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> From for T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> FromCast for T
[src]
impl<T, U> Cast for T where
U: FromCast<T>,
[src]
U: FromCast<T>,