svdJS has null value issues #2

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

Projects

None yet

2 participants

@xionluhnis

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
Member

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

@xionluhnis

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

@chrisumbel
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

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

@xionluhnis xionluhnis closed this Dec 7, 2012
@xionluhnis xionluhnis referenced this issue in NaturalNode/node-sylvester Dec 7, 2012
Open

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment