Efficiency Improvements in Maple 11 - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : System : Information : Updates : Maple 11 : updates/Maple11/efficiency

Efficiency Improvements in Maple 11

 

Numerics

Polynomial Algebra and Polynomial System Solving

Linear Algebra

Polynomial Greatest Common Divisor

Programming

Multi-Threaded Programming

Dynamic Garbage Collection

Numerics

• 

Maple can now use hardware floating-point values even outside the restricted evalhf environment. By marking procedures with the new option hfloat, Maple uses hardware floating-point arithmetic wherever possible. For numeric intensive procedures, this can increase performance by factors of 2 to 10 or more.

  

Hardware floating-point values can also be used directly via the HFloat constructor. The presence of a hardware floating-point number in an expression generally implies that the computation will use hardware floating-point evaluation, unless the settings of Digits and UseHardwareFloats specify otherwise (see UseHardwareFloats).

• 

Maple's default stiff numerical ODE solver has been made more efficient with respect to large problems, as well as the default stiff/nonstiff numerical DAE solvers.

• 

Maple's fsolve command has become more efficient for real solutions of univariate polynomials. The first of the following two calling sequences uses the Maple 10 algorithm, while the second one employs the new RootFinding[Isolate] command (the output is identical in both cases since the Chebyshev polynomials have real roots only):

f := expand(ChebyshevT(100, x)):

time(fsolve(f, x, complex));

12.182

(1)

time(fsolve(f, x));

0.405

(2)

Polynomial Algebra and Polynomial System Solving

• 

The engine underlying the Groebner[Basis] command has become dramatically more efficient by incorporating Jean-Charles Faugere's C implementation of his F4 algorithm. It is used by default for systems with rational number coefficients and graded orders.

• 

Many other commands in the Groebner package have become significantly faster as well.

• 

The Multiply command for modp1 polynomials now uses Karatsuba's algorithm for polynomials of sufficiently high degree.

• 

The evala command uses more efficient data representations and algorithms for computations involving polynomials with algebraic number coefficients. As a result, gcd computations for such polynomials have become significantly faster in many cases.

  

Examples To execute the following examples, open this help page as a worksheet. In the help system, click the Open the current help page in a worksheet window icon in the toolbar.

  

F4 algorithm for Groebner basis computations:

with(Groebner):

cyclic6 := [u+v+w+x+y+z,
            u*v+v*w+w*x+x*y+y*z+z*u,
            u*v*w+v*w*x+w*x*y+x*y*z+y*z*u+z*u*v,
            u*v*w*x+v*w*x*y+w*x*y*z+x*y*z*u+y*z*u*v+z*u*v*w,
            u*v*w*x*y+v*w*x*y*z+w*x*y*z*u+x*y*z*u*v+z*y*w*v*u+z*u*v*w*x,
            u*v*w*x*y*z-1]:

cyclic7 := [t+u+v+w+x+y+z,
            t*u+u*v+v*w+w*x+x*y+y*z+z*t,
            t*u*v+u*v*w+v*w*x+w*x*y+x*y*z+y*z*t+z*t*u,
            t*u*v*w+u*v*w*x+v*w*x*y+w*x*y*z+x*y*z*t+y*z*t*u+z*t*u*v,
            t*u*v*w*x+u*v*w*x*y+v*w*x*y*z+w*x*y*z*t+x*y*z*t*u+y*z*t*u*v+t*u*v*w*z,
            t*u*v*w*x*y+u*v*w*x*y*z+v*w*x*y*z*t+w*x*y*z*t*u+x*y*z*t*u*v+y*z*t*u*v*w+z*t*u*v*w*x,
            t*u*v*w*x*y*z-1]:

time(Basis(cyclic6,'tdeg'(u,v,w,x,y,z)));

0.052

(3)

time(Basis(cyclic7,'tdeg'(t,u,v,w,x,y,z)));

2.232

(4)
  

For comparison, we time Buchberger's algorithm on the cyclic6 example. (The reason for calling RememberBasis with second argument forget is to disable the caching mechanism and force subsequent recomputation of the Groebner basis using a different method.)

RememberBasis(cyclic6,'forget','tdeg'(u,v,w,x,y,z)):

time(Basis(cyclic6,'tdeg'(u,v,w,x,y,z),'method'='buchberger'));

14.230

(5)
  

The following gcd computation of two polynomials with algebraic number coefficients is about 10 times faster than in Maple 10:

a := (x+2^(1/2)+3^(1/2))^20:

b := (2^(1/2)*x+3^(1/2))^20:

c := (x^2+x+1+2^(1/3)*3^(1/3))^10:

f := expand(a*b):

g := expand(a*c):

time(gcd(f,g));

0.671

(6)

Linear Algebra

• 

The Matrix and Vector construction and concatenation shortcut notations, <,> and <&verbar;>, have been made much more efficient. These are now the easiest and most efficient ways (in terms of both time and space) to construct fully specified dense rectangular Matrices and Vectors, and to perform most Matrix and Vector concatenations.

• 

The LinearAlgebra[Modular] package has two new commands, IntegerCharacteristicPolynomial and IntegerDeterminant, for fast computation of characteristic polynomials and determinants of integer matrices using modular algorithms.  Maple computes the characteristic polynomial (determinant) modulo a sequence of machine primes. For each prime, Maple uses an On3 algorithm in both cases. These commands are integrated directly into the LinearAlgebra[CharacteristicPolynomial] and LinearAlgebra[Determinant] commands for handling the integer cases.

Polynomial Greatest Common Divisor

• 

The gcd command is now using a new algorithm for multivariate polynomial gcd computations over the integers. The efficiency improvements obtained by this algorithm are most noticeable for problems in three or more variables.

Programming

• 

Changes in the Maple argument processing mechanism and how storage is allocated for procedure arguments have improved performance and reduced memory requirements for virtually all Maple procedure calls. These gains benefit both custom and library procedures.

Multi-Threaded Programming

• 

Maple 11 introduces the ability to write and execute multi-threaded code. This allows Maple to execute code on multiple CPUs in parallel.  This can lead to significant performance improvements. For an overview of multi-threading in Maple, see the multi-threaded Maple help page. The Threads package provides the user interface to writing multi-threaded code.

Dynamic Garbage Collection

• 

The frequency of memory garbage collection has always been an interval based on a fixed amount of memory used.  Now, the gcfreq setting of kernelopts accepts a second parameter allows the collection frequency to dynamically adjust as more memory is allocated.

See Also

Index of New Maple 11 Features