Allow innerJoining VertexPartitions with different indexes

This commit is contained in:
Ankur Dave 2013-12-13 21:56:08 -08:00
parent 7a8952e9bb
commit b40824bc2b

View file

@ -174,6 +174,10 @@ class VertexPartition[@specialized(Long, Int, Double) VD: ClassManifest](
/** Inner join another VertexPartition. */
def innerJoin[U: ClassManifest, VD2: ClassManifest](other: VertexPartition[U])
(f: (Vid, VD, U) => VD2): VertexPartition[VD2] = {
if (index != other.index) {
logWarning("Joining two VertexPartitions with different indexes is slow.")
innerJoin(createUsingIndex(other.iterator))(f)
}
val newMask = mask & other.mask
val newValues = new Array[VD2](capacity)
var i = newMask.nextSetBit(0)