Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gsll
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
antik
gsll
Commits
add07a4f
Commit
add07a4f
authored
Jun 29, 2010
by
Liam Healy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate 'marray; replace make-marray with grid:make-foreign-array
parent
eebc5a48
Changes
156
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
156 changed files
with
1499 additions
and
1529 deletions
+1499
-1529
basis-splines.lisp
basis-splines.lisp
+9
-9
calculus/monte-carlo.lisp
calculus/monte-carlo.lisp
+2
-2
data/both.lisp
data/both.lisp
+2
-2
data/copy-cl.lisp
data/copy-cl.lisp
+12
-12
data/foreign-array.lisp
data/foreign-array.lisp
+1
-31
data/matrix.lisp
data/matrix.lisp
+4
-4
documentation/index.html
documentation/index.html
+8
-8
eigensystems/generalized.lisp
eigensystems/generalized.lisp
+4
-4
eigensystems/nonsymmetric-generalized.lisp
eigensystems/nonsymmetric-generalized.lisp
+10
-10
eigensystems/nonsymmetric.lisp
eigensystems/nonsymmetric.lisp
+6
-6
eigensystems/symmetric-hermitian.lisp
eigensystems/symmetric-hermitian.lisp
+6
-6
fast-fourier-transforms/discrete.lisp
fast-fourier-transforms/discrete.lisp
+5
-5
fast-fourier-transforms/example.lisp
fast-fourier-transforms/example.lisp
+5
-5
fast-fourier-transforms/extras.lisp
fast-fourier-transforms/extras.lisp
+1
-1
fast-fourier-transforms/unpack.lisp
fast-fourier-transforms/unpack.lisp
+7
-7
hankel.lisp
hankel.lisp
+5
-5
init/callback.lisp
init/callback.lisp
+6
-6
init/funcallable.lisp
init/funcallable.lisp
+2
-2
init/generate-examples.lisp
init/generate-examples.lisp
+3
-3
init/mobject.lisp
init/mobject.lisp
+2
-2
interpolation/spline-example.lisp
interpolation/spline-example.lisp
+5
-5
linear-algebra/blas1.lisp
linear-algebra/blas1.lisp
+2
-2
linear-algebra/blas2.lisp
linear-algebra/blas2.lisp
+4
-4
linear-algebra/blas3.lisp
linear-algebra/blas3.lisp
+4
-4
linear-algebra/cholesky.lisp
linear-algebra/cholesky.lisp
+3
-3
linear-algebra/diagonal.lisp
linear-algebra/diagonal.lisp
+3
-3
linear-algebra/exponential.lisp
linear-algebra/exponential.lisp
+2
-2
linear-algebra/householder.lisp
linear-algebra/householder.lisp
+3
-3
linear-algebra/lu.lisp
linear-algebra/lu.lisp
+5
-5
linear-algebra/matrix-generation.lisp
linear-algebra/matrix-generation.lisp
+9
-9
linear-algebra/qr.lisp
linear-algebra/qr.lisp
+14
-14
linear-algebra/qrpt.lisp
linear-algebra/qrpt.lisp
+13
-13
linear-algebra/svd.lisp
linear-algebra/svd.lisp
+11
-11
ordinary-differential-equations/ode-system.lisp
ordinary-differential-equations/ode-system.lisp
+4
-4
polynomial.lisp
polynomial.lisp
+5
-5
random/multinomial.lisp
random/multinomial.lisp
+2
-2
random/quasi.lisp
random/quasi.lisp
+2
-2
random/shuffling-sampling.lisp
random/shuffling-sampling.lisp
+3
-3
series-acceleration.lisp
series-acceleration.lisp
+2
-2
solve-minimize-fit/linear-least-squares.lisp
solve-minimize-fit/linear-least-squares.lisp
+6
-6
solve-minimize-fit/minimization-multi.lisp
solve-minimize-fit/minimization-multi.lisp
+8
-8
solve-minimize-fit/nonlinear-least-squares.lisp
solve-minimize-fit/nonlinear-least-squares.lisp
+13
-13
solve-minimize-fit/roots-multi.lisp
solve-minimize-fit/roots-multi.lisp
+13
-13
solve-minimize-fit/simulated-annealing.lisp
solve-minimize-fit/simulated-annealing.lisp
+3
-3
special-functions/bessel.lisp
special-functions/bessel.lisp
+11
-11
special-functions/coulomb.lisp
special-functions/coulomb.lisp
+6
-6
special-functions/legendre.lisp
special-functions/legendre.lisp
+9
-9
special-functions/return-structures.lisp
special-functions/return-structures.lisp
+2
-2
test-unit/augment.lisp
test-unit/augment.lisp
+2
-2
tests/absolute-deviation.lisp
tests/absolute-deviation.lisp
+2
-2
tests/absolute-sum.lisp
tests/absolute-sum.lisp
+4
-4
tests/autocorrelation.lisp
tests/autocorrelation.lisp
+1
-1
tests/axpy.lisp
tests/axpy.lisp
+8
-8
tests/bessel.lisp
tests/bessel.lisp
+9
-9
tests/blas-copy.lisp
tests/blas-copy.lisp
+8
-8
tests/blas-swap.lisp
tests/blas-swap.lisp
+8
-8
tests/cdot.lisp
tests/cdot.lisp
+4
-4
tests/cholesky.lisp
tests/cholesky.lisp
+4
-4
tests/column.lisp
tests/column.lisp
+24
-24
tests/correlation.lisp
tests/correlation.lisp
+20
-20
tests/coulomb.lisp
tests/coulomb.lisp
+5
-5
tests/covariance.lisp
tests/covariance.lisp
+20
-20
tests/dirichlet.lisp
tests/dirichlet.lisp
+4
-4
tests/discrete.lisp
tests/discrete.lisp
+2
-2
tests/dot.lisp
tests/dot.lisp
+8
-8
tests/euclidean-norm.lisp
tests/euclidean-norm.lisp
+4
-4
tests/gegenbauer.lisp
tests/gegenbauer.lisp
+1
-1
tests/givens.lisp
tests/givens.lisp
+10
-10
tests/hankel.lisp
tests/hankel.lisp
+5
-5
tests/higher-moments.lisp
tests/higher-moments.lisp
+1
-1
tests/index-max.lisp
tests/index-max.lisp
+4
-4
tests/inverse-matrix-product.lisp
tests/inverse-matrix-product.lisp
+16
-16
tests/legendre.lisp
tests/legendre.lisp
+8
-8
tests/lu.lisp
tests/lu.lisp
+6
-6
tests/matrix-add-scalar.lisp
tests/matrix-add-scalar.lisp
+10
-10
tests/matrix-add.lisp
tests/matrix-add.lisp
+20
-20
tests/matrix-copy-to-cl-and-back.lisp
tests/matrix-copy-to-cl-and-back.lisp
+12
-12
tests/matrix-copy.lisp
tests/matrix-copy.lisp
+12
-12
tests/matrix-div.lisp
tests/matrix-div.lisp
+20
-20
tests/matrix-max-index.lisp
tests/matrix-max-index.lisp
+10
-10
tests/matrix-max.lisp
tests/matrix-max.lisp
+10
-10
tests/matrix-mean.lisp
tests/matrix-mean.lisp
+10
-10
tests/matrix-min-index.lisp
tests/matrix-min-index.lisp
+10
-10
tests/matrix-min.lisp
tests/matrix-min.lisp
+10
-10
tests/matrix-minmax-index.lisp
tests/matrix-minmax-index.lisp
+10
-10
tests/matrix-minmax.lisp
tests/matrix-minmax.lisp
+10
-10
tests/matrix-mult-scalar.lisp
tests/matrix-mult-scalar.lisp
+10
-10
tests/matrix-mult.lisp
tests/matrix-mult.lisp
+20
-20
tests/matrix-product-hermitian.lisp
tests/matrix-product-hermitian.lisp
+12
-12
tests/matrix-product-nonsquare.lisp
tests/matrix-product-nonsquare.lisp
+8
-8
tests/matrix-product-symmetric.lisp
tests/matrix-product-symmetric.lisp
+12
-12
tests/matrix-product-triangular.lisp
tests/matrix-product-triangular.lisp
+16
-16
tests/matrix-product.lisp
tests/matrix-product.lisp
+24
-24
tests/matrix-set-all.lisp
tests/matrix-set-all.lisp
+12
-12
tests/matrix-set-zero.lisp
tests/matrix-set-zero.lisp
+12
-12
tests/matrix-standard-deviation-with-fixed-mean.lisp
tests/matrix-standard-deviation-with-fixed-mean.lisp
+10
-10
tests/matrix-standard-deviation-with-mean.lisp
tests/matrix-standard-deviation-with-mean.lisp
+10
-10
tests/matrix-standard-deviation.lisp
tests/matrix-standard-deviation.lisp
+10
-10
tests/matrix-sub.lisp
tests/matrix-sub.lisp
+20
-20
tests/matrix-swap.lisp
tests/matrix-swap.lisp
+24
-24
tests/matrix-transpose-copy.lisp
tests/matrix-transpose-copy.lisp
+24
-24
tests/matrix-transpose.lisp
tests/matrix-transpose.lisp
+12
-12
tests/matrix-variance-with-fixed-mean.lisp
tests/matrix-variance-with-fixed-mean.lisp
+10
-10
tests/matrix-variance-with-mean.lisp
tests/matrix-variance-with-mean.lisp
+10
-10
tests/matrix-variance.lisp
tests/matrix-variance.lisp
+10
-10
tests/median-percentile.lisp
tests/median-percentile.lisp
+2
-2
tests/multinomial.lisp
tests/multinomial.lisp
+4
-4
tests/permutation.lisp
tests/permutation.lisp
+1
-1
tests/polynomial.lisp
tests/polynomial.lisp
+10
-10
tests/qr.lisp
tests/qr.lisp
+10
-10
tests/quasi-random-number-generators.lisp
tests/quasi-random-number-generators.lisp
+1
-1
tests/row.lisp
tests/row.lisp
+24
-24
tests/scale.lisp
tests/scale.lisp
+6
-6
tests/set-basis.lisp
tests/set-basis.lisp
+12
-12
tests/set-identity.lisp
tests/set-identity.lisp
+12
-12
tests/setf-column.lisp
tests/setf-column.lisp
+24
-24
tests/setf-row.lisp
tests/setf-row.lisp
+24
-24
tests/sort-matrix-largest.lisp
tests/sort-matrix-largest.lisp
+20
-20
tests/sort-matrix-smallest.lisp
tests/sort-matrix-smallest.lisp
+20
-20
tests/sort-matrix.lisp
tests/sort-matrix.lisp
+10
-10
tests/sort-vector-index.lisp
tests/sort-vector-index.lisp
+10
-10
tests/sort-vector-largest-index.lisp
tests/sort-vector-largest-index.lisp
+10
-10
tests/sort-vector-largest.lisp
tests/sort-vector-largest.lisp
+20
-20
tests/sort-vector-smallest-index.lisp
tests/sort-vector-smallest-index.lisp
+10
-10
tests/sort-vector-smallest.lisp
tests/sort-vector-smallest.lisp
+20
-20
tests/sort-vector.lisp
tests/sort-vector.lisp
+10
-10
tests/swap-columns.lisp
tests/swap-columns.lisp
+12
-12
tests/swap-elements.lisp
tests/swap-elements.lisp
+12
-12
tests/swap-row-column.lisp
tests/swap-row-column.lisp
+12
-12
tests/swap-rows.lisp
tests/swap-rows.lisp
+12
-12
tests/vector-add-scalar.lisp
tests/vector-add-scalar.lisp
+10
-10
tests/vector-add.lisp
tests/vector-add.lisp
+30
-30
tests/vector-copy-to-cl-and-back.lisp
tests/vector-copy-to-cl-and-back.lisp
+12
-12
tests/vector-copy.lisp
tests/vector-copy.lisp
+12
-12
tests/vector-div.lisp
tests/vector-div.lisp
+20
-20
tests/vector-max-index.lisp
tests/vector-max-index.lisp
+10
-10
tests/vector-max.lisp
tests/vector-max.lisp
+10
-10
tests/vector-mean.lisp
tests/vector-mean.lisp
+10
-10
tests/vector-min-index.lisp
tests/vector-min-index.lisp
+10
-10
tests/vector-min.lisp
tests/vector-min.lisp
+10
-10
tests/vector-minmax-index.lisp
tests/vector-minmax-index.lisp
+10
-10
tests/vector-minmax.lisp
tests/vector-minmax.lisp
+10
-10
tests/vector-mult-scalar.lisp
tests/vector-mult-scalar.lisp
+10
-10
tests/vector-mult.lisp
tests/vector-mult.lisp
+20
-20
tests/vector-reverse.lisp
tests/vector-reverse.lisp
+12
-12
tests/vector-set-all.lisp
tests/vector-set-all.lisp
+12
-12
tests/vector-set-zero.lisp
tests/vector-set-zero.lisp
+12
-12
tests/vector-standard-deviation-with-fixed-mean.lisp
tests/vector-standard-deviation-with-fixed-mean.lisp
+10
-10
tests/vector-standard-deviation-with-mean.lisp
tests/vector-standard-deviation-with-mean.lisp
+10
-10
tests/vector-standard-deviation.lisp
tests/vector-standard-deviation.lisp
+10
-10
tests/vector-sub.lisp
tests/vector-sub.lisp
+20
-20
tests/vector-swap.lisp
tests/vector-swap.lisp
+24
-24
tests/vector-variance-with-fixed-mean.lisp
tests/vector-variance-with-fixed-mean.lisp
+10
-10
tests/vector-variance-with-mean.lisp
tests/vector-variance-with-mean.lisp
+10
-10
tests/vector-variance.lisp
tests/vector-variance.lisp
+10
-10
wavelet.lisp
wavelet.lisp
+2
-2
No files found.
basis-splines.lisp
View file @
add07a4f
;; Basis splines.
;; Liam Healy 2008-02-18 14:43:20EST basis-splines.lisp
;; Time-stamp: <2010-0
1-17 10:41:03ES
T basis-splines.lisp>
;; Time-stamp: <2010-0
6-29 22:15:23ED
T basis-splines.lisp>
;;
;; Copyright 2008, 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
...
...
@@ -56,7 +56,7 @@
(
defmfun
evaluate
((
workspace
basis-spline
)
x
&key
(
B
(
make-m
array
'double-float
&key
(
B
(
grid:make-foreign-
array
'double-float
:dimensions
(
number-of-coefficients
workspace
))))
"gsl_bspline_eval"
((
x
:double
)
((
mpointer
B
)
:pointer
)
((
mpointer
workspace
)
:pointer
))
...
...
@@ -112,13 +112,13 @@
(
bw
(
make-basis-spline
order
nbreak
))
(
mw
(
make-fit-workspace
ndata
ncoeffs
))
(
rng
(
make-random-number-generator
+mt19937+
0
))
(
B
(
make-m
array
'double-float
:dimensions
ncoeffs
))
(
c
(
make-m
array
'double-float
:dimensions
ncoeffs
))
(
cov
(
make-m
array
'double-float
:dimensions
(
list
ncoeffs
ncoeffs
)))
(
w
(
make-m
array
'double-float
:dimensions
ndata
))
(
x
(
make-m
array
'double-float
:dimensions
ndata
))
(
y
(
make-m
array
'double-float
:dimensions
ndata
))
(
Xmatrix
(
make-m
array
'double-float
:dimensions
(
list
ndata
ncoeffs
)))
(
B
(
grid:make-foreign-
array
'double-float
:dimensions
ncoeffs
))
(
c
(
grid:make-foreign-
array
'double-float
:dimensions
ncoeffs
))
(
cov
(
grid:make-foreign-
array
'double-float
:dimensions
(
list
ncoeffs
ncoeffs
)))
(
w
(
grid:make-foreign-
array
'double-float
:dimensions
ndata
))
(
x
(
grid:make-foreign-
array
'double-float
:dimensions
ndata
))
(
y
(
grid:make-foreign-
array
'double-float
:dimensions
ndata
))
(
Xmatrix
(
grid:make-foreign-
array
'double-float
:dimensions
(
list
ndata
ncoeffs
)))
(
sigma
0.1d0
))
;; The data to be fitted.
(
dotimes
(
i
ndata
)
...
...
calculus/monte-carlo.lisp
View file @
add07a4f
;; Monte Carlo Integration
;; Liam Healy Sat Feb 3 2007 - 17:42
;; Time-stamp: <2010-06-2
7 18:13:57
EDT monte-carlo.lisp>
;; Time-stamp: <2010-06-2
9 22:15:24
EDT monte-carlo.lisp>
;;
;; Copyright 2007, 2008, 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
...
...
@@ -211,7 +211,7 @@
(
defparameter
*mc-lower*
#
m
(
0.0d0
0.0d0
0.0d0
))
(
defparameter
*mc-upper*
(
make-m
array
'double-float
:initial-contents
(
list
pi
pi
pi
)))
(
grid:make-foreign-
array
'double-float
:initial-contents
(
list
pi
pi
pi
)))
(
defun
random-walk-plain-example
(
&optional
(
nsamples
500000
))
(
monte-carlo-integrate-plain
'mcrw
*mc-lower*
*mc-upper*
nsamples
))
...
...
data/both.lisp
View file @
add07a4f
;; Functions for both vectors and matrices.
;; Liam Healy 2008-04-26 20:48:44EDT both.lisp
;; Time-stamp: <2010-06-2
7 21:31:00
EDT both.lisp>
;; Time-stamp: <2010-06-2
9 22:12:07
EDT both.lisp>
;;
;; Copyright 2008, 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
...
...
@@ -81,7 +81,7 @@
(defmfun grid:copy-making-destination
((source both) &aux
(destination
(
make-m
array element-type :dimensions (dimensions source))))
(
grid:make-foreign-
array element-type :dimensions (dimensions source))))
("gsl_" :category :type "_memcpy")
(((mpointer destination) :pointer) ((mpointer source) :pointer))
:definition :methods
...
...
data/copy-cl.lisp
View file @
add07a4f
;; Copy
m
arrays to/from CL arrays
;; Copy
grid:foreign-
arrays to/from CL arrays
;; Liam Healy 2009-02-11 19:28:44EST copy-cl.lisp
;; Time-stamp: <2010-06-2
7 18:03:25
EDT copy-cl.lisp>
;; Time-stamp: <2010-06-2
9 22:51:21
EDT copy-cl.lisp>
;;
;; Copyright 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
...
...
@@ -20,17 +20,17 @@
;;; The function #'copy can be used to copy the contents to or from a
;;; CL array. If the destination isn't literally supplied, it can be
;;; a symbol 'array indicating that the
m
array is to be copied to a CL
;;; a symbol 'array indicating that the
grid:foreign-
array is to be copied to a CL
;;; array, or an element type like 'double-float, indicating the
;;; contents of the CL array is to be copied to a new
m
array with the
;;; contents of the CL array is to be copied to a new
grid:foreign-
array with the
;;; given element type.
;;; Contrast this with the function #'cl-array or the initarg
;;; :cl-array to #'
make-m
array. The function returns the cl-array
;;; :cl-array to #'
grid:make-foreign-
array. The function returns the cl-array
;;; without copying, and so might be faster but also makes the
;;; original
m
array object vulnerable if an element is changed, which
;;; original
grid:foreign-
array object vulnerable if an element is changed, which
;;; officially has unpredictable results. Likewise, the initarg will
;;; use the given CL array directly in the created
m
array without
;;; use the given CL array directly in the created
grid:foreign-
array without
;;; copying.
(
in-package
:gsl
)
...
...
@@ -68,21 +68,21 @@
(
setf
(
maref
destination
i
j
)
(
aref
source
i
j
))))
destination
)
(
defmethod
grid:copy-to-destination
((
source
m
array
)
(
destclass
(
eql
'array
)))
(
defmethod
grid:copy-to-destination
((
source
grid:foreign-
array
)
(
destclass
(
eql
'array
)))
(
let
((
destination
(
grid:make-ffa
(
element-type
source
)
:dimensions
(
dimensions
source
))))
(
grid:copy-to-destination
source
destination
)))
;;; Copy to a named
m
array element-type, where the type is a symbol
;;; Copy to a named
grid:foreign-
array element-type, where the type is a symbol
(
defmethod
grid:copy-to-destination
((
source
array
)
(
destclass
symbol
))
(
let
((
destination
(
make-m
array
destclass
:dimensions
(
array-dimensions
source
))))
(
grid:make-foreign-
array
destclass
:dimensions
(
array-dimensions
source
))))
(
grid:copy-to-destination
source
destination
)))
;;; Copy to a named
m
array element-type, where the type is a list
;;; Copy to a named
grid:foreign-
array element-type, where the type is a list
(
defmethod
grid:copy-to-destination
((
source
array
)
(
destclass
list
))
(
let
((
destination
(
make-m
array
destclass
:dimensions
(
array-dimensions
source
))))
(
grid:make-foreign-
array
destclass
:dimensions
(
array-dimensions
source
))))
(
grid:copy-to-destination
source
destination
)))
;;; Examples and tests
...
...
data/foreign-array.lisp
View file @
add07a4f
;; A grid:foreign-array with added metadata for GSL.
;; Liam Healy 2008-04-06 21:23:41EDT
;; Time-stamp: <2010-06-29 2
1:41:40
EDT foreign-array.lisp>
;; Time-stamp: <2010-06-29 2
2:08:52
EDT foreign-array.lisp>
;;
;; Copyright 2008, 2009, 2010 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
...
...
@@ -69,36 +69,6 @@
(
metadata-slot
object
'mpointer
)
(
make-gsl-metadata
object
)))
;;;;****************************************************************************
;;;; Make data from either the dimensions provided or from the initial values
;;;;****************************************************************************
;;;;;;; There are >1400 calls to make-marray, write an emulation?
;;; This should probably be moved/renamed grid:make-foreign-array.
(
export
'make-marray
)
(
defun
make-marray
(
element-type
&rest
keys
&key
dimensions
&allow-other-keys
)
"Make a GSLL array with the given element type,
:dimensions, and :initial-contents, :initial-element or :data."
(
when
(
subtypep
element-type
'grid:foreign-array
)
(
error
"Can't take a class name here anymore, sorry."
))
(
apply
'grid:make-grid
`
((
grid:foreign-array
,@
(
alexandria:ensure-list
dimensions
))
,
element-type
)
keys
))
(
defun
make-marray-or-default
(
default
dimensions
&optional
dont-make-if-nil
(
element-type
'double-float
)
initial-element
)
"If default is T or dont-make-if-nil, make a marray and
returned with the dimensions and element-type. If default is a
marray, it is returned."
(
if
(
member
default
(
list
t
dont-make-if-nil
))
(
if
initial-element
(
make-marray
element-type
:dimensions
dimensions
:initial-element
initial-element
)
(
make-marray
element-type
:dimensions
dimensions
))
default
))
;;;;****************************************************************************
;;;; Make from GSL mpointers
;;;;****************************************************************************
...
...
data/matrix.lisp
View file @
add07a4f
;; Matrices
;; Liam Healy 2008-04-15 21:57:52EDT matrix.lisp
;; Time-stamp: <2010-06-2
8 11:03:21
EDT matrix.lisp>
;; Time-stamp: <2010-06-2
9 22:10:48
EDT matrix.lisp>
;;
;; Copyright 2008, 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
...
...
@@ -45,7 +45,7 @@
(
defmfun
row
((
matrix
matrix
)
i
&optional
(
vector
(
make-m
array
element-type
:dimensions
(
dim1
matrix
))))
&optional
(
vector
(
grid:make-foreign-
array
element-type
:dimensions
(
dim1
matrix
))))
(
"gsl_matrix"
:type
"_get_row"
)
(((
mpointer
vector
)
:pointer
)
((
mpointer
matrix
)
:pointer
)
(
i
sizet
))
:definition
:generic
...
...
@@ -70,7 +70,7 @@
(
defmfun
column
((
matrix
matrix
)
i
&optional
(
vector
(
make-m
array
element-type
:dimensions
(
dim0
matrix
))))
&optional
(
vector
(
grid:make-foreign-
array
element-type
:dimensions
(
dim0
matrix
))))
(
"gsl_matrix"
:type
"_get_col"
)
(((
mpointer
vector
)
:pointer
)
((
mpointer
matrix
)
:pointer
)
(
i
sizet
))
:definition
:generic
...
...
@@ -145,7 +145,7 @@
((
source
matrix
)
&optional
(
destination
(
make-m
array
element-type
:dimensions
(
reverse
(
dimensions
source
)))))
(
grid:make-foreign-
array
element-type
:dimensions
(
reverse
(
dimensions
source
)))))
(
"gsl_matrix"
:type
"_transpose_memcpy"
)
(((
mpointer
destination
)
:pointer
)
((
mpointer
source
)
:pointer
))
:definition
:generic
...
...
documentation/index.html
View file @
add07a4f
...
...
@@ -290,12 +290,12 @@ area of memory.</p>
<p>
The
<a
href=
"http://repo.or.cz/w/gsd.git"
>
GSD
</a>
suite provides
many functions for construction, transformation, and composition of
GSL
m
arrays. When using grid functions for this purpose,
GSL
grid:foreign-
arrays. When using grid functions for this purpose,
the
<code>
grid:specification
</code>
will
contain
<code>
g
sl:m
array
</code>
as the type; for example,
contain
<code>
g
rid:foreign-
array
</code>
as the type; for example,
</p>
<pre>
(grid:make-grid '((g
sl:m
array 3 3) double-float) :initial-element 0)
(grid:make-grid '((g
rid:foreign-
array 3 3) double-float) :initial-element 0)
</pre>
<p>
will make a 3x3
<code>
matrix-double-float
</code>
.
...
...
@@ -304,7 +304,7 @@ area of memory.</p>
in that collection.
</p>
<p>
Common Lisp arrays should be created with
<code>
make-m
array
</code>
or
Common Lisp arrays should be created with
<code>
grid:make-foreign-
array
</code>
or
<code>
#m
</code>
:
The #m reader macro in the default form creates a vector or matrix of
element type double-float, which is the most common type needed for
...
...
@@ -348,8 +348,8 @@ area of memory.</p>
with
<code>
setf maref
</code>
. A complete CL array may
be extracted with the function
<code>
#'cl-array
</code>
.
</p>
<p>
Copying
m
arrays is performed with the function
<code>
copy
</code>
.
This works between
m
arrays, pointers, and CL arrays. It is useful
<p>
Copying
grid:foreign-
arrays is performed with the function
<code>
copy
</code>
.
This works between
grid:foreign-
arrays, pointers, and CL arrays. It is useful
for functions intended to be passed to GSL functions (for
e.g. solving, minimizing or fitting) that need to set a GSL vector
or matrix, because one can simply copy into the passed-in pointer.
...
...
@@ -361,7 +361,7 @@ area of memory.</p>
<p>
If you
use
<a
href=
"http://common-lisp.net/project/iterate/"
>
iterate
</a>
,
there are extensions defined that make it easier to iterate over
m
arrays. These are:
grid:foreign-
arrays. These are:
<ul>
<li><code>
matrix-row
</code>
,
<code>
matrix-row-index
</code></li>
<li><code>
matrix-column
</code>
,
<code>
matrix-column-index
</code></li>
...
...
@@ -472,7 +472,7 @@ and arrays used internally or for function return.
<!-- Created: Feb 25 2005 -->
<!-- hhmts start -->
<small>
Time-stamp:
<
2010
-06-2
7
18
:05:50
EDT
index.html
>
Time-stamp:
<
2010
-06-2
9
22
:51:17
EDT
index.html
>
</small>
<!-- hhmts end -->
</div>
...
...
eigensystems/generalized.lisp
View file @
add07a4f
;; Real generalized eigensystems
;; Liam Healy 2009-02-16 12:55:04EST real-generalized.lisp
;; Time-stamp: <20
09-12-27 09:45:35ES
T generalized.lisp>
;; Time-stamp: <20
10-06-29 22:15:24ED
T generalized.lisp>
;;
;; Copyright 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
...
...
@@ -59,7 +59,7 @@
(
defmfun
eigenvalues-gensymm
((
A
matrix
)
(
B
matrix
)
&optional
(
eigenvalues
(
make-m
array
element-type
:dimensions
(
dim0
A
)))
(
eigenvalues
(
grid:make-foreign-
array
element-type
:dimensions
(
dim0
A
)))
(
ws
(
eltcase
complex
(
make-eigen-genherm
(
dim0
A
))
t
(
make-eigen-gensymm
(
dim0
A
)))))
(
double-float
"gsl_eigen_gensymm"
...
...
@@ -81,8 +81,8 @@
(
defmfun
eigenvalues-eigenvectors-gensymm
((
A
matrix
)
(
B
matrix
)
&optional
(
eigenvalues
(
make-m
array
element-type
:dimensions
(
dim0
A
)))
(
eigenvectors
(
make-m
array
element-type
:dimensions
(
dimensions
A
)))
(
eigenvalues
(
grid:make-foreign-
array
element-type
:dimensions
(
dim0
A
)))
(
eigenvectors
(
grid:make-foreign-
array
element-type
:dimensions
(
dimensions
A
)))
(
ws
(
eltcase
complex
(
make-eigen-hermv
(
dim0
A
))
t
(
make-eigen-symmv
(
dim0
A
)))))
(
double-float
"gsl_eigen_gensymmv"
...
...
eigensystems/nonsymmetric-generalized.lisp
View file @
add07a4f
;; Generalized eigensystems for nonsymmetric real matrices
;; Liam Healy 2009-02-16 14:27:20EST nonsymmetric-generalized.lisp
;; Time-stamp: <20
09-12-27 09:45:35ES
T nonsymmetric-generalized.lisp>
;; Time-stamp: <20
10-06-29 22:15:24ED
T nonsymmetric-generalized.lisp>
;;
;; Copyright 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
...
...
@@ -54,20 +54,20 @@
(
A
B
&optional
(
alpha
(
make-m
array
'
(
complex
double-float
)
:dimensions
(
dim0
A
)))
(
grid:make-foreign-
array
'
(
complex
double-float
)
:dimensions
(
dim0
A
)))
(
beta
(
make-m
array
'double-float
:dimensions
(
dim0
A
)))
(
grid:make-foreign-
array
'double-float
:dimensions
(
dim0
A
)))
(
ws
(
make-eigen-gen
(
dim0
A
)))
compute-shur-form-s
compute-shur-form-t
shur-vectors
&aux
(
balance
nil
)
; unused by GSL
(
Q
(
if
(
eql
shur-vectors
t
)
(
make-m
array
'double-float
:dimensions
(
dimensions
A
))
(
grid:make-foreign-
array
'double-float
:dimensions
(
dimensions
A
))
shur-vectors
))
(
Z
(
if
(
eql
shur-vectors
t
)
(
make-m
array
'double-float
:dimensions
(
dimensions
A
))
(
grid:make-foreign-
array
'double-float
:dimensions
(
dimensions
A
))
shur-vectors
)))
(
"gsl_eigen_gen"
"gsl_eigen_gen_QZ"
)
((((
mpointer
A
)
:pointer
)
((
mpointer
B
)
:pointer
)
...
...
@@ -114,22 +114,22 @@
(
A
B
&optional
(
alpha
(
make-m
array
'
(
complex
double-float
)
:dimensions
(
dim0
A
)))
(
grid:make-foreign-
array
'
(
complex
double-float
)
:dimensions
(
dim0
A
)))
(
beta
(
make-m
array
'double-float
:dimensions
(
dim0
A
)))
(
grid:make-foreign-
array
'double-float
:dimensions
(
dim0
A
)))
(
eigenvectors
(
make-m
array
'double-float
:dimensions
(
dimensions
A
)))
(
grid:make-foreign-
array
'double-float
:dimensions
(
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
)
(
make-m
array
'double-float
:dimensions
(
dimensions
A
))
(
grid:make-foreign-
array
'double-float
:dimensions
(
dimensions
A
))
shur-vectors
))
(
Z
(
if
(
eql
shur-vectors
t
)
(
make-m
array
'double-float
:dimensions
(
dimensions
A
))
(
grid:make-foreign-
array
'double-float
:dimensions
(
dimensions
A
))
shur-vectors
)))
(
"gsl_eigen_genv"
"gsl_eigen_genv_QZ"
)
((((
mpointer
A
)
:pointer
)
((
mpointer
B
)
:pointer
)
...
...
eigensystems/nonsymmetric.lisp
View file @
add07a4f
;; Eigensystems for nonsymmetric real matrices
;; Liam Healy 2009-02-16 12:51:18EST nonsymmetric.lisp
;; Time-stamp: <20
09-12-27 09:45:34ES
T nonsymmetric.lisp>
;; Time-stamp: <20
10-06-29 22:15:24ED
T nonsymmetric.lisp>
;;
;; Copyright 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
...
...
@@ -52,13 +52,13 @@
(
A
&optional
(
eigenvalues
(
make-m
array
'
(
complex
double-float
)
:dimensions
(
dim0
A
)))
(
grid:make-foreign-
array
'
(
complex
double-float
)
:dimensions
(
dim0
A
)))
(
ws
(
make-eigen-nonsymm
(
dim0
A
)))
compute-shur-form
balance
shur-vectors
&aux
(
sv
(
if
(
eql
shur-vectors
t
)
(
make-m
array
'double-float
:dimensions
(
dimensions
A
))
(
grid:make-foreign-
array
'double-float
:dimensions
(
dimensions
A
))
shur-vectors
)))
(
"gsl_eigen_nonsymm"
"gsl_eigen_nonsymm_Z"
)
((((
mpointer
A
)
:pointer
)
...
...
@@ -117,15 +117,15 @@
(
A
&optional
(
eigenvalues
(
make-m
array
'
(
complex
double-float
)
:dimensions
(
dim0
A
)))
(
grid:make-foreign-
array
'
(
complex
double-float
)
:dimensions
(
dim0
A
)))
(
eigenvectors
(
make-m
array
'
(
complex
double-float
)
:dimensions
(
dimensions
A
)))
(
grid:make-foreign-
array
'
(
complex
double-float
)
:dimensions
(
dimensions
A
)))
(
ws
(
make-eigen-nonsymmv
(
dim0
A
)))
shur-vectors
&aux
(
sv
(
if
(
eql
shur-vectors
t
)
(
make-m
array
'double-float
:dimensions
(
dimensions
A
))
(
grid:make-foreign-
array
'double-float
:dimensions
(
dimensions
A
))
shur-vectors
)))
(
"gsl_eigen_nonsymmv"
"gsl_eigen_nonsymmv_Z"
)
((((
mpointer
A
)
:pointer
)
...
...
eigensystems/symmetric-hermitian.lisp
View file @
add07a4f
;; Eigenvectors and eigenvalues
;; Liam Healy, Sun May 21 2006 - 19:52
;; Time-stamp: <20
09-12-27 09:43:47ES
T symmetric-hermitian.lisp>
;; Time-stamp: <20
10-06-29 22:15:24ED
T symmetric-hermitian.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
...
...
@@ -69,7 +69,7 @@
(
defmfun
eigenvalues
((
A
matrix
)
&optional
(
eigenvalues
(
make-m
array
element-type
:dimensions
(
dim0
A
)))
(
eigenvalues
(
grid:make-foreign-
array
element-type
:dimensions
(
dim0
A
)))
(
ws
(
eltcase
complex
(
make-eigen-herm
(
dim0
A
))
t
(
make-eigen-symm
(
dim0
A
)))))
(
double-float
"gsl_eigen_symm"
...
...
@@ -94,8 +94,8 @@
(
defmfun
eigenvalues-eigenvectors
((
A
matrix
)
&optional
(
eigenvalues
(
make-m
array
element-type
:dimensions
(
dim0
A
)))
(
eigenvectors
(
make-m
array
element-type
:dimensions
(
dimensions
A
)))
(
eigenvalues
(
grid:make-foreign-
array
element-type
:dimensions
(
dim0
A
)))
(
eigenvectors
(
grid:make-foreign-
array
element-type
:dimensions
(
dimensions
A
)))
(
ws
(
eltcase
complex
(
make-eigen-hermv
(
dim0
A
))
t
(
make-eigen-symmv
(
dim0
A
)))))
(
double-float
"gsl_eigen_symmv"
...
...
@@ -159,8 +159,8 @@
|#
(
defun
eigenvalue-eigenvectors-example
()
(
let
((
evecs
(
make-m
array
'double-float
:dimensions
'
(
3
3
)))
(
evals
(
make-m
array
'double-float
:dimensions
3
))
(
let
((
evecs
(
grid:make-foreign-
array
'double-float
:dimensions
'
(
3
3
)))
(
evals
(
grid:make-foreign-
array
'double-float
:dimensions
3
))
(
mat
#
m
(
20.0d0
-10.0d0
0.0d0
^
-10.0d0
30.0d0
0.0d0
^
0.0d0
0.0d0
40.0d0
)))
...
...
fast-fourier-transforms/discrete.lisp
View file @
add07a4f
;; Discrete Fourier Transforms
;; Liam Healy 2009-11-07 14:24:07EST
;; Time-stamp: <2010-06-2
7 18:13:59
EDT discrete.lisp>
;; Time-stamp: <2010-06-2
9 22:15:25
EDT discrete.lisp>
;;
;; Copyright 2009 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
(
make-m
array
element-type
:dimensions
(
dimensions
vector
))))
(
result
(
grid:make-foreign-
array
element-type
:dimensions
(
dimensions
vector
))))
(
"gsl_dft"
:type
"_forward"
)
(((
foreign-pointer
vector
)
:pointer
)
(
stride
sizet
)
((
floor
(
size
vector
)
stride
)
sizet
)
((
foreign-pointer
result
)
:pointer
))
...
...
@@ -45,7 +45,7 @@
(
defmfun
backward-discrete-fourier-transform
((
vector
vector
)
&key
(
stride
1
)
(
result
(
make-m
array
element-type
:dimensions
(
dimensions
vector
))))
(
result
(
grid:make-foreign-
array
element-type
:dimensions
(
dimensions
vector
))))
(
"gsl_dft"
:type
"_backward"
)
(((
foreign-pointer
vector
)
:pointer
)
(
stride
sizet
)
((
floor
(
size
vector
)
stride
)
sizet
)
((
foreign-pointer
result
)
:pointer
))
...
...
@@ -61,7 +61,7 @@
(
defmfun
inverse-discrete-fourier-transform
((
vector
vector
)
&key
(
stride
1
)
(
result
(
make-m
array
element-type
:dimensions
(
dimensions
vector
))))
(
result
(
grid:make-foreign-
array
element-type
:dimensions
(
dimensions
vector
))))
(
"gsl_dft"
:type
"_inverse"
)
(((
foreign-pointer
vector
)
:pointer
)
(
stride
sizet
)
((
floor
(
size
vector
)
stride
)
sizet
)
((
foreign-pointer
result
)
:pointer
))
...
...
@@ -77,7 +77,7 @@
(
defmfun
discrete-fourier-transform
((
vector
vector
)
&key
(
stride
1
)
(
result
(
make-m
array
element-type
:dimensions
(
dimensions
vector
))))
(
result
(
grid:make-foreign-
array
element-type
:dimensions
(
dimensions
vector
))))
(
"gsl_dft"
:type
"_transform"
)
(((
foreign-pointer
vector
)
:pointer
)
(
stride
sizet
)
((
floor
(
size
vector
)
stride
)
sizet
)
((
foreign-pointer
result
)
:pointer
))
...
...
fast-fourier-transforms/example.lisp
View file @
add07a4f
;; Example FFT: transform a pulse (using the "clean" fft interface)
;; Sumant Oemrawsingh, Sat Oct 31 2009 - 00:24
;; Time-stamp: <2010-06-2
7 18:03:24
EDT example.lisp>
;; Time-stamp: <2010-06-2
9 22:15:25
EDT example.lisp>
;;
;; Copyright 2009 Sumant Oemrawsingh, Liam M. Healy
;; Distributed under the terms of the GNU General Public License
...
...
@@ -40,7 +40,7 @@
(
defun
fft-pulse-test
(
element-type
dimension
)
(
assert
(
and
(
integerp
dimension
)
(
>
dimension
20
)))
(
let
((
pulse
(
make-m
array
element-type
:dimensions
dimension
))
(
let
((
pulse
(
grid:make-foreign-
array
element-type
:dimensions
dimension
))
(
init-value
(
coerce
1
element-type
)))
(
setf
(
maref
pulse
0
)
init-value
)
(
loop
for
i
from
1
to
10
...
...
@@ -76,7 +76,7 @@
;; (make-urand-vector '(complex double-float) 5)
(
defun
make-urand-vector
(
element-type
dimension
&key
(
stride
1
))
"Make a vector with random elements."
(
let
((
vec
(
make-m
array
`
(
complex
,
(
grid:component-float-type
element-type
))
(
let
((
vec
(
grid:make-foreign-
array
`
(
complex
,
(
grid:component-float-type
element-type
))
:dimensions
(
list
(
*
stride
dimension
)))))
(
loop
for
i
from
0
below
(
*
stride
dimension
)
by
stride
do
...
...
@@ -89,7 +89,7 @@
(
defun
realpart-vector
(
complex-vector
)
"The real vector consisting of the real part of the complex vector."
(
let
((
real-vector
(
make-m
array
(
grid:make-foreign-
array
(
grid:component-float-type
(
element-type
complex-vector
))
:dimensions
(
dimensions
complex-vector
))))
(
loop
for
i
below
(
total-size
complex-vector
)
do
...
...
@@ -141,7 +141,7 @@
(
if
(
and
(
have-at-least-gsl-version
'
(
1
12
))
#+
fsbv
t
#-
fsbv
nil
)
(
elt/
(
copy
backward
)
(
size-vector-real
backward
:stride
stride
))
;; Hack for old GSL version without complex vector math
(
make-m
array
(
grid:make-foreign-
array
(
element-type
backward
)
:dimensions
(
dimensions
backward
)
:initial-contents
...
...
fast-fourier-transforms/extras.lisp
View file @
add07a4f
...
...
@@ -59,7 +59,7 @@
neg-f
(
loop
for
i
from
min-f-index
below
0
collect
(
coerce
(
*
i
df
)
element-type
)))
(
make-m
array
element-type
(
grid:make-foreign-
array
element-type
:initial-contents
(
if
shifted
(
nconc
neg-f
pos-f
)
(
nconc
pos-f
neg-f
))))))
...
...
fast-fourier-transforms/unpack.lisp
View file @
add07a4f
;; Unpack functions for FFT vectors.
;; Sumant Oemrawsingh, Sun Oct 25 2009 - 16:35
;; Time-stamp: <2010-06-2
7 18:14:00
EDT unpack.lisp>
;; Time-stamp: <2010-06-2
9 22:12:06
EDT unpack.lisp>
;;
;; Copyright 2009 Sumant Oemrawsingh, Liam M. Healy
;; Distributed under the terms of the GNU General Public License
...
...
@@ -30,9 +30,9 @@
&key
(
stride
1
)
(
output
(
eltcase
single-float
(
make-m
array
'
(
complex
single-float
)
:dimensions
(
size
vector
))
(
grid:make-foreign-
array
'
(
complex
single-float
)
:dimensions
(
size
vector
))
t
(
make-m
array
'
(
complex
double-float
)
:dimensions
(
size
vector
)))))
(
grid:make-foreign-
array
'
(
complex
double-float
)
:dimensions
(
size
vector
)))))
(
"gsl_fft_real"
:type
"_unpack"
)
(((
foreign-pointer
vector
)
:pointer
)
((
foreign-pointer
output
)
:pointer
)
...
...
@@ -54,9 +54,9 @@
&key
(
stride
1
)
(
output
(
eltcase
single-float
(
make-m
array
'
(
complex
single-float
)
:dimensions
(
size
vector
))
(
grid:make-foreign-
array
'
(
complex
single-float
)
:dimensions
(
size
vector
))
t
(
make-m
array
'
(
complex
double-float
)
:dimensions
(
size
vector
)))))
(
grid:make-foreign-
array
'
(
complex
double-float
)
:dimensions
(
size
vector
)))))
(
"gsl_fft_halfcomplex"
:type
"_radix2_unpack"
)
(((
foreign-pointer
vector
)
:pointer
)
((
foreign-pointer
output
)
:pointer
)
...
...
@@ -77,9 +77,9 @@
&key
(
stride
1
)
(
output
(
eltcase
single-float
(
make-m
array
'
(
complex
single-float
)
:dimensions
(
size
vector
))
(
grid:make-foreign-
array
'
(
complex
single-float
)
:dimensions
(
size
vector
))
t
(
make-m
array
'
(
complex
double-float
)
:dimensions
(
size
vector
)))))
(
grid:make-foreign-
array
'
(
complex
double-float
)
:dimensions
(
size
vector
)))))
(
"gsl_fft_halfcomplex"
:type
"_unpack"
)
(((
foreign-pointer
vector
)
:pointer
)
((
foreign-pointer
output
)
:pointer
)
...
...
hankel.lisp
View file @
add07a4f
;; Discrete Hankel Transforms.
;; Liam Healy, Sat Dec 8 2007 - 16:50
;; Time-stamp: <2010-06-2
7 18:13:50
EDT hankel.lisp>
;; Time-stamp: <2010-06-2
9 22:15:22
EDT hankel.lisp>
;;
;; Copyright 2007, 2008, 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
...
...
@@ -39,7 +39,7 @@
(
defmfun
apply-hankel
(
hankel
array-in
&optional