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.
;; 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
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -39,9 +39,9 @@
("gsl_" :category :type "_alloc_from_block")
((blockptr :pointer)
(0 sizet) ; offset
((first (dimensions object)) sizet) ; number of rows
((second (dimensions object)) sizet) ; number of columns
((second (dimensions object)) sizet)) ; "tda" = number of columns for now
((first (grid:dimensions object)) sizet) ; number of rows
((second (grid:dimensions object)) sizet) ; number of columns
((second (grid:dimensions object)) sizet)) ; "tda" = number of columns for now
:definition :methods
:c-return :pointer
:export nil)
......
;; Combinations
;; 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
;; Distributed under the terms of the GNU General Public License
......@@ -56,7 +56,7 @@
(make-instance
'combination
: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
'combination
:element-type '(unsigned-byte #+int64 64 #+int32 32)
......
;; Matrices
;; 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
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -145,7 +145,7 @@
((source matrix)
&optional
(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")
(((mpointer destination) :pointer) ((mpointer source) :pointer))
:definition :generic
......
;; Permutations
;; 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
;; Distributed under the terms of the GNU General Public License
......@@ -53,7 +53,7 @@
(make-instance
'permutation
: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
(if (typep n 'permutation)
(error "not available yet") ; (copy perm n)
......
;; Real generalized eigensystems
;; 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
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -82,7 +82,7 @@
((A matrix) (B matrix)
&optional
(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))
t (make-eigen-symmv (dim0 A)))))
(double-float "gsl_eigen_gensymmv"
......
;; Generalized eigensystems for nonsymmetric real matrices
;; 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
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -63,11 +63,11 @@
(balance nil) ; unused by GSL
(Q
(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))
(Z
(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)))
("gsl_eigen_gen" "gsl_eigen_gen_QZ")
((((mpointer A) :pointer) ((mpointer B) :pointer)
......@@ -118,18 +118,18 @@
(beta
(grid:make-foreign-array 'double-float :dimensions (dim0 A)))
(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)))
compute-shur-form-s compute-shur-form-t shur-vectors
&aux
(balance nil) ; unused by GSL
(Q
(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))
(Z
(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)))
("gsl_eigen_genv" "gsl_eigen_genv_QZ")
((((mpointer A) :pointer) ((mpointer B) :pointer)
......
;; Eigensystems for nonsymmetric real matrices
;; 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
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -58,7 +58,7 @@
&aux
(sv
(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)))
("gsl_eigen_nonsymm" "gsl_eigen_nonsymm_Z")
((((mpointer A) :pointer)
......@@ -119,13 +119,13 @@
(eigenvalues
(grid:make-foreign-array '(complex double-float) :dimensions (dim0 A)))
(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)))
shur-vectors
&aux
(sv
(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)))
("gsl_eigen_nonsymmv" "gsl_eigen_nonsymmv_Z")
((((mpointer A) :pointer)
......
;; Eigenvectors and eigenvalues
;; 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
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -95,7 +95,7 @@
((A matrix)
&optional
(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))
t (make-eigen-symmv (dim0 A)))))
(double-float "gsl_eigen_symmv"
......
;; Discrete Fourier Transforms
;; 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
;; Distributed under the terms of the GNU General Public License
......@@ -29,7 +29,7 @@
(defmfun forward-discrete-fourier-transform
((vector vector)
&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")
(((grid:foreign-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet)
((grid:foreign-pointer result) :pointer))
......@@ -45,7 +45,7 @@
(defmfun backward-discrete-fourier-transform
((vector vector)
&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")
(((grid:foreign-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet)
((grid:foreign-pointer result) :pointer))
......@@ -61,7 +61,7 @@
(defmfun inverse-discrete-fourier-transform
((vector vector)
&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")
(((grid:foreign-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet)
((grid:foreign-pointer result) :pointer))
......@@ -77,7 +77,7 @@
(defmfun discrete-fourier-transform
((vector vector)
&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")
(((grid:foreign-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet)
((grid:foreign-pointer result) :pointer))
......
;; Discrete Hankel Transforms.
;; 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
;; Distributed under the terms of the GNU General Public License
......@@ -39,7 +39,7 @@
(defmfun apply-hankel
(hankel array-in
&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"
(((mpointer hankel) :pointer) ((grid:foreign-pointer array-in) :pointer)
((grid:foreign-pointer array-out) :pointer))
......
;; Definitions for macro expansion
;; 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
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -40,7 +40,7 @@
`(make-cbstruct
',(parse-callback-static cbs 'callback-fnstruct)
(when (dimension-names object)
(mappend 'list (dimension-names object) (dimensions object)))
(mappend 'list (dimension-names object) (grid:dimensions object)))
,@(mappend
'list
(mapcar
......
;; The mobject that defines callbacks
;; 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
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -43,7 +43,7 @@
:initarg :scalarsp :reader scalarsp :initform t
:documentation "Whether the function expect to be passed and return
scalars or arrays.")
(dimensions :initarg :dimensions :reader dimensions))
(grid:dimensions :initarg :dimensions :reader grid:dimensions))
(:documentation
"A mobject that includes a callback function or functions to GSL."))
......@@ -65,7 +65,7 @@
(declare (ignore ignore))
`(defclass ,class-name ,superclasses
((dimension-names :initform nil :allocation :class)
(dimensions :initform '(1) :allocation :class)
(grid:dimensions :initform '(1) :allocation :class)
(scalarsp :initform T :allocation :class))
(:documentation ,documentation)))
......@@ -76,7 +76,7 @@
(princ (first (functions object)) stream)
(princ ", " stream))
(princ "dimensions " stream)
(princ (dimensions object) stream)))
(princ (grid:dimensions object) stream)))
;;;;****************************************************************************
;;;; For making mobjects
......
;; Generate a lambda that calls the user function; will be called by callback.
;; 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
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -214,7 +214,7 @@
(lambda (fn fnspec)
(compile
nil
(make-funcallable-form fn fnspec (scalarsp object) (dimensions object))))
(make-funcallable-form fn fnspec (scalarsp object) (grid:dimensions object))))
(functions object)
(parse-callback-static (cbinfo object) 'functions))))
......
;; Load GSL
;; 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
;; Distributed under the terms of the GNU General Public License
......@@ -22,14 +22,9 @@
(:nicknames :gsl)
(:use :common-lisp :cffi)
(:import-from
:grid
#:cl-array #:dimensions #:element-type
#:foreign-array #:matrix #:dim0 #:dim1 #:^
#:copy)
;;(:shadowing-import-from :grid #:foreign-pointer)
(:export
#:cl-array #:dimensions #:element-type #:dim0 #:dim1
#:copy))
:grid #:dimensions
#:element-type #:foreign-array #:matrix #:dim0 #:dim1 #:^ #:copy)
(:export #:element-type #:dim0 #:dim1 #:copy))
;;; Where there is a symbol conflict, take the other one.
(shadow '#:row :antik-user) ; conflict with grid:row; they are equivalent
......
;; Definition of GSL objects and ways to use them.
;; 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
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -102,7 +102,7 @@
(if (have-at-least-gsl-version gsl-version)
`(progn
,(if cbinfo
`(,(if (member 'dimensions cl-alloc-args)
`(,(if (member 'grid:dimensions cl-alloc-args)
'def-ci-subclass 'def-ci-subclass-1d)
,class
,superclasses
......
;; BLAS level 1, Vector operations
;; 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
;; Distributed under the terms of the GNU General Public License
......@@ -112,7 +112,7 @@
(defmfun axpy
(alpha (x vector)
&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
;; struct in CFFI yet.
("gsl_blas_" :type "axpy")
......
;; BLAS level 2, Matrix-vector operations
;; 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
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -42,9 +42,9 @@
(defun matrix-product-dimensions (a b)
(if (typep b 'matrix)
(list (first (dimensions a))
(second (dimensions b)))
(first (dimensions a))))
(list (first (grid:dimensions a))
(second (grid:dimensions b)))
(first (grid:dimensions a))))
(defmfun matrix-product
((A matrix) (x vector)
......
;; Cholesky Decomposition
;; 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
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -53,7 +53,7 @@
(defmfun cholesky-solve
((A matrix) (b vector) &optional x-spec
&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_solve"))
((((mpointer A) :pointer) ((mpointer b) :pointer))
......
;; Householder Transformations
;; 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
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -87,7 +87,7 @@
(defmfun householder-solve
(A b &optional x-spec
&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")
((((mpointer A) :pointer) ((mpointer b) :pointer))
(((mpointer A) :pointer) ((mpointer b) :pointer)
......
;; LU decomposition
;; 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
;; Distributed under the terms of the GNU General Public License
......@@ -56,7 +56,7 @@
((A matrix) (b vector) permutation &optional x-spec
&aux
(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)))
(("gsl_linalg" :complex "_LU_svx")
("gsl_linalg" :complex "_LU_solve"))
......
;; QR decomposition
;; 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
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -62,7 +62,7 @@
(defmfun QR-solve
(QR tau b &optional x-spec
&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")
((((mpointer QR) :pointer) ((mpointer tau) :pointer)
((mpointer b) :pointer))
......@@ -129,7 +129,7 @@
(defmfun QR-Rsolve
(QR b &optional x-spec
&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_Rsvx" "gsl_linalg_QR_Rsolve")
((((mpointer QR) :pointer) ((mpointer b) :pointer))
(((mpointer QR) :pointer) ((mpointer b) :pointer) ((mpointer x) :pointer)))
......@@ -149,7 +149,7 @@
(QR tau
&optional
(Q (grid:make-foreign-array 'double-float :dimensions (list (dim0 QR) (dim0 QR))))
(R (grid:make-foreign-array 'double-float :dimensions (dimensions QR))))
(R (grid:make-foreign-array 'double-float :dimensions (grid:dimensions QR))))
"gsl_linalg_QR_unpack"
(((mpointer QR) :pointer) ((mpointer tau) :pointer)
((mpointer Q) :pointer) ((mpointer R) :pointer))
......@@ -189,7 +189,7 @@
(defmfun R-solve
(R b &optional x-spec
&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_R_svx" "gsl_linalg_R_solve")
((((mpointer R) :pointer) ((mpointer b) :pointer))
(((mpointer R) :pointer) ((mpointer b) :pointer) ((mpointer x) :pointer)))
......
;; QR with column pivoting
;; Liam Healy, Fri Apr 28 2006 - 16:53
;; Time-stamp: <2010-06-29 22:51:20EDT qrpt.lisp>
;; Time-stamp: <2011-01-10 18:19:08EST qrpt.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
......@@ -60,7 +60,7 @@
(A
&optional
(q (grid:make-foreign-array 'double-float :dimensions (list (dim0 A) (dim0 A))))
(r (grid:make-foreign-array 'double-float :dimensions (dimensions A)))
(r (grid:make-foreign-array 'double-float :dimensions (grid:dimensions A)))
(tau (grid:make-foreign-array 'double-float :dimensions (min (dim0 A) (dim1 A))))
(permutation (make-permutation (dim1 A)))
(norm (grid:make-foreign-array 'double-float :dimensions (dim1 A))))
......@@ -80,7 +80,7 @@
(defmfun QRPT-solve
(QR tau permutation b &optional x-spec
&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_QRPT_svx" "gsl_linalg_QRPT_solve")
((((mpointer QR) :pointer) ((mpointer tau) :pointer)
((mpointer permutation) :pointer) ((mpointer b) :pointer))
......@@ -131,7 +131,7 @@
(defmfun QRPT-Rsolve
(QR permutation b &optional x-spec
&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_QRPT_Rsvx" "gsl_linalg_QRPT_Rsolve")
((((mpointer QR) :pointer) ((mpointer permutation) :pointer)
((mpointer b) :pointer))
......@@ -180,7 +180,7 @@
(QR-unpack QRPT tau)
(let* ((qr (matrix-product Q R))
(ans (grid:make-foreign-array
'double-float :dimensions (dimensions qr)
'double-float :dimensions (grid:dimensions qr)
;; It shouldn't be necessary to initialize values
;; because we are going to setf every row,
;; Sat Dec 26 2009.
......
;; Evolution functions for ODE integration.
;; Liam Healy, Sun Sep 30 2007 - 14:31
;; Time-stamp: <2011-01-10 17:59:27EST evolution.lisp>
;; Time-stamp: <2011-01-10 18:16:19EST evolution.lisp>
;;
;; Copyright 2007, 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -21,7 +21,7 @@
(in-package :gsl)
(defmobject ode-evolution "gsl_odeiv_evolve"
((dimensions sizet))
((grid:dimensions sizet))
"evolution for ordinary differential equations"
:documentation "Make an object to advance the ODE solution."
:initialize-suffix "reset"
......
;; Linear least squares, or linear regression
;; Liam Healy <2008-01-21 12:41:46EST linear-least-squares.lisp>
;; Time-stamp: <2011-01-10 17:59:31EST linear-least-squares.lisp>
;; Time-stamp: <2011-01-10 18:16:18EST linear-least-squares.lisp>
;;
;; Copyright 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -284,7 +284,7 @@
(x observations coefficients
&optional
(residuals
(grid:make-foreign-array 'double-float :dimensions (dimensions observations))))
(grid:make-foreign-array 'double-float :dimensions (grid:dimensions observations))))
"gsl_multifit_linear_residuals"
(((mpointer x) :pointer) ((mpointer observations) :pointer)
((mpointer coefficients) :pointer) ((mpointer residuals) :pointer))
......
;;; Multivariate roots.
;;; Liam Healy 2008-01-12 12:49:08
;;; Time-stamp: <2010-07-13 09:52:54EDT roots-multi.lisp>
;;; Time-stamp: <2011-01-10 18:19:07EST roots-multi.lisp>
;;
;; Copyright 2008, 2009 Liam M. Healy
;; Copyright 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
......@@ -54,7 +54,7 @@
`((type &optional function-or-dimension (initial nil ,set) (scalarsp t))
(:type type
:dimensions
(if ,set (dimensions initial) function-or-dimension))
(if ,set (grid:dimensions initial) function-or-dimension))
(:functions
(list function-or-dimension) :initial initial :scalarsp scalarsp)))
:inputs (initial))
......@@ -91,7 +91,7 @@
(scalarsp t))
(:type type
:dimensions
(if ,set (dimensions initial) function-or-dimension))
(if ,set (grid:dimensions initial) function-or-dimension))
(:functions function-or-dimension :initial initial :scalarsp scalarsp)))
:inputs (initial))
......
;; Sorting
;; Liam Healy, Fri Apr 14 2006 - 20:20
;; Time-stamp: <2011-01-10 17:59:31EST sorting.lisp>
;; Time-stamp: <2011-01-10 18:16:18EST sorting.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -169,7 +169,7 @@
(((grid:foreign-pointer combination) :pointer) ((size combination) sizet)
((mpointer v) :pointer)
(1 sizet) ; stride, set to 1 for now
((first (dimensions combination)) sizet))
((first (grid:dimensions combination)) sizet))
:definition :generic
:element-types :no-complex
:c-return :void
......@@ -187,7 +187,7 @@
(((grid:foreign-pointer combination) :pointer) ((size combination) sizet)
((grid:foreign-pointer v) :pointer)
(1 sizet) ; stride, set to 1 for now
((first (dimensions combination)) sizet))
((first (grid:dimensions combination)) sizet))
:definition :generic
:element-types :no-complex
:c-return :void
......@@ -233,7 +233,7 @@
(((grid:foreign-pointer combination) :pointer) ((size combination) sizet)
((mpointer v) :pointer)
(1 sizet) ; stride, set to 1 for now
((first (dimensions combination)) sizet))
((first (grid:dimensions combination)) sizet))
:definition :generic
:element-types :no-complex
:c-return :void
......@@ -251,7 +251,7 @@
(((grid:foreign-pointer combination) :pointer) ((size combination) sizet)
((grid:foreign-pointer v) :pointer)
(1 sizet) ; stride, set to 1 for now
((first (dimensions combination)) sizet))
((first (grid:dimensions combination)) sizet))
:element-types :no-complex
:definition :generic
:c-return :void
......
;; Mean, standard deviation, and variance
;; Liam Healy, Sat Dec 2 2006 - 22:15
;; Time-stamp: <2011-01-10 17:59:35EST mean-variance.lisp>
;; Time-stamp: <2011-01-10 18:16:17EST mean-variance.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -273,7 +273,7 @@
(generate-all-array-tests weighted-mean :float
(let ((v1 (array-default 8))
(v2 (array-default 8)))
(loop for i below (first (dimensions v2))
(loop for i below (first (grid:dimensions v2))
do (setf (grid:gref v2 i) (abs (grid:gref v2 i))))
(weighted-mean v1 v2)))
|#
......
;; Additional methods for lisp-unit
;; Liam Healy 2009-04-15 23:23:30EDT augment.lisp
;; Time-stamp: <2010-07-07 14:24:56EDT augment.lisp>
;; Time-stamp: <2011-01-10 18:19:07EST augment.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
......@@ -23,7 +23,7 @@
(defmethod lisp-unit:numerical-equal
((result1 grid:foreign-array) (result2 grid:foreign-array) &key (test #'lisp-unit:number-equal))
"Return true if the arrays are numerically equal according to :TEST."
(when (equal (dimensions result1) (dimensions result2))
(when (equal (grid:dimensions result1) (grid:dimensions result2))
(lisp-unit:numerical-equal (grid:copy-to result1) (grid:copy-to result2)
:test test)))
......
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