On 6/12/2012 11:08 AM, Raul Miller wrote:
> Which verb?
pp =: +//.@:(*/)"1
pdet =: ([: , ({."2 -/ . pp $:@(1&(}."2\.)))^:(1<#))"3
> Another issue here is generality, and motivation. There is something
> nice about being able to use the same "determinant primitive" to
> compute both regular determinants and eigenvalues. And even if that
> never gets into the interpreter, I find some joy in modeling things
> that way.
Yes, me too.
>
> The "resource cost" issue you are raising can be significant, in some
> contexts, but it's not going to be significant in all contexts. In
> the case I am working up to dealing with (several hundred collections
> 4x4 matrices where each collection typically contains of several
> thousand of these 4x4 matrices), it's hard for me to see why I should
> care about it.
>
Yeah. 1e7 4x4 matrices will take about the same time as 1 12x12, using
determinants. If you keep to 4x4 matrices it won't get out of hand.
LAPACK is 3x faster for 4x4s, on my machine, 1e7x faster for 12x12.
Henry Rich
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm