Program: 9309
Project: 9309
Buggy source:
/** 
 * This function inductively adds all of the cofaces of the simplex tau to the complex. For more information about this algorithm, consult the paper "Fast Construction of the Vietoris-Rips Complex" by Afra Zomorodian.
 * @param G the neighborhood graph
 * @param k the maximum allowable dimension
 * @param tau the current simplex to add
 * @param N the lower neighbors to investigate
 * @param filtrationValue the filtration value of the current simplex, tau
 */
protected void addCofaces(UndirectedWeightedListGraph G,int k,Simplex tau,TIntHashSet N,double filtrationValue){
  Simplex newSimplex=null;
  if (this.indices != null) {
    newSimplex=HomologyUtility.convertIndices(tau,this.indices);
  }
 else {
    newSimplex=tau;
  }
  if (this.isMember(tau)) {
    this.storageStructure.addElement(newSimplex,this.converter.getFiltrationIndex(filtrationValue));
  }
  if (tau.getDimension() >= k) {
    return;
  }
  double weight=0;
  TIntIterator iterator=N.iterator();
  TIntHashSet M;
  while (iterator.hasNext()) {
    int v=iterator.next();
    Simplex sigma=new Simplex(HomologyUtility.appendToArray(tau.getVertices(),v));
    M=HomologyUtility.computeIntersection(N,G.getLowerNeighbors(v));
    if (sigma.getDimension() == 1) {
      int i=sigma.getVertices()[0];
      int j=sigma.getVertices()[1];
      weight=G.getWeight(i,j);
    }
 else     if (sigma.getDimension() > 1) {
      weight=filtrationValue;
      int[] tauVertices=tau.getVertices();
      for (      int tauVertex : tauVertices) {
        weight=this.converter.computeInducedFiltrationValue(weight,G.getWeight(tauVertex,v));
      }
    }
    this.addCofaces(G,k,sigma,M,weight);
  }
}

Fixed version (ground truth):
/** 
 * This function inductively adds all of the cofaces of the simplex tau to the complex. For more information about this algorithm, consult the paper "Fast Construction of the Vietoris-Rips Complex" by Afra Zomorodian.
 * @param G the neighborhood graph
 * @param k the maximum allowable dimension
 * @param tau the current simplex to add
 * @param N the lower neighbors to investigate
 * @param filtrationValue the filtration value of the current simplex, tau
 */
protected void addCofaces(UndirectedWeightedListGraph G,int k,Simplex tau,ArrayList<Integer> lower_vertices,int filtrationIndex){
  Simplex newSimplex=null;
  if (this.indices != null) {
    newSimplex=HomologyUtility.convertIndices(tau,this.indices);
  }
 else {
    newSimplex=tau;
  }
  BooleanDoublePair member=this.isMember(tau);
  if (member.getFirst()) {
    filtrationIndex=Math.max(filtrationIndex,this.converter.getFiltrationIndex(member.getSecond()));
    this.storageStructure.addElement(newSimplex,filtrationIndex);
  }
  if (tau.getDimension() >= k) {
    return;
  }
  if (lower_vertices.size() == 0)   return;
  ArrayList<Integer> new_lower_vertices=new ArrayList<Integer>(lower_vertices.size() - 1);
  for (  int v : lower_vertices) {
    Simplex sigma=new Simplex(HomologyUtility.appendToArray(tau.getVertices(),v));
    if (this.indices != null) {
      newSimplex=HomologyUtility.convertIndices(sigma,this.indices);
    }
 else {
      newSimplex=sigma;
    }
    int newFiltrationIndex=filtrationIndex;
    for (    Simplex ds : newSimplex.getBoundaryArray()) {
      if (this.storageStructure.containsElement(ds)) {
        newFiltrationIndex=Math.max(newFiltrationIndex,this.storageStructure.getFiltrationIndex(ds));
      }
 else {
        continue;
      }
    }
    this.addCofaces(G,k,sigma,new_lower_vertices,newFiltrationIndex);
    new_lower_vertices.add(v);
  }
}