Browse files

clean up targets and dependencies; cleaner CL despite sideeffect func…

…tions
  • Loading branch information...
1 parent 4fe6d33 commit 91599955f127bfb76358f9325316df77fa133f7d @blindglobe committed Jul 11, 2007
Showing with 60 additions and 53 deletions.
  1. +3 −4 Makefile
  2. +5 −4 lispstat.asd
  3. +0 −1 ls-user.lisp
  4. +0 −1 lsmath.lsp
  5. +52 −43 optimize.lisp
View
7 Makefile
@@ -14,11 +14,10 @@ git-push :
clean:
(cd lib; make clean)
- rm -f *.o *.fasl kclcmplr *~
+ rm -f *.o *.fasl *~
-cleanall:
- (cd lib; make cleanall)
- rm -f *.o *.fasl kclcmplr saved_kcls kcls cls
+dist-clean: clean
+ rm -rf fasl sbcl-fasl
## C compilation
View
9 lispstat.asd
@@ -50,10 +50,15 @@ Last touched 1991, then in 2005--2007."
"sequence"))
(:lispstat-lsp-source-file "lsmacros"
:depends-on ("compound"))
+ (:lispstat-lsp-source-file "lsmath"
+ :depends-on ("lsobjects"
+ "lsmacros"
+ "lsfloat"))
(:lispstat-lsp-source-file "matrices"
:depends-on ("sequence"))
(:lispstat-lsp-source-file "linalg"
:depends-on ("lstypes"
+ "lsmath"
"matrices"))
(:lispstat-lsp-source-file "lsbasics"
:depends-on ("lsobjects"
@@ -64,10 +69,6 @@ Last touched 1991, then in 2005--2007."
"matrices"
"linalg"))
- (:lispstat-lsp-source-file "lsmath"
- :depends-on ("lsbasics"
- "lsmacros"
- "lsfloat"))
(:lispstat-lsp-source-file "dists"
:depends-on ("lsbasics"))
View
1 ls-user.lisp
@@ -27,7 +27,6 @@ should be packaged up elsewhere for reproducibility.")
min max logand logior logxor lognot ffloor fceiling
ftruncate fround signum cis)
-
(:export
;; lsobjects.lsp : should this become a prototype object?
defproto defmeth send
View
1 lsmath.lsp
@@ -16,7 +16,6 @@
:lisp-stat-object-system
:lisp-stat-macros
:lisp-stat-float)
- ;; Shadow the symbols in the lisp package that will be redefined
(:shadowing-import-from :lisp-stat-object-system
slot-value call-method call-next-method)
(:shadow expt + - * / ** mod rem abs 1+ 1- log exp sqrt sin cos tan
View
95 optimize.lisp
@@ -11,9 +11,14 @@
:lisp-stat-basics)
(:shadowing-import-from :lisp-stat-object-system
slot-value call-method call-next-method)
- (:export newtonmax nelmeadmax
+ (:export
+ ;; derivatives
+ numgrad numhess
- numgrad numhess))
+ ;; optimization
+ newtonmax nelmeadmax))
+
+
;;; FIXME:AJR: There is a need to figure out the proper symbols to
;;; export. more importantly should there be any specialty package
@@ -23,54 +28,58 @@ z;;; that are exported for maximization?
(defvar *maximize-callback-function* nil
"Used in generic optimization to determine function name -- symbol or string?")
+
(defvar *maximize-callback-arg* nil
"args to function to maximize")
;;;;
;;;; minfo basics (internal??)
;;;;
-(defun init-minfo-ipar-values (n ipars)
- (let* ((TRUE 1)
- (FALSE 0)
- (k 0)
- (m 0)
- (itnlimit -1)
- (backtrack TRUE)
- (verbose 0)
- (vals_suppl FALSE)
- (exptilt TRUE)
- (count 0)
- (termcode 0))
- (setf (aref ipars 0) n)
- (setf (aref ipars 1) m)
- (setf (aref ipars 2) k)
- (setf (aref ipars 3) itnlimit)
- (setf (aref ipars 4) backtrack)
- (setf (aref ipars 5) verbose)
- (setf (aref ipars 6) vals_suppl)
- (setf (aref ipars 7) exptilt)
- (setf (aref ipars 8) count)
- (setf (aref ipars 9) termcode)))
-
-(defun init-minfo-dpar-values (h dpars)
- (let ((typf 1.0)
- (gradtol -1.0)
- (steptol -1.0)
- (maxstep -1.0)
- (dflt 0.0)
- (tilt 0.0)
- (newtilt 0.0)
- (hessadd 0.0))
- (setf (aref dpars 0) typf)
- (setf (aref dpars 1) h)
- (setf (aref dpars 2) gradtol)
- (setf (aref dpars 3) steptol)
- (setf (aref dpars 4) maxstep)
- (setf (aref dpars 5) dflt)
- (setf (aref dpars 6) tilt)
- (setf (aref dpars 7) newtilt)
- (setf (aref dpars 8) hessadd)))
+(defun init-minfo-ipar-values (n ipars
+ &optional
+ (TRUE 1)
+ (FALSE 0)
+ (k 0)
+ (m 0)
+ (itnlimit -1)
+ (backtrack TRUE)
+ (verbose 0)
+ (vals_suppl FALSE)
+ (exptilt TRUE)
+ (count 0)
+ (termcode 0))
+ "Initialize ipars (iteration parameters) by destructive modification."
+ (setf (aref ipars 0) n)
+ (setf (aref ipars 1) m)
+ (setf (aref ipars 2) k)
+ (setf (aref ipars 3) itnlimit)
+ (setf (aref ipars 4) backtrack)
+ (setf (aref ipars 5) verbose)
+ (setf (aref ipars 6) vals_suppl)
+ (setf (aref ipars 7) exptilt)
+ (setf (aref ipars 8) count)
+ (setf (aref ipars 9) termcode))
+
+(defun init-minfo-dpar-values (h dpars &optional
+ (typf 1.0)
+ (gradtol -1.0)
+ (steptol -1.0)
+ (maxstep -1.0)
+ (dflt 0.0)
+ (tilt 0.0)
+ (newtilt 0.0)
+ (hessadd 0.0))
+ "Initialize dpars (derivative parameters) by destructive modification."
+ (setf (aref dpars 0) typf)
+ (setf (aref dpars 1) h)
+ (setf (aref dpars 2) gradtol)
+ (setf (aref dpars 3) steptol)
+ (setf (aref dpars 4) maxstep)
+ (setf (aref dpars 5) dflt)
+ (setf (aref dpars 6) tilt)
+ (setf (aref dpars 7) newtilt)
+ (setf (aref dpars 8) hessadd))
(defun init-minfo-internals (n h internals)
(let ((ipars (aref internals 8))

0 comments on commit 9159995

Please sign in to comment.