test_class.declarator: g
test_class.modifier: private static
test_class.original_string: private static SimpleGraph      g;
test_class.type: SimpleGraph
test_class.var_name: g
test_class.declarator: basis
test_class.modifier: private static
test_class.original_string: private static SimpleCycleBasis basis;
test_class.type: SimpleCycleBasis
test_class.var_name: basis
test_class.file: legacy/src/test/java/org/openscience/cdk/ringsearch/cyclebasis/SimpleCycleBasisTest.java
test_class.identifier: SimpleCycleBasisTest
test_class.superclass: extends CDKTestCase
test_case.body: @Test
      public void testEssentialCycles() {
          Assert.assertEquals(2, basis.essentialCycles().size());
      }
test_case.class_method_signature: SimpleCycleBasisTest.testEssentialCycles()
test_case.full_signature: @Test public void testEssentialCycles()
test_case.identifier: testEssentialCycles
test_case.invocations: assertEquals size essentialCycles
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testEssentialCycles()
focal_class.declarator: edgeList
focal_class.modifier: private
focal_class.original_string: private List              edgeList;
focal_class.type: List
focal_class.var_name: edgeList
focal_class.declarator: cycles
focal_class.modifier: private
focal_class.original_string: private List<SimpleCycle> cycles;
focal_class.type: List<SimpleCycle>
focal_class.var_name: cycles
focal_class.declarator: graph
focal_class.modifier: private
focal_class.original_string: private UndirectedGraph   graph;
focal_class.type: UndirectedGraph
focal_class.var_name: graph
focal_class.declarator: isMinimized = false
focal_class.modifier: private
focal_class.original_string: private boolean           isMinimized = false;
focal_class.type: boolean
focal_class.var_name: isMinimized
focal_class.declarator: edgeIndexMap
focal_class.modifier: private
focal_class.original_string: private HashMap           edgeIndexMap;
focal_class.type: HashMap
focal_class.var_name: edgeIndexMap
focal_class.file: legacy/src/main/java/org/openscience/cdk/ringsearch/cyclebasis/SimpleCycleBasis.java
focal_class.identifier: SimpleCycleBasis
focal_class.class_method_signature: SimpleCycleBasis.SimpleCycleBasis(List<SimpleCycle> cycles, List edgeList, UndirectedGraph graph)
focal_class.full_signature: public  SimpleCycleBasis(List<SimpleCycle> cycles, List edgeList, UndirectedGraph graph)
focal_class.identifier: SimpleCycleBasis
focal_class.modifiers: public
focal_class.parameters: (List<SimpleCycle> cycles, List edgeList, UndirectedGraph graph)
focal_class.signature:  SimpleCycleBasis(List<SimpleCycle> cycles, List edgeList, UndirectedGraph graph)
focal_class.class_method_signature: SimpleCycleBasis.SimpleCycleBasis(UndirectedGraph graph)
focal_class.full_signature: public  SimpleCycleBasis(UndirectedGraph graph)
focal_class.identifier: SimpleCycleBasis
focal_class.modifiers: public
focal_class.parameters: (UndirectedGraph graph)
focal_class.signature:  SimpleCycleBasis(UndirectedGraph graph)
focal_class.class_method_signature: SimpleCycleBasis.createMinimumCycleBasis()
focal_class.full_signature: private void createMinimumCycleBasis()
focal_class.identifier: createMinimumCycleBasis
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void createMinimumCycleBasis()
focal_class.class_method_signature: SimpleCycleBasis.getCycleEdgeIncidenceMatrix()
focal_class.full_signature:  boolean[][] getCycleEdgeIncidenceMatrix()
focal_class.identifier: getCycleEdgeIncidenceMatrix
focal_class.parameters: ()
focal_class.return: boolean[][]
focal_class.signature: boolean[][] getCycleEdgeIncidenceMatrix()
focal_class.class_method_signature: SimpleCycleBasis.getCycleEdgeIncidenceMatrix(Object[] cycleArray)
focal_class.full_signature:  boolean[][] getCycleEdgeIncidenceMatrix(Object[] cycleArray)
focal_class.identifier: getCycleEdgeIncidenceMatrix
focal_class.parameters: (Object[] cycleArray)
focal_class.return: boolean[][]
focal_class.signature: boolean[][] getCycleEdgeIncidenceMatrix(Object[] cycleArray)
focal_class.class_method_signature: SimpleCycleBasis.minimize(int startIndex)
focal_class.full_signature: private void minimize(int startIndex)
focal_class.identifier: minimize
focal_class.modifiers: private
focal_class.parameters: (int startIndex)
focal_class.return: void
focal_class.signature: void minimize(int startIndex)
focal_class.class_method_signature: SimpleCycleBasis.constructKernelVector(int size, boolean[][] a, int i)
focal_class.full_signature: static boolean[] constructKernelVector(int size, boolean[][] a, int i)
focal_class.identifier: constructKernelVector
focal_class.modifiers: static
focal_class.parameters: (int size, boolean[][] a, int i)
focal_class.return: boolean[]
focal_class.signature: boolean[] constructKernelVector(int size, boolean[][] a, int i)
focal_class.class_method_signature: SimpleCycleBasis.weightVector()
focal_class.full_signature: public int[] weightVector()
focal_class.identifier: weightVector
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int[]
focal_class.signature: int[] weightVector()
focal_class.class_method_signature: SimpleCycleBasis.edges()
focal_class.full_signature: public List edges()
focal_class.identifier: edges
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List
focal_class.signature: List edges()
focal_class.class_method_signature: SimpleCycleBasis.cycles()
focal_class.full_signature: public List cycles()
focal_class.identifier: cycles
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List
focal_class.signature: List cycles()
focal_class.class_method_signature: SimpleCycleBasis.inverseBinaryMatrix(boolean[][] m, int n)
focal_class.full_signature: static boolean[][] inverseBinaryMatrix(boolean[][] m, int n)
focal_class.identifier: inverseBinaryMatrix
focal_class.modifiers: static
focal_class.parameters: (boolean[][] m, int n)
focal_class.return: boolean[][]
focal_class.signature: boolean[][] inverseBinaryMatrix(boolean[][] m, int n)
focal_class.class_method_signature: SimpleCycleBasis.essentialCycles()
focal_class.full_signature: public Collection essentialCycles()
focal_class.identifier: essentialCycles
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Collection
focal_class.signature: Collection essentialCycles()
focal_class.class_method_signature: SimpleCycleBasis.relevantCycles()
focal_class.full_signature: public Map relevantCycles()
focal_class.identifier: relevantCycles
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Map
focal_class.signature: Map relevantCycles()
focal_class.class_method_signature: SimpleCycleBasis.equivalenceClasses()
focal_class.full_signature: public List equivalenceClasses()
focal_class.identifier: equivalenceClasses
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List
focal_class.signature: List equivalenceClasses()
focal_class.class_method_signature: SimpleCycleBasis.createEdgeIndexMap(List edgeList)
focal_class.full_signature: private HashMap createEdgeIndexMap(List edgeList)
focal_class.identifier: createEdgeIndexMap
focal_class.modifiers: private
focal_class.parameters: (List edgeList)
focal_class.return: HashMap
focal_class.signature: HashMap createEdgeIndexMap(List edgeList)
focal_class.class_method_signature: SimpleCycleBasis.getEdgeIndex(Edge edge)
focal_class.full_signature: private int getEdgeIndex(Edge edge)
focal_class.identifier: getEdgeIndex
focal_class.modifiers: private
focal_class.parameters: (Edge edge)
focal_class.return: int
focal_class.signature: int getEdgeIndex(Edge edge)
focal_class.class_method_signature: SimpleCycleBasis.printIncidenceMatrix()
focal_class.full_signature: public void printIncidenceMatrix()
focal_class.identifier: printIncidenceMatrix
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void printIncidenceMatrix()
focal_method.body: public Collection essentialCycles() {
          Collection result = new HashSet();
  
          boolean[][] a = getCycleEdgeIncidenceMatrix();
  
          boolean[][] ai = inverseBinaryMatrix(a, cycles.size());
  
          for (int i = 0; i < cycles.size(); i++) {
  
              // Construct kernel vector u
              boolean[] u = new boolean[edgeList.size()];
              for (int j = 0; j < cycles.size(); j++) {
                  u[j] = ai[j][i];
              }
  
              // Construct kernel vector u from a column of the inverse of a
              AuxiliaryGraph gu = new AuxiliaryGraph(graph, u);
  
              boolean isEssential = true;
  
              Iterator vertexIterator = graph.vertexSet().iterator();
              while (isEssential && vertexIterator.hasNext()) {
                  Object vertex = vertexIterator.next();
  
                  Collection incidentEdges = graph.edgesOf(vertex);
  
                  // check if the vertex is incident to an edge with u[edge] == 1
                  boolean shouldSearchCycle = false;
  
                  for (Iterator it = incidentEdges.iterator(); it.hasNext();) {
                      Edge edge = (Edge) it.next();
                      int index = getEdgeIndex(edge);
                      if (u[index]) {
                          shouldSearchCycle = true;
                          break;
                      }
                  }
  
                  if (shouldSearchCycle) {
  
                      Object auxVertex0 = gu.auxVertex0(vertex);
                      Object auxVertex1 = gu.auxVertex1(vertex);
  
                      // Search for shortest paths
                      for (Iterator minPaths = new MinimalPathIterator(gu, auxVertex0, auxVertex1); minPaths.hasNext();) {
                          List auxPath = (List) minPaths.next();
                          List edgesOfNewCycle = new ArrayList(auxPath.size());
  
                          for (Iterator it = auxPath.iterator(); it.hasNext();) {
                              Edge auxEdge = (Edge) it.next();
  
                              // Get the edge corresponding to the aux. edge
                              Edge e = (Edge) gu.edge(auxEdge);
  
                              if (edgesOfNewCycle.contains(e)) {
                                  edgesOfNewCycle.remove(e);
                              } else {
                                  edgesOfNewCycle.add(e);
                              }
  
                          }
  
                          SimpleCycle cycle = new SimpleCycle(graph, edgesOfNewCycle);
  
                          if (cycle.weight() > ((SimpleCycle) cycles.get(i)).weight()) {
                              break;
                          }
  
                          if (!cycle.equals((SimpleCycle) cycles.get(i))) {
                              isEssential = false;
                              break;
                          }
  
                      }
  
                  }
  
              }
  
              if (isEssential) {
                  result.add(cycles.get(i));
              }
  
          }
  
          return result;
      }
focal_method.class_method_signature: SimpleCycleBasis.essentialCycles()
focal_method.full_signature: public Collection essentialCycles()
focal_method.identifier: essentialCycles
focal_method.invocations: getCycleEdgeIncidenceMatrix inverseBinaryMatrix size size size size iterator vertexSet hasNext next edgesOf iterator hasNext next getEdgeIndex auxVertex0 auxVertex1 hasNext next size iterator hasNext next edge contains remove add weight weight get equals get add get
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: Collection
focal_method.signature: Collection essentialCycles()