Commit 37fde725 authored by liam's avatar liam

Added nonlinear least squares with working example. Attempted

gsl-vector-unsigned-fixnum, but these don't work, so it's temporarily
commented out.  Made the letm for vectors less complicated when the
initialization is a literal vector.


git-svn-id: svn+ssh://pop/opt/space/mathematics/gsl/trunk@3285 a3d8a0fb-c1db-0310-ace7-a616afeb9e30
parent b40b3238
TODO
remove cffi-array
rename defun-gsl, defvariable.
Document with-gsl-objects
Document letm
Document chapters
organize presentation
what to do about regression tests? clean up files in floating-point if necessary
Errors in sorting; do C? see Sun Feb 10 2008
Other regression errors
Do tests in ia32.
normalize terminology for solve-minimize-fit; make subdir?
Wishlist:
Sun Feb 10 2008 GSLL creation of objects within letm as from e.g. #'covariance.
Bulk changes needed:
Rename defun-gsl, defvariable.
Clean up markup and header files.
Features:
......
;; Using GSL storage.
;; Liam Healy, Sun Mar 26 2006 - 16:32
;; Time-stamp: <2008-02-05 22:32:15EST data.lisp>
;; Time-stamp: <2008-02-10 15:30:20EST data.lisp>
;; $Id: $
(in-package :gsl)
......@@ -126,19 +126,30 @@
(lambda () (list argsymb size-or-initial))))))
;; Vector or other one-index object
`(defgo ,type (size-or-initial &optional zero)
(if (numberp size-or-initial)
;; Size is given as literal number
(list
`(make-data ',',type ,zero ,size-or-initial)
'free)
;; Determine at runtime whether first arg is initial or size
(let ((argsymb (gensym "ARG")))
(list
`(make-data ',',type ,zero
(if (numberp ,argsymb) ,argsymb (length ,argsymb)))
'free
(lambda (symb) `(unless (numberp ,argsymb) (setf (data ,symb) ,argsymb)))
(lambda () (list argsymb size-or-initial))))))))
(typecase size-or-initial
(number
;; Size is given as literal number
(list
`(make-data ',',type ,zero ,size-or-initial)
'free))
(vector
;; Initial value supplied as literal CL vector)
(let ((argsymb (gensym "ARG")))
(list
`(make-data ',',type ,zero
(length ,argsymb))
'free
(lambda (symb) `(setf (data ,symb) ,argsymb))
(lambda () (list argsymb size-or-initial)))))
(t
;; Determine at runtime whether first arg is initial or size
(let ((argsymb (gensym "ARG")))
(list
`(make-data ',',type ,zero
(if (numberp ,argsymb) ,argsymb (length ,argsymb)))
'free
(lambda (symb) `(unless (numberp ,argsymb) (setf (data ,symb) ,argsymb)))
(lambda () (list argsymb size-or-initial)))))))))
(defmacro defdata
(c-string cl-symbol cl-base-type
......
;; Vectors
;; Liam Healy, Sun Mar 26 2006 - 11:51
;; Time-stamp: <2008-02-04 19:44:24EST vector.lisp>
;; Time-stamp: <2008-02-10 11:06:54EST vector.lisp>
;; $Id: $
(in-package :gsl)
......@@ -62,8 +62,13 @@ deallocated with the vector.
(defdata "vector_float" vector-single single-float gsl-vector)
(defdata "vector_int" vector-fixnum fixnum gsl-vector)
(defdata "vector_complex" vector-complex complex gsl-vector)
;;; (defdata "vector_uint" vector-unsigned-fixnum (unsigned-byte 64) gsl-vector)
;;; doesn't work 2007-03-04.
;;; (deftype unsigned-fixnum () `(integer 0 ,most-positive-fixnum))
;;; (defdata "vector_uint" vector-unsigned-fixnum unsigned-fixnum gsl-vector)
;;; doesn't work either 2008-02-10.
(defmacro defun-gsl-vdsfc (&rest args)
"A defun-gsl for vectors of double, single, fixnum, and complex."
......
;; Definition of GSLL system
;; Liam Healy
;; Time-stamp: <2008-02-05 22:37:29EST gsll.asd>
;; Time-stamp: <2008-02-10 23:17:25EST gsll.asd>
;; $Id: $
(asdf:defsystem "gsll"
......@@ -174,4 +174,5 @@
(:file "minimization-one" :depends-on (init general))
(:file "roots-multi" :depends-on (init general data roots-one))
(:file "minimization-multi" :depends-on (init general data))
(:file "linear-least-squares" :depends-on (init general data random))))
(:file "linear-least-squares" :depends-on (init general data random))
(:file "nonlinear-least-squares" :depends-on (init general data random))))
This diff is collapsed.
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