From 1873512ad833f39871143ccea4cecd7e0743d62e Mon Sep 17 00:00:00 2001 From: AJ Rossini Date: Sat, 27 Oct 2007 22:05:48 +0200 Subject: [PATCH] doc cleanup and comment removal. --- cffiglue.lsp | 110 +++++------------------------------------------------------ defsys.lsp | 2 ++ dists.lsp | 59 +++++++++++++++++--------------- lispstat.asd | 46 ++++++++++++++++--------- ls-demo.lisp | 1 - lsfloat.lsp | 7 ++-- lsmath.lsp | 3 +- 7 files changed, 74 insertions(+), 154 deletions(-) diff --git a/cffiglue.lsp b/cffiglue.lsp index 0fa08f6..192cc4e 100644 --- a/cffiglue.lsp +++ b/cffiglue.lsp @@ -1,19 +1,14 @@ ;; -*- mode: lisp -*- -;;;; cffiglue -- Interface to C library -;;;; -;;;; Copyright (c) 1991, by Luke Tierney. -;;;; Copyright (c) 2007, by Carlos Ungil. -;;;; Copyright (c) 2007, by AJ Rossini . -;;;; Permission is granted for unrestricted use. +;;; cffiglue -- Interface to C library. Based on the range of CL FFI +;;; "glues" by Luke Tierney. +;;; +;;; Copyright (c) 1991, by Luke Tierney. +;;; Copyright (c) 2007, by Carlos Ungil. +;;; Copyright (c) 2007, by AJ Rossini . +;;; Permission is granted for unrestricted use. -;;;; Tested (but the results have not been checked): -;;;; Probability Distributions -;;;; Internal Error Message Emulation -;;;; Matrix Manipulation - -;;;; Untested -;;;; numgrad numhess minfo-maximize +(in-package :cl-user) (defpackage :lisp-stat-ffi-int (:use :common-lisp @@ -25,82 +20,6 @@ ;; This package initially loads the liblispstat library for access. - -;; formerly exported: - -#| - chol-decomp-front - lu-decomp-front lu-solve-front - sv-decomp-front - qr-decomp-front - - rcondest-front - make-rotation-front - - eigen-front - - la-range-to-rseq - spline-front - - kernel-dens-front - kernel-smooth-front - - base-lowess-front - - numgrad-front - numhess-front - base-minfo-maximize - - one-uniform-rand - base-log-gamma - - base-normal-cdf - base-normal-quant - base-normal-dens - one-normal-rand - base-bivnorm-cdf - - base-cauchy-cdf - base-cauchy-quant - base-cauchy-dens - one-cauchy-rand - - base-gamma-cdf - base-gamma-quant - base-gamma-dens - one-gamma-rand - - base-chisq-cdf - base-chisq-quant - base-chisq-dens - one-chisq-rand - - base-beta-cdf - base-beta-quant - base-beta-dens - one-beta-rand - - base-t-cdf - base-t-quant - base-t-dens - one-t-rand - - base-f-cdf - base-f-quant - base-f-dens - one-f-rand - - base-poisson-cdf - base-poisson-quant - base-poisson-dens - one-poisson-rand - - base-binomial-cdf - base-binomial-quant - base-binomial-dens - one-binomial-rand -|# - (in-package :lisp-stat-ffi-int) (cffi:load-foreign-library @@ -123,15 +42,6 @@ (cffi:defcfun ("ccl_store_ptr" ccl-store-ptr) :void (x :pointer)) -;;; -;;; Lisp-Managed Calloc/Free -;;; - -;;; this section is commented out in mclglue.lsp -;;; and the relevant fragment in cffi-glue.c is not compiled (ifdef DODO) - - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; XLISP Internal Error Message Emulation @@ -164,7 +74,3 @@ :void (string :string)) (cffi:defcfun ("xlfail" xlfail) :void (string :string)) - - - - diff --git a/defsys.lsp b/defsys.lsp index d2a9c4f..20aab92 100644 --- a/defsys.lsp +++ b/defsys.lsp @@ -1,5 +1,7 @@ ;;; -*- mode: lisp -*- +(in-package :cl-user) + (defpackage :lisp-stat-config (:use :common-lisp) (:export *default-path* diff --git a/dists.lsp b/dists.lsp index 5f49785..de56da3 100644 --- a/dists.lsp +++ b/dists.lsp @@ -3,31 +3,34 @@ ;;; See COPYRIGHT file for any additional restrictions (BSD license). ;;; Since 1991, ANSI was finally finished. Edited for ANSI Common Lisp. -;;;; dists -- Lisp-Stat interface to basic probability distribution routines -;;;; -;;;; Copyright (c) 1991, by Luke Tierney. Permission is granted for -;;;; unrestricted use. +;;; dists -- Lisp-Stat interface to basic probability distribution routines +;;; +;;; Copyright (c) 1991, by Luke Tierney. Permission is granted for +;;; unrestricted use. -;;;; -;;;; Package Setup -;;;; +;;; +;;; Package Setup +;;; + +(in-package :cl-user) (defpackage :lisp-stat-probability (:use :common-lisp + :cffi :lisp-stat-ffi-int :lisp-stat-macros) - (:export - log-gamma - 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)) + (:export log-gamma + 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)) (in-package :lisp-stat-probability) @@ -48,18 +51,18 @@ (defun one-uniform-rand () (random 1.0)) -;;;; -;;;; Log-gamma function -;;;; +;;; +;;; Log-gamma function +;;; (cffi:defcfun ("ccl_gamma" ccl-base-log-gamma) :double (x :double)) (defun base-log-gamma (x) (ccl-base-log-gamma (float x 1d0))) -;;;; -;;;; Normal distribution -;;;; +;;; +;;; Normal distribution +;;; (cffi:defcfun ("ccl_normalcdf" ccl-base-normal-cdf) :double (x :double)) @@ -84,9 +87,9 @@ (defun base-bivnorm-cdf (x y z) (ccl-base-bivnorm-cdf (float x 1d0) (float y 1d0) (float z 1d0))) -;;;; -;;;; Cauchy distribution -;;;; +;;; +;;; Cauchy distribution +;;; (cffi:defcfun ("ccl_cauchycdf" ccl-base-cauchy-cdf) :double (x :double)) diff --git a/lispstat.asd b/lispstat.asd index c89cc91..3cda769 100644 --- a/lispstat.asd +++ b/lispstat.asd @@ -7,7 +7,7 @@ ;;(asdf:oos 'asdf:load-op 'cffi) (defpackage #:lispstat-system - (:use :asdf :common-lisp)) + (:use :asdf :common-lisp)) (in-package #:lispstat-system) @@ -42,39 +42,55 @@ Last touched 1991, then in 2005--2007." (:lispstat-lsp-source-file "lsobjects") (:lispstat-lsp-source-file "cffiglue") (:lispstat-lsp-source-file "defsys") + + (:lispstat-lsp-source-file "fastmap") (:lispstat-lsp-source-file "lstypes") (:lispstat-lsp-source-file "lsfloat") (:lispstat-lsp-source-file "sequence" :depends-on ("lstypes")) + (:lispstat-lsp-source-file "matrices" + :depends-on ("cffiglue" + "sequence")) (:lispstat-lsp-source-file "compound" :depends-on ("lsobjects" "fastmap" "sequence")) - - (:file "data" :depends-on ("lsobjects" - "compound" )) + (:lispstat-lsp-source-file "ladata" + :depends-on ("cffiglue" + "defsys" + "lstypes" + "sequence" + "compound" + "matrices" + )) (:lispstat-lsp-source-file "lsmacros" :depends-on ("compound")) + + (:lispstat-lsp-source-file "dists" + :depends-on ("cffiglue" + "lsmacros")) + + (:lispstat-lsp-source-file "lsmath" :depends-on ("lsobjects" + "compound" "lsmacros" "lsfloat")) - (:lispstat-lsp-source-file "matrices" - :depends-on ("cffiglue" - "sequence")) + (:file "data" :depends-on ("lsobjects" + "compound" + "matrices" + "linalg")) - (:lispstat-lsp-source-file "dists" - :depends-on ("cffiglue")) + (:lispstat-lsp-source-file "statistics" + :depends-on ("lsobjects" + "lsmath" + "data" )) - (:lispstat-lsp-source-file "ladata" - :depends-on ("defsys" - ;;"lsbasics")) - )) (:lispstat-lsp-source-file "linalg" :depends-on ("cffiglue" "lsmath" @@ -105,10 +121,6 @@ Last touched 1991, then in 2005--2007." "lsbasics")) (:lispstat-lsp-source-file "nonlin" :depends-on ("regression")) - (:lispstat-lsp-source-file "statistics" - :depends-on ("lsobjects" - "lsmath" - "data" )) (:lispstat-lsp-source-file "bayes" :depends-on ("lsobjects" "lsmath" diff --git a/ls-demo.lisp b/ls-demo.lisp index 923b2ea..7439c3a 100644 --- a/ls-demo.lisp +++ b/ls-demo.lisp @@ -10,7 +10,6 @@ (asdf:oos 'asdf:load-op :lispstat) - (setf *my-base-directory* #p"/home/tony/sandbox/CLS.git/" #p"/Users/ungil/lisp/CommonLispStat/" diff --git a/lsfloat.lsp b/lsfloat.lsp index 9cb0c2c..7724bfa 100644 --- a/lsfloat.lsp +++ b/lsfloat.lsp @@ -101,16 +101,13 @@ ;; long-float. An object can simultaneously be of types single-float and ;; short-float. - ;;; Package Setup - +(in-package :cl-user) (defpackage :lisp-stat-float (:use :common-lisp) (:export +stat-float-typing+ +stat-cfloat-typing+ +stat-float-template+ - machine-epsilon - - base-float makedouble + machine-epsilon base-float makedouble make-base-trans-fun-2 make-base-trans-fun diff --git a/lsmath.lsp b/lsmath.lsp index 723860a..30d8fa6 100644 --- a/lsmath.lsp +++ b/lsmath.lsp @@ -10,7 +10,8 @@ ;;; Package Setup -;; in another world... +(in-package :cl-user) + (defpackage :lisp-stat-math (:use :common-lisp :lisp-stat-object-system -- 2.11.4.GIT