[lisplab-cvs] r83 - src/core src/fft src/io src/linalg src/matrix src/util

Jørn Inge Vestgården jivestgarden at common-lisp.net
Sat Aug 15 18:26:01 UTC 2009


Author: jivestgarden
Date: Sat Aug 15 14:26:00 2009
New Revision: 83

Log:
centralized the package structure. Not tested

Modified:
   package.lisp
   src/core/level0-basic.lisp
   src/core/level0-const.lisp
   src/core/level0-functions.lisp
   src/core/level0-infpre.lisp
   src/core/level0-interface.lisp
   src/core/level0-permutation.lisp
   src/fft/level3-fft-interface.lisp
   src/io/level3-io.lisp
   src/linalg/level3-linalg-interface.lisp
   src/matrix/level1-classes.lisp
   src/matrix/level1-interface.lisp
   src/matrix/level2-constructors.lisp
   src/matrix/level2-interface.lisp
   src/util/level3-euler.lisp
   src/util/level3-rk4.lisp

Modified: package.lisp
==============================================================================
--- package.lisp	(original)
+++ package.lisp	Sat Aug 15 14:26:00 2009
@@ -19,11 +19,6 @@
 
 ;;; TODO split this out
 
-(defpackage "LISPLAB"
-  (:nicknames "LL")
-  (:use "COMMON-LISP")
-  (:documentation "Mathematics and linear algebra library"))
-
 (defpackage "FORTRAN-FFI-ACCESSORS"
   (:use "COMMON-LISP" "SB-ALIEN" "SB-C")
   (:export "DEF-FORTRAN-ROUTINE"
@@ -32,10 +27,183 @@
 	   "WITH-VECTOR-DATA-ADDRESSES")
   (:documentation "Fortran foreign function interface"))
   
+(defpackage "LISPLAB"
+  (:use "COMMON-LISP")
+  (:export
+   ;; Numerical constants
+   "%I" 
+   "%E" 
+   "-%I"
+
+   ;; Some general methods
+   "COPY"
+   "CONVERT"
+   "SCALAR?"
+   "VECTOR?"
+   "MATRIX?"
+
+   ;; Basic methods (The dotted algebra)
+   ".+"
+   ".*"
+   "./"
+   ".-"
+   ".^"
+   "^"
+   ".MAX"
+   ".MIN"
+   ".ABS"
+   ".IMAGPART"
+   ".REALPART"
+   ".="
+   "./="
+   ".<" 
+   ".<=" 
+   ".>" 
+   ".>=" 
+   ".ADD"
+   ".MUL"
+   ".DIV"
+   ".SUB"
+   ".EXPT"
+   ".CONJ"
+   ".SIN"
+   ".COS"
+   ".TAN"
+   ".ASIN"
+   ".ACOS"
+   ".ATAN"
+   ".SINH"
+   ".COSH" 
+   ".TANH"
+   ".ASINH"
+   ".ACOSH" 
+   ".ATANH"
+   ".LOG"
+   ".EXP"
+   ".SQR"
+   ".SQRT"
+   ".AI" 
+   ".BESJ" 
+   ".BESY"
+   ".BESI"
+   ".BESK"
+   ".BESH1"
+   ".BESH2"
+   ".ERF" 
+   ".ERFC"
+   ".GAMMA"
+   
+   ;; Infix notation
+   "*SEPARATORS*" 
+   "W/INFIX"
+   "INFIX->PREFIX"
+   "PREFIX->INFIX"
+   
+   ;; Now the matrix stuff
+   ;; Matrix classes
+   "MATRIX-BASE"
+   "MATRIX-GE"
+   "MATRIX-DGE"
+   "MATRIX-ZGE"
+   "FUNCTION-MATRIX"
+   "*LISPLAB-PRINT-SIZE*"
+   ;; Matrix level 1 methods
+   "MAKE-MATRIX-INSTANCE"
+   "MREF"
+   "VREF"
+   "DIM"
+   "ELEMENT-TYPE"
+   "SIZE"
+   "RANK"
+   "ROWS"
+   "COLS"
+   ;; Matrix level 2 constructors
+   "FUNMAT"
+   "FMAT"
+   "MAT"
+   "COL"
+   "ROW"
+   "DMAT"
+   "DNEW"
+   "DCOL"
+   "DROW"
+   "DRANDOM"
+   "ZMAT"
+   "ZNEW" 
+   "ZCOL" 
+   "ZROW"
+   ;; Matrix level 2 methods
+
+   ".EVERY"; to level0 or change name?
+   ".SOME" ; to level0 or change name?	  
+   "SQUARE-MATRIX?"
+   "MNEW" 
+   "MCREATE"
+   "COPY-CONTENTS" 
+   
+   "MMAP" 
+   "MFILL"
+   "TO-VECTOR"
+   "TO-MATRIX"
+   "RESHAPE"
+   "GET-ROW" 
+   "GET-COL"
+   "VIEW-ROW" 
+   "VIEW-COL"
+   "VIEW-MATRIX"
+   "VIEW-MATRIX-AS-VECTOR"
+   "VIEW-VECTOR-AS-MATRIX" 
+   "VIEW-TRANSPOSE"
+   "MSUM" 
+   "MMIN" 
+   "MMAX" 
+   "MABSMIN" 
+   "MABSMAX"
+   "SUB-MATRIX" ; To level3 ?
+   "CIRC-SHIFT"
+   "PAD-SHIFT"
+
+   ;; Matrix level 3
+   ;; IO
+   "PGMWRITE"
+   "PSWRITE"
+   "DLMREAD" 
+   "DLMWRITE" 
+
+   ;; ODE solvers
+   "EULER" ; todo change name
+   "RK4"   ; todo change name
+   
+   ;; Linear algebra
+   "MTP" 
+   "MCT" 
+   "MTR" 
+   "MDET"  
+   "MINV"	  
+   "M*"  
+   "M/" 
+   "LU-FACTOR" 
+   "LIN-SOLVE" 
+   "EIGENVALUES"
+   "EIGENVECTORS"
+
+   ;; FFT
+   "ffT1" 
+   "IFFT1" 
+   "FFT2" 
+   "IFFT2" 	  
+   "FFT-SHIFT" 
+   "IFFT-SHIFT"
+   ))
+
 (defpackage "LISPLAB-BLAS"
-  (:nicknames "LL-BLAS")
-  (:use "COMMON-LISP" "SB-EXT" "LISPLAB")
-  (:documentation "Mathematics and linear algebra library"))
+  (:use "COMMON-LISP" "LISPLAB")
+  (:documentation "Mathematics and linear algebra library."))
+
+
+
+
+
 
 
 

Modified: src/core/level0-basic.lisp
==============================================================================
--- src/core/level0-basic.lisp	(original)
+++ src/core/level0-basic.lisp	Sat Aug 15 14:26:00 2009
@@ -21,8 +21,6 @@
 
 (in-package :lisplab)
 
-(export '(in-dir ))
-
 ;; Here non ansi stuff. 
 ;; First we need the truely-the macro
 

Modified: src/core/level0-const.lisp
==============================================================================
--- src/core/level0-const.lisp	(original)
+++ src/core/level0-const.lisp	Sat Aug 15 14:26:00 2009
@@ -19,8 +19,6 @@
 
 (in-package :lisplab)
 
-(export '(%i %e -%i))
-
 ;;; Float and complex constants
 (define-constant %e (exp 1.0) "The number e = exp(1).")
 (define-constant %i #C(0.0 1.0) "The imaginary unit i=sqrt(-1).")
@@ -33,8 +31,6 @@
 (define-constant %sb32 '(signed-byte 32))
 (define-constant %ub32 '(unsigned-byte 32))
 
-
-
 ;;;; Constants from gsl. 
 
 ;;; TODO: throw them out

Modified: src/core/level0-functions.lisp
==============================================================================
--- src/core/level0-functions.lisp	(original)
+++ src/core/level0-functions.lisp	Sat Aug 15 14:26:00 2009
@@ -19,8 +19,6 @@
 
 (in-package :lisplab)
 
-(export '(.+ .* ./ .- .^ ^))
-
 (defmethod matrix? ((a number)) nil)
 
 (defmethod vector? ((a number)) nil)
@@ -140,119 +138,3 @@
     (* x x)))
 
 
-
-
-
-
-
-
-
-
-#+nil (defmacro expand-on-numbers-lisplab-two-argument-functions-alist ()
-  ;; TODO: optimize? why?
-  (cons 'progn
-      (mapcar (lambda (name)
-		`(defmethod ,(car name) ((a number) (b number))
-		   (,(cdr name) a b)))
-	      +lisplab-two-argument-functions-alist+)))
-
-#+nil (expand-on-numbers-lisplab-two-argument-functions-alist)
-
-#+why-did-I-do-this?(defmethod .expt ((a real) (b real))
-  (expt (to-df a) b))
-
-
-#|
-
-
-
-(defmethod .expt ((a real) (b real))
-  (expt (to-df a) b))
-|#
-
-#|
-(defmethod .sin ((x number))
-  (sin x))
-
-(defmethod .sin ((x real))
-  (sin (to-df x)))
-
-(defmethod .cos ((x number))
-  (cos x))
-
-(defmethod .cos ((x real))
-  (cos (to-df x)))
-
-(defmethod .tan ((x number))
-  (tan x))
-
-(defmethod .tan ((x real))
-  (tan (to-df x)))
-
-(defmethod .asin ((x real))
-  (asin (to-df x)))
-
-(defmethod .acos ((x number))
-  (acos x))
-
-(defmethod .acos ((x real))
-  (acos (to-df x)))
-
-(defmethod .atan ((x number))
-  (atan x))
-
-(defmethod .atan ((x real))
-  (atan (to-df x)))
-
-(defmethod .exp ((x number))
-  (exp x))
-
-(defmethod .exp ((x real))
-  (exp (to-df x)))
-
-
-(defmethod .sqrt ((x number))
-  (sqrt x))
-
-(defmethod .sqrt ((x real))
-  (sqrt (to-df x)))
-
-(defmethod .sinh ((x number))
-  (sinh x))
-
-(defmethod .sinh ((x real))
-  (sinh (to-df x)))
-
-(defmethod .cosh ((x number))
-  (cosh x))
-
-(defmethod .cosh ((x real))
-  (cosh (to-df x)))
-
-(defmethod .tanh ((x number))
-  (tanh x))
-
-(defmethod .tanh ((x real))
-  (tanh (to-df x)))
-
-(defmethod .asinh ((x number))
-  (asinh x))
-
-(defmethod .asinh ((x real))
-  (asinh (to-df x)))
-
-(defmethod .acosh ((x number))
-  (acosh x))
-
-(defmethod .acosh ((x real))
-  (acosh (to-df x)))
-
-(defmethod .atanh ((x number))
-  (atanh x))
-
-(defmethod .atanh ((x real))
-  (atanh (to-df x)))
-
-|#
-
-

Modified: src/core/level0-infpre.lisp
==============================================================================
--- src/core/level0-infpre.lisp	(original)
+++ src/core/level0-infpre.lisp	Sat Aug 15 14:26:00 2009
@@ -35,8 +35,6 @@
 
 (in-package :lisplab)
 
-(export '(*separators* w/infix infix->prefix prefix->infix))
-
 (defvar *separators* '(.+ + .- - .* * ./ / .^ ^) 
   "Default operators for the math macros") 
 

Modified: src/core/level0-interface.lisp
==============================================================================
--- src/core/level0-interface.lisp	(original)
+++ src/core/level0-interface.lisp	Sat Aug 15 14:26:00 2009
@@ -20,29 +20,6 @@
 
 (in-package :lisplab)
 
-(export '(copy convert
-	  scalar?
-	  vector? matrix?
-	  .max .min
-	  .abs .imagpart .realpart
-	  .= ./= .< .<= .> .>= 
-	  .add .add! 
-	  .mul mul!
-	  .div .div!
-	  .sub .sub!
-	  .expt .expt!
-	  .conj
-	  .sin .cos .tan 
-	  .asin .acos .atan 
-	  .sinh .cosh .tanh 
-	  .asinh .acosh .atanh 
-	  .log .exp 
-	  .sqr .sqrt
-	  .Ai 
-	  .besj .besy .besi .besk .besh1 .besh2 
-	  .erf .erfc 
-	  .gamma)) 	  
-
 (define-constant +functions-real-to-real+ 
     '((.sin . sin) (.cos . cos) (.tan . tan) 
       (.asin . asin) (.acos . acos) (.atan . atan)

Modified: src/core/level0-permutation.lisp
==============================================================================
--- src/core/level0-permutation.lisp	(original)
+++ src/core/level0-permutation.lisp	Sat Aug 15 14:26:00 2009
@@ -1,5 +1,5 @@
 ;;; Level2-funmat.lisp 
-;;; Functions as matrix
+;;; Permutation of matrix indices. 
 
 ;;; Copyright (C) 2009 Joern Inge Vestgaarden
 ;;;
@@ -19,8 +19,9 @@
 
 (in-package :lisplab)
 
-(deftype type-permutation ()
-  '(MOD 536870911))
+(deftype type-permutation ()  
+  ;; This should be the same as the max size of arrays
+  '(MOD 536870911)) 
 
 (deftype type-permutation-vector ()
   '(simple-array type-permutation (*)))

Modified: src/fft/level3-fft-interface.lisp
==============================================================================
--- src/fft/level3-fft-interface.lisp	(original)
+++ src/fft/level3-fft-interface.lisp	Sat Aug 15 14:26:00 2009
@@ -19,9 +19,6 @@
 
 (in-package :lisplab)
 
-(export '(fft1 ifft1 fft1! ifft! fft2 ifft2 fft2! ifft2!
-	  fft-shift ifft-shift))
-
 ;;;; Fourier stuff
 
 (defgeneric fft1 (x)

Modified: src/io/level3-io.lisp
==============================================================================
--- src/io/level3-io.lisp	(original)
+++ src/io/level3-io.lisp	Sat Aug 15 14:26:00 2009
@@ -25,8 +25,6 @@
 
 (in-package :lisplab)
 
-(export '(pgmwrite dlmread dlmwrite pswrite))
-
 (defun dlmwrite (a &optional (out t)
 		     &key 
 		     (dlm " ")

Modified: src/linalg/level3-linalg-interface.lisp
==============================================================================
--- src/linalg/level3-linalg-interface.lisp	(original)
+++ src/linalg/level3-linalg-interface.lisp	Sat Aug 15 14:26:00 2009
@@ -19,14 +19,6 @@
 
 (in-package :lisplab)
 
-(export '(mtp mtp! mct mct!
-	  mtr mdet minv! minv
-	  m* m*!  m/ m/!
-	  LU-factor LU-factor!
-	  lin-solve 
-	  eigenvalues
-	  eigenvectors))
-
 (defgeneric mtp (matrix)
   (:documentation "Matrix transpose."))
 

Modified: src/matrix/level1-classes.lisp
==============================================================================
--- src/matrix/level1-classes.lisp	(original)
+++ src/matrix/level1-classes.lisp	Sat Aug 15 14:26:00 2009
@@ -23,14 +23,6 @@
 
 (in-package :lisplab) 
 
-(export '(matrix-ge
-	  matrix-base
-	  matrix-dge
-	  matrix-zge 
-	  function-matrix
-	  ;; Do we need the others?
-	  ))
-
 (declaim (inline matrix-store))
 
 (defclass matrix-base () ())

Modified: src/matrix/level1-interface.lisp
==============================================================================
--- src/matrix/level1-interface.lisp	(original)
+++ src/matrix/level1-interface.lisp	Sat Aug 15 14:26:00 2009
@@ -20,12 +20,6 @@
 
 (in-package :lisplab)
 
-(export '(*lisplab-print-size*
-	  make-matrix-instance 
-	  ref mref vref 
-	  dim element-type 
-	  size rank rows cols))
-
 (defvar *lisplab-print-size* 10 "Suggested number of rows and columns printed to standard output. Not all matrices, such as ordinary lisp arrays, will care about the value.")
 
 (defgeneric make-matrix-instance (type dim value)

Modified: src/matrix/level2-constructors.lisp
==============================================================================
--- src/matrix/level2-constructors.lisp	(original)
+++ src/matrix/level2-constructors.lisp	Sat Aug 15 14:26:00 2009
@@ -19,13 +19,6 @@
 
 (in-package :lisplab)
 
-(export '(funmat
-	  fmat
-	  mat col row
-	  dmat dnew dcol drow
-	  drandom
-	  zmat znew zcol zrow))
-
 (defmethod copy ((a matrix-base))
   (let ((x (make-matrix-instance (class-of a) (dim a) 0)))
     (dotimes (i (size x))

Modified: src/matrix/level2-interface.lisp
==============================================================================
--- src/matrix/level2-interface.lisp	(original)
+++ src/matrix/level2-interface.lisp	Sat Aug 15 14:26:00 2009
@@ -21,30 +21,6 @@
 
 ;;; TODO sort and possibly move to other levels
 
-(export '(
-	  .every .some ; to level0 ?	  
-	  square-matrix?
-	  mnew 
-	  mcreate
-	  copy-contents 
-;         .map 
-	  mmap mfill	   
-;	  dlmwrite dlmread 
-	  to-vector! to-vector
-	  to-matrix! to-matrix
-	  reshape! reshape
-	  get-row! get-row 
-	  get-col! get-col
-	  view-row view-col
-	  view-matrix
-	  view-matrix-as-vector
-	  view-vector-as-matrix 
-	  view-transpose
-	  msum mmin mmax mabsmin mabsmax
-	  sub-matrix ; To level3 ?
-	  circ-shift
-	  pad-shift))
-
 (defgeneric .some (pred a &rest matrices)
   (:documentation "Generalizes some"))
 

Modified: src/util/level3-euler.lisp
==============================================================================
--- src/util/level3-euler.lisp	(original)
+++ src/util/level3-euler.lisp	Sat Aug 15 14:26:00 2009
@@ -19,8 +19,6 @@
 
 (in-package :lisplab)
 
-(export '(euler))
-
 (defun euler (func y x 
 	      &key 
 	      (step)

Modified: src/util/level3-rk4.lisp
==============================================================================
--- src/util/level3-rk4.lisp	(original)
+++ src/util/level3-rk4.lisp	Sat Aug 15 14:26:00 2009
@@ -20,8 +20,6 @@
 
 (in-package :lisplab)
 
-(export '(rk4))
-
 (defun rk4 (func y x 
 	    &key 
 	    (step)




More information about the lisplab-cvs mailing list