mikera/vectorz — pull request #62 by moygit (2014-08-04 07:42:08+00:00)
Title: Use arrays instead of HashMaps in sparse matrices.

Summary of changes:
- Switched sparse-matrix data structure to array of AVectors instead of HashMap of AVectors.
- Rearranged SparseRowMatrix.java and SparseColumnMatrix.java for future refactoring.
- Added unit tests for SparseRowMatrix.java and SparseColumnMatrix.java

Main performance improvements ("Multiply with dense matrix" is the line to look at):

1. original code; 1 run of original test/java/example/SparseMatrix.java with CSIZE changed to 200
Construct sparse matrix: 642ms
Normalise all rows: 63ms
Construct dense matrix: 2663ms
Dense element sum = 3200254.1444549807
Multiply with dense matrix: 77823ms
Result element sum = 3200239.622613527

2. new code; 1 run of original test/java/example/SparseMatrix.java with CSIZE changed to 200
Construct sparse matrix: 711ms
Normalise all rows: 54ms
Construct dense matrix: 157ms
Dense element sum = 3201564.9522423935
Multiply with dense matrix: 9420ms
Result element sum = 3201692.2413928537