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 has null value issues #2

Closed
xionluhnis opened this issue Dec 5, 2012 · 4 comments
Closed

svdJS has null value issues #2

xionluhnis opened this issue Dec 5, 2012 · 4 comments

Comments

@xionluhnis
Copy link

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)

Is it an issue with the qr factorization? Looks like at some point the R in qrJs() becomes null and everything crashes from there.

@chrisumbel
Copy link
Member

I think this issue might belong in the node-sylvester project.

@xionluhnis
Copy link
Author

Arghk. My bad. It does...
What should I do, just report it back in Sylvester ?

@chrisumbel
Copy link
Member

in NaturalNode / node-sylvester, yup. QR and SVD were somewhat experimental so it's not a shock to me to see some problems reported. i'll have a look at it over the weekend.

@xionluhnis
Copy link
Author

Ok, I close here then. Thanks for the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants