Calculation of determinant takes extremely long time.

Richard B. Kreckel kreckel at thep.physik.uni-mainz.de
Tue Jan 22 17:09:02 CET 2002


On Tue, 22 Jan 2002, Ananda Murthy R S wrote:
> Below I have given a program which tries to find the determinant of a matrix 
> having real numbers and and symbols. The program compiles properly. But 
> when I run the program it takes extremely long time to give the output. I 
> have waited for nearly 4 hours before pressing Ctrl+C.
> 
> How can I find determinants of such matrices of larger sizes? 
> 
> What method does GiNaC employ to calculate the determinant of a matrix having 
> symbols?
> 
> What method does GiNaC employ to calculate the characteristic polynomial of a 
> matrix?

Have you actually looked at this beast?
[...]
>    ex e1=determinant(Af);
[...]

It is a dense 8x8 matrix with 27 free variables.  If I haven't done the
binomials wrong, that amounts to 1344904 terms in the determinant
polynomial, just for representing the solution.  The calculation is going
to take even more, because of intermediate expression swell.

Please see
<http://www.ginac.de/reference/class_GiNaC__determinant_algo.html> 
for an algorithm to choose from and pass this algorithmic hint to smaller
test cases to see how it goes.

Good luck!
       -richy.
-- 
Richard B. Kreckel
<Richard.Kreckel at Uni-Mainz.DE>
<http://wwwthep.physik.uni-mainz.de/~kreckel/>



More information about the GiNaC-list mailing list