[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

speed up for array ops



Hello out there!

Anyone have any ideas, declarations, etc.  that will speed up the likes of
this?  For a 256x256 element array, with complex values, this takes about 7
secs on my IIfx, MCL2.0.  For real elements (without the absolute value
function ***) it takes about 5 secs.  I have not had too much luck with
various declarations (specifing fixnum array elements and indices, speed 3,
safety 0) but then I don't know exactly what I am doing yet.  

(defmethod climits ((ara array))
  "Returns the maximum and minimum values of elements of an array."
  (let* ((asiz (array-total-size ara))
         (av (make-array asiz
	                 :displaced-to ara
	                 :element-type (array-element-type ara)))
         (amax (aref av 1))
         (amin (aref av 1)))
    (dotimes (i asiz)
      (setq amax (max amax (abs(aref av i))))  ;  ***
      (setq amin (min amin (abs(aref av i)))))    ; ***
    `((min ,amin)(max ,amax))))

P.S.  Anyone have  code for reading and writing such things (complex array
elements where the real and imaginary parts are either fixnums or real)  to
a file?

Thanks
-- Dave
David S. Bright                        bright@enh.nist.gov  
Microanalysis Research Group                                   
National Institute of Standards & Technology (NIST, formerly NBS)
Gaithersburg, MD 20899                                           
USA
301-975-3911