Open mahrud opened 1 week ago
I don't see your timings. I get something like:
i1 : exponentMatrix = B -> transpose matrix apply(numcols B, c -> first exponents B_(0,c));
i2 : kk = ZZ/32003;
i3 : elapsedTime B = basis(5, kk[x_1..x_30]); -- takes .22 sec, 278,256 columns
-- 0.163152 seconds elapsed
1 278256
o3 : Matrix (kk[x ..x ]) <-- (kk[x ..x ])
1 30 1 30
i4 : elapsedTime exponentMatrix B; -- takes anywhere from 9 to 17 or so seconds, depending on garbage collections...
-- 17.1095 seconds elapsed
30 278256
o4 : Matrix ZZ <-- ZZ
i5 : elapsedTime exponentMatrix B; -- takes
-- 9.71178 seconds elapsed
30 278256
o5 : Matrix ZZ <-- ZZ
i6 : elapsedTime exponentMatrix B; -- takes
-- 10.2289 seconds elapsed
30 278256
o6 : Matrix ZZ <-- ZZ
It should still be made faster, but just wondered what your example was?
Hmm maybe your computer is much faster than mine, or maybe it's garbage collection that's throwing in randomness.
Even in your timings though, when the basis matrix takes 0.163152s to construct a 1x278256 matrix, a conservative estimate might be 30x0.16 so ~4.8s for constructing a 3x278256 matrix, but of course this is just integers so it should be much faster I would imagine.
Is there a fast (i.e. implemented in the engine) routine for the following? (or its transpose)
The one liner above obviously works, but when
B
is a matrix of basis monomials with tens thousands of columns, it gets quite slow (e.g. the basis itself takes a couple of seconds but computing the exponent matrix takes a minute!!)cc: @mikestillman