From 002eb048a683bd292667574e746d9a946a6ce389 Mon Sep 17 00:00:00 2001 From: AJ Rossini Date: Sun, 1 Jul 2012 11:20:13 +0200 Subject: [PATCH] more cruft cleanup. Nothing essential changed. --- ls-demo.lisp | 26 +++++++++++++++++--------- src/packages.lisp | 17 +++++------------ 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/ls-demo.lisp b/ls-demo.lisp index 3e13323..d757c54 100644 --- a/ls-demo.lisp +++ b/ls-demo.lisp @@ -3,7 +3,7 @@ ;;; See COPYRIGHT file for any additional restrictions (BSD license). ;;; Since 1991, ANSI was finally finished. Edited for ANSI Common Lisp. -;;; Time-stamp: <2009-09-22 23:42:06 tony> +;;; Time-stamp: <2011-12-06 16:04:17 tony> ;;; Creation: <2009-09-17 22:19:31 tony> (sometime earlier, but serious now) ;;; File: ls-demo.lisp ;;; Author: AJ Rossini @@ -24,10 +24,11 @@ ;; Go somewhere so that you have the functions available. (in-package :ls-user) + ;; we'll be loading from directories in the CLS homedir, so we want to ;; make it easier to reach. (defparameter *my-cls-homedir* - "/media/disk/Desktop/sandbox/CLS.git/" ; <- value with trailing + "/home/tony/sandbox/CLS.git/" ; <- value with trailing ; directory separator "documentation: change this to localize") ; <- doc ;; so @@ -58,7 +59,7 @@ return a pathspec, not a string/namespec" *df-test* ; but with SBCL, ints become floats? (caselabels *df-test*) (varlabels *df-test*) -(vartypes *df-test*) +(vartypes *df-test*) ;; currently errors (setf (xref *df-test* 0 0) -1d0) ; for dataframes, we might want to do ; some type checking to prevent what @@ -70,8 +71,8 @@ return a pathspec, not a string/namespec" ;; Making from arrays and matrix-likes (make-dataframe #2A((1 2 3 4 5) - (10 20 30 40 50))) -(make-dataframe (rand 4 3)) + (10 20 30 40 50))) ;; another error... +(make-dataframe (rand 4 3)) ;; another error ;;; HERE#1 ;;; == READ DATA @@ -91,9 +92,6 @@ return a pathspec, not a string/namespec" - - - (rsm.string:file->number-table (localized-pathto "Data/R-chickwts.csv") :delims ",") @@ -133,6 +131,8 @@ return a pathspec, not a string/namespec" (aref (dataset *my-df-4*) 0 1) +(xref (dataset *my-df-4*) 0 1) ;; preferred to use the x* tools. + (defparameter *my-df-5* (make-instance 'dataframe-array @@ -157,9 +157,17 @@ return a pathspec, not a string/namespec" (4d0 4d0 -5d0)))) (mref *mat-1* 2 0) +(xref *mat-1* 2 0) ;; fails, but should work. + + + +(defparameter *mat-2* + (let ((m (rand 3 3))) + (m* m (transpose m)))) ;; fails, but should work. + (defparameter *mat-2* (let ((m (rand 3 3))) - (m* m (transpose m)))) + (m* m (transpose-matrix m)))) ;; works, it's transpose-matrix (axpy 100.0d0 *mat-2* (eye 3 3)) diff --git a/src/packages.lisp b/src/packages.lisp index 653726a..a6f4674 100644 --- a/src/packages.lisp +++ b/src/packages.lisp @@ -1,6 +1,6 @@ ;;; -*- mode: lisp -*- -;;; Time-stamp: <2010-11-10 14:03:10 tony> +;;; Time-stamp: <2012-07-01 11:19:31 tony> ;;; Creation: <2008-03-11 19:18:34 user> ;;; File: packages.lisp ;;; Author: AJ Rossini @@ -27,11 +27,8 @@ (:cls-datatrans : ) |# - - ;;; Basics - (defpackage :lisp-stat-config (:documentation "holds Common Lisp Statistics configuration/loading variables and related functions.") (:nicknames :cls-config) @@ -132,6 +129,7 @@ :lisp-stat-compound-data) (:export make-rv-function make-rv-function-1)) +;;;;;;;; NEw CLS structure (defpackage :cls-matrix (:documentation "basic utilities for using lisp arrays as numerical @@ -144,7 +142,6 @@ cross-product transpose bind-columns bind-rows array-data-vector vector-to-array)) - ;;; NEW CLOS STRUCTURE ;; CLS-DATA contains the basic variable structure, classes, support/indexing, and mixins. @@ -184,8 +181,7 @@ xref xtype xdims xdim xrank slice take carray ;; support - make-labels - )) + make-labels)) (defpackage :cls-dataio (:documentation "Data I/O and similar import technologies.") @@ -200,8 +196,7 @@ dsvstream->matrix dsvstream->listoflist - filename.dsv->dataframe - )) + filename.dsv->dataframe)) (defpackage :cls-datatrans (:documentation "Data I/O and similar import technologies.") @@ -214,9 +209,7 @@ call-method call-next-method) (:export listoflist->dataframe dataframe->listoflist listoflist->array array->listoflist - listoflist->matrix-like matrix-like->listoflist - - )) + listoflist->matrix-like matrix-like->listoflist)) ;;;; MODELING -- 2.11.4.GIT