pub struct Coset {
pub initial_index: CirclePointIndex,
pub initial: CirclePoint<M31>,
pub step_size: CirclePointIndex,
pub step: CirclePoint<M31>,
pub log_size: u32,
}Expand description
Represents the coset initial + <step>.
Fields§
§initial_index: CirclePointIndex§initial: CirclePoint<M31>§step_size: CirclePointIndex§step: CirclePoint<M31>§log_size: u32Implementations§
Source§impl Coset
impl Coset
pub fn new(initial_index: CirclePointIndex, log_size: u32) -> Self
Sourcepub fn subgroup(log_size: u32) -> Self
pub fn subgroup(log_size: u32) -> Self
Creates a coset of the form <G_n>. For example, for n=8, we get the point indices [0,1,2,3,4,5,6,7].
Sourcepub fn odds(log_size: u32) -> Self
pub fn odds(log_size: u32) -> Self
Creates a coset of the form G_2n + <G_n>.
For example, let n = 8 and denote G_16 = x, <G_8> = <2x>.
The point indices are [x, 3x, 5x, 7x, 9x, 11x, 13x, 15x].
Sourcepub fn half_odds(log_size: u32) -> Self
pub fn half_odds(log_size: u32) -> Self
Creates a coset of the form G_4n + <G_n>. It’s conjugate is 3 * G_4n + <G_n>.
For example, let n = 8 and denote G_32 = x, <G_8> = <4x>.
The point indices are [x, 5x, 9x, 13x, 17x, 21x, 25x, 29x].
Conjugate coset indices are [3x, 7x, 11x, 15x, 19x, 23x, 27x, 31x].
Note: This coset union with its conjugate coset is the odds(log_size + 1) coset.
pub const fn iter(&self) -> CosetIterator<CirclePoint<M31>> ⓘ
pub const fn iter_indices(&self) -> CosetIterator<CirclePointIndex> ⓘ
Sourcepub fn double(&self) -> Self
pub fn double(&self) -> Self
Returns a new coset comprising of all points in current coset doubled.
pub fn repeated_double(&self, n_doubles: u32) -> Self
Sourcepub fn is_doubling_of(&self, other: Self) -> bool
pub fn is_doubling_of(&self, other: Self) -> bool
Note that this function panics when self.log_size == 0.
pub const fn initial(&self) -> CirclePoint<M31>
pub fn index_at(&self, index: usize) -> CirclePointIndex
pub fn at(&self, index: usize) -> CirclePoint<M31>
pub fn shift(&self, shift_size: CirclePointIndex) -> Self
Trait Implementations§
impl Copy for Coset
impl Eq for Coset
Source§impl IntoIterator for Coset
impl IntoIterator for Coset
Source§type Item = CirclePoint<M31>
type Item = CirclePoint<M31>
Source§type IntoIter = CosetIterator<CirclePoint<M31>>
type IntoIter = CosetIterator<CirclePoint<M31>>
impl StructuralPartialEq for Coset
Auto Trait Implementations§
impl Freeze for Coset
impl RefUnwindSafe for Coset
impl Send for Coset
impl Sync for Coset
impl Unpin for Coset
impl UnsafeUnpin for Coset
impl UnwindSafe for Coset
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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