Skip to content

Commit

Permalink
Merge branch 'master' of github.com:willcannings/Ruby-SVD
Browse files Browse the repository at this point in the history
  • Loading branch information
willcannings committed Sep 30, 2010
2 parents 9a535ad + d58cc3e commit 35031cc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ Makefile
*.so
*.bundle
.DS_Store

pkg/*
4 changes: 2 additions & 2 deletions lib/svd_matrix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ def decompose(reduce_dimensions_to = nil)

# recompose U matrix
u = SVDMatrix.new(row_size, reduce_dimensions_to || column_size)
row_size.times {|i| u.set_row(i, u_array.slice!(0, column_size)[0...reduce_dimensions_to])}
row_size.times {|i| u.set_row(i, u_array.slice!(0, column_size)[0...(reduce_dimensions_to || column_size)])}

# recompose V matrix
v = SVDMatrix.new(column_size, reduce_dimensions_to || column_size)
column_size.times {|i| v.set_row(i, v_array.slice!(0, column_size)[0...reduce_dimensions_to])}
column_size.times {|i| v.set_row(i, v_array.slice!(0, column_size)[0...(reduce_dimensions_to || column_size)])}

# diagonalise W array as a matrix
if reduce_dimensions_to
Expand Down
Binary file modified pkg/ruby-svd-0.4.5.gem
Binary file not shown.

0 comments on commit 35031cc

Please sign in to comment.