   (:use [clojure.contrib.seq-utils :only (indexed)])
   (:use [conexp.fca.contexts :only (objects attributes incidence)]))
 
-
-;(set! *warn-on-reflection* true)
+(set! *warn-on-reflection* true)
 
 ;;; Helpers to convert to and from BitSets
 

  attribute-count, incidence-matrix] of context with the obvious
  definitions."
  [context]
  (let [object-vector (vec (objects context))
	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 context))]
    [object-vector attribute-vector,
     object-count  attribute-count,
     incidence-matrix]))

(defmacro with-binary-context
  "For a given context defines object-vector, attribute-vector,

     ~@body))

(defn bitwise-object-derivation
  "Implements object derivation for BitSets."
  [incidence-matrix, object-count, attribute-count, ^BitSet bitset]
  (let [^BitSet derived-attributes (BitSet. attribute-count)]
    (dotimes [att (int attribute-count)]
      (when (forall-in-bitset [obj bitset]
              (== 1 (deep-aget ints incidence-matrix obj att)))
        (.set derived-attributes att)))
    derived-attributes))

(defn bitwise-attribute-derivation
  "Implements attribute derivation for BitSets."
  [incidence-matrix, object-count, attribute-count, ^BitSet bitset]
  (let [^BitSet derived-objects (BitSet. object-count)]
    (dotimes [obj (int object-count)]
      (when (forall-in-bitset [att bitset]
              (== 1 (deep-aget ints incidence-matrix obj att)))
        (.set derived-objects obj)))
    derived-objects))

;;;

(set! *warn-on-reflection* false)

;;;

nil
