/** * True iff simplices are neighbors. * Two simplices are neighbors if they are the same dimension and they share * a facet. * @param simplex the other Simplex * @return true iff this Simplex is a neighbor of simplex */ public bool isNeighbor(Simplex simplex) { HashSet h = new HashSet(this); h.removeAll(simplex); return (this.size() == simplex.size()) && (h.size() == 1); }