Skip to content

Commit

Permalink
Fix scala style.
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Feb 12, 2016
1 parent d749f6d commit 2860025
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,9 @@ object PowerIterationClustering extends Logging {
Graph(vD, graph.edges)
.mapTriplets(
e => e.attr / math.max(e.srcAttr, MLUtils.EPSILON),
new TripletFields(/* useSrc */ true, /* useDst */ false, /* useEdge */ true))
new TripletFields(/* useSrc */ true,
/* useDst */ false,
/* useEdge */ true))
}

/**
Expand Down Expand Up @@ -293,7 +295,9 @@ object PowerIterationClustering extends Logging {
Graph(vD, gA.edges)
.mapTriplets(
e => e.attr / math.max(e.srcAttr, MLUtils.EPSILON),
new TripletFields(/* useSrc */ true, /* useDst */ false, /* useEdge */ true))
new TripletFields(/* useSrc */ true,
/* useDst */ false,
/* useEdge */ true))
}

/**
Expand Down Expand Up @@ -354,7 +358,9 @@ object PowerIterationClustering extends Logging {
val v = curG.aggregateMessages[Double](
sendMsg = ctx => ctx.sendToSrc(ctx.attr * ctx.dstAttr),
mergeMsg = _ + _,
new TripletFields(/* useSrc */ false, /* useDst */ true, /* useEdge */ true)).cache()
new TripletFields(/* useSrc */ false,
/* useDst */ true,
/* useEdge */ true)).cache()
// normalize v
val norm = v.values.map(math.abs).sum()
logInfo(s"$msgPrefix: norm(v) = $norm.")
Expand Down

0 comments on commit 2860025

Please sign in to comment.