Skip to content

Commit f6655e5

Browse files
committed
Go back to math.floor
This reverts commit 5900c22.
1 parent 5900c22 commit f6655e5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

graphx/src/main/scala/org/apache/spark/graphx/util/GraphGenerators.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,13 @@ object GraphGenerators {
114114
// Z ~ N(0, 1)
115115
var X: Double = maxVal
116116

117-
while (round(X) >= maxVal) {
117+
while (X >= maxVal) {
118118
val Z = rand.nextGaussian()
119119
X = math.exp(mu + sigma*Z)
120120
}
121-
round(X)
121+
math.floor(X).toInt
122122
}
123123

124-
private def round(x: Double): Int = math.round(x.toFloat)
125-
126124
/**
127125
* A random graph generator using the R-MAT model, proposed in
128126
* "R-MAT: A Recursive Model for Graph Mining" by Chakrabarti et al.

0 commit comments

Comments
 (0)