Commit 0701df89 authored by Liam M. Healy's avatar Liam M. Healy

Explicit package reference to grid:dimensions

Explicit package reference to grid:dimensions but there's an error
because if the symbol isn't imported many more tests fail.
parent 9fc8126d
;; Functions for both vectors and matrices. ;; Functions for both vectors and matrices.
;; Liam Healy 2008-04-26 20:48:44EDT both.lisp ;; Liam Healy 2008-04-26 20:48:44EDT both.lisp
;; Time-stamp: <2010-11-25 09:31:17EST both.lisp> ;; Time-stamp: <2011-01-10 18:17:02EST both.lisp>
;; ;;
;; Copyright 2008, 2009, 2010 Liam M. Healy ;; Copyright 2008, 2009, 2010, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
;; ;;
;; This program is free software: you can redistribute it and/or modify ;; This program is free software: you can redistribute it and/or modify
...@@ -39,9 +39,9 @@ ...@@ -39,9 +39,9 @@
("gsl_" :category :type "_alloc_from_block") ("gsl_" :category :type "_alloc_from_block")
((blockptr :pointer) ((blockptr :pointer)
(0 sizet) ; offset (0 sizet) ; offset
((first (dimensions object)) sizet) ; number of rows ((first (grid:dimensions object)) sizet) ; number of rows
((second (dimensions object)) sizet) ; number of columns ((second (grid:dimensions object)) sizet) ; number of columns
((second (dimensions object)) sizet)) ; "tda" = number of columns for now ((second (grid:dimensions object)) sizet)) ; "tda" = number of columns for now
:definition :methods :definition :methods
:c-return :pointer :c-return :pointer
:export nil) :export nil)
......
;; Combinations ;; Combinations
;; Liam Healy, Sun Mar 26 2006 - 11:51 ;; Liam Healy, Sun Mar 26 2006 - 11:51
;; Time-stamp: <2011-01-10 17:59:21EST combination.lisp> ;; Time-stamp: <2011-01-10 18:16:28EST combination.lisp>
;; ;;
;; Copyright 2006, 2007, 2008, 2009, 2010, 2011 Liam M. Healy ;; Copyright 2006, 2007, 2008, 2009, 2010, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
(make-instance (make-instance
'combination 'combination
:element-type '(unsigned-byte #+int64 64 #+int32 32) :element-type '(unsigned-byte #+int64 64 #+int32 32)
:range (combination-range n) :dimensions (dimensions k)) :range (combination-range n) :dimensions (grid:dimensions k))
(make-instance (make-instance
'combination 'combination
:element-type '(unsigned-byte #+int64 64 #+int32 32) :element-type '(unsigned-byte #+int64 64 #+int32 32)
......
;; Matrices ;; Matrices
;; Liam Healy 2008-04-15 21:57:52EDT matrix.lisp ;; Liam Healy 2008-04-15 21:57:52EDT matrix.lisp
;; Time-stamp: <2010-06-29 22:10:48EDT matrix.lisp> ;; Time-stamp: <2011-01-10 18:17:17EST matrix.lisp>
;; ;;
;; Copyright 2008, 2009 Liam M. Healy ;; Copyright 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
;; ;;
;; This program is free software: you can redistribute it and/or modify ;; This program is free software: you can redistribute it and/or modify
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
((source matrix) ((source matrix)
&optional &optional
(destination (destination
(grid:make-foreign-array element-type :dimensions (reverse (dimensions source))))) (grid:make-foreign-array element-type :dimensions (reverse (grid:dimensions source)))))
("gsl_matrix" :type "_transpose_memcpy") ("gsl_matrix" :type "_transpose_memcpy")
(((mpointer destination) :pointer) ((mpointer source) :pointer)) (((mpointer destination) :pointer) ((mpointer source) :pointer))
:definition :generic :definition :generic
......
;; Permutations ;; Permutations
;; Liam Healy, Sun Mar 26 2006 - 11:51 ;; Liam Healy, Sun Mar 26 2006 - 11:51
;; Time-stamp: <2011-01-10 17:59:22EST permutation.lisp> ;; Time-stamp: <2011-01-10 18:16:26EST permutation.lisp>
;; ;;
;; Copyright 2006, 2007, 2008, 2009, 2010, 2011 Liam M. Healy ;; Copyright 2006, 2007, 2008, 2009, 2010, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
(make-instance (make-instance
'permutation 'permutation
:element-type '(unsigned-byte #+int64 64 #+int32 32) :element-type '(unsigned-byte #+int64 64 #+int32 32)
:dimensions (if (typep n 'permutation) (dimensions n) (list n))))) :dimensions (if (typep n 'permutation) (grid:dimensions n) (list n)))))
(when initialize (when initialize
(if (typep n 'permutation) (if (typep n 'permutation)
(error "not available yet") ; (copy perm n) (error "not available yet") ; (copy perm n)
......
;; Real generalized eigensystems ;; Real generalized eigensystems
;; Liam Healy 2009-02-16 12:55:04EST real-generalized.lisp ;; Liam Healy 2009-02-16 12:55:04EST real-generalized.lisp
;; Time-stamp: <2010-06-29 22:15:24EDT generalized.lisp> ;; Time-stamp: <2011-01-10 18:17:27EST generalized.lisp>
;; ;;
;; Copyright 2009 Liam M. Healy ;; Copyright 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
;; ;;
;; This program is free software: you can redistribute it and/or modify ;; This program is free software: you can redistribute it and/or modify
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
((A matrix) (B matrix) ((A matrix) (B matrix)
&optional &optional
(eigenvalues (grid:make-foreign-array element-type :dimensions (dim0 A))) (eigenvalues (grid:make-foreign-array element-type :dimensions (dim0 A)))
(eigenvectors (grid:make-foreign-array element-type :dimensions (dimensions A))) (eigenvectors (grid:make-foreign-array element-type :dimensions (grid:dimensions A)))
(ws (eltcase complex (make-eigen-hermv (dim0 A)) (ws (eltcase complex (make-eigen-hermv (dim0 A))
t (make-eigen-symmv (dim0 A))))) t (make-eigen-symmv (dim0 A)))))
(double-float "gsl_eigen_gensymmv" (double-float "gsl_eigen_gensymmv"
......
;; Generalized eigensystems for nonsymmetric real matrices ;; Generalized eigensystems for nonsymmetric real matrices
;; Liam Healy 2009-02-16 14:27:20EST nonsymmetric-generalized.lisp ;; Liam Healy 2009-02-16 14:27:20EST nonsymmetric-generalized.lisp
;; Time-stamp: <2010-06-29 22:15:24EDT nonsymmetric-generalized.lisp> ;; Time-stamp: <2011-01-10 18:19:14EST nonsymmetric-generalized.lisp>
;; ;;
;; Copyright 2009 Liam M. Healy ;; Copyright 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
;; ;;
;; This program is free software: you can redistribute it and/or modify ;; This program is free software: you can redistribute it and/or modify
...@@ -63,11 +63,11 @@ ...@@ -63,11 +63,11 @@
(balance nil) ; unused by GSL (balance nil) ; unused by GSL
(Q (Q
(if (eql shur-vectors t) (if (eql shur-vectors t)
(grid:make-foreign-array 'double-float :dimensions (dimensions A)) (grid:make-foreign-array 'double-float :dimensions (grid:dimensions A))
shur-vectors)) shur-vectors))
(Z (Z
(if (eql shur-vectors t) (if (eql shur-vectors t)
(grid:make-foreign-array 'double-float :dimensions (dimensions A)) (grid:make-foreign-array 'double-float :dimensions (grid:dimensions A))
shur-vectors))) shur-vectors)))
("gsl_eigen_gen" "gsl_eigen_gen_QZ") ("gsl_eigen_gen" "gsl_eigen_gen_QZ")
((((mpointer A) :pointer) ((mpointer B) :pointer) ((((mpointer A) :pointer) ((mpointer B) :pointer)
...@@ -118,18 +118,18 @@ ...@@ -118,18 +118,18 @@
(beta (beta
(grid:make-foreign-array 'double-float :dimensions (dim0 A))) (grid:make-foreign-array 'double-float :dimensions (dim0 A)))
(eigenvectors (eigenvectors
(grid:make-foreign-array 'double-float :dimensions (dimensions A))) (grid:make-foreign-array 'double-float :dimensions (grid:dimensions A)))
(ws (make-eigen-genv (dim0 A))) (ws (make-eigen-genv (dim0 A)))
compute-shur-form-s compute-shur-form-t shur-vectors compute-shur-form-s compute-shur-form-t shur-vectors
&aux &aux
(balance nil) ; unused by GSL (balance nil) ; unused by GSL
(Q (Q
(if (eql shur-vectors t) (if (eql shur-vectors t)
(grid:make-foreign-array 'double-float :dimensions (dimensions A)) (grid:make-foreign-array 'double-float :dimensions (grid:dimensions A))
shur-vectors)) shur-vectors))
(Z (Z
(if (eql shur-vectors t) (if (eql shur-vectors t)
(grid:make-foreign-array 'double-float :dimensions (dimensions A)) (grid:make-foreign-array 'double-float :dimensions (grid:dimensions A))
shur-vectors))) shur-vectors)))
("gsl_eigen_genv" "gsl_eigen_genv_QZ") ("gsl_eigen_genv" "gsl_eigen_genv_QZ")
((((mpointer A) :pointer) ((mpointer B) :pointer) ((((mpointer A) :pointer) ((mpointer B) :pointer)
......
;; Eigensystems for nonsymmetric real matrices ;; Eigensystems for nonsymmetric real matrices
;; Liam Healy 2009-02-16 12:51:18EST nonsymmetric.lisp ;; Liam Healy 2009-02-16 12:51:18EST nonsymmetric.lisp
;; Time-stamp: <2010-06-29 22:15:24EDT nonsymmetric.lisp> ;; Time-stamp: <2011-01-10 18:19:13EST nonsymmetric.lisp>
;; ;;
;; Copyright 2009 Liam M. Healy ;; Copyright 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
;; ;;
;; This program is free software: you can redistribute it and/or modify ;; This program is free software: you can redistribute it and/or modify
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
&aux &aux
(sv (sv
(if (eql shur-vectors t) (if (eql shur-vectors t)
(grid:make-foreign-array 'double-float :dimensions (dimensions A)) (grid:make-foreign-array 'double-float :dimensions (grid:dimensions A))
shur-vectors))) shur-vectors)))
("gsl_eigen_nonsymm" "gsl_eigen_nonsymm_Z") ("gsl_eigen_nonsymm" "gsl_eigen_nonsymm_Z")
((((mpointer A) :pointer) ((((mpointer A) :pointer)
...@@ -119,13 +119,13 @@ ...@@ -119,13 +119,13 @@
(eigenvalues (eigenvalues
(grid:make-foreign-array '(complex double-float) :dimensions (dim0 A))) (grid:make-foreign-array '(complex double-float) :dimensions (dim0 A)))
(eigenvectors (eigenvectors
(grid:make-foreign-array '(complex double-float) :dimensions (dimensions A))) (grid:make-foreign-array '(complex double-float) :dimensions (grid:dimensions A)))
(ws (make-eigen-nonsymmv (dim0 A))) (ws (make-eigen-nonsymmv (dim0 A)))
shur-vectors shur-vectors
&aux &aux
(sv (sv
(if (eql shur-vectors t) (if (eql shur-vectors t)
(grid:make-foreign-array 'double-float :dimensions (dimensions A)) (grid:make-foreign-array 'double-float :dimensions (grid:dimensions A))
shur-vectors))) shur-vectors)))
("gsl_eigen_nonsymmv" "gsl_eigen_nonsymmv_Z") ("gsl_eigen_nonsymmv" "gsl_eigen_nonsymmv_Z")
((((mpointer A) :pointer) ((((mpointer A) :pointer)
......
;; Eigenvectors and eigenvalues ;; Eigenvectors and eigenvalues
;; Liam Healy, Sun May 21 2006 - 19:52 ;; Liam Healy, Sun May 21 2006 - 19:52
;; Time-stamp: <2010-07-07 14:25:01EDT symmetric-hermitian.lisp> ;; Time-stamp: <2011-01-10 18:19:13EST symmetric-hermitian.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 ;; Distributed under the terms of the GNU General Public License
;; ;;
;; This program is free software: you can redistribute it and/or modify ;; This program is free software: you can redistribute it and/or modify
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
((A matrix) ((A matrix)
&optional &optional
(eigenvalues (grid:make-foreign-array element-type :dimensions (dim0 A))) (eigenvalues (grid:make-foreign-array element-type :dimensions (dim0 A)))
(eigenvectors (grid:make-foreign-array element-type :dimensions (dimensions A))) (eigenvectors (grid:make-foreign-array element-type :dimensions (grid:dimensions A)))
(ws (eltcase complex (make-eigen-hermv (dim0 A)) (ws (eltcase complex (make-eigen-hermv (dim0 A))
t (make-eigen-symmv (dim0 A))))) t (make-eigen-symmv (dim0 A)))))
(double-float "gsl_eigen_symmv" (double-float "gsl_eigen_symmv"
......
;; Discrete Fourier Transforms ;; Discrete Fourier Transforms
;; Liam Healy 2009-11-07 14:24:07EST ;; Liam Healy 2009-11-07 14:24:07EST
;; Time-stamp: <2011-01-10 17:59:23EST discrete.lisp> ;; Time-stamp: <2011-01-10 18:16:24EST discrete.lisp>
;; ;;
;; Copyright 2009, 2011 Liam M. Healy ;; Copyright 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
(defmfun forward-discrete-fourier-transform (defmfun forward-discrete-fourier-transform
((vector vector) ((vector vector)
&key (stride 1) &key (stride 1)
(result (grid:make-foreign-array element-type :dimensions (dimensions vector)))) (result (grid:make-foreign-array element-type :dimensions (grid:dimensions vector))))
("gsl_dft" :type "_forward") ("gsl_dft" :type "_forward")
(((grid:foreign-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet) (((grid:foreign-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet)
((grid:foreign-pointer result) :pointer)) ((grid:foreign-pointer result) :pointer))
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
(defmfun backward-discrete-fourier-transform (defmfun backward-discrete-fourier-transform
((vector vector) ((vector vector)
&key (stride 1) &key (stride 1)
(result (grid:make-foreign-array element-type :dimensions (dimensions vector)))) (result (grid:make-foreign-array element-type :dimensions (grid:dimensions vector))))
("gsl_dft" :type "_backward") ("gsl_dft" :type "_backward")
(((grid:foreign-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet) (((grid:foreign-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet)
((grid:foreign-pointer result) :pointer)) ((grid:foreign-pointer result) :pointer))
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
(defmfun inverse-discrete-fourier-transform (defmfun inverse-discrete-fourier-transform
((vector vector) ((vector vector)
&key (stride 1) &key (stride 1)
(result (grid:make-foreign-array element-type :dimensions (dimensions vector)))) (result (grid:make-foreign-array element-type :dimensions (grid:dimensions vector))))
("gsl_dft" :type "_inverse") ("gsl_dft" :type "_inverse")
(((grid:foreign-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet) (((grid:foreign-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet)
((grid:foreign-pointer result) :pointer)) ((grid:foreign-pointer result) :pointer))
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
(defmfun discrete-fourier-transform (defmfun discrete-fourier-transform
((vector vector) ((vector vector)
&key (stride 1) &key (stride 1)
(result (grid:make-foreign-array element-type :dimensions (dimensions vector)))) (result (grid:make-foreign-array element-type :dimensions (grid:dimensions vector))))
("gsl_dft" :type "_transform") ("gsl_dft" :type "_transform")
(((grid:foreign-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet) (((grid:foreign-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet)
((grid:foreign-pointer result) :pointer)) ((grid:foreign-pointer result) :pointer))
......
;; Discrete Hankel Transforms. ;; Discrete Hankel Transforms.
;; Liam Healy, Sat Dec 8 2007 - 16:50 ;; Liam Healy, Sat Dec 8 2007 - 16:50
;; Time-stamp: <2011-01-10 17:59:25EST hankel.lisp> ;; Time-stamp: <2011-01-10 18:16:23EST hankel.lisp>
;; ;;
;; Copyright 2007, 2008, 2009, 2011 Liam M. Healy ;; Copyright 2007, 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
(defmfun apply-hankel (defmfun apply-hankel
(hankel array-in (hankel array-in
&optional &optional
(array-out (grid:make-foreign-array 'double-float :dimensions (dimensions array-in)))) (array-out (grid:make-foreign-array 'double-float :dimensions (grid:dimensions array-in))))
"gsl_dht_apply" "gsl_dht_apply"
(((mpointer hankel) :pointer) ((grid:foreign-pointer array-in) :pointer) (((mpointer hankel) :pointer) ((grid:foreign-pointer array-in) :pointer)
((grid:foreign-pointer array-out) :pointer)) ((grid:foreign-pointer array-out) :pointer))
......
;; Definitions for macro expansion ;; Definitions for macro expansion
;; Liam Healy 2009-03-15 14:50:28EDT callback-compile-defs.lisp ;; Liam Healy 2009-03-15 14:50:28EDT callback-compile-defs.lisp
;; Time-stamp: <2009-12-27 09:50:34EST callback-compile-defs.lisp> ;; Time-stamp: <2011-01-10 18:19:12EST callback-compile-defs.lisp>
;; ;;
;; Copyright 2009 Liam M. Healy ;; Copyright 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
;; ;;
;; This program is free software: you can redistribute it and/or modify ;; This program is free software: you can redistribute it and/or modify
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
`(make-cbstruct `(make-cbstruct
',(parse-callback-static cbs 'callback-fnstruct) ',(parse-callback-static cbs 'callback-fnstruct)
(when (dimension-names object) (when (dimension-names object)
(mappend 'list (dimension-names object) (dimensions object))) (mappend 'list (dimension-names object) (grid:dimensions object)))
,@(mappend ,@(mappend
'list 'list
(mapcar (mapcar
......
;; The mobject that defines callbacks ;; The mobject that defines callbacks
;; Liam Healy 2009-03-14 11:20:03EDT callback-included.lisp ;; Liam Healy 2009-03-14 11:20:03EDT callback-included.lisp
;; Time-stamp: <2009-12-27 09:50:34EST callback-included.lisp> ;; Time-stamp: <2011-01-10 18:19:12EST callback-included.lisp>
;; ;;
;; Copyright 2009 Liam M. Healy ;; Copyright 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
;; ;;
;; This program is free software: you can redistribute it and/or modify ;; This program is free software: you can redistribute it and/or modify
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
:initarg :scalarsp :reader scalarsp :initform t :initarg :scalarsp :reader scalarsp :initform t
:documentation "Whether the function expect to be passed and return :documentation "Whether the function expect to be passed and return
scalars or arrays.") scalars or arrays.")
(dimensions :initarg :dimensions :reader dimensions)) (grid:dimensions :initarg :dimensions :reader grid:dimensions))
(:documentation (:documentation
"A mobject that includes a callback function or functions to GSL.")) "A mobject that includes a callback function or functions to GSL."))
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
(declare (ignore ignore)) (declare (ignore ignore))
`(defclass ,class-name ,superclasses `(defclass ,class-name ,superclasses
((dimension-names :initform nil :allocation :class) ((dimension-names :initform nil :allocation :class)
(dimensions :initform '(1) :allocation :class) (grid:dimensions :initform '(1) :allocation :class)
(scalarsp :initform T :allocation :class)) (scalarsp :initform T :allocation :class))
(:documentation ,documentation))) (:documentation ,documentation)))
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
(princ (first (functions object)) stream) (princ (first (functions object)) stream)
(princ ", " stream)) (princ ", " stream))
(princ "dimensions " stream) (princ "dimensions " stream)
(princ (dimensions object) stream))) (princ (grid:dimensions object) stream)))
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; For making mobjects ;;;; For making mobjects
......
;; Generate a lambda that calls the user function; will be called by callback. ;; Generate a lambda that calls the user function; will be called by callback.
;; Liam Healy ;; Liam Healy
;; Time-stamp: <2010-11-25 09:09:40EST funcallable.lisp> ;; Time-stamp: <2011-01-10 18:19:11EST funcallable.lisp>
;; ;;
;; Copyright 2009, 2010 Liam M. Healy ;; Copyright 2009, 2010, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
;; ;;
;; This program is free software: you can redistribute it and/or modify ;; This program is free software: you can redistribute it and/or modify
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
(lambda (fn fnspec) (lambda (fn fnspec)
(compile (compile
nil nil
(make-funcallable-form fn fnspec (scalarsp object) (dimensions object)))) (make-funcallable-form fn fnspec (scalarsp object) (grid:dimensions object))))
(functions object) (functions object)
(parse-callback-static (cbinfo object) 'functions)))) (parse-callback-static (cbinfo object) 'functions))))
......
;; Load GSL ;; Load GSL
;; Liam Healy Sat Mar 4 2006 - 18:53 ;; Liam Healy Sat Mar 4 2006 - 18:53
;; Time-stamp: <2011-01-10 17:47:50EST init.lisp> ;; Time-stamp: <2011-01-10 18:28:14EST init.lisp>
;; ;;
;; Copyright 2006, 2007, 2008, 2009, 2010, 2011 Liam M. Healy ;; Copyright 2006, 2007, 2008, 2009, 2010, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -22,14 +22,9 @@ ...@@ -22,14 +22,9 @@
(:nicknames :gsl) (:nicknames :gsl)
(:use :common-lisp :cffi) (:use :common-lisp :cffi)
(:import-from (:import-from
:grid :grid #:dimensions
#:cl-array #:dimensions #:element-type #:element-type #:foreign-array #:matrix #:dim0 #:dim1 #:^ #:copy)
#:foreign-array #:matrix #:dim0 #:dim1 #:^ (:export #:element-type #:dim0 #:dim1 #:copy))
#:copy)
;;(:shadowing-import-from :grid #:foreign-pointer)
(:export
#:cl-array #:dimensions #:element-type #:dim0 #:dim1
#:copy))
;;; Where there is a symbol conflict, take the other one. ;;; Where there is a symbol conflict, take the other one.
(shadow '#:row :antik-user) ; conflict with grid:row; they are equivalent (shadow '#:row :antik-user) ; conflict with grid:row; they are equivalent
......
;; Definition of GSL objects and ways to use them. ;; Definition of GSL objects and ways to use them.
;; Liam Healy, Sun Dec 3 2006 - 10:21 ;; Liam Healy, Sun Dec 3 2006 - 10:21
;; Time-stamp: <2010-11-13 18:22:18EST mobject.lisp> ;; Time-stamp: <2011-01-10 18:19:11EST mobject.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 ;; Distributed under the terms of the GNU General Public License
;; ;;
;; This program is free software: you can redistribute it and/or modify ;; This program is free software: you can redistribute it and/or modify
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
(if (have-at-least-gsl-version gsl-version) (if (have-at-least-gsl-version gsl-version)
`(progn `(progn
,(if cbinfo ,(if cbinfo
`(,(if (member 'dimensions cl-alloc-args) `(,(if (member 'grid:dimensions cl-alloc-args)
'def-ci-subclass 'def-ci-subclass-1d) 'def-ci-subclass 'def-ci-subclass-1d)
,class ,class
,superclasses ,superclasses
......
;; BLAS level 1, Vector operations ;; BLAS level 1, Vector operations
;; Liam Healy, Wed Apr 26 2006 - 15:23 ;; Liam Healy, Wed Apr 26 2006 - 15:23
;; Time-stamp: <2011-01-10 17:59:27EST blas1.lisp> ;; Time-stamp: <2011-01-10 18:16:22EST blas1.lisp>
;; ;;
;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy ;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
(defmfun axpy (defmfun axpy
(alpha (x vector) (alpha (x vector)
&optional &optional
(y (grid:make-foreign-array element-type :dimensions (dimensions x)))) (y (grid:make-foreign-array element-type :dimensions (grid:dimensions x))))
;; This gets an error for complex types because you can't pass a ;; This gets an error for complex types because you can't pass a
;; struct in CFFI yet. ;; struct in CFFI yet.
("gsl_blas_" :type "axpy") ("gsl_blas_" :type "axpy")
......
;; BLAS level 2, Matrix-vector operations ;; BLAS level 2, Matrix-vector operations
;; Liam Healy, Wed Apr 26 2006 - 21:08 ;; Liam Healy, Wed Apr 26 2006 - 21:08
;; Time-stamp: <2010-07-07 14:25:00EDT blas2.lisp> ;; Time-stamp: <2011-01-10 18:19:10EST blas2.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 ;; Distributed under the terms of the GNU General Public License
;; ;;
;; This program is free software: you can redistribute it and/or modify ;; This program is free software: you can redistribute it and/or modify
...@@ -42,9 +42,9 @@ ...@@ -42,9 +42,9 @@
(defun matrix-product-dimensions (a b) (defun matrix-product-dimensions (a b)
(if (typep b 'matrix) (if (typep b 'matrix)
(list (first (dimensions a)) (list (first (grid:dimensions a))
(second (dimensions b))) (second (grid:dimensions b)))
(first (dimensions a)))) (first (grid:dimensions a))))
(defmfun matrix-product (defmfun matrix-product
((A matrix) (x vector) ((A matrix) (x vector)
......
;; Cholesky Decomposition ;; Cholesky Decomposition
;; Liam Healy, Wed May 3 2006 - 16:38 ;; Liam Healy, Wed May 3 2006 - 16:38
;; Time-stamp: <2010-06-30 19:57:28EDT cholesky.lisp> ;; Time-stamp: <2011-01-10 18:19:09EST cholesky.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 ;; Distributed under the terms of the GNU General Public License
;; ;;
;; This program is free software: you can redistribute it and/or modify ;; This program is free software: you can redistribute it and/or modify
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
(defmfun cholesky-solve (defmfun cholesky-solve
((A matrix) (b vector) &optional x-spec ((A matrix) (b vector) &optional x-spec
&aux &aux
(x (grid:make-foreign-array-or-default x-spec (dimensions b) t))) (x (grid:make-foreign-array-or-default x-spec (grid:dimensions b) t)))
(("gsl_linalg" :complex "_cholesky_svx") (("gsl_linalg" :complex "_cholesky_svx")
("gsl_linalg" :complex "_cholesky_solve")) ("gsl_linalg" :complex "_cholesky_solve"))
((((mpointer A) :pointer) ((mpointer b) :pointer)) ((((mpointer A) :pointer) ((mpointer b) :pointer))
......
;; Householder Transformations ;; Householder Transformations
;; Liam Healy, Wed May 10 2006 - 10:03 ;; Liam Healy, Wed May 10 2006 - 10:03
;; Time-stamp: <2010-06-29 22:51:21EDT householder.lisp> ;; Time-stamp: <2011-01-10 18:19:08EST householder.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 ;; Distributed under the terms of the GNU General Public License
;; ;;
;; This program is free software: you can redistribute it and/or modify ;; This program is free software: you can redistribute it and/or modify
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
(defmfun householder-solve (defmfun householder-solve
(A b &optional x-spec (A b &optional x-spec
&aux &aux
(x (grid:make-foreign-array-or-default x-spec (dimensions b) t))) (x (grid:make-foreign-array-or-default x-spec (grid:dimensions b) t)))
("gsl_linalg_HH_svx" "gsl_linalg_HH_solve") ("gsl_linalg_HH_svx" "gsl_linalg_HH_solve")
((((mpointer A) :pointer) ((mpointer b) :pointer)) ((((mpointer A) :pointer) ((mpointer b) :pointer))
(((mpointer A) :pointer) ((mpointer b) :pointer) (((mpointer A) :pointer) ((mpointer b) :pointer)
......
;; LU decomposition ;; LU decomposition
;; Liam Healy, Thu Apr 27 2006 - 12:42 ;; Liam Healy, Thu Apr 27 2006 - 12:42
;; Time-stamp: <2011-01-01 11:47:45EST lu.lisp> ;; Time-stamp: <2011-01-10 18:16:19EST lu.lisp>
;; ;;
;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy ;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
((A matrix) (b vector) permutation &optional x-spec ((A matrix) (b vector) permutation &optional x-spec
&aux &aux
(x (if (eq x-spec t) (x (if (eq x-spec t)
(grid:make-foreign-array element-type :dimensions (dimensions b)) (grid:make-foreign-array element-type :dimensions (grid:dimensions b))
x-spec))) x-spec)))
(("gsl_linalg" :complex "_LU_svx") (("gsl_linalg" :complex "_LU_svx")
("gsl_linalg" :complex "_LU_solve")) ("gsl_linalg" :complex "_LU_solve"))
......
;; QR decomposition ;; QR decomposition
;; Liam Healy 2008-02-17 11:05:20EST qr.lisp ;; Liam Healy 2008-02-17 11:05:20EST qr.lisp
;; Time-stamp: <2010-06-30 19:57:28EDT qr.lisp> ;; Time-stamp: <2011-01-10 18:19:08EST qr.lisp>
;; ;;
;; Copyright 2008, 2009 Liam M. Healy ;; Copyright 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
;; ;;
;; This program is free software: you can redistribute it and/or modify ;; This program is free software: you can redistribute it and/or modify
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
(defmfun QR-solve (defmfun QR-solve
(QR tau b &optional x-spec (QR tau b &optional x-spec
&aux &aux
(x (grid:make-foreign-array-or-default x-spec (dimensions b) t))) (x (grid:make-foreign-array-or-default x-spec (grid:dimensions b) t)))
("gsl_linalg_QR_svx" "gsl_linalg_QR_solve") ("gsl_linalg_QR_svx" "gsl_linalg_QR_solve")
((((mpointer QR) :pointer) ((mpointer tau) :pointer) ((((mpointer QR) :pointer) ((mpointer tau) :pointer)
((mpointer b) :pointer)) ((mpointer b) :pointer))
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
(defmfun QR-Rsolve (defmfun QR-Rsolve
(QR b &optional x-spec