octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #57185] svds returns inconsistent singular val


From: Rik
Subject: [Octave-bug-tracker] [bug #57185] svds returns inconsistent singular values
Date: Fri, 8 Nov 2019 16:08:42 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Follow-up Comment #7, bug #57185 (project octave):

I think we should consider fixing this is two steps.  The first question to
resolve is the return of complex singular values rather than just real ones. 
The complex values are very small, which suggests the algorithm is effective
but there is a small loss of precision owing to the fact that this is imperfct
numerical computation.  Sample:


octave:9>  x = randn(10, 5) ;
octave:10> y = randn(10, 5) ;
octave:11> z = complex(x, y) ;
octave:12> s = svds (z)
s =

   5.9713 + 0.0000i
   4.6205 - 0.0000i
   3.7797 + 0.0000i
   2.5995 + 0.0000i
   1.9744 - 0.0000i

octave:13> imag (s)
ans =

   9.0733e-17
  -1.2895e-16
   9.0859e-17
   2.8342e-19
  -7.4995e-17



A simple answer might be to take the equivalent, in C++, of


s = real (s);


before returning the values.

Alternatively, it make be possible to declare s as a real array in C++ so that
it can never hold imaginary values.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57185>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]