vkostyukov / la4j

Linear Algebra for Java
http://la4j.org
Apache License 2.0
371 stars 109 forks source link

Fix vector creation with unordered maps #291

Closed bashok001 closed 5 years ago

bashok001 commented 6 years ago
CompressedVector stores the underlying data in a two arrays: A values array and a indices 
array. The values array matches the indices array, and they're both sorted by the indices 
array. To get a value at an index, the index is found in the indices array with a binary 
search and the respective value is obtained from the values array.

Since the lookup is done as indicated above, it is important that the values and indices are stored in sorted order for binary search to work properly.

Closes #290

vkostyukov commented 5 years ago

Thanks @bashok001! This looks good to me.