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>
impl<const P: u128> Coord<P>
sourcepub fn to_chi(&self) -> Either<QuadNum<P>, FpNum<P>>
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>>
.
sourcepub fn rot(
self,
b: Coord<P>,
c: Coord<P>
) -> impl Iterator<Item = (Coord<P>, Coord<P>)>
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)$.
sourcepub fn part(self, b: Coord<P>) -> Option<Box<dyn Iterator<Item = Coord<P>>>>
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$.
Trait Implementations§
source§impl<const P: u128> PartialEq<Coord<P>> for Coord<P>
impl<const P: u128> PartialEq<Coord<P>> for Coord<P>
impl<const P: u128> Copy for Coord<P>
impl<const P: u128> Eq for Coord<P>
impl<const P: u128> StructuralEq for Coord<P>
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> 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