Alexandre
7/18/2015 7:32:00 AM
Le vendredi 17 juillet 2015 10:09:47 UTC+2, Alexandre Landi a écrit :
> Any idea of where the problem is?
Found it. Credits to Miroslav Urbanek from Charles University in Prague for the hint.
-(define-alien-routine ("ddot_" ddot) void
+(define-alien-routine ("ddot_" ddot) double
(defun dot (dx dy)
(unless (= (length dx) (length dy))
(error "Vectors length does not match"))
- (let ((n (length dx))
- (result 0.0d0))
- (sb-sys:with-pinned-objects (dx dy result)
+ (let ((n (length dx)))
+ (sb-sys:with-pinned-objects (dx dy)
The ddot routine is meant to return a double, not a void. And the result variable is useless. Things are so obvious *after* you realize them :-)