From 517468c2ade3fbef79526a4bde8cf03565932665 Mon Sep 17 00:00:00 2001 From: AJ Rossini Date: Mon, 18 Jun 2007 08:50:20 +0200 Subject: [PATCH] common lisp errors fixed, first error-free compile on clisp, time to fix --- compound.lsp | 3 +-- lispstat.asd | 19 +++++-------------- lsbasics.lsp | 16 ++++++++++------ maximize.lsp | 22 ++++++++++++++-------- statistics.lsp | 32 ++++++++++++++++++-------------- 5 files changed, 48 insertions(+), 44 deletions(-) diff --git a/compound.lsp b/compound.lsp index 38520ba..8826142 100644 --- a/compound.lsp +++ b/compound.lsp @@ -16,8 +16,7 @@ (defpackage :lisp-stat-compound-data (:use :common-lisp :lisp-stat-object-system) - (:import-from :lisp-stat-fastmap - fastmap) + (:import-from :lisp-stat-fastmap fastmap) (:shadowing-import-from :lisp-stat-object-system slot-value call-next-method call-method) diff --git a/lispstat.asd b/lispstat.asd index 8c3d72e..36adcdb 100644 --- a/lispstat.asd +++ b/lispstat.asd @@ -5,13 +5,11 @@ ;;(asdf:oos 'asdf:load-op 'cffi) - (defpackage #:lispstat-system (:use :asdf :common-lisp)) (in-package #:lispstat-system) - ;;; To avoid renaming everything from *.lsp to *.lisp... ;;; borrowed from Cyrus Harmon's work, for example for the ch-util. (defclass lispstat-lsp-source-file (cl-source-file) ()) @@ -28,7 +26,6 @@ ;;; again, thanks to Cyrus for saving me time... - (defsystem "lispstat" :version #.(with-open-file (vers (merge-pathnames "version.lisp-expr" *load-truename*)) @@ -38,28 +35,21 @@ :description "CommonLispStat (CLS): A System for Statistical Computing with Common Lisp; based on CLS by Luke Tierney (originally written when Luke was at CMU, apparently). Last touched 1991, then in 2005--2007." - :depends-on (:cffi ) - - ;; FFI systems: - ;; kclglue.lsp kclpatch.lsp exclglue.lsp mclglue.lsp - :components ((:static-file "version" :pathname #p"version.lisp-expr") (:lispstat-lsp-source-file "lsobjects") (:lispstat-lsp-source-file "fastmap") - ;; ls-basisc + (:lispstat-lsp-source-file "lstypes") + (:lispstat-lsp-source-file "lsfloat") (:lispstat-lsp-source-file "compound" :depends-on ("lsobjects" "fastmap")) + (:lispstat-lsp-source-file "lsmacros" + :depends-on ("compound")) (:lispstat-lsp-source-file "sequence" :depends-on ("compound")) (:lispstat-lsp-source-file "matrices" :depends-on ("sequence")) - (:lispstat-lsp-source-file "lsmacros" - :depends-on ("compound")) - - (:lispstat-lsp-source-file "lsfloat") - (:lispstat-lsp-source-file "lstypes") (:lispstat-lsp-source-file "lsbasics" :depends-on ("lsobjects" "lstypes" @@ -67,6 +57,7 @@ Last touched 1991, then in 2005--2007." "sequence" "lsfloat" "matrices")) + (:lispstat-lsp-source-file "lsmath" :depends-on ("lsbasics" "lsmacros" diff --git a/lsbasics.lsp b/lsbasics.lsp index fde174f..f9e9b2d 100644 --- a/lsbasics.lsp +++ b/lsbasics.lsp @@ -21,9 +21,12 @@ :lisp-stat-macros :lisp-stat-compound-data :lisp-stat-sequence - :lisp-stat-matrix ) + :lisp-stat-matrix + :lisp-stat-linalg) (:shadowing-import-from :lisp-stat-object-system slot-value call-method call-next-method) + (:shadowing-import-from :lisp-stat-types + check-sequence) (:export ;; lsbasics.lisp copy-vector copy-array which repeat @@ -35,11 +38,12 @@ ;; column-list inner-product outer-product cross-product transpose ;; bind-columns bind-rows - ;; linalg.lisp - chol-decomp lu-decomp lu-solve determinant inverse sv-decomp - qr-decomp rcondest make-rotation - fft make-sweep-matrix sweep-operator ax+y numgrad numhess - split-list eigen + ;;; linalg.lisp + ;; chol-decomp lu-decomp lu-solve determinant inverse sv-decomp + ;; qr-decomp rcondest make-rotation + ;; fft make-sweep-matrix sweep-operator ax+y numgrad numhess + ;; split-list eigen + ;; in linalg.lisp, possibly not supported by matlisp spline kernel-dens kernel-smooth ;; lispstat-macros diff --git a/maximize.lsp b/maximize.lsp index f4b56be..8de2a5d 100644 --- a/maximize.lsp +++ b/maximize.lsp @@ -1,13 +1,16 @@ -(provide "maximize") +;;; -*- mode: lisp -*- +;;; Copyright (c) 2005--2007, by A.J. Rossini +;;; See COPYRIGHT file for any additional restrictions (BSD license). +;;; Since 1991, ANSI was finally finished. Edited for ANSI Common Lisp. -#+:CLtL2 -(in-package lisp-stat) -#-:CLtL2 -(in-package 'lisp-stat) +(defpackage :lisp-stat-optimize + (:use :common-lisp + :lisp-stat-object-system + :lisp-stat-basics) + (:shadowing-import-from :lisp-stat-object-system + slot-value call-method call-next-method) + (:export newtonmax nelmeadmax)) -(export '(newtonmax nelmeadmax)) - -(import '(ls-basics::new-minfo-internals ls-basics::minfo-maximize)) ;;;; ;;;; Mode Info Prototype @@ -324,3 +327,6 @@ control the behavior of simplex algorithm." (let ((best (send self :point-value (send self :best-point))) (worst (send self :point-value (send self :worst-point)))) (* 2 (/ (abs (- best worst)) (+ 1 (abs best) (abs worst)))))) + + + diff --git a/statistics.lsp b/statistics.lsp index d26fb1d..f4545ba 100644 --- a/statistics.lsp +++ b/statistics.lsp @@ -1,4 +1,10 @@ -;;;; +;;; -*- mode: lisp -*- +;;; Copyright (c) 2005--2007, by A.J. Rossini +;;; See COPYRIGHT file for any additional restrictions (BSD license). +;;; Since 1991, ANSI was finally finished. Edited for ANSI Common Lisp. + +;;; XLisp-ism's removed to focus on Common Lisp. + ;;;; statistics.lsp XLISP-STAT statistics functions ;;;; XLISP-STAT 2.1 Copyright (c) 1990, by Luke Tierney ;;;; Additions to Xlisp 2.1, Copyright (c) 1989 by David Michael Betz @@ -6,21 +12,19 @@ ;;;; COPYING included with this distribution. ;;;; -(provide "statistics") - -#+:CLtL2 -(in-package lisp-stat) -#-:CLtL2 -(in-package 'lisp-stat) - -(export '(open-file-dialog read-data-file read-data-columns load-data - load-example *variables* *ask-on-redefine* def variables savevar - undef standard-deviation quantile median interquartile-range - fivnum covariance-matrix difference rseq matrix print-matrix solve +(defpackage :lisp-stat + (:use common-lisp) + ;;(:import-from :lisp-stat-basics |base-lowess|) + (:export open-file-dialog read-data-file read-data-columns load-data + load-example *variables* *ask-on-redefine* def variables savevar + undef standard-deviation quantile median interquartile-range + fivnum covariance-matrix difference rseq matrix print-matrix solve backsolve eigenvalues eigenvectors accumulate cumsum combine lowess)) -(import 'ls-basics::|base-lowess|) + +(:in-package :lisp-stat) + ;;;; ;;;; Data File Reading @@ -323,4 +327,4 @@ to T speeds up the computation." (let ((x (if sorted x (sort-data x))) (y (if sorted y (select y (order x)))) (delta (if (> delta 0.0) delta (/ (- (max x) (min x)) 50)))) - (list x (|base-lowess| x y f steps delta)))) + (list x)));; (|base-lowess| x y f steps delta)))) -- 2.11.4.GIT