pub struct BinarySubspace<F, Data: Deref<Target = [F]> = Vec<F>> { /* private fields */ }Expand description
An $F_2$-linear subspace of a binary field.
The subspace is defined by a basis of elements from a binary field. The basis elements are ordered, which implies an ordering on the subspace elements.
Implementations§
Source§impl<F: BinaryField, Data: Deref<Target = [F]>> BinarySubspace<F, Data>
impl<F: BinaryField, Data: Deref<Target = [F]>> BinarySubspace<F, Data>
Sourcepub const fn new_unchecked(basis: Data) -> Self
pub const fn new_unchecked(basis: Data) -> Self
Creates a new subspace from a vector of ordered basis elements.
This constructor does not check that the basis elements are linearly independent.
Sourcepub fn isomorphic<FIso>(&self) -> BinarySubspace<FIso>where
FIso: BinaryField + From<F>,
pub fn isomorphic<FIso>(&self) -> BinarySubspace<FIso>where
FIso: BinaryField + From<F>,
Creates a new subspace isomorphic to the given one.
pub fn get(&self, index: usize) -> F
pub fn get_checked(&self, index: usize) -> Result<F, Error>
Sourcepub fn iter(&self) -> BinarySubspaceIterator<'_, F> ⓘ
pub fn iter(&self) -> BinarySubspaceIterator<'_, F> ⓘ
Returns an iterator over all elements of the subspace in order.
This has a limitation that the iterator only yields the first 2^usize::BITS elements.
Source§impl<F: BinaryField> BinarySubspace<F>
impl<F: BinaryField> BinarySubspace<F>
Sourcepub fn with_dim(dim: usize) -> Result<Self, Error>
pub fn with_dim(dim: usize) -> Result<Self, Error>
Creates a new subspace of this binary subspace with the given dimension.
This creates a new sub-subspace using a prefix of the default $\mathbb{F}_2$ basis elements of the field.
§Throws
Error::DomainSizeTooLargeifdimis greater than this subspace’s dimension.
Trait Implementations§
Source§impl<F: Clone, Data: Clone + Deref<Target = [F]>> Clone for BinarySubspace<F, Data>
impl<F: Clone, Data: Clone + Deref<Target = [F]>> Clone for BinarySubspace<F, Data>
Source§fn clone(&self) -> BinarySubspace<F, Data>
fn clone(&self) -> BinarySubspace<F, Data>
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<F: BinaryField> Default for BinarySubspace<F>
impl<F: BinaryField> Default for BinarySubspace<F>
Source§impl<F: PartialEq, Data: PartialEq + Deref<Target = [F]>> PartialEq for BinarySubspace<F, Data>
impl<F: PartialEq, Data: PartialEq + Deref<Target = [F]>> PartialEq for BinarySubspace<F, Data>
impl<F: Eq, Data: Eq + Deref<Target = [F]>> Eq for BinarySubspace<F, Data>
impl<F, Data: Deref<Target = [F]>> StructuralPartialEq for BinarySubspace<F, Data>
Auto Trait Implementations§
impl<F, Data> Freeze for BinarySubspace<F, Data>where
Data: Freeze,
impl<F, Data> RefUnwindSafe for BinarySubspace<F, Data>where
Data: RefUnwindSafe,
impl<F, Data> Send for BinarySubspace<F, Data>where
Data: Send,
impl<F, Data> Sync for BinarySubspace<F, Data>where
Data: Sync,
impl<F, Data> Unpin for BinarySubspace<F, Data>where
Data: Unpin,
impl<F, Data> UnwindSafe for BinarySubspace<F, Data>where
Data: UnwindSafe,
Blanket Implementations§
§impl<T> AsMaybeUninit for T
impl<T> AsMaybeUninit for T
§type Uninit = MaybeUninit<T>
type Uninit = MaybeUninit<T>
This type in its maybe-uninitialized form.
§fn as_ref_uninit(&self) -> &<T as AsMaybeUninit>::Uninit
fn as_ref_uninit(&self) -> &<T as AsMaybeUninit>::Uninit
Converts a
&self to its maybe-initialized equivalent.§unsafe fn as_mut_uninit(&mut self) -> &mut <T as AsMaybeUninit>::Uninit
unsafe fn as_mut_uninit(&mut self) -> &mut <T as AsMaybeUninit>::Uninit
Converts a
&mut T to its maybe-initialized equivalent. Read more§unsafe fn raw_as_uninit<'a>(raw: *const T) -> &'a <T as AsMaybeUninit>::Uninit
unsafe fn raw_as_uninit<'a>(raw: *const T) -> &'a <T as AsMaybeUninit>::Uninit
Converts a raw pointer to a reference to maybe-uninit. Read more
§unsafe fn raw_mut_as_uninit<'a>(
raw: *mut T,
) -> &'a mut <T as AsMaybeUninit>::Uninit
unsafe fn raw_mut_as_uninit<'a>( raw: *mut T, ) -> &'a mut <T as AsMaybeUninit>::Uninit
Converts a raw mutable pointer to a mutable reference to maybe-uninit. Read more
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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