View Issue Details

IDProjectCategoryView StatusLast Update
0002486OpenFOAMBugpublic2017-04-20 11:03
Reporterhertzsprung Assigned Towill  
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSUbuntuOS Version16.10
Product Versiondev 
Summary0002486: Singular value decomposition of singular matrix returns nans
DescriptionThe attached application returns a psuedo-inverse that is all nans. The same operation in python3-numpy gives the expected result.
TagsNo tags attached.



2017-03-05 12:10


testSingularSVD.tar.gz (1,388 bytes)


2017-03-05 12:32

manager   ~0007854

Can you provide a patch to fix this problem?


2017-04-08 00:41

reporter   ~0008022

Here is some basic info about NumPy:


2017-04-20 11:03

manager   ~0008035

Your test program needs to construct the SVD class after setting the matrix coefficients. The decomposition is done on construction, not at the point of generating the pseudo-inverse.

The bug report was still valid, though. I don't fully understand the SVD code, but I found a product that was under-flowing, which was later used in a division. I've added protection to these operations as of commit 646a269217d1558bb67386a8721c0ca5d50830c0. The matrix in your test routine now doesn't generate any NaNs, so I'm considering this bug resolved. The pseudo-inverse still isn't exactly the same as numpy or octave, though. I don't know whether that's a bug, or if it is to be expected for a matrix this badly conditioned.

Issue History

Date Modified Username Field Change
2017-03-05 12:10 hertzsprung New Issue
2017-03-05 12:10 hertzsprung File Added: testSingularSVD.tar.gz
2017-03-05 12:32 henry Note Added: 0007854
2017-04-08 00:41 travm1 Note Added: 0008022
2017-04-20 11:03 will Assigned To => will
2017-04-20 11:03 will Status new => resolved
2017-04-20 11:03 will Resolution open => fixed
2017-04-20 11:03 will Note Added: 0008035