Skip to content

Commit

Permalink
clean up targets and dependencies; cleaner CL despite sideeffect func…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
blindglobe committed Jul 11, 2007
1 parent 4fe6d33 commit 9159995
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 53 deletions.
7 changes: 3 additions & 4 deletions Makefile
Expand Up @@ -14,11 +14,10 @@ git-push :


clean: clean:
(cd lib; make clean) (cd lib; make clean)
rm -f *.o *.fasl kclcmplr *~ rm -f *.o *.fasl *~


cleanall: dist-clean: clean
(cd lib; make cleanall) rm -rf fasl sbcl-fasl
rm -f *.o *.fasl kclcmplr saved_kcls kcls cls


## C compilation ## C compilation


Expand Down
9 changes: 5 additions & 4 deletions lispstat.asd
Expand Up @@ -50,10 +50,15 @@ Last touched 1991, then in 2005--2007."
"sequence")) "sequence"))
(:lispstat-lsp-source-file "lsmacros" (:lispstat-lsp-source-file "lsmacros"
:depends-on ("compound")) :depends-on ("compound"))
(:lispstat-lsp-source-file "lsmath"
:depends-on ("lsobjects"
"lsmacros"
"lsfloat"))
(:lispstat-lsp-source-file "matrices" (:lispstat-lsp-source-file "matrices"
:depends-on ("sequence")) :depends-on ("sequence"))
(:lispstat-lsp-source-file "linalg" (:lispstat-lsp-source-file "linalg"
:depends-on ("lstypes" :depends-on ("lstypes"
"lsmath"
"matrices")) "matrices"))
(:lispstat-lsp-source-file "lsbasics" (:lispstat-lsp-source-file "lsbasics"
:depends-on ("lsobjects" :depends-on ("lsobjects"
Expand All @@ -64,10 +69,6 @@ Last touched 1991, then in 2005--2007."
"matrices" "matrices"
"linalg")) "linalg"))


(:lispstat-lsp-source-file "lsmath"
:depends-on ("lsbasics"
"lsmacros"
"lsfloat"))


(:lispstat-lsp-source-file "dists" (:lispstat-lsp-source-file "dists"
:depends-on ("lsbasics")) :depends-on ("lsbasics"))
Expand Down
1 change: 0 additions & 1 deletion ls-user.lisp
Expand Up @@ -27,7 +27,6 @@ should be packaged up elsewhere for reproducibility.")
min max logand logior logxor lognot ffloor fceiling min max logand logior logxor lognot ffloor fceiling
ftruncate fround signum cis) ftruncate fround signum cis)



(:export (:export
;; lsobjects.lsp : should this become a prototype object? ;; lsobjects.lsp : should this become a prototype object?
defproto defmeth send defproto defmeth send
Expand Down
1 change: 0 additions & 1 deletion lsmath.lsp
Expand Up @@ -16,7 +16,6 @@
:lisp-stat-object-system :lisp-stat-object-system
:lisp-stat-macros :lisp-stat-macros
:lisp-stat-float) :lisp-stat-float)
;; Shadow the symbols in the lisp package that will be redefined
(:shadowing-import-from :lisp-stat-object-system (:shadowing-import-from :lisp-stat-object-system
slot-value call-method call-next-method) slot-value call-method call-next-method)
(:shadow expt + - * / ** mod rem abs 1+ 1- log exp sqrt sin cos tan (:shadow expt + - * / ** mod rem abs 1+ 1- log exp sqrt sin cos tan
Expand Down
95 changes: 52 additions & 43 deletions optimize.lisp
Expand Up @@ -11,9 +11,14 @@
:lisp-stat-basics) :lisp-stat-basics)
(:shadowing-import-from :lisp-stat-object-system (:shadowing-import-from :lisp-stat-object-system
slot-value call-method call-next-method) 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 ;;; FIXME:AJR: There is a need to figure out the proper symbols to
;;; export. more importantly should there be any specialty package ;;; export. more importantly should there be any specialty package
Expand All @@ -23,54 +28,58 @@ z;;; that are exported for maximization?


(defvar *maximize-callback-function* nil (defvar *maximize-callback-function* nil
"Used in generic optimization to determine function name -- symbol or string?") "Used in generic optimization to determine function name -- symbol or string?")

(defvar *maximize-callback-arg* nil (defvar *maximize-callback-arg* nil
"args to function to maximize") "args to function to maximize")


;;;; ;;;;
;;;; minfo basics (internal??) ;;;; minfo basics (internal??)
;;;; ;;;;


(defun init-minfo-ipar-values (n ipars) (defun init-minfo-ipar-values (n ipars
(let* ((TRUE 1) &optional
(FALSE 0) (TRUE 1)
(k 0) (FALSE 0)
(m 0) (k 0)
(itnlimit -1) (m 0)
(backtrack TRUE) (itnlimit -1)
(verbose 0) (backtrack TRUE)
(vals_suppl FALSE) (verbose 0)
(exptilt TRUE) (vals_suppl FALSE)
(count 0) (exptilt TRUE)
(termcode 0)) (count 0)
(setf (aref ipars 0) n) (termcode 0))
(setf (aref ipars 1) m) "Initialize ipars (iteration parameters) by destructive modification."
(setf (aref ipars 2) k) (setf (aref ipars 0) n)
(setf (aref ipars 3) itnlimit) (setf (aref ipars 1) m)
(setf (aref ipars 4) backtrack) (setf (aref ipars 2) k)
(setf (aref ipars 5) verbose) (setf (aref ipars 3) itnlimit)
(setf (aref ipars 6) vals_suppl) (setf (aref ipars 4) backtrack)
(setf (aref ipars 7) exptilt) (setf (aref ipars 5) verbose)
(setf (aref ipars 8) count) (setf (aref ipars 6) vals_suppl)
(setf (aref ipars 9) termcode))) (setf (aref ipars 7) exptilt)

(setf (aref ipars 8) count)
(defun init-minfo-dpar-values (h dpars) (setf (aref ipars 9) termcode))
(let ((typf 1.0)
(gradtol -1.0) (defun init-minfo-dpar-values (h dpars &optional
(steptol -1.0) (typf 1.0)
(maxstep -1.0) (gradtol -1.0)
(dflt 0.0) (steptol -1.0)
(tilt 0.0) (maxstep -1.0)
(newtilt 0.0) (dflt 0.0)
(hessadd 0.0)) (tilt 0.0)
(setf (aref dpars 0) typf) (newtilt 0.0)
(setf (aref dpars 1) h) (hessadd 0.0))
(setf (aref dpars 2) gradtol) "Initialize dpars (derivative parameters) by destructive modification."
(setf (aref dpars 3) steptol) (setf (aref dpars 0) typf)
(setf (aref dpars 4) maxstep) (setf (aref dpars 1) h)
(setf (aref dpars 5) dflt) (setf (aref dpars 2) gradtol)
(setf (aref dpars 6) tilt) (setf (aref dpars 3) steptol)
(setf (aref dpars 7) newtilt) (setf (aref dpars 4) maxstep)
(setf (aref dpars 8) hessadd))) (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) (defun init-minfo-internals (n h internals)
(let ((ipars (aref internals 8)) (let ((ipars (aref internals 8))
Expand Down

0 comments on commit 9159995

Please sign in to comment.