We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6fd5fb1 commit 5900c22Copy full SHA for 5900c22
graphx/src/main/scala/org/apache/spark/graphx/util/GraphGenerators.scala
@@ -114,13 +114,15 @@ object GraphGenerators {
114
// Z ~ N(0, 1)
115
var X: Double = maxVal
116
117
- while (X >= maxVal) {
+ while (round(X) >= maxVal) {
118
val Z = rand.nextGaussian()
119
X = math.exp(mu + sigma*Z)
120
}
121
- math.floor(X).toInt
+ round(X)
122
123
124
+ private def round(x: Double): Int = math.round(x.toFloat)
125
+
126
/**
127
* A random graph generator using the R-MAT model, proposed in
128
* "R-MAT: A Recursive Model for Graph Mining" by Chakrabarti et al.
0 commit comments