Permalink
Browse files

[CLOSES #12] Correct spelling mistakes for 'adjacency'

  • Loading branch information...
adrw committed Apr 10, 2018
1 parent d877722 commit 18fc83142036c381f4c02fe33362431fa76b8853
@@ -50,7 +50,7 @@
private Type type;
private int nodeid;
private int distance;
private ArrayListOfIntsWritable adjacenyList;
private ArrayListOfIntsWritable adjacencyList;
public BfsNode() {}
@@ -70,12 +70,12 @@ public void setNodeId(int n) {
nodeid = n;
}
public ArrayListOfIntsWritable getAdjacenyList() {
return adjacenyList;
public ArrayListOfIntsWritable getAdjacencyList() {
return adjacencyList;
}
public void setAdjacencyList(ArrayListOfIntsWritable l) {
adjacenyList = l;
adjacencyList = l;
}
public Type getType() {
@@ -107,8 +107,8 @@ public void readFields(DataInput in) throws IOException {
distance = in.readInt();
}
adjacenyList = new ArrayListOfIntsWritable();
adjacenyList.readFields(in);
adjacencyList = new ArrayListOfIntsWritable();
adjacencyList.readFields(in);
}
/**
@@ -131,13 +131,13 @@ public void write(DataOutput out) throws IOException {
out.writeInt(distance);
}
adjacenyList.write(out);
adjacencyList.write(out);
}
@Override
public String toString() {
return String.format("{%d %d %s}", nodeid, distance, (adjacenyList == null ? "[]"
: adjacenyList.toString(10)));
return String.format("{%d %d %s}", nodeid, distance, (adjacencyList == null ? "[]"
: adjacencyList.toString(10)));
}
/**
@@ -68,7 +68,7 @@ public void map(IntWritable nid, BfsNode node, Context context)
// Pass along node structure.
intermediateStructure.setNodeId(node.getNodeId());
intermediateStructure.setType(BfsNode.Type.Structure);
intermediateStructure.setAdjacencyList(node.getAdjacenyList());
intermediateStructure.setAdjacencyList(node.getAdjacencyList());
context.write(nid, intermediateStructure);
@@ -80,7 +80,7 @@ public void map(IntWritable nid, BfsNode node, Context context)
// Retain distance to self.
map.put(nid.get(), node.getDistance());
ArrayListOfInts adj = node.getAdjacenyList();
ArrayListOfInts adj = node.getAdjacencyList();
int dist = node.getDistance() + 1;
// Keep track of shortest distance to neighbors.
for (int i = 0; i < adj.size(); i++) {
@@ -130,7 +130,7 @@ public void reduce(IntWritable nid, Iterable<BfsNode> iterable, Context context)
if (n.getType() == BfsNode.Type.Structure) {
// This is the structure; update accordingly.
ArrayListOfIntsWritable list = n.getAdjacenyList();
ArrayListOfIntsWritable list = n.getAdjacencyList();
structureReceived++;
int arr[] = new int[list.size()];
@@ -51,7 +51,7 @@ private Type(byte v) {
private Type type;
private int nodeid;
private float pagerank;
private ArrayListOfIntsWritable adjacenyList;
private ArrayListOfIntsWritable adjacencyList;
public PageRankNode() {}
@@ -71,12 +71,12 @@ public void setNodeId(int n) {
this.nodeid = n;
}
public ArrayListOfIntsWritable getAdjacenyList() {
return adjacenyList;
public ArrayListOfIntsWritable getAdjacencyList() {
return adjacencyList;
}
public void setAdjacencyList(ArrayListOfIntsWritable list) {
this.adjacenyList = list;
this.adjacencyList = list;
}
public Type getType() {
@@ -108,8 +108,8 @@ public void readFields(DataInput in) throws IOException {
pagerank = in.readFloat();
}
adjacenyList = new ArrayListOfIntsWritable();
adjacenyList.readFields(in);
adjacencyList = new ArrayListOfIntsWritable();
adjacencyList.readFields(in);
}
/**
@@ -132,13 +132,13 @@ public void write(DataOutput out) throws IOException {
out.writeFloat(pagerank);
}
adjacenyList.write(out);
adjacencyList.write(out);
}
@Override
public String toString() {
return String.format("{%d %.4f %s}", nodeid, pagerank, (adjacenyList == null ? "[]"
: adjacenyList.toString(10)));
return String.format("{%d %.4f %s}", nodeid, pagerank, (adjacencyList == null ? "[]"
: adjacencyList.toString(10)));
}
/**
@@ -97,16 +97,16 @@ public void map(IntWritable nid, PageRankNode node, Context context)
// Pass along node structure.
intermediateStructure.setNodeId(node.getNodeId());
intermediateStructure.setType(PageRankNode.Type.Structure);
intermediateStructure.setAdjacencyList(node.getAdjacenyList());
intermediateStructure.setAdjacencyList(node.getAdjacencyList());
context.write(nid, intermediateStructure);
int massMessages = 0;
// Distribute PageRank mass to neighbors (along outgoing edges).
if (node.getAdjacenyList().size() > 0) {
if (node.getAdjacencyList().size() > 0) {
// Each neighbor gets an equal share of PageRank mass.
ArrayListOfIntsWritable list = node.getAdjacenyList();
ArrayListOfIntsWritable list = node.getAdjacencyList();
float mass = node.getPageRank() - (float) StrictMath.log(list.size());
context.getCounter(PageRank.edges).increment(list.size());
@@ -152,17 +152,17 @@ public void map(IntWritable nid, PageRankNode node, Context context)
// Pass along node structure.
intermediateStructure.setNodeId(node.getNodeId());
intermediateStructure.setType(PageRankNode.Type.Structure);
intermediateStructure.setAdjacencyList(node.getAdjacenyList());
intermediateStructure.setAdjacencyList(node.getAdjacencyList());
context.write(nid, intermediateStructure);
int massMessages = 0;
int massMessagesSaved = 0;
// Distribute PageRank mass to neighbors (along outgoing edges).
if (node.getAdjacenyList().size() > 0) {
if (node.getAdjacencyList().size() > 0) {
// Each neighbor gets an equal share of PageRank mass.
ArrayListOfIntsWritable list = node.getAdjacenyList();
ArrayListOfIntsWritable list = node.getAdjacencyList();
float mass = node.getPageRank() - (float) StrictMath.log(list.size());
context.getCounter(PageRank.edges).increment(list.size());
@@ -268,7 +268,7 @@ public void reduce(IntWritable nid, Iterable<PageRankNode> iterable, Context con
if (n.getType().equals(PageRankNode.Type.Structure)) {
// This is the structure; update accordingly.
ArrayListOfIntsWritable list = n.getAdjacenyList();
ArrayListOfIntsWritable list = n.getAdjacencyList();
structureReceived++;
node.setAdjacencyList(list);
@@ -101,9 +101,9 @@ public void map(IntWritable nid, PageRankNode node, Context context)
int massMessages = 0;
// Distribute PageRank mass to neighbors (along outgoing edges).
if (node.getAdjacenyList().size() > 0) {
if (node.getAdjacencyList().size() > 0) {
// Each neighbor gets an equal share of PageRank mass.
ArrayListOfIntsWritable list = node.getAdjacenyList();
ArrayListOfIntsWritable list = node.getAdjacencyList();
float mass = node.getPageRank() - (float) StrictMath.log(list.size());
// Iterate over neighbors.
@@ -135,9 +135,9 @@ public void map(IntWritable nid, PageRankNode node, Context context)
int massMessagesSaved = 0;
// Distribute PageRank mass to neighbors (along outgoing edges).
if (node.getAdjacenyList().size() > 0) {
if (node.getAdjacencyList().size() > 0) {
// Each neighbor gets an equal share of PageRank mass.
ArrayListOfIntsWritable list = node.getAdjacenyList();
ArrayListOfIntsWritable list = node.getAdjacencyList();
float mass = node.getPageRank() - (float) StrictMath.log(list.size());
// Iterate over neighbors.

0 comments on commit 18fc831

Please sign in to comment.