]> www.ginac.de Git - ginac.git/commit
In power::expand_add(), don't reserve excess monomial sizes.
authorRichard Kreckel <kreckel@ginac.de>
Wed, 25 Nov 2015 10:28:10 +0000 (11:28 +0100)
committerRichard Kreckel <kreckel@ginac.de>
Wed, 25 Nov 2015 11:40:00 +0000 (12:40 +0100)
commitb236efe23093bf2c4b5e7702b60d45505724d915
tree28d22c2822a1167e56b5ace482444209483144b2
parentcec09e9ce4e1d10387d3551d1da0bf497ef3e03f
In power::expand_add(), don't reserve excess monomial sizes.

There is no need to reserve n terms in each of the monomials of the
result of power(+(x,y,z...;0),n): We can compute it exactly as the
number of nonzero exponents in the multinomial expansion. The good
thing is that this counting is the same for each composition of a
partition, so it can be hoisted out of the loop over compositions.
ginac/power.cpp