Menu

#22 LaEigSolve hangs when matrix contains NaN; LaLUInverseIP

open
nobody
None
5
2012-09-14
2008-04-03
confuted
No

Using Lapack++ 1.5.1

Affects: LaEigSolve, LaLUInverseIP, others?

Attempting to call LaEigSolve on a LaGenMatComplex which contains a NaN causes Lapack++ to hang if the NaN is not in the (1,1) position, or to throw an exception if NaN is in (1,1). It would make sense to me to throw an exception if there is a NaN anywhere in the matrix.

Using LUFactorizeIP and LaLUInverseIP to find the inverse of the same matrix returns an inverse of all NaN; I would expect that this should also throw an exception?

It's easiest just to demonstrate. bug.cpp and bug2.cpp show the two behaviors.

Discussion

  • confuted

    confuted - 2008-04-03

    Demonstration code

     
  • confuted

    confuted - 2008-04-03

    Logged In: YES
    user_id=1579622
    Originator: YES

    My apologies, I meant to say that I'm using Lapack++ 2.5.1

     
  • Christian Stimming

    Logged In: YES
    user_id=531034
    Originator: NO

    I'm afraid I also don't know any short term solution to this problem. As lapack++ is merely a wrapper to lapack, if lapack itself hangs, lapack++ can't do anything anymore.

     
  • Nobody/Anonymous

    Logged In: NO

    I am not familiar with the underlying code, but would it be feasible to simply scan the matrix for NaN in the lapack++ portion of the code, and throw the exception if one or more are present instead of calling the lapack function immediately?

    Possibly add a FLAG to opt-in/out of that check?

     
  • Christian Stimming

    Logged In: YES
    user_id=531034
    Originator: NO

    In principle a hand-written loop over the full matrix content would work, but OTOH it would incur a massive performance overhead, especially because the matrix size can be enormous. I would only add such a check if there is a LAPACK function for this - otherwise a hand-written loop will be much too inefficient.

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.