Performance
Maple 2019 improves the performance of many routines.
factor
Graph Theory
Group Theory
Real Root Finding
Maple 2019 includes performance improvements for factoring sparse multivariate polynomials with integer coefficients. See factor for more details.
vars≔seq⁡xi,i=1..8
vars≔x1,x2,x3,x4,x5,x6,x7,x8
g≔randpolyvars, degree=15,terms=50,coeffs=rand−1000..1000
g≔555⁢x14⁢x2⁢x32⁢x53⁢x62⁢x7⁢x82+771⁢x14⁢x2⁢x3⁢x42⁢x63⁢x84+584⁢x13⁢x2⁢x34⁢x6⁢x76+930⁢x13⁢x43⁢x5⁢x63⁢x7⁢x84−778⁢x12⁢x22⁢x3⁢x4⁢x78⁢x8−642⁢x12⁢x32⁢x42⁢x5⁢x66⁢x7⁢x8+897⁢x12⁢x42⁢x6⁢x75⁢x85−73⁢x1⁢x2⁢x34⁢x4⁢x65⁢x7⁢x82+396⁢x1⁢x2⁢x611⁢x82+728⁢x26⁢x43⁢x52⁢x6⁢x83−981⁢x25⁢x3⁢x44⁢x7⁢x84−45⁢x23⁢x3⁢x44⁢x55⁢x7⁢x8−173⁢x22⁢x3⁢x43⁢x66⁢x7⁢x82+369⁢x22⁢x53⁢x64⁢x75⁢x8+190⁢x2⁢x45⁢x53⁢x7⁢x85−257⁢x39⁢x52⁢x63⁢x7+227⁢x32⁢x47⁢x74⁢x82+83⁢x3⁢x4⁢x611⁢x82+809⁢x53⁢x6⁢x72⁢x89−921⁢x16⁢x23⁢x45−466⁢x12⁢x22⁢x34⁢x6⁢x85−265⁢x12⁢x22⁢x52⁢x65⁢x72⁢x8−394⁢x1⁢x2⁢x32⁢x43⁢x52⁢x64⁢x7+898⁢x1⁢x35⁢x64⁢x72⁢x82−916⁢x1⁢x4⁢x68⁢x73⁢x8−583⁢x23⁢x4⁢x58⁢x72−932⁢x34⁢x710−588⁢x44⁢x67⁢x72⁢x8+989⁢x43⁢x56⁢x62⁢x72⁢x8+330⁢x12⁢x23⁢x4⁢x52⁢x63⁢x82+510⁢x12⁢x22⁢x42⁢x62⁢x85+587⁢x12⁢x52⁢x77⁢x82+430⁢x1⁢x22⁢x46⁢x5⁢x6⁢x72+67⁢x22⁢x33⁢x43⁢x5⁢x84−296⁢x13⁢x26⁢x3⁢x4⁢x7−799⁢x13⁢x2⁢x3⁢x53⁢x73⁢x8+717⁢x12⁢x25⁢x4⁢x62⁢x82+550⁢x12⁢x2⁢x52⁢x7⁢x86−417⁢x12⁢x32⁢x4⁢x54⁢x6⁢x82−991⁢x27⁢x3⁢x4⁢x52⁢x6−672⁢x22⁢x32⁢x4⁢x65⁢x72−434⁢x22⁢x42⁢x5⁢x76⁢x8+399⁢x22⁢x4⁢x55⁢x6⁢x7⁢x82−23⁢x2⁢x36⁢x42⁢x6⁢x7⁢x8−500⁢x15⁢x33⁢x4⁢x52−630⁢x1⁢x2⁢x3⁢x46⁢x6⁢x7−513⁢x1⁢x2⁢x3⁢x4⁢x54⁢x7⁢x82+322⁢x2⁢x43⁢x52⁢x74⁢x8−933⁢x3⁢x44⁢x53⁢x8+545⁢x52⁢x6⁢x75
h≔randpolyvars, degree=15,terms=50,coeffs=rand−1000..1000
h≔−474⁢x15⁢x34⁢x43⁢x5⁢x62+429⁢x14⁢x22⁢x3⁢x64⁢x73⁢x8−188⁢x13⁢x2⁢x32⁢x43⁢x63⁢x72⁢x8−197⁢x13⁢x2⁢x3⁢x4⁢x53⁢x63⁢x7⁢x82−464⁢x12⁢x2⁢x33⁢x43⁢x6⁢x74⁢x8−495⁢x12⁢x34⁢x5⁢x62⁢x76+725⁢x1⁢x26⁢x54⁢x74+811⁢x1⁢x23⁢x3⁢x44⁢x54⁢x6⁢x7−26⁢x1⁢x2⁢x33⁢x44⁢x52⁢x6⁢x73+470⁢x23⁢x57⁢x73⁢x82+159⁢x2⁢x34⁢x54⁢x86−631⁢x15⁢x23⁢x3⁢x44⁢x7−910⁢x14⁢x43⁢x6⁢x74⁢x82+527⁢x13⁢x2⁢x35⁢x52⁢x83+558⁢x13⁢x2⁢x33⁢x45⁢x72−168⁢x13⁢x44⁢x63⁢x84+920⁢x12⁢x26⁢x42⁢x73⁢x8−672⁢x1⁢x24⁢x43⁢x65⁢x8+201⁢x1⁢x22⁢x49⁢x6⁢x8+660⁢x1⁢x2⁢x56⁢x65⁢x7+153⁢x1⁢x58⁢x72⁢x83−628⁢x26⁢x3⁢x43⁢x53⁢x8+771⁢x23⁢x42⁢x59−710⁢x22⁢x46⁢x52⁢x74+392⁢x22⁢x57⁢x85+211⁢x2⁢x46⁢x5⁢x63⁢x83−997⁢x33⁢x4⁢x55⁢x62⁢x7⁢x82−968⁢x3⁢x5⁢x712−160⁢x14⁢x22⁢x52⁢x85−488⁢x13⁢x3⁢x52⁢x77+554⁢x12⁢x22⁢x33⁢x46−687⁢x12⁢x2⁢x42⁢x5⁢x63⁢x72⁢x82+665⁢x1⁢x23⁢x33⁢x43⁢x83+870⁢x22⁢x36⁢x53⁢x7⁢x8−160⁢x22⁢x54⁢x77+136⁢x2⁢x32⁢x42⁢x6⁢x76⁢x8−487⁢x14⁢x2⁢x35⁢x5⁢x8+549⁢x1⁢x23⁢x32⁢x43⁢x5⁢x62−262⁢x1⁢x22⁢x64⁢x7⁢x84+649⁢x1⁢x2⁢x32⁢x44⁢x62⁢x82+864⁢x1⁢x2⁢x32⁢x42⁢x63⁢x7⁢x82+336⁢x13⁢x2⁢x32⁢x42⁢x6⁢x7⁢x8−679⁢x1⁢x2⁢x33⁢x4⁢x53⁢x7⁢x8+871⁢x22⁢x37⁢x4⁢x7−823⁢x33⁢x46⁢x6⁢x8+386⁢x1⁢x22⁢x63⁢x7⁢x83−373⁢x2⁢x54⁢x63⁢x8+511⁢x12⁢x2⁢x4⁢x72⁢x82−838⁢x22⁢x6⁢x74⁢x8−124⁢x23⁢x4⁢x5⁢x7
f≔expandg⋅h:
The following factorization took about 5 seconds in Maple 2018 on the same machine.
CodeTools:-Usagefactorf
memory used=40.03MiB, alloc change=41.09MiB, cpu time=250.00ms, real time=247.00ms, gc time=0ns
474⁢x15⁢x34⁢x43⁢x5⁢x62−429⁢x14⁢x22⁢x3⁢x64⁢x73⁢x8+188⁢x13⁢x2⁢x32⁢x43⁢x63⁢x72⁢x8+197⁢x13⁢x2⁢x3⁢x4⁢x53⁢x63⁢x7⁢x82+464⁢x12⁢x2⁢x33⁢x43⁢x6⁢x74⁢x8+495⁢x12⁢x34⁢x5⁢x62⁢x76−725⁢x1⁢x26⁢x54⁢x74−811⁢x1⁢x23⁢x3⁢x44⁢x54⁢x6⁢x7+26⁢x1⁢x2⁢x33⁢x44⁢x52⁢x6⁢x73−470⁢x23⁢x57⁢x73⁢x82−159⁢x2⁢x34⁢x54⁢x86+631⁢x15⁢x23⁢x3⁢x44⁢x7+910⁢x14⁢x43⁢x6⁢x74⁢x82−527⁢x13⁢x2⁢x35⁢x52⁢x83−558⁢x13⁢x2⁢x33⁢x45⁢x72+168⁢x13⁢x44⁢x63⁢x84−920⁢x12⁢x26⁢x42⁢x73⁢x8+672⁢x1⁢x24⁢x43⁢x65⁢x8−201⁢x1⁢x22⁢x49⁢x6⁢x8−660⁢x1⁢x2⁢x56⁢x65⁢x7−153⁢x1⁢x58⁢x72⁢x83+628⁢x26⁢x3⁢x43⁢x53⁢x8−771⁢x23⁢x42⁢x59+710⁢x22⁢x46⁢x52⁢x74−392⁢x22⁢x57⁢x85−211⁢x2⁢x46⁢x5⁢x63⁢x83+997⁢x33⁢x4⁢x55⁢x62⁢x7⁢x82+968⁢x3⁢x5⁢x712+160⁢x14⁢x22⁢x52⁢x85+488⁢x13⁢x3⁢x52⁢x77−554⁢x12⁢x22⁢x33⁢x46+687⁢x12⁢x2⁢x42⁢x5⁢x63⁢x72⁢x82−665⁢x1⁢x23⁢x33⁢x43⁢x83−870⁢x22⁢x36⁢x53⁢x7⁢x8+160⁢x22⁢x54⁢x77−136⁢x2⁢x32⁢x42⁢x6⁢x76⁢x8+487⁢x14⁢x2⁢x35⁢x5⁢x8−549⁢x1⁢x23⁢x32⁢x43⁢x5⁢x62+262⁢x1⁢x22⁢x64⁢x7⁢x84−649⁢x1⁢x2⁢x32⁢x44⁢x62⁢x82−864⁢x1⁢x2⁢x32⁢x42⁢x63⁢x7⁢x82−336⁢x13⁢x2⁢x32⁢x42⁢x6⁢x7⁢x8+679⁢x1⁢x2⁢x33⁢x4⁢x53⁢x7⁢x8−871⁢x22⁢x37⁢x4⁢x7+823⁢x33⁢x46⁢x6⁢x8−386⁢x1⁢x22⁢x63⁢x7⁢x83+373⁢x2⁢x54⁢x63⁢x8−511⁢x12⁢x2⁢x4⁢x72⁢x82+838⁢x22⁢x6⁢x74⁢x8+124⁢x23⁢x4⁢x5⁢x7⁢−555⁢x14⁢x2⁢x32⁢x53⁢x62⁢x7⁢x82−771⁢x14⁢x2⁢x3⁢x42⁢x63⁢x84−584⁢x13⁢x2⁢x34⁢x6⁢x76−930⁢x13⁢x43⁢x5⁢x63⁢x7⁢x84+778⁢x12⁢x22⁢x3⁢x4⁢x78⁢x8+642⁢x12⁢x32⁢x42⁢x5⁢x66⁢x7⁢x8−897⁢x12⁢x42⁢x6⁢x75⁢x85+73⁢x1⁢x2⁢x34⁢x4⁢x65⁢x7⁢x82−396⁢x1⁢x2⁢x611⁢x82−728⁢x26⁢x43⁢x52⁢x6⁢x83+981⁢x25⁢x3⁢x44⁢x7⁢x84+45⁢x23⁢x3⁢x44⁢x55⁢x7⁢x8+173⁢x22⁢x3⁢x43⁢x66⁢x7⁢x82−369⁢x22⁢x53⁢x64⁢x75⁢x8−190⁢x2⁢x45⁢x53⁢x7⁢x85+257⁢x39⁢x52⁢x63⁢x7−227⁢x32⁢x47⁢x74⁢x82−83⁢x3⁢x4⁢x611⁢x82−809⁢x53⁢x6⁢x72⁢x89+921⁢x16⁢x23⁢x45+466⁢x12⁢x22⁢x34⁢x6⁢x85+265⁢x12⁢x22⁢x52⁢x65⁢x72⁢x8+394⁢x1⁢x2⁢x32⁢x43⁢x52⁢x64⁢x7−898⁢x1⁢x35⁢x64⁢x72⁢x82+916⁢x1⁢x4⁢x68⁢x73⁢x8+583⁢x23⁢x4⁢x58⁢x72+932⁢x34⁢x710+588⁢x44⁢x67⁢x72⁢x8−989⁢x43⁢x56⁢x62⁢x72⁢x8−330⁢x12⁢x23⁢x4⁢x52⁢x63⁢x82−510⁢x12⁢x22⁢x42⁢x62⁢x85−587⁢x12⁢x52⁢x77⁢x82−430⁢x1⁢x22⁢x46⁢x5⁢x6⁢x72−67⁢x22⁢x33⁢x43⁢x5⁢x84+296⁢x13⁢x26⁢x3⁢x4⁢x7+799⁢x13⁢x2⁢x3⁢x53⁢x73⁢x8−717⁢x12⁢x25⁢x4⁢x62⁢x82−550⁢x12⁢x2⁢x52⁢x7⁢x86+417⁢x12⁢x32⁢x4⁢x54⁢x6⁢x82+991⁢x27⁢x3⁢x4⁢x52⁢x6+672⁢x22⁢x32⁢x4⁢x65⁢x72+434⁢x22⁢x42⁢x5⁢x76⁢x8−399⁢x22⁢x4⁢x55⁢x6⁢x7⁢x82+23⁢x2⁢x36⁢x42⁢x6⁢x7⁢x8+500⁢x15⁢x33⁢x4⁢x52+630⁢x1⁢x2⁢x3⁢x46⁢x6⁢x7+513⁢x1⁢x2⁢x3⁢x4⁢x54⁢x7⁢x82−322⁢x2⁢x43⁢x52⁢x74⁢x8+933⁢x3⁢x44⁢x53⁢x8−545⁢x52⁢x6⁢x75
A larger example, with about 30000 terms.
f≔expandmulrandpolyseqxj,j=1..12,degree=15,terms=30,coeffs=rand1..100000+i,i=1..3:
nopsf
29791
This factorization took more than 1 minute in Maple 2018.
F≔CodeTools:-Usagefactorf:
memory used=475.20MiB, alloc change=133.50MiB, cpu time=3.29s, real time=3.08s, gc time=468.00ms
nopsF
3
The last example is the determinant of a generic circulant matrix, i.e., where all entries are indeterminates, and each row is a cyclic rotation of the first one.
withLinearAlgebra: interfacertablesize=12:
A≔Matrix12,shape=Circulantseqxj,j=1..12
A≔x1x2x3x4x5x6x7x8x9x10x11x12x12x1x2x3x4x5x6x7x8x9x10x11x11x12x1x2x3x4x5x6x7x8x9x10x10x11x12x1x2x3x4x5x6x7x8x9x9x10x11x12x1x2x3x4x5x6x7x8x8x9x10x11x12x1x2x3x4x5x6x7x7x8x9x10x11x12x1x2x3x4x5x6x6x7x8x9x10x11x12x1x2x3x4x5x5x6x7x8x9x10x11x12x1x2x3x4x4x5x6x7x8x9x10x11x12x1x2x3x3x4x5x6x7x8x9x10x11x12x1x2x2x3x4x5x6x7x8x9x10x11x12x1
f≔DeterminantA,method=minor:
86500
This factorization took about 17 seconds in Maple 2018.
memory used=488.25MiB, alloc change=-41.44MiB, cpu time=5.37s, real time=3.96s, gc time=421.20ms
6
mapnops,opF
12,12,42,78,78,621
mapdegree,opF
1,1,2,2,2,4
expandf−F
0
In Maple 2019 the MaximumClique function of the GraphTheory package has new algorithms for computing the maximum clique of a graph and an option to choose the algorithm that you want to use, giving a huge performance boost on certain kinds of graphs. In the following example, Maple 2019 almost instantly finds the maximum clique of a graph that Maple 2018 needed over 3 minutes to find. In this case the "sat" method is used which translates the problem into Boolean logic and solves the resulting satisfiability problem using a SAT solver.
withGraphTheory:
filename≔FileTools:-JoinPathkerneloptsdatadir,example,MANN_a9.clq
filename≔E:\Maple2019\data\example\MANN_a9.clq
G≔ImportGraphfilename, 'dimacs'
G≔Graph 1: an undirected unweighted graph with 45 vertices and 918 edge(s)
DegreeSequenceG
40,40,40,40,40,40,40,40,40,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41
C≔CodeTools:-UsageMaximumCliqueG,method='sat'
memory used=10.44MiB, alloc change=28.99MiB, cpu time=187.00ms, real time=152.00ms, gc time=62.40ms
C≔2,3,4,6,10,14,17,20,24,25,30,33,36,39,41,45
numelemsC
16
Arithmetic and other low-level operations for permutations have been completely re-written in compiled kernel code. In addition, the memory overhead of permutations has been considerably reduced.
For example, the following call to PermOrder took about 200 times longer in Maple 2018.
withGroupTheory:
p≔Perm⁡combinat:-randperm⁡105:
PermOrder⁡p
47396163561937236086040
Timing details will of course vary from one machine to another, and depend also upon the random state of the Maple session. But, reproduced here are some representative calculations run in a fresh Maple 2018 session, on a particular 64-bit Linux workstation.
L≔CodeTools:-Usageseq⁡Perm⁡combinat:-randperm⁡104,i=1..1000:
CodeTools:-UsagePermProduct⁡op⁡L:
memory used=307.57MiB, alloc change=288.00MiB, cpu time=9.78s, real time=8.36s, gc time=1.75s
CodeTools:-Usagemap⁡PermOrder,L:
memory used=2.54GiB, alloc change=96.00MiB, cpu time=52.62s, real time=40.96s, gc time=13.75s
CodeTools:-Usagemap⁡PermInverse,L:
memory used=0.74GiB, alloc change=320.00MiB, cpu time=19.56s, real time=14.66s, gc time=5.71s
CodeTools:-Usagemap⁡PermCycleType,L:
memory used=0.84MiB, alloc change=0 bytes, cpu time=152.00ms, real time=149.00ms, gc time=0ns
CodeTools:-Usagemap⁡PermPower,L,3333:
memory used=4.53GiB, alloc change=2.22GiB, cpu time=3.78m, real time=2.17m, gc time=113.08s
And here are the same calculations run in a fresh 2019 session on the same machine. It is apparent that both time used an memory consumption have been considerably reduced.
memory used=77.16MiB, alloc change=59.42MiB, cpu time=1.10s, real time=1.10s, gc time=8.00ms
memory used=77.85MiB, alloc change=0 bytes, cpu time=592.00ms, real time=587.00ms, gc time=24.00ms
memory used=8.08MiB, alloc change=3.01MiB, cpu time=204.00ms, real time=203.00ms, gc time=0ns
memory used=77.30MiB, alloc change=-1.00MiB, cpu time=568.00ms, real time=560.00ms, gc time=16.00ms
memory used=214.05KiB, alloc change=0 bytes, cpu time=124.00ms, real time=125.00ms, gc time=0ns
memory used=77.81MiB, alloc change=0 bytes, cpu time=764.00ms, real time=752.00ms, gc time=36.00ms
The RootFinding:-Isolate command has a new algorithm for univariate polynomials that is much faster for ill-conditioned problems and high accuracy solutions. See Real Root Finding for details.
Download Help Document