Skip to content

Commit

Permalink
fix the corner case of maxmin
Browse files Browse the repository at this point in the history
  • Loading branch information
yinxusen committed Apr 10, 2014
1 parent 967d041 commit f7a3ca2
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ private class Aggregator(

override def max(): Vector = {
nnz.activeIterator.foreach {
case (id, 0.0) => currMax(id) = 0.0
case _ =>
case (id, count) =>
if ((count == 0.0) || ((count < totalCnt) && (currMax(id) < 0.0))) currMax(id) = 0.0
}
Vectors.fromBreeze(currMax)
}

override def min(): Vector = {
nnz.activeIterator.foreach {
case (id, 0.0) => currMin(id) = 0.0
case _ =>
case (id, count) =>
if ((count == 0.0) || ((count < totalCnt) && (currMin(id) > 0.0))) currMin(id) = 0.0
}
Vectors.fromBreeze(currMin)
}
Expand Down

0 comments on commit f7a3ca2

Please sign in to comment.