From: Tamas K Papp <tkpapp@gm...>  20100108 15:55:19

I have a simple array of a numerical type (float or integer), and I need to convert it to another type (eg with coerce). What's the fastest way to do this in SBCL? I tried (map '(simplearray doublefloat (*)) (lambda (x) (declare (type singlefloat x)) (coerce x 'doublefloat)) (the (simplearray singlefloat (*)) elements)))) but get various warnings with (declare (optimize speed)). For the above: ; note: doing float to pointer coercion (cost 13) to "<return value>" in the (lambda ...). For coercion to complex numbers, I get ; note: unable to ; optimize ; because: ; open coding coercion to (COMPLEX SINGLEFLOAT) not implemented. I need the following conversions (in (source target) pairs): (singlefloat doublefloat) (singlefloat (complex singlefloat)) (singlefloat (complex doublefloat)) (doublefloat singlefloat) (doublefloat (complex singlefloat)) (doublefloat (complex doublefloat)) ((complex singlefloat) (complex doublefloat)) ((complex doublefloat) (complex singlefloat)) ((signedbyte 32) singlefloat) ((signedbyte 32) doublefloat) ((signedbyte 32) (complex singlefloat)) ((signedbyte 32) (complex doublefloat)) I am happy to do convoluted things, the code is macrogenerated. Just don't know where to start. Thanks, Tamas 