ModularFactorizationOperations(PA, MMT, MD, PMD)ΒΆ
ffact.spad line 1 [edit on github]
This category specifies operations needed by univariate factorization over finite fields
- add_poly: (PA, PA, MD) -> PA
add_poly(pol1, pol2, md)
add polynomialspol1
andpol2
.
- copy_mat_part: (MMT, Integer) -> MMT
copy_mat_part(man, nr)
creates copy of modular composition matrix stored in firstnr
rows of mat.
- copy_poly: (PA, Integer, MD) -> PA
copy_poly(pol, d, m)
creates copy ofpol
with enough space to represent polynomials of degree smaller thand
. Error if degree ofpol
is bigger or equal thand
.
- degree: PA -> Integer
degree(pol)
returns degree of the polynomialpol
.
- divide!: (PA, PA, MD) -> PA
divide!(pol1, pol2, md)
performs division with remainder ofpol1
bypol2
.pol1
is modified in place to contain remainder. Quotient is return value.
- empty_mat?: MMT -> Boolean
empty_mat?(mat)
returnstrue
if matrix is empty,false
otherwise.
- empty_mat: () -> MMT
empty_mat()
returns empty (that is of dimensions 0) matrix.
- empty_poly: () -> PA
empty_poly()
returns empty (that is 0) polynomial.
- gcd: (PA, PA, MD) -> PA
gcd(pol1, pol2, md)
computesgcd
ofpol1
andpol2
.
- get_char: MD -> Integer
get_char(md)
returns characteristic of the field described by infomd
.
- get_extension_degree: MD -> Integer
get_extension_degree(md)
returns degree of the field described by infomd
over its prime subfield.
- get_mod: PMD -> MD
get_mod(pmd)
extracts field info from reduction data.
- ini_rdata: (PA, MD) -> PMD
ini_rdata(pv, p)
generates data allowing faster computation of remainders from division bypv
modulop
. Result is used by other functions in this package, in particularred_pol!
.
- mod_exp: (PA, Integer, PMD) -> PA
mod_exp(pv, d, rd)
computespv^d
modulo reduction data inrd
.
- modular_compose: (PA, MMT, PA, NonNegativeInteger, PMD) -> PA
modular_compose(pol, pm, p1, l1, rd)
computes composion ofpol
withp0
modulo reduction datard
.pm
andp1
are as from call topower_matrix(p0, l1, rd)
.
- monomial1: MD -> PA
monomial1(md)
returns monomial of degree 1 with coefficient 1.
- power_matrix: (PA, NonNegativeInteger, PMD) -> Record(matr: MMT, poly: PA)
power_matrix(s, l, rd)
computes [m
,p
] such thatp = s^l
modulo reduction datard
and columnj
ofm
contains^j
modulo reduction datard
. Note that lowest column index isj = 0
and highest index isj=l-1
.rd
should be obtained by earlier call toini_rdata
.
- random_poly: (Integer, MD) -> PA
random_poly(n, md)
generated random polynomial of degreen
.
- red_pol!: (PA, PMD) -> PA
red_pol!(pv, rd)
computes remainder ofpv
using reduction datard
produced by earlier call toini_rdata
.
- shift_mat!: (MMT, Integer, Integer) -> Void
shift_mat!(mat, sa, nr)
moves modular composition matrix stored innr
rows ofmat
starting atsa
to firstnr
rows ofmat
. This is designed to work on output of split_mat!.
- split_mat!: (MMT, Integer, Integer, Integer, PMD, PMD) -> Void
split_mat!(mat, nr0, nr1, nr2, pmod1, pmod2)
splits modular composition matrixmat
into two matrices, first modulopmod1
, second modulopmod2
. To save space first result replaces firstnr1
rows ofmat
, second result is stored in nextnr2
rows ofmat
.nr0
is number of rows used in argument.
- sub1!: (PA, MD) -> PA
sub1!(pol, md)
subtracts 1 from the polynomialpol
.
- sub_poly: (PA, PA, MD) -> PA
sub_poly(pol1, pol2, md)
subtracts polynomialspol2
frompol1
.