 ;;
 ;; The ComplexArray class and protocol implementations
 ;;
-;; Implemented as a wrapper of two numerical arrays representing the real and imaginary parts
+;; Implemented as a wrapper of two real-valued numerical arrays representing the real and imaginary parts
 
 (declare my-det)
 (deftype ComplexArray [real imag]

  (get-nd [m indexes]
    (c/complex (double (mp/get-nd (.real m) indexes))
               (double (mp/get-nd (.imag m) indexes))))

  mp/PIndexedSetting
  (set-1d [m row v]

  (toString [m]
    (str "#complex/complex-array [" (clojure.core.matrix.complex/real m) ", " (clojure.core.matrix.complex/imag m) "]"))

  mp/PReshaping
  (reshape [m shape]
    (ComplexArray. (mp/reshape real shape)
                   (mp/reshape imag shape)))
  
  Seqable
  (seq [m]
    (map complex-array (m/slices (.real m)) (m/slices (.imag m))))
