         attribute-vector (vec (attributes context)),
         object-count     (count object-vector),
         attribute-count  (count attribute-vector),
-        incidence-matrix (to-binary-matrix object-vector attribute-vector (incidence-relation context))]
+        incidence-matrix (to-binary-matrix object-vector attribute-vector (incidence context))]
     [object-vector attribute-vector object-count attribute-count incidence-matrix]))
 
 (defmacro with-binary-context

(defn to-binary-matrix
  "Converts the incidence-relation to a binary matrix (in the sense of
  Java) filled with 1 and 0."
  [object-vector attribute-vector incidence-relation]
  (let [incidence-matrix (make-array Integer/TYPE (count object-vector) (count attribute-vector))]
    (dotimes [obj-idx (count object-vector)]
      (let [^ints row (aget ^objects incidence-matrix obj-idx)]
        (dotimes [att-idx (count attribute-vector)]
          (aset row att-idx
                (if (contains? incidence-relation [(nth object-vector obj-idx)
                                                   (nth attribute-vector att-idx)])
                  (int 1)
                  (int 0))))))
    incidence-matrix))

(ns conexp.contrib.algorithms.bitwise
  (:import [java.util BitSet])
  (:import [java.util.concurrent SynchronousQueue])
  (:use [conexp.fca.contexts :only (objects attributes incidence)]))


;;; Helpers to convert to and from BitSets
