From 9775642a115acfde6c3c0aa2e96eeff2b484e24e Mon Sep 17 00:00:00 2001 From: AJ Rossini Date: Mon, 16 Mar 2009 21:59:34 +0100 Subject: [PATCH] export symbols so we can run unittests. Signed-off-by: AJ Rossini --- src/packages.lisp | 22 ++++++++++++++++------ src/unittests/unittests-arrays.lisp | 9 +++++++++ src/unittests/unittests-data-clos.lisp | 18 +++++++++--------- 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/src/packages.lisp b/src/packages.lisp index 5a2a91b..2912ce1 100644 --- a/src/packages.lisp +++ b/src/packages.lisp @@ -1,6 +1,6 @@ ;;; -*- mode: lisp -*- -;;; Time-stamp: <2009-03-11 05:53:30 tony> +;;; Time-stamp: <2009-03-16 21:56:47 tony> ;;; Creation: <2008-03-11 19:18:34 user> ;;; File: packages.lisp ;;; Author: AJ Rossini @@ -111,10 +111,13 @@ (defpackage :lisp-stat-data-clos (:use :common-lisp :lisp-matrix) - (:export get-variable-matrix get-variable-vector - ;; generic container class for data -- if small enough - ;; could be value, otherwise might be reference. - data-pointer)) + (:export + ;; generic container class for data -- if small enough + ;; could be value, otherwise might be reference. + dataframe-like + dataframe-array + get-variable-matrix get-variable-vector + data-pointer)) #| (defpackage :lisp-stat-regression-linear-clos @@ -325,6 +328,7 @@ :lisp-stat-float :lisp-stat-basics :lisp-stat-data + :lisp-stat-data-clos :lisp-stat-math :lisp-matrix ;; conversion to a more robust linalg approach :lisp-stat-descriptive-statistics @@ -410,11 +414,17 @@ ;; lispstat-macros make-rv-function make-rv-function-1 - ;; data.lisp + ;; data open-file-dialog read-data-file read-data-columns load-data load-example *variables* *ask-on-redefine* def variables savevar undef + ;; data-clos + dataframe-like + dataframe-array + + + ;; statistics.lsp (descriptions, should probably be moved ;; later...? standard-deviation quantile median interquartile-range diff --git a/src/unittests/unittests-arrays.lisp b/src/unittests/unittests-arrays.lisp index 4e2ca78..b8c9604 100644 --- a/src/unittests/unittests-arrays.lisp +++ b/src/unittests/unittests-arrays.lisp @@ -23,6 +23,15 @@ 5.000000000000003) :test 'almost=lists)) +(addtest (lisp-stat-ut-array) cholesky-decomposition-1 + (ensure-same + (chol-decomp #2A((2 3 4) (1 2 4) (2 4 5))) + (list #2A((1.7888543819998317 0.0 0.0) + (1.6770509831248424 0.11180339887498929 0.0) + (2.23606797749979 2.23606797749979 3.332000937312528e-8)) + 5.000000000000003) + :test 'almost=lists)) + #| (addtest (lisp-stat-ut-array) cholesky-decomposition-2 (ensure-same diff --git a/src/unittests/unittests-data-clos.lisp b/src/unittests/unittests-data-clos.lisp index 2e62028..cadd810 100644 --- a/src/unittests/unittests-data-clos.lisp +++ b/src/unittests/unittests-data-clos.lisp @@ -5,7 +5,7 @@ ;;; Copyright: (c)2008, AJ Rossini. BSD, LLGPL, or GPLv2, depending ;;; on how it arrives. ;;; Purpose: unittests for the data-clos package -;;; Time-stamp: <2008-11-03 08:32:24 tony> +;;; Time-stamp: <2009-03-16 20:49:53 tony> ;;; Creation: <2008-05-09 14:18:19 tony> ;;; What is this talk of 'release'? Klingons do not make software @@ -39,21 +39,21 @@ (addtest (lisp-stat-dataclos) equaltestnameData (ensure-error (equal (lisp-stat-data-clos::dataset - (make-instance 'statistical-dataset + (make-instance 'dataframe-array :storage #2A(('a 'b) ('c 'd)))) #2A(('a 'b) ('c 'd))))) (defvar my-ds-1 nil "test ds for experiment.") -(setf my-ds-1 (make-instance 'statistical-dataset)) +(setf my-ds-1 (make-instance 'dataframe-array)) my-ds-1 (defvar my-ds-2 nil "test ds for experiment.") -(setf my-ds-2 (make-instance 'statistical-dataset +(setf my-ds-2 (make-instance 'dataframe-array :storage #2A((1 2 3 4 5) (10 20 30 40 50)) - :doc "This is an interesting statistical-dataset" + :doc "This is an interesting dataframe-array" :case-labels (list "a" "b" "c" "d" "e") :var-labels (list "x" "y"))) my-ds-2 @@ -64,7 +64,7 @@ my-ds-2 (addtest (lisp-stat-dataclos) consData (ensure - (consistent-statistical-dataset-p my-ds-2))) + (consistent-dataframe-like-p my-ds-2))) (addtest (lisp-stat-dataclos) badAccess1 (ensure-error @@ -106,7 +106,7 @@ my-ds-2 ;; need to ensure that for things like the following, that we protect ;; this a bit more so that the results are not going to to be wrong. -;; That would be a bit nasty if the statistical-dataset becomes +;; That would be a bit nasty if the dataframe-array becomes ;; inconsistent. (addtest (lisp-stat-dataclos) badAccess9 @@ -121,7 +121,7 @@ my-ds-2 (setf (lisp-stat-data-clos::var-labels my-ds-2) (list "a" "b" "c")) ;; error happens here - (not (consistent-statistical-dataset-p my-ds-2))))) ;; Nil + (not (consistent-dataframe-like-p my-ds-2))))) ;; Nil (addtest (lisp-stat-dataclos) badAccess12 (ensure @@ -130,7 +130,7 @@ my-ds-2 (addtest (lisp-stat-dataclos) badAccess13 (ensure - (consistent-statistical-dataset-p my-ds-2))) ;; T + (consistent-dataframe-like-p my-ds-2))) ;; T ;; This is now done by: (addtest (lisp-stat-dataclos) badAccess14 -- 2.11.4.GIT