Reply to topic

API differences between FullPivLU and FullPivHouseholderQR

garrison
Registered Member
Posts
7
Karma
0
Hi there!

FullPivLU has a method that gives the determinant(), but FullPivHouseholderQR has methods that give absDeterminant() and logAbsDeterminant(). I'm confused as to why there is this API difference between the two decompositions.

In particular, I'm using the LU decomposition and would like to get the logAbsDeterminant() as well as its sign/phase separately, as I am considering a big enough determinant that it is likely to overflow if I just use FullPivLU::determinant(). Is there a particular reason FullPivLU::logAbsDeterminant() is not defined as a method?

Turns out, I can easily calculate the logAbsDeterminant just by looking at the diagonal of matrixLU(), so it is not a big deal that this is not supported directly in the API. However, when I go to try to access the sign of the determinant, this requires not only access to the diagonal of matrixLU(), but it also requires looking at a protected member variable, m_det_pq (which is either +1 or -1). In order to access this variable, I have subclassed FullPivLU and made a method that returns m_det_pq. But I find it suboptimal to access a protected member variable in my code. Is there a reason this value is not accessible from the public API?

Cheers,
Jim
User avatar ggael
Moderator
Posts
2206
Karma
15
OS
No particular reason. Feel free to propose a patch.

 
Reply to topic

Bookmarks



Who is online

Registered users: apater, Baidu [Spider], Bing [Bot], Exabot [Bot], Google [Bot], Majestic-12 [Bot], mmistretta, MSNbot Media, onesandzeros, shmerl, Uri_Herrera, Yahoo [Bot]