Commit c3be4c44 authored by Liam M. Healy's avatar Liam M. Healy

Don't import grid:element-type, grid:foreign-array, and grid:matrix

Don't import grid:element-type, grid:foreign-array, and grid:matrix,
but rather refer to them with package prefix explicitly.
Superficially checked but requires more careful check.
parent 5fb9ef54
;; Functions for both vectors and matrices.
;; Liam Healy 2008-04-26 20:48:44EDT both.lisp
;; Time-stamp: <2011-01-10 18:17:02EST both.lisp>
;; Time-stamp: <2011-01-12 00:38:30EST both.lisp>
;;
;; Copyright 2008, 2009, 2010, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -35,7 +35,7 @@
:export nil
:documentation "Allocate memory for the GSL struct given a block pointer.")
(defmfun alloc-from-block ((object matrix) blockptr)
(defmfun alloc-from-block ((object grid:matrix) blockptr)
("gsl_" :category :type "_alloc_from_block")
((blockptr :pointer)
(0 sizet) ; offset
......@@ -113,7 +113,7 @@
`(cffi:foreign-funcall
,(actual-gsl-function-name
`("gsl_" :category :type ,(if value "_set" "_get"))
(if matrixp 'matrix 'vector)
(if matrixp 'grid:matrix 'vector)
element-type)
:pointer ,mpointer
sizet ,(first indices)
......@@ -192,7 +192,7 @@
:documentation ; FDL
"Add the scalar complex x to all the elements of array a.")
(defmethod elt+ ((x float) (a foreign-array))
(defmethod elt+ ((x float) (a grid:foreign-array))
(elt+ a x))
(defmfun elt- ((a both) (b both))
......@@ -207,7 +207,7 @@
"Subtract the elements of b from the elements of a.
The two must have the same dimensions.")
(defmethod elt- ((a foreign-array) (x float))
(defmethod elt- ((a grid:foreign-array) (x float))
(elt+ a (- x)))
(defmfun elt* ((a vector) (b vector))
......@@ -222,7 +222,7 @@
"Multiply the elements of a by the elements of b.
The two must have the same dimensions.")
(defmfun elt* ((a matrix) (b matrix))
(defmfun elt* ((a grid:matrix) (b grid:matrix))
("gsl_" :category :type "_mul_elements")
(((mpointer a) :pointer) ((mpointer b) :pointer))
:definition :methods
......@@ -243,7 +243,7 @@
"Divide the elements of a by the elements of b.
The two must have the same dimensions.")
(defmfun elt/ ((a matrix) (b matrix))
(defmfun elt/ ((a grid:matrix) (b grid:matrix))
("gsl_" :category :type "_div_elements")
(((mpointer a) :pointer) ((mpointer b) :pointer))
:definition :methods
......@@ -252,7 +252,7 @@
:outputs (a)
:return (a))
(defmethod elt/ ((a foreign-array) (x number))
(defmethod elt/ ((a grid:foreign-array) (x number))
(elt* a (/ x)))
(defmfun elt* ((a both) (x float))
......@@ -279,7 +279,7 @@
:documentation ; FDL
"Multiply the elements of a by the scalar complex factor x.")
(defmethod elt* ((x float) (a foreign-array))
(defmethod elt* ((x float) (a grid:foreign-array))
(elt* a x))
;;;;****************************************************************************
......@@ -329,7 +329,7 @@
"The index of the minimum value in a. When there are several
equal minimum elements, then the lowest index is returned.")
(defmfun min-index ((a matrix))
(defmfun min-index ((a grid:matrix))
("gsl_" :category :type "_min_index")
(((mpointer a) :pointer) (imin (:pointer sizet)) (jmin (:pointer sizet)))
:definition :methods
......@@ -348,7 +348,7 @@
"The index of the maximum value in a. When there are several
equal maximum elements, then the lowest index is returned.")
(defmfun max-index ((a matrix))
(defmfun max-index ((a grid:matrix))
("gsl_" :category :type "_max_index")
(((mpointer a) :pointer) (imin (:pointer sizet)) (jmin (:pointer sizet)))
:definition :methods
......@@ -369,7 +369,7 @@
returned. Returned indices are minimum, maximum; for matrices
imin, jmin, imax, jmax.")
(defmfun minmax-index ((a matrix))
(defmfun minmax-index ((a grid:matrix))
("gsl_" :category :type "_minmax_index")
(((mpointer a) :pointer)
(imin (:pointer sizet)) (jmin (:pointer sizet))
......
;; A grid:foreign-array with added metadata for GSL.
;; Liam Healy 2008-04-06 21:23:41EDT
;; Time-stamp: <2011-01-10 17:54:07EST foreign-array.lisp>
;; Time-stamp: <2011-01-12 00:34:42EST foreign-array.lisp>
;;
;; Copyright 2008, 2009, 2010, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -53,7 +53,7 @@
;; from the block to the vector/matrix; we must do that manually here
(cffi:foreign-slot-value
array-struct
(if (typep object 'matrix) 'gsl-matrix-c 'gsl-vector-c) 'data)
(if (typep object 'grid:matrix) 'gsl-matrix-c 'gsl-vector-c) 'data)
(grid:foreign-pointer object))
(tg:finalize object
(lambda ()
......@@ -82,20 +82,20 @@
(let* ((category
(case category-or-rank
((vector :vector 1) 'vector)
((matrix :matrix 2) 'matrix)
((matrix grid:matrix :matrix 2) 'grid:matrix)
(t (error "Unrecognized category ~a" category-or-rank))))
(cstruct
(case category
(vector 'gsl-vector-c)
(matrix 'gsl-matrix-c)))
(grid:matrix 'gsl-matrix-c)))
(fa
(grid:make-grid
(case category
(vector
`((foreign-array ,(cffi:foreign-slot-value mpointer cstruct 'size))
`((grid:foreign-array ,(cffi:foreign-slot-value mpointer cstruct 'size))
,element-type))
(matrix
`((foreign-array
(grid:matrix
`((grid:foreign-array
,(cffi:foreign-slot-value mpointer cstruct 'size0)
,(cffi:foreign-slot-value mpointer cstruct 'size1))
,element-type)))
......
;; Matrices
;; Liam Healy 2008-04-15 21:57:52EDT matrix.lisp
;; Time-stamp: <2011-01-10 18:17:17EST matrix.lisp>
;; Time-stamp: <2011-01-12 00:34:45EST matrix.lisp>
;;
;; Copyright 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -26,7 +26,7 @@
;;;; Mathematical
;;;;****************************************************************************
(defmfun set-identity ((matrix matrix))
(defmfun set-identity ((matrix grid:matrix))
("gsl_matrix" :type "_set_identity")
(((mpointer matrix) :pointer))
:definition :generic
......@@ -43,8 +43,7 @@
;;;; Copying rows and columns
;;;;****************************************************************************
(defmfun row
((matrix matrix) i
(defmfun row ((matrix grid:matrix) i
&optional (vector (grid:make-foreign-array element-type :dimensions (dim1 matrix))))
("gsl_matrix" :type "_get_row")
(((mpointer vector) :pointer) ((mpointer matrix) :pointer) (i sizet))
......@@ -57,7 +56,7 @@
into the vector. The length of the vector must be the
same as the length of the row.")
(defmfun (setf row) ((vector vector) (matrix matrix) i)
(defmfun (setf row) ((vector vector) (matrix grid:matrix) i)
("gsl_matrix" :type "_set_row")
(((mpointer matrix) :pointer) (i sizet) ((mpointer vector) :pointer))
:definition :generic
......@@ -68,8 +67,7 @@
"Copy the elements of the vector into the jth row of the matrix.
The length of the vector must be the same as the length of the row.")
(defmfun column
((matrix matrix) i
(defmfun column ((matrix grid:matrix) i
&optional (vector (grid:make-foreign-array element-type :dimensions (dim0 matrix))))
("gsl_matrix" :type "_get_col")
(((mpointer vector) :pointer) ((mpointer matrix) :pointer) (i sizet))
......@@ -82,7 +80,7 @@
into the vector. The length of the vector must be the
same as the length of the column.")
(defmfun (setf column) ((vector vector) (matrix matrix) i)
(defmfun (setf column) ((vector vector) (matrix grid:matrix) i)
("gsl_matrix" :type "_set_col")
(((mpointer matrix) :pointer) (i sizet) ((mpointer vector) :pointer))
:definition :generic
......@@ -97,7 +95,7 @@
;;;; Exchanging rows and columns
;;;;****************************************************************************
(defmfun swap-rows ((matrix matrix) i j)
(defmfun swap-rows ((matrix grid:matrix) i j)
("gsl_matrix" :type "_swap_rows")
(((mpointer matrix) :pointer) (i sizet) (j sizet))
:definition :generic
......@@ -107,7 +105,7 @@
:documentation ; FDL
"Exchange the ith and jth rows of the matrix in-place.")
(defmfun swap-columns ((matrix matrix) i j)
(defmfun swap-columns ((matrix grid:matrix) i j)
("gsl_matrix" :type "_swap_columns")
(((mpointer matrix) :pointer) (i sizet) (j sizet))
:definition :generic
......@@ -117,7 +115,7 @@
:documentation ; FDL
"Exchange the ith and jth columns of the matrix in-place.")
(defmfun swap-row-column ((matrix matrix) i j)
(defmfun swap-row-column ((matrix grid:matrix) i j)
("gsl_matrix" :type "_swap_rowcol")
(((mpointer matrix) :pointer) (i sizet) (j sizet))
:definition :generic
......@@ -129,7 +127,7 @@
matrix in-place. The matrix must be square for this operation to
be possible.")
(defmfun matrix-transpose* ((matrix matrix))
(defmfun matrix-transpose* ((matrix grid:matrix))
("gsl_matrix" :type "_transpose")
(((mpointer matrix) :pointer))
:definition :generic
......@@ -142,7 +140,7 @@
operation to be possible.")
(defmfun matrix-transpose
((source matrix)
((source grid:matrix)
&optional
(destination
(grid:make-foreign-array element-type :dimensions (reverse (grid:dimensions source)))))
......
;; Real generalized eigensystems
;; Liam Healy 2009-02-16 12:55:04EST real-generalized.lisp
;; Time-stamp: <2011-01-10 18:17:27EST generalized.lisp>
;; Time-stamp: <2011-01-12 00:08:22EST generalized.lisp>
;;
;; Copyright 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -56,8 +56,7 @@
n-by-n complex generalized hermitian-definite eigensystems. The
size of the workspace is O(5n).")
(defmfun eigenvalues-gensymm
((A matrix) (B matrix)
(defmfun eigenvalues-gensymm ((A grid:matrix) (B grid:matrix)
&optional
(eigenvalues (grid:make-foreign-array element-type :dimensions (dim0 A)))
(ws (eltcase complex (make-eigen-genherm (dim0 A))
......@@ -78,8 +77,7 @@
outlined above. On output, B contains its Cholesky decomposition and
A is destroyed.")
(defmfun eigenvalues-eigenvectors-gensymm
((A matrix) (B matrix)
(defmfun eigenvalues-eigenvectors-gensymm ((A grid:matrix) (B grid:matrix)
&optional
(eigenvalues (grid:make-foreign-array element-type :dimensions (dim0 A)))
(eigenvectors (grid:make-foreign-array element-type :dimensions (grid:dimensions A)))
......
;; Eigenvectors and eigenvalues
;; Liam Healy, Sun May 21 2006 - 19:52
;; Time-stamp: <2011-01-10 18:19:13EST symmetric-hermitian.lisp>
;; Time-stamp: <2011-01-12 00:09:43EST symmetric-hermitian.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -66,8 +66,7 @@
;;;; Eigenvalues and eigenvectors
;;;;****************************************************************************
(defmfun eigenvalues
((A matrix)
(defmfun eigenvalues ((A grid:matrix)
&optional
(eigenvalues (grid:make-foreign-array element-type :dimensions (dim0 A)))
(ws (eltcase complex (make-eigen-herm (dim0 A))
......@@ -91,8 +90,7 @@
referenced. The eigenvalues are stored in the vector eigenvalues and
are unordered.")
(defmfun eigenvalues-eigenvectors
((A matrix)
(defmfun eigenvalues-eigenvectors ((A grid:matrix)
&optional
(eigenvalues (grid:make-foreign-array element-type :dimensions (dim0 A)))
(eigenvectors (grid:make-foreign-array element-type :dimensions (grid:dimensions A)))
......@@ -126,7 +124,7 @@
;;;;****************************************************************************
(defmfun sort-eigenvalues-eigenvectors
((eigenvalues vector) (eigenvectors matrix) sort-type)
((eigenvalues vector) (eigenvectors grid:matrix) sort-type)
(double-float "gsl_eigen_symmv_sort"
complex-double-float "gsl_eigen_hermv_sort")
(((mpointer eigenvalues) :pointer) ((mpointer eigenvectors) :pointer)
......
;; Backward FFT
;; Sumant Oemrawsingh, Sat Oct 24 2009 - 12:55
;; Time-stamp: <2011-01-10 17:59:22EST backward.lisp>
;; Time-stamp: <2011-01-11 23:34:19EST backward.lisp>
;;
;; Copyright 2009, 2011 Sumant Oemrawsingh, Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -138,13 +138,13 @@
(remf pass-on-args :decimation-in-frequency)
(remf pass-on-args :non-radix-2)
(if (and (not non-radix-2) (power-of-2-p (floor (size vector) stride)))
(if (subtypep (element-type vector) 'real)
(if (subtypep (grid:element-type vector) 'real)
(apply 'backward-fourier-transform-halfcomplex-radix2
vector pass-on-args)
(if decimation-in-frequency
(apply 'backward-fourier-transform-dif-radix2 vector pass-on-args)
(apply 'backward-fourier-transform-radix2 vector pass-on-args)))
(if (subtypep (element-type vector) 'real)
(if (subtypep (grid:element-type vector) 'real)
(apply 'backward-fourier-transform-halfcomplex-nonradix2
vector pass-on-args)
(apply 'backward-fourier-transform-nonradix2 vector pass-on-args)))))
;; Example FFT: transform a pulse (using the "clean" fft interface)
;; Sumant Oemrawsingh, Sat Oct 31 2009 - 00:24
;; Time-stamp: <2010-09-04 08:44:35EDT example.lisp>
;; Time-stamp: <2011-01-11 23:32:17EST example.lisp>
;;
;; Copyright 2009 Sumant Oemrawsingh, Liam M. Healy
;; Copyright 2009, 2010, 2011 Sumant Oemrawsingh, Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -107,7 +107,7 @@
"The real vector consisting of the real part of the complex vector."
(let ((real-vector
(make-and-init-vector
(grid:component-float-type (element-type complex-vector))
(grid:component-float-type (grid:element-type complex-vector))
(size complex-vector)
:init-offset init-offset)))
(loop for i below (size complex-vector) by stride
......@@ -119,19 +119,20 @@
(defun copy-with-stride (vector &key (stride 1) init-offset)
"Copy a vector and initialize it."
(let ((vec
(make-and-init-vector (element-type vector)
(size vector)
:init-offset init-offset)))
(make-and-init-vector
(grid:element-type vector)
(size vector)
:init-offset init-offset)))
(loop for i below (size vector) by stride
do
(setf (grid:gref vec i) (grid:gref vector i)))
(setf (grid:gref vec i) (grid:gref vector i)))
vec))
(defun size-vector-scalar (vector &key (stride 1))
"Return the size of a vector while taking the stride into account."
(coerce (floor (size vector) stride)
(if (subtypep (element-type vector) 'complex)
(element-type vector)
(if (subtypep (grid:element-type vector) 'complex)
(grid:element-type vector)
'double-float)))
#+nil
......@@ -139,7 +140,7 @@
(elt/ vector (size-vector-scalar vector :stride stride)))
(defun vector/length (vector &key (stride 1))
(let ((element-type (element-type vector)))
(let ((element-type (grid:element-type vector)))
(loop with length = (size-vector-scalar vector :stride stride)
for i from 0 below (size vector) by stride
do
......
;; Inverse FFT
;; Sumant Oemrawsingh, Sat Oct 24 2009 - 12:55
;; Time-stamp: <2011-01-10 17:59:24EST inverse.lisp>
;; Time-stamp: <2011-01-11 23:34:17EST inverse.lisp>
;;
;; Copyright 2009, 2011 Sumant Oemrawsingh, Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -138,13 +138,13 @@
(remf pass-on-args :decimation-in-frequency)
(remf pass-on-args :non-radix-2)
(if (and (not non-radix-2) (power-of-2-p (floor (size vector) stride)))
(if (subtypep (element-type vector) 'real)
(if (subtypep (grid:element-type vector) 'real)
(apply 'inverse-fourier-transform-halfcomplex-radix2
vector pass-on-args)
(if decimation-in-frequency
(apply 'inverse-fourier-transform-dif-radix2 vector pass-on-args)
(apply 'inverse-fourier-transform-radix2 vector pass-on-args)))
(if (subtypep (element-type vector) 'real)
(if (subtypep (grid:element-type vector) 'real)
(apply 'inverse-fourier-transform-halfcomplex-nonradix2
vector pass-on-args)
(apply 'inverse-fourier-transform-nonradix2 vector pass-on-args)))))
;; Helpers for defining GSL functions on arrays
;; Liam Healy 2009-01-07 22:01:16EST defmfun-array.lisp
;; Time-stamp: <2010-07-12 12:28:57EDT defmfun-array.lisp>
;; Time-stamp: <2011-01-12 00:22:59EST defmfun-array.lisp>
;;
;; Copyright 2009 Liam M. Healy
;; Copyright 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -28,7 +28,7 @@
(defn name arglist gsl-name c-arguments categories key-args)
(setf categories
(remove-if-not
(lambda (c) (member c '(both matrix vector)))
(lambda (c) (member c '(both grid:matrix vector)))
categories))
(if (member 'both categories)
(progn
......@@ -45,12 +45,12 @@
(optional-args-to-switch-gsl-functions arglist gsl-name))
(copy-list key-args) 'vector)
(generate-methods
defn 'matrix
defn 'grid:matrix
name arglist gsl-name
(actual-array-c-type
'matrix c-arguments
'grid:matrix c-arguments
(optional-args-to-switch-gsl-functions arglist gsl-name))
(copy-list key-args) 'matrix)))
(copy-list key-args) 'grid:matrix)))
;; Generate forms for one category
(generate-methods
defn (first categories)
......@@ -149,7 +149,7 @@
base-name))))))))))
(defun actual-array-class (category element-type &optional replace-both)
"From the category ('vector, 'matrix, or 'both) and element type,
"From the category ('vector, 'grid:matrix, or 'both) and element type,
find the class name."
(case category
(:element-type (grid:number-class element-type))
......
;; Load GSL
;; Liam Healy Sat Mar 4 2006 - 18:53
;; Time-stamp: <2011-01-11 19:06:42EST init.lisp>
;; Time-stamp: <2011-01-12 00:35:16EST init.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009, 2010, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -21,10 +21,8 @@
(defpackage gsll
(:nicknames :gsl)
(:use :common-lisp :cffi)
(:import-from
:grid
#:element-type #:foreign-array #:matrix #:dim0 #:dim1 #:^ #:copy)
(:export #:element-type #:dim0 #:dim1 #:copy))
(:import-from :grid #:dim0 #:dim1 #:^ #:copy)
(:export #:dim0 #:dim1 #:copy))
;;; Where there is a symbol conflict, take the other one.
(shadow '#:row :antik-user) ; conflict with grid:row; they are equivalent
......
;; BLAS level 2, Matrix-vector operations
;; Liam Healy, Wed Apr 26 2006 - 21:08
;; Time-stamp: <2011-01-10 18:19:10EST blas2.lisp>
;; Time-stamp: <2011-01-12 00:42:10EST blas2.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -41,13 +41,13 @@
;;;;****************************************************************************
(defun matrix-product-dimensions (a b)
(if (typep b 'matrix)
(if (typep b 'grid:matrix)
(list (first (grid:dimensions a))
(second (grid:dimensions b)))
(first (grid:dimensions a))))
(defmfun matrix-product
((A matrix) (x vector)
((A grid:matrix) (x vector)
&optional
y
(alpha 1) (beta 1) (TransA :notrans) TransB
......@@ -74,7 +74,7 @@
parameter TransB.")
(defmfun matrix-product-triangular
((A matrix) (x vector)
((A grid:matrix) (x vector)
&optional (alpha 1) (uplo :upper) (TransA :notrans)
(diag :nonunit) (side :left))
("gsl_blas_" :type "trmv")
......@@ -106,7 +106,7 @@
are taken as unity and are not referenced.")
(defmfun inverse-matrix-product
((A matrix) (x vector)
((A grid:matrix) (x vector)
&optional (alpha 1) (uplo :upper) (TransA :notrans)
(diag :nonunit) (side :left))
("gsl_blas_" :type "trsv")
......@@ -137,7 +137,7 @@
matrix A are taken as unity and are not referenced.")
(defmfun matrix-product-symmetric
((A matrix) (x vector)
((A grid:matrix) (x vector)
&optional y
(alpha 1) (beta 1) (uplo :upper) (side :left)
&aux
......@@ -170,7 +170,7 @@
#+fsbv
(defmfun matrix-product-hermitian
((A matrix) (x vector)
((A grid:matrix) (x vector)
&optional
(y (grid:make-foreign-array element-type :dimensions (matrix-product-dimensions A x)
:initial-element 0))
......@@ -199,7 +199,7 @@
are used. The imaginary elements of the diagonal are automatically
set to zero.")
(defmfun rank-1-update (alpha (x vector) (y vector) (A matrix))
(defmfun rank-1-update (alpha (x vector) (y vector) (A grid:matrix))
("gsl_blas_" :type "ger" :suffix)
((alpha :element-c-type) ((mpointer x) :pointer)
((mpointer y) :pointer) ((mpointer A) :pointer))
......@@ -211,7 +211,7 @@
"The rank-1 update A = alpha x y^T + A of the matrix A.")
#+fsbv
(defmfun conjugate-rank-1-update (alpha (x vector) (y vector) (A matrix))
(defmfun conjugate-rank-1-update (alpha (x vector) (y vector) (A grid:matrix))
("gsl_blas_" :type "gerc")
((alpha :element-c-type) ((mpointer x) :pointer)
((mpointer y) :pointer) ((mpointer A) :pointer))
......@@ -223,7 +223,7 @@
"The conjugate rank-1 update A = alpha x y^H + A of the matrix A.")
(defmfun symmetric-rank-1-update
((x vector) (A matrix)
((x vector) (A grid:matrix)
&optional (alpha 1) (beta 1) (uplo :upper) (trans :notrans))
("gsl_blas_" :type "syr")
((uplo cblas-uplo) (alpha :element-c-type)
......@@ -249,7 +249,7 @@
#+fsbv
(defmfun hermitian-rank-1-update
((x vector) (A matrix)
((x vector) (A grid:matrix)
&optional (alpha 1) (beta 1) (uplo :upper) (trans :notrans))
("gsl_blas_" :type "her")
((uplo cblas-uplo) (alpha :element-c-type)
......@@ -276,7 +276,7 @@
elements of the diagonal are automatically set to zero.")
(defmfun symmetric-rank-2-update
((x vector) (y vector) (A matrix)
((x vector) (y vector) (A grid:matrix)
&optional (alpha 1) (beta 1) (uplo :upper) (trans :notrans))
("gsl_blas_" :type "syr2")
((uplo cblas-uplo) (alpha :element-c-type)
......@@ -303,7 +303,7 @@
#+fsbv
(defmfun hermitian-rank-2-update
((x vector) (y vector) (A matrix)
((x vector) (y vector) (A grid:matrix)
&optional (alpha 1) (beta 1) (uplo :upper) (trans :notrans))
("gsl_blas_" :type "her2")
((uplo cblas-uplo) (alpha :element-c-type)
......
;; BLAS level 3, Matrix-matrix operations
;; Liam Healy, Wed Apr 26 2006 - 21:08
;; Time-stamp: <2010-07-07 14:25:00EDT blas3.lisp>
;; Time-stamp: <2011-01-12 00:49:27EST blas3.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -34,7 +34,7 @@
;;;;****************************************************************************
(defmfun matrix-product
((A matrix) (B matrix)
((A grid:matrix) (B grid:matrix)
&optional
C
(alpha 1) (beta 1) (TransA :notrans) (TransB :notrans)
......@@ -53,7 +53,7 @@
:outputs (Carr))
(defmfun matrix-product-symmetric
((A matrix) (B matrix)
((A grid:matrix) (B grid:matrix)
&optional C (alpha 1) (beta 1) (uplo :upper) (side :left)
&aux
(Carr
......@@ -71,7 +71,7 @@
#+fsbv
(defmfun matrix-product-hermitian
((A matrix) (B matrix)
((A grid:matrix) (B grid:matrix)
&optional
(C (grid:make-foreign-array element-type :dimensions (matrix-product-dimensions A B)
:initial-element 0))
......@@ -88,7 +88,7 @@
:outputs (C))
(defmfun matrix-product-triangular
((A matrix) (B matrix)
((A grid:matrix) (B grid:matrix)
&optional (alpha 1) (uplo :upper) (TransA :notrans)
(diag :nonunit) (side :left))
("gsl_blas_" :type "trmm")
......@@ -101,7 +101,7 @@
:outputs (B))
(defmfun inverse-matrix-product
((A matrix) (B matrix)
((A grid:matrix) (B grid:matrix)
&optional (alpha 1) (uplo :upper) (TransA :notrans)
(diag :nonunit) (side :left))
;; This signals an error for complex arguments because you can't pass a
......@@ -116,7 +116,7 @@
:outputs (B))
(defmfun symmetric-rank-1-update
((A matrix) (C matrix)
((A grid:matrix) (C grid:matrix)
&optional (alpha 1) (beta 1) (uplo :upper) (trans :notrans))
("gsl_blas_" :type "syrk")
((uplo cblas-uplo) (trans cblas-transpose)
......@@ -129,7 +129,7 @@
#+fsbv
(defmfun hermitian-rank-1-update
((A matrix) (C matrix)
((A grid:matrix) (C grid:matrix)
&optional (alpha 1) (beta 1) (uplo :upper) (trans :notrans))
("gsl_blas_" :type "herk")
((uplo cblas-uplo) (trans cblas-transpose)
......@@ -141,7 +141,7 @@
:outputs (C))