code: final void addAll(final Iterable<Cycle> cycles) {
          for (final Cycle cycle : cycles)
              add(cycle);
      }
  
      /**
       * Check if all the edges of the <i>cycle</i> are present in the current
       * <i>basis</i>.
       *
       * @param cycle an initial cycle
       * @return any edges of the basis are present
       */
      final boolean isSubsetOfBasis(final Cycle cycle) {
          final BitSet edgeVector = cycle.edgeVector();
          final int intersect = and(edgesOfBasis, edgeVector).cardinality();
          return intersect == cycle.length();
      }
  
      /**
       * Determine whether the <i>candidate</i> cycle is linearly
       * <i>independent</i> from the current basis.
       *
       * @param candidate a cycle not in currently in the basis
       * @return the candidate is independent
       */
      final boolean isIndependent(final Cycle candidate) {
  
          // simple checks for independence
          if (basis.isEmpty() || !isSubsetOfBasis(candidate)) return true;
  
          final BitMatrix matrix = BitMatrix.from(basis, candidate);
  
          // perform gaussian elimination
          matrix.eliminate();
  
          // if the last row (candidate) was eliminated it is not independent
          return !matrix.eliminated(basis.size());
      }
  
      /** and <i>s</i> and <i>t</i> without modifying <i>s</i> */
      private static final BitSet and(final BitSet s, final BitSet t) {
          final BitSet u = (BitSet) s.clone();
          u.and(t);
          return u;
      }
  }
docs: Add all cycles to the basis.
  
  @param cycles new members of the basis