es.yrbcn.graph.triangles
Class BitbasedTrianglesAlgorithm

java.lang.Object
  extended by es.yrbcn.graph.triangles.TrianglesAlgorithm
      extended by es.yrbcn.graph.triangles.BitbasedTrianglesAlgorithm
Direct Known Subclasses:
MainmemBitbasedTrianglesAlgorithm, MainmemlongBitbasedTrianglesAlgorithm

public class BitbasedTrianglesAlgorithm
extends TrianglesAlgorithm


Field Summary
static int BUFFER_SIZE
           
 int currentPass
           
static int DEFAULT_MAX_PASSES
           
 
Fields inherited from class es.yrbcn.graph.triangles.TrianglesAlgorithm
DEFAULT_WIDTH, done, graph, maxDistance, numNodes, random, triangles
 
Constructor Summary
BitbasedTrianglesAlgorithm(ImmutableGraph graph, int seed, short maxDistance)
           
 
Method Summary
 void countTriangles()
           
 void destroyHashFunction()
           
 int getHash(int nodeid)
           
 void init()
          Initializes one run of the algorithm
 void initHashFunction(int pass)
          Uses a lookup table for the hash function number x
 void setMaxPasses(int mp)
           
 void step()
          Does one step of the algorithm; this is called until done()
 
Methods inherited from class es.yrbcn.graph.triangles.TrianglesAlgorithm
done
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAX_PASSES

public static final int DEFAULT_MAX_PASSES
See Also:
Constant Field Values

BUFFER_SIZE

public static final int BUFFER_SIZE
See Also:
Constant Field Values

currentPass

public int currentPass
Constructor Detail

BitbasedTrianglesAlgorithm

public BitbasedTrianglesAlgorithm(ImmutableGraph graph,
                                  int seed,
                                  short maxDistance)
Method Detail

destroyHashFunction

public void destroyHashFunction()

init

public void init()
Description copied from class: TrianglesAlgorithm
Initializes one run of the algorithm

Specified by:
init in class TrianglesAlgorithm

step

public void step()
          throws IOException
Description copied from class: TrianglesAlgorithm
Does one step of the algorithm; this is called until done()

Specified by:
step in class TrianglesAlgorithm
Throws:
FileNotFoundException
IOException

countTriangles

public void countTriangles()
                    throws IOException
Specified by:
countTriangles in class TrianglesAlgorithm
Throws:
IOException

getHash

public int getHash(int nodeid)

initHashFunction

public void initHashFunction(int pass)
Uses a lookup table for the hash function number x


setMaxPasses

public void setMaxPasses(int mp)