Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix an issue where decompose would fail if the optional second parame…

…ter wasn't supplied
  • Loading branch information...
commit d58cc3e0ff4a380c980216316fa3138b0892cb83 1 parent bbaf343
Will Cannings authored
2  .gitignore
@@ -2,4 +2,4 @@ Makefile
2 2 *.so
3 3 *.bundle
4 4 .DS_Store
5   -
  5 +pkg/*
4 lib/svd_matrix.rb
@@ -41,11 +41,11 @@ def decompose(reduce_dimensions_to = nil)
41 41
42 42 # recompose U matrix
43 43 u = SVDMatrix.new(row_size, reduce_dimensions_to || column_size)
44   - row_size.times {|i| u.set_row(i, u_array.slice!(0, column_size)[0...reduce_dimensions_to])}
  44 + row_size.times {|i| u.set_row(i, u_array.slice!(0, column_size)[0...(reduce_dimensions_to || column_size)])}
45 45
46 46 # recompose V matric
47 47 v = SVDMatrix.new(column_size, reduce_dimensions_to || column_size)
48   - column_size.times {|i| v.set_row(i, v_array.slice!(0, column_size)[0...reduce_dimensions_to])}
  48 + column_size.times {|i| v.set_row(i, v_array.slice!(0, column_size)[0...(reduce_dimensions_to || column_size)])}
49 49
50 50 # diagonalise W array as a matrix
51 51 if reduce_dimensions_to
BIN  pkg/ruby-svd-0.4.5.gem
Binary file not shown

0 comments on commit d58cc3e

Please sign in to comment.
Something went wrong with that request. Please try again.