Skip to content

Commit

Permalink
pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sbeamer committed Aug 18, 2015
1 parent 5428a4f commit 961e9de
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions pr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,28 @@
#include "graph.h"
#include "pvector.h"

using namespace std;

/*
GAP Benchmark Suite
Kernel: PageRank (PR)
Author: Scott Beamer
Will return pagerank scores for all vertices once total change < epsilon
This PR implementation uses the traditional iterative approach. This is done
to ease comparisons to other implementations (often use same algorithm), but
it is not necesarily the fastest way to implement it. It does perform the
updates in the pull direction to remove the need for atomics.
*/


using namespace std;

typedef float ScoreT;
const float kDamp = 0.85;

pvector<ScoreT> PageRankPull(const Graph &g, int max_iters, double epsilon=0) {
pvector<ScoreT> PageRankPull(const Graph &g, int max_iters,
double epsilon = 0) {
const ScoreT init_score = 1.0f / g.num_nodes();
const ScoreT base_score = (1.0f - kDamp) / g.num_nodes();
pvector<ScoreT> scores(g.num_nodes(), init_score);
Expand Down

0 comments on commit 961e9de

Please sign in to comment.