Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public VectorBasedSequentialSparseVector(Vector other) {
List<Double> nonZeros = new ArrayList<Double>();
for (VectorEntry e : other) {
double value = e.get();
if (value != 0d && value != Double.NaN) {
if (value != 0d && !Double.isNaN(value)) {
nonZeros.add(value);
}
}
Expand Down Expand Up @@ -93,7 +93,7 @@ private OrderedIntDoubleMapping copySortedRandomAccessSparseVector(Vector other)
// get nonZero values
for (VectorEntry vectorEntry : other) {
double value = vectorEntry.get();
if (value != 0d && value != Double.NaN) {
if (value != 0d && !Double.isNaN(value)) {
sortableEntries[elementIndex++] = new OrderedVectorElement(vectorEntry.index(), value);
}
}
Expand Down