Boost logo

Ublas :

From: Karl Meerbergen (Karl.Meerbergen_at_[hidden])
Date: 2005-12-20 03:47:38

Eddie Vedder wrote:

>>I think that the sign of the product of the diagonal elements of U
>>depends on the number of row permutations in pivoting: if this number
>>is even, product is equal to determinant, but if it is odd,
>>product is -determinant.
>Is there a way to find out the number of rows permutations in pivoting? Does
>the pivot vector give any information about that? Or is this information

It is in the pivot vector. I suggest you look at the LAPACK code DGETRF,
although it might not be easy to find the details.

Or, compute the QR factorization with xgeqrf() (LAPACK binding) and
multiply the diagonal elements of R. I think this is also the
determinant. I seem to recall something of the form: det(Q*R) =
det(Q)*det(R) = det(R).
The computation of the QR factorization is more expensive than an LU

Alternatively, compute the eigenvalues of the matrix and multiply them,
which is also the determinant. It is more expensive though.


>ublas mailing list

Look at our unique training program and
Register on-line at
Karl Meerbergen
Free Field Technologies
16 place de l'Université
B-1348 Louvain-la-Neuve - BELGIUM
Company Phone:  +32 10 45 12 26
Company Fax:    +32 10 45 46 26
Mobile Phone:   +32 474 26 66 59
Home Phone:     +32 2 306 38 10