Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
antik
gsll
Commits
2a877243
Commit
2a877243
authored
Aug 16, 2011
by
Liam M. Healy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'antik'
Conflicts: gsll.asd ordinary-differential-equations/ode-system.lisp random/dirichlet.lisp
parents
dfdabff8
13e65854
Changes
164
Hide whitespace changes
Inline
Side-by-side
Showing
75 changed files
with
850 additions
and
885 deletions
+850
-885
basis-splines.lisp
basis-splines.lisp
+7
-7
calculus/monte-carlo.lisp
calculus/monte-carlo.lisp
+5
-5
calculus/numerical-integration.lisp
calculus/numerical-integration.lisp
+3
-3
data/both.lisp
data/both.lisp
+17
-17
data/combination.lisp
data/combination.lisp
+4
-4
data/foreign-array.lisp
data/foreign-array.lisp
+14
-14
data/matrix.lisp
data/matrix.lisp
+13
-15
data/permutation.lisp
data/permutation.lisp
+5
-5
documentation/index.html
documentation/index.html
+16
-10
eigensystems/generalized.lisp
eigensystems/generalized.lisp
+5
-7
eigensystems/nonsymmetric-generalized.lisp
eigensystems/nonsymmetric-generalized.lisp
+7
-7
eigensystems/nonsymmetric.lisp
eigensystems/nonsymmetric.lisp
+5
-5
eigensystems/symmetric-hermitian.lisp
eigensystems/symmetric-hermitian.lisp
+6
-8
fast-fourier-transforms/backward.lisp
fast-fourier-transforms/backward.lisp
+9
-9
fast-fourier-transforms/discrete.lisp
fast-fourier-transforms/discrete.lisp
+14
-14
fast-fourier-transforms/example.lisp
fast-fourier-transforms/example.lisp
+19
-18
fast-fourier-transforms/extras.lisp
fast-fourier-transforms/extras.lisp
+8
-8
fast-fourier-transforms/forward.lisp
fast-fourier-transforms/forward.lisp
+7
-7
fast-fourier-transforms/inverse.lisp
fast-fourier-transforms/inverse.lisp
+9
-9
fast-fourier-transforms/select-direction.lisp
fast-fourier-transforms/select-direction.lisp
+4
-4
fast-fourier-transforms/unpack.lisp
fast-fourier-transforms/unpack.lisp
+8
-8
gsll-tests.asd
gsll-tests.asd
+0
-218
gsll.asd
gsll.asd
+199
-25
hankel.lisp
hankel.lisp
+8
-8
histogram/histogram.lisp
histogram/histogram.lisp
+5
-5
histogram/ntuple-example.dat
histogram/ntuple-example.dat
+0
-0
histogram/ntuple.lisp
histogram/ntuple.lisp
+2
-2
histogram/updating-accessing.lisp
histogram/updating-accessing.lisp
+7
-7
init/callback-compile-defs.lisp
init/callback-compile-defs.lisp
+3
-3
init/callback-included.lisp
init/callback-included.lisp
+5
-5
init/defmfun-array.lisp
init/defmfun-array.lisp
+16
-14
init/funcallable.lisp
init/funcallable.lisp
+3
-3
init/init.lisp
init/init.lisp
+31
-12
init/mobject.lisp
init/mobject.lisp
+4
-4
interpolation/evaluation.lisp
interpolation/evaluation.lisp
+10
-10
interpolation/interpolation.lisp
interpolation/interpolation.lisp
+4
-4
interpolation/lookup.lisp
interpolation/lookup.lisp
+2
-2
interpolation/spline-example.lisp
interpolation/spline-example.lisp
+2
-2
linear-algebra/blas1.lisp
linear-algebra/blas1.lisp
+13
-13
linear-algebra/blas2.lisp
linear-algebra/blas2.lisp
+19
-19
linear-algebra/blas3.lisp
linear-algebra/blas3.lisp
+11
-11
linear-algebra/cholesky.lisp
linear-algebra/cholesky.lisp
+6
-6
linear-algebra/diagonal.lisp
linear-algebra/diagonal.lisp
+11
-11
linear-algebra/householder.lisp
linear-algebra/householder.lisp
+3
-3
linear-algebra/lu.lisp
linear-algebra/lu.lisp
+14
-33
linear-algebra/matrix-generation.lisp
linear-algebra/matrix-generation.lisp
+5
-5
linear-algebra/qr.lisp
linear-algebra/qr.lisp
+7
-7
linear-algebra/qrpt.lisp
linear-algebra/qrpt.lisp
+6
-6
ordinary-differential-equations/evolution.lisp
ordinary-differential-equations/evolution.lisp
+5
-5
ordinary-differential-equations/ode-system.lisp
ordinary-differential-equations/ode-system.lisp
+13
-9
ordinary-differential-equations/stepping.lisp
ordinary-differential-equations/stepping.lisp
+6
-6
polynomial.lisp
polynomial.lisp
+23
-21
random/dirichlet.lisp
random/dirichlet.lisp
+8
-8
random/discrete.lisp
random/discrete.lisp
+3
-3
random/multinomial.lisp
random/multinomial.lisp
+6
-6
random/quasi.lisp
random/quasi.lisp
+3
-3
random/shuffling-sampling.lisp
random/shuffling-sampling.lisp
+9
-9
random/spherical-vector.lisp
random/spherical-vector.lisp
+3
-3
series-acceleration.lisp
series-acceleration.lisp
+6
-6
solve-minimize-fit/linear-least-squares.lisp
solve-minimize-fit/linear-least-squares.lisp
+29
-29
solve-minimize-fit/minimization-multi.lisp
solve-minimize-fit/minimization-multi.lisp
+15
-15
solve-minimize-fit/nonlinear-least-squares.lisp
solve-minimize-fit/nonlinear-least-squares.lisp
+16
-16
solve-minimize-fit/roots-multi.lisp
solve-minimize-fit/roots-multi.lisp
+20
-20
solve-minimize-fit/simulated-annealing.lisp
solve-minimize-fit/simulated-annealing.lisp
+6
-6
sorting.lisp
sorting.lisp
+20
-20
special-functions/bessel.lisp
special-functions/bessel.lisp
+14
-14
special-functions/coulomb.lisp
special-functions/coulomb.lisp
+8
-8
special-functions/gegenbauer.lisp
special-functions/gegenbauer.lisp
+3
-3
special-functions/legendre.lisp
special-functions/legendre.lisp
+9
-9
special-functions/mathieu.lisp
special-functions/mathieu.lisp
+8
-8
special-functions/psi.lisp
special-functions/psi.lisp
+2
-2
statistics/absolute-deviation.lisp
statistics/absolute-deviation.lisp
+8
-8
statistics/autocorrelation.lisp
statistics/autocorrelation.lisp
+4
-4
statistics/covariance.lisp
statistics/covariance.lisp
+8
-8
statistics/higher-moments.lisp
statistics/higher-moments.lisp
+14
-14
No files found.
basis-splines.lisp
View file @
2a877243
;; Basis splines.
;; Liam Healy 2008-02-18 14:43:20EST basis-splines.lisp
;; Time-stamp: <201
0
-0
6-30 19:5
7:2
8
EDT basis-splines.lisp>
;; Time-stamp: <201
1
-0
5-26 12:3
7:2
9
EDT basis-splines.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
...
...
@@ -125,18 +125,18 @@
(
let*
((
xi
(
coerce
(
*
i
(
/
15
(
1-
ndata
)))
'double-float
))
(
yi
(
+
(
*
(
cos
xi
)
(
exp
(
*
-0.1d0
xi
)))
(
sample
rng
:gaussian
:sigma
sigma
))))
(
setf
(
grid:
g
ref
x
i
)
xi
(
grid:
g
ref
y
i
)
yi
(
grid:
g
ref
w
i
)
(
/
(
expt
sigma
2
)))))
(
setf
(
grid:
a
ref
x
i
)
xi
(
grid:
a
ref
y
i
)
yi
(
grid:
a
ref
w
i
)
(
/
(
expt
sigma
2
)))))
;; Uniform breakpoints [0, 15]
(
uniform-knots
0.0d0
15.0d0
bw
)
;; Fit matrix
(
dotimes
(
i
ndata
)
;; Compute B_j
(
evaluate
bw
(
grid:
g
ref
x
i
)
:b
B
)
(
evaluate
bw
(
grid:
a
ref
x
i
)
:b
B
)
;; Fill in row i of X
(
dotimes
(
j
ncoeffs
)
(
setf
(
grid:
g
ref
Xmatrix
i
j
)
(
grid:
g
ref
B
j
))))
(
setf
(
grid:
a
ref
Xmatrix
i
j
)
(
grid:
a
ref
B
j
))))
;; Do the fit
(
linear-mfit
Xmatrix
y
c
w
nil
cov
mw
)
;; Return the smoothed curve
...
...
calculus/monte-carlo.lisp
View file @
2a877243
;; Monte Carlo Integration
;; Liam Healy Sat Feb 3 2007 - 17:42
;; Time-stamp: <201
0
-0
8-07 21:41:14ED
T monte-carlo.lisp>
;; Time-stamp: <201
1
-0
1-10 17:59:20ES
T monte-carlo.lisp>
;;
;; Copyright 2007, 2008, 2009 Liam M. Healy
;; Copyright 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
...
...
@@ -51,7 +51,7 @@
(
scalars
t
))
"gsl_monte_plain_integrate"
((
callback
:pointer
)
((
foreign-pointer
lower-limits
)
:pointer
)
((
foreign-pointer
upper-limits
)
:pointer
)
((
grid:
foreign-pointer
lower-limits
)
:pointer
)
((
grid:
foreign-pointer
upper-limits
)
:pointer
)
((
dim0
lower-limits
)
sizet
)
(
number-of-samples
sizet
)
((
mpointer
generator
)
:pointer
)
((
mpointer
state
)
:pointer
)
...
...
@@ -112,7 +112,7 @@
(
scalars
t
))
"gsl_monte_miser_integrate"
((
callback
:pointer
)
((
foreign-pointer
lower-limits
)
:pointer
)
((
foreign-pointer
upper-limits
)
:pointer
)
((
grid:
foreign-pointer
lower-limits
)
:pointer
)
((
grid:
foreign-pointer
upper-limits
)
:pointer
)
((
dim0
lower-limits
)
sizet
)
(
number-of-samples
sizet
)
((
mpointer
generator
)
:pointer
)
((
mpointer
state
)
:pointer
)
...
...
@@ -173,7 +173,7 @@
(
scalars
t
))
"gsl_monte_vegas_integrate"
((
callback
:pointer
)
((
foreign-pointer
lower-limits
)
:pointer
)
((
foreign-pointer
upper-limits
)
:pointer
)
((
grid:
foreign-pointer
lower-limits
)
:pointer
)
((
grid:
foreign-pointer
upper-limits
)
:pointer
)
((
dim0
lower-limits
)
sizet
)
(
number-of-samples
sizet
)
((
mpointer
generator
)
:pointer
)
((
mpointer
state
)
:pointer
)
...
...
calculus/numerical-integration.lisp
View file @
2a877243
;; Numerical integration
;; Liam Healy, Wed Jul 5 2006 - 23:14
;; Time-stamp: <201
0
-0
8-07 21:46
:21E
D
T numerical-integration.lisp>
;; Time-stamp: <201
1
-0
1-10 17:59
:21E
S
T numerical-integration.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009, 2010 Liam M. Healy
;; Copyright 2006, 2007, 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
...
...
@@ -157,7 +157,7 @@
(
limit
1000
)
(
workspace
(
make-integration-workspace
limit
)))
"gsl_integration_qagp"
((
callback
:pointer
)
((
foreign-pointer
points
)
:pointer
)
((
dim0
points
)
sizet
)
((
grid:
foreign-pointer
points
)
:pointer
)
((
dim0
points
)
sizet
)
(
absolute-error
:double
)
(
relative-error
:double
)
(
limit
sizet
)
((
mpointer
workspace
)
:pointer
)
(
result
(
:pointer
:double
))
(
abserr
(
:pointer
:double
)))
...
...
data/both.lisp
View file @
2a877243
;; Functions for both vectors and matrices.
;; Liam Healy 2008-04-26 20:48:44EDT both.lisp
;; Time-stamp: <201
0-11-25 09:31:17ES
T both.lisp>
;; Time-stamp: <201
1-05-26 12:37:36ED
T 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
...
...
@@ -35,13 +35,13 @@
:export
nil
:documentation
"Allocate memory for the GSL struct given a block pointer."
)
(
defmfun
alloc-from-block
((
object
matrix
)
blockptr
)
(
defmfun
alloc-from-block
((
object
grid:
matrix
)
blockptr
)
(
"gsl_"
:category
:type
"_alloc_from_block"
)
((
blockptr
:pointer
)
(
0
sizet
)
; offset
((
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
)
...
...
@@ -81,7 +81,7 @@
;;;;****************************************************************************
;;;; Array elements; used in callbacks scalarsp=T only
;;;;****************************************************************************
;;; Normal foreign array access is with grid:
g
ref, but in order to
;;; Normal foreign array access is with grid:
a
ref, but in order to
;;; avoid the overhead of instantiating a foreign-array object to
;;; access components, we use these macros which expand to gsl_*_get
;;; and gsl_*_set.
...
...
@@ -113,7 +113,7 @@
`
(
cffi:foreign-funcall
,
(
actual-gsl-function-name
`
(
"gsl_"
:category
:type
,
(
if
value
"_set"
"_get"
))
(
if
matrixp
'matrix
'vector
)
(
if
matrixp
'
grid:
matrix
'vector
)
element-type
)
:pointer
,
mpointer
sizet
,
(
first
indices
)
...
...
@@ -192,7 +192,7 @@
:documentation
; FDL
"Add the scalar complex x to all the elements of array a."
)
(
defmethod
elt+
((
x
float
)
(
a
foreign-array
))
(
defmethod
elt+
((
x
float
)
(
a
grid:
foreign-array
))
(
elt+
a
x
))
(
defmfun
elt-
((
a
both
)
(
b
both
))
...
...
@@ -207,7 +207,7 @@
"Subtract the elements of b from the elements of a.
The two must have the same dimensions."
)
(
defmethod
elt-
((
a
foreign-array
)
(
x
float
))
(
defmethod
elt-
((
a
grid:
foreign-array
)
(
x
float
))
(
elt+
a
(
-
x
)))
(
defmfun
elt*
((
a
vector
)
(
b
vector
))
...
...
@@ -222,7 +222,7 @@
"Multiply the elements of a by the elements of b.
The two must have the same dimensions."
)
(
defmfun
elt*
((
a
matrix
)
(
b
matrix
))
(
defmfun
elt*
((
a
grid:
matrix
)
(
b
grid:
matrix
))
(
"gsl_"
:category
:type
"_mul_elements"
)
(((
mpointer
a
)
:pointer
)
((
mpointer
b
)
:pointer
))
:definition
:methods
...
...
@@ -243,7 +243,7 @@
"Divide the elements of a by the elements of b.
The two must have the same dimensions."
)
(
defmfun
elt/
((
a
matrix
)
(
b
matrix
))
(
defmfun
elt/
((
a
grid:
matrix
)
(
b
grid:
matrix
))
(
"gsl_"
:category
:type
"_div_elements"
)
(((
mpointer
a
)
:pointer
)
((
mpointer
b
)
:pointer
))
:definition
:methods
...
...
@@ -252,7 +252,7 @@
:outputs
(
a
)
:return
(
a
))
(
defmethod
elt/
((
a
foreign-array
)
(
x
number
))
(
defmethod
elt/
((
a
grid:
foreign-array
)
(
x
number
))
(
elt*
a
(
/
x
)))
(
defmfun
elt*
((
a
both
)
(
x
float
))
...
...
@@ -279,7 +279,7 @@
:documentation
; FDL
"Multiply the elements of a by the scalar complex factor x."
)
(
defmethod
elt*
((
x
float
)
(
a
foreign-array
))
(
defmethod
elt*
((
x
float
)
(
a
grid:
foreign-array
))
(
elt*
a
x
))
;;;;****************************************************************************
...
...
@@ -329,7 +329,7 @@
"The index of the minimum value in a. When there are several
equal minimum elements, then the lowest index is returned."
)
(
defmfun
min-index
((
a
matrix
))
(
defmfun
min-index
((
a
grid:
matrix
))
(
"gsl_"
:category
:type
"_min_index"
)
(((
mpointer
a
)
:pointer
)
(
imin
(
:pointer
sizet
))
(
jmin
(
:pointer
sizet
)))
:definition
:methods
...
...
@@ -348,7 +348,7 @@
"The index of the maximum value in a. When there are several
equal maximum elements, then the lowest index is returned."
)
(
defmfun
max-index
((
a
matrix
))
(
defmfun
max-index
((
a
grid:
matrix
))
(
"gsl_"
:category
:type
"_max_index"
)
(((
mpointer
a
)
:pointer
)
(
imin
(
:pointer
sizet
))
(
jmin
(
:pointer
sizet
)))
:definition
:methods
...
...
@@ -369,7 +369,7 @@
returned. Returned indices are minimum, maximum; for matrices
imin, jmin, imax, jmax."
)
(
defmfun
minmax-index
((
a
matrix
))
(
defmfun
minmax-index
((
a
grid:
matrix
))
(
"gsl_"
:category
:type
"_minmax_index"
)
(((
mpointer
a
)
:pointer
)
(
imin
(
:pointer
sizet
))
(
jmin
(
:pointer
sizet
))
...
...
data/combination.lisp
View file @
2a877243
;; Combinations
;; Liam Healy, Sun Mar 26 2006 - 11:51
;; Time-stamp: <201
0
-0
7
-1
6
1
7
:1
4:03ED
T combination.lisp>
;; Time-stamp: <201
1
-0
1
-1
0
1
8
:1
6:28ES
T combination.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009, 2010 Liam M. Healy
;; Copyright 2006, 2007, 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
...
...
@@ -37,7 +37,7 @@
(
setf
(
grid:metadata-slot
object
'mpointer
)
mptr
(
cffi:foreign-slot-value
mptr
'gsl-combination-c
'data
)
(
foreign-pointer
object
)
(
grid:
foreign-pointer
object
)
(
cffi:foreign-slot-value
mptr
'gsl-combination-c
'range
)
range
(
cffi:foreign-slot-value
mptr
'gsl-combination-c
'size
)
...
...
@@ -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
)
...
...
data/foreign-array.lisp
View file @
2a877243
;; A grid:foreign-array with added metadata for GSL.
;; Liam Healy 2008-04-06 21:23:41EDT
;; Time-stamp: <201
0
-0
7
-1
3 22:53:0
2E
D
T foreign-array.lisp>
;; Time-stamp: <201
1
-0
1
-1
2 00:34:4
2E
S
T foreign-array.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
...
...
@@ -44,7 +44,7 @@
(
setf
(
cffi:foreign-slot-value
blockptr
'gsl-block-c
'size
)
(
size
object
)
(
cffi:foreign-slot-value
blockptr
'gsl-block-c
'data
)
(
foreign-pointer
object
)
(
grid:
foreign-pointer
object
)
(
grid:metadata-slot
object
'block-pointer
)
blockptr
)
(
let
((
array-struct
(
alloc-from-block
object
blockptr
)))
(
setf
...
...
@@ -53,8 +53,8 @@
;; from the block to the vector/matrix; we must do that manually here
(
cffi:foreign-slot-value
array-struct
(
if
(
typep
object
'matrix
)
'gsl-matrix-c
'gsl-vector-c
)
'data
)
(
foreign-pointer
object
))
(
if
(
typep
object
'
grid:
matrix
)
'gsl-matrix-c
'gsl-vector-c
)
'data
)
(
grid:
foreign-pointer
object
))
(
tg:finalize
object
(
lambda
()
(
cffi:foreign-free
blockptr
)
...
...
@@ -82,23 +82,23 @@
(
let*
((
category
(
case
category-or-rank
((
vector
:vector
1
)
'vector
)
((
matrix
:matrix
2
)
'matrix
)
((
matrix
grid:matrix
:matrix
2
)
'
grid:
matrix
)
(
t
(
error
"Unrecognized category ~a"
category-or-rank
))))
(
cstruct
(
case
category
(
vector
'gsl-vector-c
)
(
matrix
'gsl-matrix-c
)))
(
grid:
matrix
'gsl-matrix-c
)))
(
fa
(
grid:make-grid
(
case
category
(
vector
`
((
foreign-array
,
(
cffi:foreign-slot-value
mpointer
cstruct
'size
))
,
element-type
))
(
matrix
`
((
foreign-array
,
(
cffi:foreign-slot-value
mpointer
cstruct
'size0
)
,
(
cffi:foreign-slot-value
mpointer
cstruct
'size1
))
,
element-type
)))
`
((
grid:
foreign-array
,
(
cffi:foreign-slot-value
mpointer
cstruct
'size
))
,
element-type
))
(
grid:
matrix
`
((
grid:
foreign-array
,
(
cffi:foreign-slot-value
mpointer
cstruct
'size0
)
,
(
cffi:foreign-slot-value
mpointer
cstruct
'size1
))
,
element-type
)))
:foreign-pointer
(
cffi:foreign-slot-value
mpointer
cstruct
'data
)
:finalizer
finalize
)))
...
...
data/matrix.lisp
View file @
2a877243
;; Matrices
;; Liam Healy 2008-04-15 21:57:52EDT matrix.lisp
;; Time-stamp: <201
0
-0
6-29 22:10:48ED
T matrix.lisp>
;; Time-stamp: <201
1
-0
1-12 00:34:45ES
T 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
...
...
@@ -26,7 +26,7 @@
;;;; Mathematical
;;;;****************************************************************************
(
defmfun
set-identity
((
matrix
matrix
))
(
defmfun
set-identity
((
matrix
grid:
matrix
))
(
"gsl_matrix"
:type
"_set_identity"
)
(((
mpointer
matrix
)
:pointer
))
:definition
:generic
...
...
@@ -43,8 +43,7 @@
;;;; Copying rows and columns
;;;;****************************************************************************
(
defmfun
row
((
matrix
matrix
)
i
(
defmfun
row
((
matrix
grid:matrix
)
i
&optional
(
vector
(
grid:make-foreign-array
element-type
:dimensions
(
dim1
matrix
))))
(
"gsl_matrix"
:type
"_get_row"
)
(((
mpointer
vector
)
:pointer
)
((
mpointer
matrix
)
:pointer
)
(
i
sizet
))
...
...
@@ -57,7 +56,7 @@
into the vector. The length of the vector must be the
same as the length of the row."
)
(
defmfun
(
setf
row
)
((
vector
vector
)
(
matrix
matrix
)
i
)
(
defmfun
(
setf
row
)
((
vector
vector
)
(
matrix
grid:
matrix
)
i
)
(
"gsl_matrix"
:type
"_set_row"
)
(((
mpointer
matrix
)
:pointer
)
(
i
sizet
)
((
mpointer
vector
)
:pointer
))
:definition
:generic
...
...
@@ -68,8 +67,7 @@
"Copy the elements of the vector into the jth row of the matrix.
The length of the vector must be the same as the length of the row."
)
(
defmfun
column
((
matrix
matrix
)
i
(
defmfun
column
((
matrix
grid:matrix
)
i
&optional
(
vector
(
grid:make-foreign-array
element-type
:dimensions
(
dim0
matrix
))))
(
"gsl_matrix"
:type
"_get_col"
)
(((
mpointer
vector
)
:pointer
)
((
mpointer
matrix
)
:pointer
)
(
i
sizet
))
...
...
@@ -82,7 +80,7 @@
into the vector. The length of the vector must be the
same as the length of the column."
)
(
defmfun
(
setf
column
)
((
vector
vector
)
(
matrix
matrix
)
i
)
(
defmfun
(
setf
column
)
((
vector
vector
)
(
matrix
grid:
matrix
)
i
)
(
"gsl_matrix"
:type
"_set_col"
)
(((
mpointer
matrix
)
:pointer
)
(
i
sizet
)
((
mpointer
vector
)
:pointer
))
:definition
:generic
...
...
@@ -97,7 +95,7 @@
;;;; Exchanging rows and columns
;;;;****************************************************************************
(
defmfun
swap-rows
((
matrix
matrix
)
i
j
)
(
defmfun
swap-rows
((
matrix
grid:
matrix
)
i
j
)
(
"gsl_matrix"
:type
"_swap_rows"
)
(((
mpointer
matrix
)
:pointer
)
(
i
sizet
)
(
j
sizet
))
:definition
:generic
...
...
@@ -107,7 +105,7 @@
:documentation
; FDL
"Exchange the ith and jth rows of the matrix in-place."
)
(
defmfun
swap-columns
((
matrix
matrix
)
i
j
)
(
defmfun
swap-columns
((
matrix
grid:
matrix
)
i
j
)
(
"gsl_matrix"
:type
"_swap_columns"
)
(((
mpointer
matrix
)
:pointer
)
(
i
sizet
)
(
j
sizet
))
:definition
:generic
...
...
@@ -117,7 +115,7 @@
:documentation
; FDL
"Exchange the ith and jth columns of the matrix in-place."
)
(
defmfun
swap-row-column
((
matrix
matrix
)
i
j
)
(
defmfun
swap-row-column
((
matrix
grid:
matrix
)
i
j
)
(
"gsl_matrix"
:type
"_swap_rowcol"
)
(((
mpointer
matrix
)
:pointer
)
(
i
sizet
)
(
j
sizet
))
:definition
:generic
...
...
@@ -129,7 +127,7 @@
matrix in-place. The matrix must be square for this operation to
be possible."
)
(
defmfun
matrix-transpose*
((
matrix
matrix
))
(
defmfun
matrix-transpose*
((
matrix
grid:
matrix
))
(
"gsl_matrix"
:type
"_transpose"
)
(((
mpointer
matrix
)
:pointer
))
:definition
:generic
...
...
@@ -142,10 +140,10 @@
operation to be possible."
)
(
defmfun
matrix-transpose
((
source
matrix
)
((
source
grid:
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
...
...
data/permutation.lisp
View file @
2a877243
;; Permutations
;; Liam Healy, Sun Mar 26 2006 - 11:51
;; Time-stamp: <201
0-11-13 18:44:09ES
T permutation.lisp>
;; Time-stamp: <201
1-05-26 12:37:36ED
T permutation.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009, 2010 Liam M. Healy
;; Copyright 2006, 2007, 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
...
...
@@ -38,7 +38,7 @@
(
setf
(
grid:metadata-slot
object
'mpointer
)
mptr
(
cffi:foreign-slot-value
mptr
'gsl-permutation-c
'data
)
(
foreign-pointer
object
)
(
grid:
foreign-pointer
object
)
(
cffi:foreign-slot-value
mptr
'gsl-permutation-c
'size
)
(
first
dimensions
))
(
tg:finalize
object
(
lambda
()
(
cffi:foreign-free
mptr
)))))
...
...
@@ -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)
...
...
@@ -339,7 +339,7 @@
(
save-test
permutation
(
let
((
perm-1
(
make-permutation
4
t
)))
(
grid:
g
ref
perm-1
2
))
(
grid:
a
ref
perm-1
2
))
(
let
((
perm-1
(
make-permutation
4
t
)))
;grid:contents
(
grid:contents
perm-1
))
(
let
((
perm-1
(
make-permutation
4
t
)))
;permutation-reverse
...
...
documentation/index.html
View file @
2a877243
...
...
@@ -9,6 +9,21 @@
content=
"text/html; charset=iso-8859-1"
>
<link
rev=
"made"
href=
"mailto:lhealy@common-lisp.net"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"site.css"
>
<script
type=
"text/javascript"
>
var
_gaq
=
_gaq
||
[];
_gaq
.
push
([
'
_setAccount
'
,
'
UA-25052371-1
'
]);
_gaq
.
push
([
'
_setDomainName
'
,
'
none
'
]);
_gaq
.
push
([
'
_setAllowLinker
'
,
true
]);
_gaq
.
push
([
'
_trackPageview
'
]);
(
function
()
{
var
ga
=
document
.
createElement
(
'
script
'
);
ga
.
type
=
'
text/javascript
'
;
ga
.
async
=
true
;
ga
.
src
=
(
'
https:
'
==
document
.
location
.
protocol
?
'
https://ssl
'
:
'
http://www
'
)
+
'
.google-analytics.com/ga.js
'
;
var
s
=
document
.
getElementsByTagName
(
'
script
'
)[
0
];
s
.
parentNode
.
insertBefore
(
ga
,
s
);
})();
</script>
</head>
<body>
<div
id=
"banner"
>
...
...
@@ -336,18 +351,9 @@ four-digit number; please attach them all to your email.
<!-- Created: Feb 25 2005 -->
<!-- hhmts start -->
<small>
Time-stamp:
<
201
0
-10-12
17
:46:29
EDT
index.html
>
Time-stamp:
<
201
1
-08-09
22
:37:23
EDT
index.html
>
</small>
<!-- hhmts end -->
</div>
<script
type=
"text/javascript"
>
var
gaJsHost
=
((
"
https:
"
==
document
.
location
.
protocol
)
?
"
https://ssl.
"
:
"
http://www.
"
);
document
.
write
(
unescape
(
"
%3Cscript src='
"
+
gaJsHost
+
"
google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E
"
));
</script>
<script
type=
"text/javascript"
>
var
pageTracker
=
_gat
.
_getTracker
(
"
UA-3669275-1
"
);
pageTracker
.
_initData
();
pageTracker
.
_trackPageview
();
</script>
</body>
</html>
eigensystems/generalized.lisp
View file @
2a877243
;; Real generalized eigensystems
;; Liam Healy 2009-02-16 12:55:04EST real-generalized.lisp
;; Time-stamp: <201
0
-0
6-29 22:15:24ED
T generalized.lisp>
;; Time-stamp: <201
1
-0
1-12 00:08:22ES
T 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
...
...
@@ -56,8 +56,7 @@
n-by-n complex generalized hermitian-definite eigensystems. The
size of the workspace is O(5n)."
)
(
defmfun
eigenvalues-gensymm
((
A
matrix
)
(
B
matrix
)
(
defmfun
eigenvalues-gensymm
((
A
grid:matrix
)
(
B
grid:matrix
)
&optional
(
eigenvalues
(
grid:make-foreign-array
element-type
:dimensions
(
dim0
A
)))
(
ws
(
eltcase
complex
(
make-eigen-genherm
(
dim0
A
))
...
...
@@ -78,11 +77,10 @@
outlined above. On output, B contains its Cholesky decomposition and
A is destroyed."
)
(
defmfun
eigenvalues-eigenvectors-gensymm
((
A
matrix
)
(
B
matrix
)
(
defmfun
eigenvalues-eigenvectors-gensymm
((
A
grid:matrix
)
(
B
grid:matrix
)
&optional
(
eigenvalues
(
grid:make-foreign-array
element-type
:dimensions
(
dim0
A
)))
(
eigenvectors
(
grid:make-foreign-array
element-type
:dimensions
(
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"
...
...
eigensystems/nonsymmetric-generalized.lisp
View file @
2a877243
;; Generalized eigensystems for nonsymmetric real matrices
;; Liam Healy 2009-02-16 14:27:20EST nonsymmetric-generalized.lisp
;; Time-stamp: <201
0-06-29 22:15:2
4E
D
T nonsymmetric-generalized.lisp>
;; Time-stamp: <201
1-01-10 18:19:1
4E
S
T 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/nonsymmetric.lisp
View file @
2a877243
;; Eigensystems for nonsymmetric real matrices
;; Liam Healy 2009-02-16 12:51:18EST nonsymmetric.lisp
;; Time-stamp: <201
0
-0
6-29 22:15:24ED
T nonsymmetric.lisp>
;; Time-stamp: <201
1
-0
1-10 18:19:13ES
T 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