11.07.2015 Views

Advanced Programming Guide

Advanced Programming Guide

Advanced Programming Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

A.3 The Use of Hashing in Maple • 367Polynomials with Integer Coefficients modulo nZPPOLY ∧ indet mod coef0 coef1 ...ZPPOLY ∧ indet_seq mod ∧ zppoly0 ∧ zppoly1 ...Maple Syntax: modp1( ConvertIn( expr, indet ), n );Maple Syntax: modp2( ConvertIn( expr, indet1, indet2 ), n );Length: degree(zppoly) +2 (for the zero polynomial)Length: degree(zppoly) +3 (otherwise)This is the internal representation of univariate and bivariate polynomialsmodulo some integer. The modp1() and modp2() front ends providea suite of functions to work on this data structure operating in the domainof polynomials in one or two variables with integer coefficients modulo n,written Zn[x] or Zn[x, y], respectively. indet_seq is an expression sequenceof the indeterminates of the polynomial (x), or (x,y). mod is theinteger modulus of the integer domain. In a univariate polynomial thecoefficients are stored in the following order.(coef0*indet^0 + coef1*indet^1 + ... + coefi*indet^i) mod nA bivariate polynomial contains pointers to univariate ZPPOLY structuresrepresenting the coefficients of the first indeterminate.(coef0(indet2)*indet1^0 + coef1(indet2)*indet1^1 + ...) mod nwhere each coefi is a univariate polynomial in indet1 mod n.All coefficients are stored including zero coefficients. The leading coefficientis always non-zero.A.3 The Use of Hashing in MapleAn important factor in achieving Maple’s overall performance is the useof hash table based algorithms for critical functions. Tables are used inboth simplification and evaluation, as well as for less critical functions.For simplification, Maple keeps a single copy of each expression, or subexpression,during a session. This is done by keeping all objects in a table.In procedures, the remember option specifies that the result of each computationof the procedure is to be stored in a remember table associatedwith the procedure. Finally, tables are available to the user as one ofMaple’s data types.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!