Skip to content

Commit

Permalink
new interface
Browse files Browse the repository at this point in the history
  • Loading branch information
rezazadeh committed Aug 5, 2014
1 parent 654c4fb commit 502ce52
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -414,7 +414,7 @@ class RowMatrix(
require(colMags.size == this.numCols(),
"Number of magnitudes didn't match column dimension")

val sg = math.sqrt(gamma)
val sg = math.sqrt(gamma) // sqrt(gamma) used many times

val sims = rows.flatMap {
row =>
Expand All @@ -427,7 +427,8 @@ class RowMatrix(
case (_, 0.0) => // Skip explicit zero elements.
case (j, jVal) =>
if (Math.random < sg / colMags(j)) {
val contrib = ((i.toLong, j.toLong), (iVal * jVal) / (math.min(sg, colMags(i)) * math.min(sg, colMags(j))))
val contrib = ((i.toLong, j.toLong), (iVal * jVal) /
(math.min(sg, colMags(i)) * math.min(sg, colMags(j))))
buf += contrib
}
}
Expand Down

0 comments on commit 502ce52

Please sign in to comment.