pub struct CirclePoint<F> {
pub x: F,
pub y: F,
}Expand description
A point on the complex circle. Treated as an additive group.
Fields§
§x: F§y: FImplementations§
Source§impl<F: Zero + Add<Output = F> + FieldExpOps + Sub<Output = F> + Neg<Output = F>> CirclePoint<F>
impl<F: Zero + Add<Output = F> + FieldExpOps + Sub<Output = F> + Neg<Output = F>> CirclePoint<F>
pub fn zero() -> Self
pub fn double(&self) -> Self
Sourcepub fn double_x(x: F) -> F
pub fn double_x(x: F) -> F
Applies the circle’s x-coordinate doubling map.
§Examples
use stwo::core::circle::{CirclePoint, M31_CIRCLE_GEN};
use stwo::core::fields::m31::M31;
let p = M31_CIRCLE_GEN.mul(17);
assert_eq!(CirclePoint::double_x(p.x), (p + p).x);Sourcepub fn log_order(&self) -> u32
pub fn log_order(&self) -> u32
Returns the log order of a point.
All points have an order of the form 2^k.
§Examples
use stwo::core::circle::{CirclePoint, M31_CIRCLE_GEN, M31_CIRCLE_LOG_ORDER};
use stwo::core::fields::m31::M31;
assert_eq!(M31_CIRCLE_GEN.log_order(), M31_CIRCLE_LOG_ORDER);pub fn mul(&self, scalar: u128) -> CirclePoint<F>
pub fn repeated_double(&self, n: u32) -> Self
pub fn conjugate(&self) -> CirclePoint<F>
pub fn antipode(&self) -> CirclePoint<F>
pub fn into_ef<EF: From<F>>(self) -> CirclePoint<EF>
pub fn mul_signed(&self, off: isize) -> CirclePoint<F>
Trait Implementations§
Source§impl<F: Zero + Add<Output = F> + FieldExpOps + Sub<Output = F> + Neg<Output = F>> Add for CirclePoint<F>
impl<F: Zero + Add<Output = F> + FieldExpOps + Sub<Output = F> + Neg<Output = F>> Add for CirclePoint<F>
Source§impl<F: Clone> Clone for CirclePoint<F>
impl<F: Clone> Clone for CirclePoint<F>
Source§fn clone(&self) -> CirclePoint<F>
fn clone(&self) -> CirclePoint<F>
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 moreSource§impl<F: Field> ComplexConjugate for CirclePoint<F>
impl<F: Field> ComplexConjugate for CirclePoint<F>
Source§fn complex_conjugate(&self) -> Self
fn complex_conjugate(&self) -> Self
Example Read more
impl<F: Copy> Copy for CirclePoint<F>
Source§impl<F: Debug> Debug for CirclePoint<F>
impl<F: Debug> Debug for CirclePoint<F>
Source§impl<F: Default> Default for CirclePoint<F>
impl<F: Default> Default for CirclePoint<F>
Source§fn default() -> CirclePoint<F>
fn default() -> CirclePoint<F>
Returns the “default value” for a type. Read more
impl<F: Eq> Eq for CirclePoint<F>
Source§impl<F: Hash> Hash for CirclePoint<F>
impl<F: Hash> Hash for CirclePoint<F>
Source§impl<F: Zero + Add<Output = F> + FieldExpOps + Sub<Output = F> + Neg<Output = F>> Neg for CirclePoint<F>
impl<F: Zero + Add<Output = F> + FieldExpOps + Sub<Output = F> + Neg<Output = F>> Neg for CirclePoint<F>
Source§impl<F: PartialEq> PartialEq for CirclePoint<F>
impl<F: PartialEq> PartialEq for CirclePoint<F>
Source§fn eq(&self, other: &CirclePoint<F>) -> bool
fn eq(&self, other: &CirclePoint<F>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<F: PartialEq> StructuralPartialEq for CirclePoint<F>
Auto Trait Implementations§
impl<F> Freeze for CirclePoint<F>where
F: Freeze,
impl<F> RefUnwindSafe for CirclePoint<F>where
F: RefUnwindSafe,
impl<F> Send for CirclePoint<F>where
F: Send,
impl<F> Sync for CirclePoint<F>where
F: Sync,
impl<F> Unpin for CirclePoint<F>where
F: Unpin,
impl<F> UnsafeUnpin for CirclePoint<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for CirclePoint<F>where
F: UnwindSafe,
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> 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<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>
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