Commit c6fa7363 authored by Liam Healy's avatar Liam Healy

Fix definition of #'euclidean-norm and defmfun :component-float-type

The function #'euclidean-norm (gsl_blas_*_nrm2) takes one vector
argument, not two, and returns the result as a return from the
function.  Handling of return declaration :component-float-type for a
method created with defmfun was wrong, because #'component-type alread
returns the C type and does not need to be converted with #'cl-ffa.
parent 134132bc
;; Macro for defining GSL functions.
;; Liam Healy 2008-04-16 20:49:50EDT defmfun.lisp
;; Time-stamp: <2008-08-31 10:46:03EDT defmfun.lisp>
;; Time-stamp: <2008-08-31 15:12:33EDT defmfun.lisp>
;; $Id$
(in-package :gsl)
......@@ -261,7 +261,7 @@
(when (eq c-return :element-c-type)
(setf (getf key-args :c-return) (cl-ffa eltype)))
(when (eq c-return :component-float-type)
(setf (getf key-args :c-return) (cl-ffa (component-type eltype))))
(setf (getf key-args :c-return) (component-type eltype)))
(if (and (llkp arglist) (listp (first gsl-name))) ; ad-hoc detection!
;; The methods have optional argument(s) and
;; multiple GSL functions for presence/absence of
;; BLAS level 1, Vector operations
;; Liam Healy, Wed Apr 26 2006 - 15:23
;; Time-stamp: <2008-08-23 14:34:44EDT blas1.lisp>
;; Time-stamp: <2008-08-31 15:12:31EDT blas1.lisp>
;; $Id$
(in-package :gsl)
......@@ -35,13 +35,13 @@
:documentation ; FDL
"The complex conjugate scalar product x^H y for the vectors.")
(defmfun euclidean-norm ((vec1 vector) (vec2 vector))
(defmfun euclidean-norm ((vec vector))
("gsl_blas_" :component-float-type :type "nrm2")
(((mpointer vec1) :pointer) ((mpointer vec2) :pointer)
(result :component-float-type))
(((mpointer vec) :pointer))
:definition :generic
:element-types :float-complex
:inputs (vec1 vec2)
:inputs (vec)
:c-return :component-float-type
:documentation ; FDL
"The Euclidean norm ||x||_2 = \sqrt {\sum x_i^2} of the vector x.")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment