canon-0.1.0.0: Massive Number Arithmetic

Copyright(c) 2015-2018 Frederick Schneider
LicenseMIT
MaintainerFrederick Schneider <frederick.schneider2011@gmail.com>
StabilityProvisional
Safe HaskellNone
LanguageHaskell2010

Math.NumberTheory.Canon.AurifCyclo

Description

Aurifeullian and Cyclotomic factorization method functions.

Synopsis

Documentation

aurCandDec :: Integer -> Integer -> Bool -> Maybe (Integer, Integer) Source #

Integer wrapper for aurCandDecCr

aurCandDecCr :: CR_ -> CR_ -> Bool -> Maybe (Integer, Integer) Source #

This function checks if the input is a candidate for Aurifeuillian decomposition. If so, split it into two and evaluate it. Otherwise, return nothing. The code will "prep" the input params so they will be relatively prime.

aurDec :: Integer -> Maybe (Array Integer Integer, Array Integer Integer) Source #

This function returns a pair of polynomials (in array form) or Nothing (if it's squareful). An illogical n (n <= 1) will generate an error.

aurDecCr :: CR_ -> Maybe (Array Integer Integer, Array Integer Integer) Source #

CR_ wrapper for aurDec

applyCycloPair :: Integer -> Integer -> Integer -> [Integer] Source #

Wraps applyCycloPairWithMap with default CycloMap argument.

applyCycloPairWithMap :: Integer -> Integer -> Integer -> CycloMap -> ([Integer], CycloMap) Source #

This will use cyclotomic polynomial methods to factor x^e - b^e.

cyclo :: Integer -> (CycloPair, CycloMap) Source #

Integer wrapper for crCyclo with default CycloMap parameter

cycloWithMap :: Integer -> CycloMap -> (CycloPair, CycloMap) Source #

Integer wrapper for crCyclo

cycloDivSet :: Integer -> CycloMap Source #

Integer wrapper for crCycloDivSet with default CycloMap parameter

cycloDivSetWithMap :: Integer -> CycloMap -> (CycloMap, CycloMap) Source #

Integer wrapper for crCycloDivSet

chineseAurif :: Integer -> Integer -> Bool -> Maybe (Integer, Integer) Source #

Wrapper for chineseAurifWithMap with default CycloMap parameter

chineseAurifWithMap :: Integer -> Integer -> Bool -> CycloMap -> (Maybe (Integer, Integer), CycloMap) Source #

Integer wrapper for chineseAurifCr

chineseAurifCr :: CR_ -> CR_ -> Bool -> CycloMap -> (Maybe (Integer, Integer), CycloMap) Source #

This function reduces the two CR parameters by gcd before calling an internal function to find a Chinese Aurifeullian factorization.

crCycloAurifApply :: Bool -> CR_ -> CR_ -> CR_ -> Integer -> CycloMap -> (CR_, CycloMap) Source #

This function checks if the inputs along with operator flag have a cyclotomic or Aurifeuillian form to greatly simplify factoring. If they do not, potentially much more expesive simple factorization is used via crSimpleApply. Note: The cyclotomic map is threaded into the functions

applyCrCycloPair :: Integer -> Integer -> CR_ -> CycloMap -> ([Integer], CycloMap) Source #

These "apply cyclo" functions will use cyclotomic polynomial methods to factor x^e - b^e.

divvy :: [Integer] -> Integer -> Integer -> [Integer] Source #

Internal function requires two integers (computed via Aurif. methods) along with a list of Integers. The product of the Integers must be a divisor of the list's product otherwise an error will be generated. It's called divvy because it splits the 2 integers across the array using the gcd. This will help factoring because the larger term(s) will be broken up into smaller pieces.

data CycloMap Source #

CycloMap is a newtype hiding the details of a map of CR_ to pairs of integers and corresponding cyclotomic polynomials.

fromCycloMap :: CycloMap -> CycloMapInternal Source #

Unwrap the CycloMap newtype.

fromCM :: CycloMap -> CycloMapInternal Source #

Unwrap the CycloMap newtype.

showCyclo :: CR_ -> CycloMap -> [Char] Source #

This will display the cyclotomic polynomials for a CR.

crCycloInitMap :: CycloMap Source #

This is an initial map with the cyclotomic polynomials for 1 and 2.