From 62cdf4f23bd291357c56243baecdf6e798d8883e Mon Sep 17 00:00:00 2001 From: AJ Rossini Date: Thu, 4 Oct 2012 17:48:50 +0200 Subject: [PATCH] got CLS to load without externals or liblispstat removed CFFI from CLS, but it is still needed for lisp-matrix liblispstat and externals are now gone, leaving massive holes for probability and optimization. stat-models needs to be rewritten using lisp-matrix and dataframe packages. Signed-off-by: AJ Rossini --- TODO.org | 7 ++- cls.asd | 79 ++++++++++++++++++--------------- src/packages.lisp | 130 +++++++++++++++++++++++++++--------------------------- 3 files changed, 114 insertions(+), 102 deletions(-) diff --git a/TODO.org b/TODO.org index 3956657..3642f7e 100644 --- a/TODO.org +++ b/TODO.org @@ -1,5 +1,5 @@ -Time-stamp: <2012-10-04 04:10:12 tony> +Time-stamp: <2012-10-04 17:26:54 tony> Creation: <2008-09-08 08:06:30 tony> * Intro and Metadata @@ -99,9 +99,12 @@ current (possibly incomplete) set of lisp dependencies <2012-10-04 Thu> #+name: loadit #+begin_src lisp - (ql:quickload :cls) + (ql:quickload :cls) #+end_src +#+RESULTS: loadit +| :CLS | + though sometimes we might want to recompile fully. (Can this be done via QL? Need to check) diff --git a/cls.asd b/cls.asd index f18c3ed..368a570 100644 --- a/cls.asd +++ b/cls.asd @@ -1,5 +1,5 @@ ;; -*- mode: lisp -*- -;;; Time-stamp: <2012-10-04 16:05:52 tony> +;;; Time-stamp: <2012-10-04 17:45:23 tony> ;;; Created: <2005-05-30 17:09:47 blindglobe> ;;; File: cls.asd ;;; Author: AJ Rossini @@ -67,13 +67,13 @@ when Luke was at CMU, on leave at Bell Labs?). Last touched by him in 1991, then by AJR starting in 2005." :serial t - :depends-on (;; :cldoc documentation tool? (not Lit Prog, but coding support) - :cffi + :depends-on (;; :cldoc ;; documentation tool? (not Lit Prog, but coding support) + ;; :cffi ;; only needed within lisp-matrix :xarray - :lisp-matrix ; on fnv, cl-blapack, ffa + :lisp-matrix ;; on fnv, cl-blapack, ffa :listoflist :lift - ;; :rsm-string -- need something for importing CSV files into listoflist or arrays. + :rsm-string ;; need something for importing CSV files into listoflist or arrays. ;;; need to select pRNG stream system ;; :cl-random ;; or cl-variates, or...? :cl-variates @@ -117,26 +117,26 @@ "lsmacros" "lsfloat")))) - (:module - "numerics-internal" - :pathname "src/numerics/" - :depends-on ("packaging" "proto-objects" "cls-core") - :components - ((:cls-lsp-source-file "cffiglue") - (:cls-lsp-source-file "dists" - :depends-on ("cffiglue")) -#| - (:cls-lsp-source-file "matrices" - :depends-on ("cffiglue")) - (:cls-lsp-source-file "ladata" - :depends-on ("cffiglue" - "matrices")) - (:file "linalg" - :depends-on ("cffiglue" - "matrices" - "ladata")) -|# - )) +;; (:module +;; "numerics-internal" +;; :pathname "src/numerics/" +;; :depends-on ("packaging" "proto-objects" "cls-core") +;; :components +;; ((:cls-lsp-source-file "cffiglue") +;; (:cls-lsp-source-file "dists" +;; :depends-on ("cffiglue")) +;; #| +;; (:cls-lsp-source-file "matrices" +;; :depends-on ("cffiglue")) +;; (:cls-lsp-source-file "ladata" +;; :depends-on ("cffiglue" +;; "matrices")) +;; (:file "linalg" +;; :depends-on ("cffiglue" +;; "matrices" +;; "ladata")) +;; |# +;; )) ;; Dataframes and statistical structures. @@ -146,7 +146,8 @@ :depends-on ("packaging" "proto-objects" "cls-core" - "numerics-internal") + ;; "numerics-internal" + ) :components ((:file "dataframe") (:file "dataframe-array") @@ -162,7 +163,7 @@ :depends-on ("packaging" "proto-objects" "cls-core" - "numerics-internal" + ;; "numerics-internal" "stat-data") :components ((:cls-lsp-source-file "lsbasics"))) @@ -175,7 +176,7 @@ :depends-on ("packaging" "proto-objects" "cls-core" - "numerics-internal" + ;; "numerics-internal" "stat-data" "cls-basics") :components @@ -188,13 +189,17 @@ :components ((:file "plot"))) |# + +#| + +;;; FIXME: OPTIMIZE USES ORIG CLS CFFI-based LIBCODE, NEED TO REPLACE WITH ALT MINIMIZERS (:module "optimization" :pathname "src/numerics/" :depends-on ("packaging" "proto-objects" "cls-core" - "numerics-internal" + ;; "numerics-internal" "stat-data" "cls-basics") :components @@ -208,7 +213,7 @@ :depends-on ("packaging" "proto-objects" "cls-core" - "numerics-internal" + ;; "numerics-internal" "cls-basics" "descriptives" "optimization") @@ -219,6 +224,7 @@ ;; (:cls-lsp-source-file "bayes" ;; :depends-on ("regression")) )) +|# ;; Applications (:module @@ -227,10 +233,11 @@ :depends-on ("packaging" "proto-objects" "cls-core" - "numerics-internal" + ;; "numerics-internal" "cls-basics" "descriptives" - "optimization") + ;; "optimization" + ) :components ((:file "examples") (:cls-lsp-source-file "absorbtion") @@ -252,12 +259,12 @@ "lisp-stat-unittest" :depends-on ("packaging" "proto-objects" "cls-core" - "numerics-internal" + ;; "numerics-internal" "stat-data" "cls-basics" "descriptives" - "optimization" - "stat-models" + ;; "optimization" + ;; "stat-models" "example-data") :pathname "src/unittests/" :components ((:file "unittests") @@ -271,6 +278,8 @@ (:file "unittests-dataframe" :depends-on ("unittests")))))) #| + +;;; NEED TO ADD A TEST OPERATION (defmethod perform ((o test-op) (c (eql (find-system :cls)))) (describe (lift:run-tests :suite 'lisp-stat-unittests::lisp-stat-ut))) |# diff --git a/src/packages.lisp b/src/packages.lisp index a6f4674..c022fd4 100644 --- a/src/packages.lisp +++ b/src/packages.lisp @@ -1,6 +1,6 @@ ;;; -*- mode: lisp -*- -;;; Time-stamp: <2012-07-01 11:19:31 tony> +;;; Time-stamp: <2012-10-04 17:33:12 tony> ;;; Creation: <2008-03-11 19:18:34 user> ;;; File: packages.lisp ;;; Author: AJ Rossini @@ -243,29 +243,29 @@ ;;; USER PACKAGES -(defpackage :lisp-stat-ffi-int - (:use :common-lisp - :cffi) - (:export ccl-store-integer ccl-store-double ccl-store-ptr - get-buf )) - -(defpackage :lisp-stat-probability - (:use :common-lisp - :cffi - :lisp-stat-ffi-int - :lisp-stat-macros) - (:export log-gamma set-seed - uniform-rand - normal-cdf normal-quant normal-dens normal-rand - bivnorm-cdf - cauchy-cdf cauchy-quant cauchy-dens cauchy-rand - gamma-cdf gamma-quant gamma-dens gamma-rand - chisq-cdf chisq-quant chisq-dens chisq-rand - beta-cdf beta-quant beta-dens beta-rand - t-cdf t-quant t-dens t-rand - f-cdf f-quant f-dens f-rand - poisson-cdf poisson-quant poisson-pmf poisson-rand - binomial-cdf binomial-quant binomial-pmf binomial-rand)) +;; (defpackage :lisp-stat-ffi-int +;; (:use :common-lisp +;; :cffi) +;; (:export ccl-store-integer ccl-store-double ccl-store-ptr +;; get-buf )) + +;; (defpackage :lisp-stat-probability +;; (:use :common-lisp +;; :cffi +;; :lisp-stat-ffi-int +;; :lisp-stat-macros) +;; (:export log-gamma set-seed +;; uniform-rand +;; normal-cdf normal-quant normal-dens normal-rand +;; bivnorm-cdf +;; cauchy-cdf cauchy-quant cauchy-dens cauchy-rand +;; gamma-cdf gamma-quant gamma-dens gamma-rand +;; chisq-cdf chisq-quant chisq-dens chisq-rand +;; beta-cdf beta-quant beta-dens beta-rand +;; t-cdf t-quant t-dens t-rand +;; f-cdf f-quant f-dens f-rand +;; poisson-cdf poisson-quant poisson-pmf poisson-rand +;; binomial-cdf binomial-quant binomial-pmf binomial-rand)) (defpackage :cls-probability (:use common-lisp @@ -514,7 +514,7 @@ |# ;; optimize.lsp - newtonmax nelmeadmax +;; newtonmax nelmeadmax ;; package LISPSTAT-MACROS make-rv-function make-rv-function-1 @@ -568,14 +568,14 @@ fivnum sample ;; probability (dists.lisp) - log-gamma set-seed - uniform-rand normal-cdf normal-quant normal-dens - normal-rand bivnorm-cdf cauchy-cdf cauchy-quant cauchy-dens - cauchy-rand gamma-cdf gamma-quant gamma-dens gamma-rand - chisq-cdf chisq-quant chisq-dens chisq-rand beta-cdf beta-quant - beta-dens beta-rand t-cdf t-quant t-dens t-rand f-cdf f-quant - f-dens f-rand poisson-cdf poisson-quant poisson-pmf poisson-rand - binomial-cdf binomial-quant binomial-pmf binomial-rand + ;; log-gamma set-seed + ;; uniform-rand normal-cdf normal-quant normal-dens + ;; normal-rand bivnorm-cdf cauchy-cdf cauchy-quant cauchy-dens + ;; cauchy-rand gamma-cdf gamma-quant gamma-dens gamma-rand + ;; chisq-cdf chisq-quant chisq-dens chisq-rand beta-cdf beta-quant + ;; beta-dens beta-rand t-cdf t-quant t-dens t-rand f-cdf f-quant + ;; f-dens f-rand poisson-cdf poisson-quant poisson-pmf poisson-rand + ;; binomial-cdf binomial-quant binomial-pmf binomial-rand ;; Here is where we have a problem -- lispstat core should be core ;; data management and config problems, with packages providing @@ -687,35 +687,35 @@ (:export absorbtion aluminum iron)) -(defpackage :lisp-stat-optimize - (:use :common-lisp - :cffi - :lisp-matrix - :lisp-stat-ffi-int - :lisp-stat-object-system - :lisp-stat-types - :lisp-stat-compound-data - :lisp-stat-math - :lisp-stat-float - :lisp-stat-basics -#| - :lisp-stat-matrix - :lisp-stat-linalg-data - :lisp-stat-linalg -|# - ) - (:shadowing-import-from :lisp-stat-object-system - call-method call-next-method) - (:shadowing-import-from :lisp-stat-math - expt + - * / ** mod rem abs 1+ 1- log exp sqrt sin cos tan - asin acos atan sinh cosh tanh asinh acosh atanh float random - truncate floor ceiling round minusp zerop plusp evenp oddp - < <= = /= >= > complex conjugate realpart imagpart phase - min max logand logior logxor lognot ffloor fceiling - ftruncate fround signum cis) - (:export - ;; derivatives - numgrad numhess - - ;; optimization - newtonmax nelmeadmax)) +;; (defpackage :lisp-stat-optimize +;; (:use :common-lisp +;; :cffi +;; :lisp-matrix +;; :lisp-stat-ffi-int +;; :lisp-stat-object-system +;; :lisp-stat-types +;; :lisp-stat-compound-data +;; :lisp-stat-math +;; :lisp-stat-float +;; :lisp-stat-basics +;; #| +;; :lisp-stat-matrix +;; :lisp-stat-linalg-data +;; :lisp-stat-linalg +;; |# +;; ) +;; (:shadowing-import-from :lisp-stat-object-system +;; call-method call-next-method) +;; (:shadowing-import-from :lisp-stat-math +;; expt + - * / ** mod rem abs 1+ 1- log exp sqrt sin cos tan +;; asin acos atan sinh cosh tanh asinh acosh atanh float random +;; truncate floor ceiling round minusp zerop plusp evenp oddp +;; < <= = /= >= > complex conjugate realpart imagpart phase +;; min max logand logior logxor lognot ffloor fceiling +;; ftruncate fround signum cis) +;; (:export +;; ;; derivatives +;; numgrad numhess + +;; ;; optimization +;; newtonmax nelmeadmax)) -- 2.11.4.GIT