             [mikera.cljutils.error :refer :all])
   (:import [org.apache.commons.math3.complex Complex]))
 
-(declare real imag complex-array)
+(declare real imag complex-array complex complex? canonical-complex-array)
 
-;; The complex array class
+;; ==============================================================
+;;
+;; The ComplexArray class and protocol implementations
 ;;
 ;; Implemented as a wrapper of two numerical arrays representing the real and imaginary parts
 

     (seq [m]
       (map complex-array (m/slices (.real m)) (m/slices (.imag m)))))

(defn complex-array 
  ([real]
    (complex-array real 0.0))

	    (and (m/array? m) (m/numerical? m)) (mp/coerce-param m (mp/broadcast-like m 0.0)) 
	    :else (error "Unable to get imaginary part of object: " m))))

;; a canoncial object used to register the complex array implementation
(def canonical-complex-array
  (let [a (complex-array 0 1)] 
    (imp/register-implementation a)
    a))

