[lisplab-cvs] r214 - in trunk: . src/matrix1 src/vector1
jivestgarden at common-lisp.net
jivestgarden at common-lisp.net
Sat Apr 14 19:08:20 UTC 2012
Author: jivestgarden
Date: Sat Apr 14 12:08:19 2012
New Revision: 214
Log:
rearranged code.
Added:
trunk/src/matrix1/matrix1-interface.lisp
trunk/src/vector1/vector1-d.lisp
trunk/src/vector1/vector1-z.lisp
Modified:
trunk/lisplab.asd
trunk/src/vector1/level1-interface.lisp
trunk/src/vector1/level1-vector.lisp
Modified: trunk/lisplab.asd
==============================================================================
--- trunk/lisplab.asd Sat Apr 14 11:43:40 2012 (r213)
+++ trunk/lisplab.asd Sat Apr 14 12:08:19 2012 (r214)
@@ -82,13 +82,16 @@
((:file "level1-interface")
(:file "level1-element")
(:file "level1-vector")
+ (:file "vector1-d")
+ (:file "vector1-z")
))
(:module :src/matrix1
:depends-on (:src/core :src/vector1)
:serial t
:components
- ((:file "level1-classes")
+ ((:file "matrix1-interface")
+ (:file "level1-classes")
(:file "level1-constructors")
(:file "level1-matrix")
Added: trunk/src/matrix1/matrix1-interface.lisp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/src/matrix1/matrix1-interface.lisp Sat Apr 14 12:08:19 2012 (r214)
@@ -0,0 +1,45 @@
+;;; Lisplab, matrix1-interface.lisp
+;;; Level1, the interface for the matrix methods
+
+;;; Copyright (C) 2009 Joern Inge Vestgaarden
+;;;
+;;; This program is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 2 of the License, or
+;;; (at your option) any later version.
+;;;
+;;; This program is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License along
+;;; with this program; if not, write to the Free Software Foundation, Inc.,
+;;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+(in-package :lisplab)
+
+(defgeneric make-matrix-instance (type dim value)
+ (:documentation "Creates a new matrix instance"))
+
+(defgeneric ref (matrix &rest subscripts)
+ (:documentation "A general accessor."))
+
+(defgeneric (setf ref) (value matrix &rest subscripts))
+
+(defgeneric mref (matrix row col)
+ (:documentation "Matrix accessor."))
+
+(defgeneric (setf mref) (value matrix row col))
+
+(defgeneric rows (matrix)
+ (:documentation "The number of rows, ie (dim 0)."))
+
+(defgeneric (setf rows) (value matrix))
+
+(defgeneric cols (matrix)
+ (:documentation "The number of columns, ie (dim 1)."))
+
+(defgeneric (setf cols) (value matrix))
+
+
\ No newline at end of file
Modified: trunk/src/vector1/level1-interface.lisp
==============================================================================
--- trunk/src/vector1/level1-interface.lisp Sat Apr 14 11:43:40 2012 (r213)
+++ trunk/src/vector1/level1-interface.lisp Sat Apr 14 12:08:19 2012 (r214)
@@ -25,20 +25,8 @@
Not all matrices will care about the value.")
(defvar *lisplab-element-printer* nil
- "The function used to print matrix elements. For is same as princ and prin1.")
-
-(defgeneric make-matrix-instance (type dim value)
- (:documentation "Creates a new matrix instance"))
-
-(defgeneric ref (matrix &rest subscripts)
- (:documentation "A general accessor."))
-
-(defgeneric (setf ref) (value matrix &rest subscripts))
-
-(defgeneric mref (matrix row col)
- (:documentation "Matrix accessor."))
-
-(defgeneric (setf mref) (value matrix row col))
+ "The function used to print matrix elements.
+For is same as princ and prin1.")
(defgeneric vref (matrix idx)
(:documentation "Vector accessor."))
@@ -66,18 +54,8 @@
(defgeneric (setf rank) (value matrix))
-(defgeneric rows (matrix)
- (:documentation "The number of rows, ie (dim 0)."))
-
-(defgeneric (setf rows) (value matrix))
-
-(defgeneric cols (matrix)
- (:documentation "The number of columns, ie (dim 1)."))
-
-(defgeneric (setf cols) (value matrix))
-
-;;; Integral routines for access to matrix store
+;;; Internal routines for access to matrix store
(declaim (inline vector-store))
Modified: trunk/src/vector1/level1-vector.lisp
==============================================================================
--- trunk/src/vector1/level1-vector.lisp Sat Apr 14 11:43:40 2012 (r213)
+++ trunk/src/vector1/level1-vector.lisp Sat Apr 14 12:08:19 2012 (r214)
@@ -37,12 +37,6 @@
:reader vector-store
:type (simple-array t (*)))))
-(defclass vector-d (vector-base element-double-float)
- ((store :initarg :store
- :initform nil
- :reader vector-store
- :type type-blas-store)))
-
(defclass vector-z (vector-base element-complex-double-float)
((store :initarg :store
:initform nil
@@ -75,27 +69,4 @@
(setf (aref (slot-value vector 'store) idx)
value))
-;;; Double-float vectors
-
-(defmethod vref ((vector vector-d) idx)
- (aref (the type-blas-store (slot-value vector 'store)) idx))
-
-(defmethod (setf vref) (value (vector vector-d) idx)
- (let ((val2 (coerce value 'double-float)))
- (declare (type double-float val2))
- (setf (aref (the type-blas-store (slot-value vector 'store)) idx)
- val2)
- val2))
-
-;;; Complex double float vectors
-
-(defmethod vref ((vector vector-z) i)
- (ref-blas-complex-store (slot-value vector 'store) i 0 1))
-
-(defmethod (setf vref) (value (vector vector-z) i)
- (let ((val2 (coerce value '(complex double-float))))
- (declare (type (complex double-float) val2))
- (setf (ref-blas-complex-store (slot-value vector 'store) i 0 1)
- val2)
- val2))
Added: trunk/src/vector1/vector1-d.lisp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/src/vector1/vector1-d.lisp Sat Apr 14 12:08:19 2012 (r214)
@@ -0,0 +1,36 @@
+;;; Lisplab, vector1-d.lisp
+;;; Level1, double float vectors
+
+;;; Copyright (C) 2012 Joern Inge Vestgaarden
+;;;
+;;; This program is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 2 of the License, or
+;;; (at your option) any later version.
+;;;
+;;; This program is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License along
+;;; with this program; if not, write to the Free Software Foundation, Inc.,
+;;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+(in-package :lisplab)
+
+(defclass vector-d (vector-base element-double-float)
+ ((store :initarg :store
+ :initform nil
+ :reader vector-store
+ :type type-blas-store)))
+
+(defmethod vref ((vector vector-d) idx)
+ (aref (the type-blas-store (slot-value vector 'store)) idx))
+
+(defmethod (setf vref) (value (vector vector-d) idx)
+ (let ((val2 (coerce value 'double-float)))
+ (declare (type double-float val2))
+ (setf (aref (the type-blas-store (slot-value vector 'store)) idx)
+ val2)
+ val2))
Added: trunk/src/vector1/vector1-z.lisp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/src/vector1/vector1-z.lisp Sat Apr 14 12:08:19 2012 (r214)
@@ -0,0 +1,30 @@
+;;; Lisplab, vector1-d.lisp
+;;; Level1, complex double float vectors
+
+;;; Copyright (C) 2012 Joern Inge Vestgaarden
+;;;
+;;; This program is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 2 of the License, or
+;;; (at your option) any later version.
+;;;
+;;; This program is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License along
+;;; with this program; if not, write to the Free Software Foundation, Inc.,
+;;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+(in-package :lisplab)
+
+(defmethod vref ((vector vector-z) i)
+ (ref-blas-complex-store (slot-value vector 'store) i 0 1))
+
+(defmethod (setf vref) (value (vector vector-z) i)
+ (let ((val2 (coerce value '(complex double-float))))
+ (declare (type (complex double-float) val2))
+ (setf (ref-blas-complex-store (slot-value vector 'store) i 0 1)
+ val2)
+ val2))
More information about the lisplab-cvs
mailing list