CogComp / lbjava

Learning Based Java (LBJava)
http://cogcomp.cs.illinois.edu/page/software_view/LBJava
Other
13 stars 17 forks source link

Why sort inside vectors #66

Closed danyaljj closed 8 years ago

danyaljj commented 8 years ago

Why all these sort functions inside? I don't understand the logic ...: https://github.com/IllinoisCogComp/lbjava/blob/master/lbjava/src/main/java/edu/illinois/cs/cogcomp/lbjava/util/DVector.java#L189-L192 https://github.com/IllinoisCogComp/lbjava/blob/master/lbjava/src/main/java/edu/illinois/cs/cogcomp/lbjava/util/DVector2D.java#L236-L238 https://github.com/IllinoisCogComp/lbjava/blob/master/lbjava/src/main/java/edu/illinois/cs/cogcomp/lbjava/util/FVector.java#L197-L200 https://github.com/IllinoisCogComp/lbjava/blob/master/lbjava/src/main/java/edu/illinois/cs/cogcomp/lbjava/util/OVector.java#L201-L203

christos-c commented 8 years ago

The reason is stated below in the binarySearch method:

This vector must be sorted (as by the sort() method) prior to making this call.

danyaljj commented 8 years ago

FYI @cowchipkid