arithmoi-0.9.0.0: Efficient basic number-theoretic functions.

Copyright(c) 2016 Chris Fredrickson Google Inc.
LicenseMIT
MaintainerChris Fredrickson <chris.p.fredrickson@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Math.NumberTheory.Quadratic.GaussianIntegers

Description

This module exports functions for manipulating Gaussian integers, including computing their prime factorisations.

Synopsis

Documentation

data GaussianInteger Source #

A Gaussian integer is a+bi, where a and b are both integers.

Constructors

(:+) infix 6 

Fields

Instances
Eq GaussianInteger Source # 
Instance details

Defined in Math.NumberTheory.Quadratic.GaussianIntegers

Num GaussianInteger Source # 
Instance details

Defined in Math.NumberTheory.Quadratic.GaussianIntegers

Ord GaussianInteger Source # 
Instance details

Defined in Math.NumberTheory.Quadratic.GaussianIntegers

Show GaussianInteger Source # 
Instance details

Defined in Math.NumberTheory.Quadratic.GaussianIntegers

Generic GaussianInteger Source # 
Instance details

Defined in Math.NumberTheory.Quadratic.GaussianIntegers

Associated Types

type Rep GaussianInteger :: Type -> Type #

NFData GaussianInteger Source # 
Instance details

Defined in Math.NumberTheory.Quadratic.GaussianIntegers

Methods

rnf :: GaussianInteger -> () #

Euclidean GaussianInteger Source # 
Instance details

Defined in Math.NumberTheory.Quadratic.GaussianIntegers

UniqueFactorisation GaussianInteger Source # 
Instance details

Defined in Math.NumberTheory.Quadratic.GaussianIntegers

type Rep GaussianInteger Source # 
Instance details

Defined in Math.NumberTheory.Quadratic.GaussianIntegers

type Rep GaussianInteger = D1 (MetaData "GaussianInteger" "Math.NumberTheory.Quadratic.GaussianIntegers" "arithmoi-0.9.0.0-E3bSyM9N8uIFxgJyxrBJhq" False) (C1 (MetaCons ":+" PrefixI True) (S1 (MetaSel (Just "real") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Integer) :*: S1 (MetaSel (Just "imag") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Integer)))

ι :: GaussianInteger Source #

The imaginary unit, where

ι .^ 2 == -1

conjugate :: GaussianInteger -> GaussianInteger Source #

Conjugate a Gaussian integer.

norm :: GaussianInteger -> Integer Source #

The square of the magnitude of a Gaussian integer.

primes :: [Prime GaussianInteger] Source #

An infinite list of the Gaussian primes. Uses primes in Z to exhaustively generate all Gaussian primes (up to associates), in order of ascending magnitude.

findPrime :: Prime Integer -> Prime GaussianInteger Source #

Find a Gaussian integer whose norm is the given prime number of form 4k + 1 using Hermite-Serret algorithm.