Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

svdJs is broken, qrJs too, probably from identSize #2

Open
xionluhnis opened this issue Dec 7, 2012 · 0 comments
Open

svdJs is broken, qrJs too, probably from identSize #2

xionluhnis opened this issue Dec 7, 2012 · 0 comments
Labels
Milestone

Comments

@xionluhnis
Copy link

See NaturalNode/node-lapack#2

Using the following on matlab / octave:

A = [ 1, 2; 3, 4; 5, 6];
[u, s, v] = svd(A)

I obtain:

u =
  -0.22985   0.88346   0.40825
  -0.52474   0.24078  -0.81650
  -0.81964  -0.40190   0.40825

  s =
  9.52552  0.00000
  0.00000  0.51430
  0.00000  0.00000

  v =
  -0.61963  -0.78489
  -0.78489   0.61963

Now with the js implementation:

require('sylvester');
var A = $M([
  [1, 2],
  [3, 4],
  [5, 6]
]);
var svd = A.svd();
console.log(JSON.stringify(svd));

I obtain nothing because it crashes:

  /[...]/node_modules/sylvester/lib/node-sylvester
  /matrix.js:60
    var e = S.triu(1).unroll().norm();
              ^
  TypeError: Cannot call method 'triu' of null
    at Object.svdJs (/[...]/node_modules/sylvester
  /lib/node-sylvester/matrix.js:60:15)

Error summary: it breaks because of a null value being returned by qrJs, which in turn starts with the R matrix being null at some point. That comes from identSize.

However, it's mostly just an issue notification. I personally needed to have reliable and fast svd, so I used SVDLIBC and bound it as a C++ module (see node-svd). You may look at SVDLIBC if you think it can help you with svd / qr processing.

@connor4312 connor4312 added the bug label Jan 5, 2017
@connor4312 connor4312 added this to the 1.0.0 milestone Jan 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants