Subject: Help with very very slow determinant calcuation
From: Richard Fateman
Date: Mon, 08 Aug 2011 06:58:23 -0700
If the matrix entries are all polynomials in a single variable, say z,
then you can use modular arithmetic and the "Chinese Remainder Theorem"
to find the symbolic determinant, if it is a polynomial of modest degree.
You compute the determinant several times modulo prime numbers p1, p2,
... , pn.
Then you use the CRT to determine the polynomial of degree n-1 that
assumes those values.
This can also work with polys in several variables. You have managed
to not describe your problem
sufficiently to actually discuss it from a symbolic standpoint. From
this standpoint what matters is the
structural complexity of the entries: how many variables, polynomial or
rational, degree, perhaps sparsity.
It might be easier if you just put the matrix on a file and gave people
a link to it. Or perhaps just posted
it if it is small enough.
RJF
On 8/7/2011 6:28 AM, Nghia Ho wrote:
> I think you might be right, I'm probably trying to calculate something
> very impractical mathematically. I was following an algorithm from a
> computer vision paper and was hoping to keep everything symbolic so I
> could write a function that calculates the result in "one shot"
> (albeit some monstrous equation). The 10x10 matrix that they have ends
> up having mostly numerical values mixed with a single polynomial
> symbol (z or z^2), which is probably practical to calculate. Of
> interest is that they note that higher order polynomial terms (> 10)
> end up canceling each other out, which made me optimistic that it was
> possible to keep it all symbolic. But I guess the intermediate steps
> that Maxima has to do will take an extremely long amount of time
> before it can do any cancellation of terms.
>
> ------------------------------------------------------------------------
> *From:* Barton Willis <willisb at unk.edu>
> *To:* nghiaho12 at yahoo.com
> *Cc:* bernard at marcade.biz; cladelpino at gmail.com;
> maxima at math.utexas.edu
> *Sent:* Sunday, 7 August 2011 8:18 PM
> *Subject:* Re: [Maxima] Help with very very slow determinant
> calcuation
>
> The cost for the function determinant is comparable to the cost of
> a LU factorization. So, no
> computing the determinant by means of the LU factorization is
> unlikely to help. Nghia Ho already
> tried setting ratmx to true and newdet. And that's about all that
> might speed up the
> calculation.
>
> For symbolic matrices, the standard big oh time estimates are
> misleading. The time for addition,
> for example, isn't constant, but the time depends on the
> complexity of the expressions.
>
> It's likely that if Maxima was able to find the determinant of
> this 10x10 symbolic matrix, the
> result would be so huge that it wouldn't be useful. I would
> suggest a different approach.
>
> --Barton
>
> -----maxima-bounces at math.utexas.edu
> <mailto:-----maxima-bounces at math.utexas.edu> wrote: -----
>
> Can you elaborate more on how factorizing the matrix can help? My
> background isn't in mathematics, I only did basic engineering
> level maths.
>
>
>
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima