Struct libbgs::markoff::Coord

source ·
pub struct Coord<const P: u128>(pub FpNum<P>);
Expand description

A coordinate for a Markoff triple. May represent any of $a$, $b$, or $c$ in a Markoff triple $(a, b, c)$. This is a single field struct containing only an FpNum<P> for prime P.

Tuple Fields§

§0: FpNum<P>

Implementations§

source§

impl<const P: u128> Coord<P>

source

pub fn to_chi(&self) -> Either<QuadNum<P>, FpNum<P>>

Returns an element $\chi$ such that, for a coordinate $a$, $a = \chi + \chi^{-1}$. If $a$ is a quadratic residue modulo P, then $\chi \in \mathbb{F}_p$, and the result will be a Right<FpNum<P>>. Otherwise, $\chi \in \mathbb{F}_{p^2}$, and the result will be a Left<QuadNum<P>>.

source

pub fn rot( self, b: Coord<P>, c: Coord<P> ) -> impl Iterator<Item = (Coord<P>, Coord<P>)>

Returns an iterator yielding the coordinates $(b, c)$ contained in the orbit with fixed coordinate $a$ (the coordinate on which rot is called), beginning with $(a, b, c)$.

source

pub fn part(self, b: Coord<P>) -> Option<Box<dyn Iterator<Item = Coord<P>>>>

Returns an iterator yielding the values $b$ such that $(a, b, c)$ is a Markoff triple for some value $c$.

source

pub fn rot_order<S1, S2>(&self) -> RotOrderwhere FpNum<P>: Factor<S1>, QuadNum<P>: Factor<S2>,

Returns the order of the map $\text{rot}_a$, that is, $\lvert \langle \text{rot}_a \rangle \rvert$, along with the type of RotOrder that it is.

source

pub fn endgame<S>() -> (u128, u128)where FpNum<P>: Factor<S>, QuadNum<P>: Factor<S>,

Returns an upper bound on the endgame breakpoint. That is, every triple with order larger than the value returned by this method is guarenteed to lie in the endgame.

Trait Implementations§

source§

impl<const P: u128> Clone for Coord<P>

source§

fn clone(&self) -> Coord<P>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<const P: u128> From<Coord<P>> for u128

source§

fn from(src: Coord<P>) -> u128

Converts to this type from the input type.
source§

impl<const P: u128> From<u128> for Coord<P>

source§

fn from(src: u128) -> Coord<P>

Converts to this type from the input type.
source§

impl<const P: u128> PartialEq<Coord<P>> for Coord<P>

source§

fn eq(&self, other: &Coord<P>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<const P: u128> Copy for Coord<P>

source§

impl<const P: u128> Eq for Coord<P>

source§

impl<const P: u128> StructuralEq for Coord<P>

source§

impl<const P: u128> StructuralPartialEq for Coord<P>

Auto Trait Implementations§

§

impl<const P: u128> RefUnwindSafe for Coord<P>

§

impl<const P: u128> Send for Coord<P>

§

impl<const P: u128> Sync for Coord<P>

§

impl<const P: u128> Unpin for Coord<P>

§

impl<const P: u128> UnwindSafe for Coord<P>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.