[lisplab-cvs] r205 - in trunk: . src/list

jivestgarden at common-lisp.net jivestgarden at common-lisp.net
Sun Oct 9 13:52:00 UTC 2011


Author: jivestgarden
Date: Sun Oct  9 06:51:59 2011
New Revision: 205

Log:
Rename list file

Added:
   trunk/src/list/list.lisp
      - copied unchanged from r204, trunk/src/list/level2-list.lisp
Deleted:
   trunk/src/list/level2-list.lisp
Modified:
   trunk/lisplab.asd

Modified: trunk/lisplab.asd
==============================================================================
--- trunk/lisplab.asd	Sun Oct  9 06:50:13 2011	(r204)
+++ trunk/lisplab.asd	Sun Oct  9 06:51:59 2011	(r205)
@@ -120,7 +120,7 @@
    (:module :src/list
     :depends-on (:src/core)
     :serial t
-    :components ((:file "level2-list")))
+    :components ((:file "list")))
 
 
    (:module :src/matrix2

Copied: trunk/src/list/list.lisp (from r204, trunk/src/list/level2-list.lisp)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/src/list/list.lisp	Sun Oct  9 06:51:59 2011	(r205, copy of r204, trunk/src/list/level2-list.lisp)
@@ -0,0 +1,74 @@
+;;; Lisplab, level2-list.lisp
+;;; Basic algebra stuff for lists
+
+;;; 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.
+
+;;; Should it be somewhere else. It has nothing to do with matrices, really. 
+
+(in-package :lisplab)
+
+(defmethod convert ((x cons) type)
+  (let* ((cols (length (car x)))
+	 (rows (length x))
+	 (m (make-matrix-instance type (list rows cols) 0)))
+    (fill-matrix-with-list m x)
+    m))
+
+(defmethod .mul ((x cons) (y cons))
+  (mapcar #'.mul x y))
+
+(defmethod .mul ((x cons) (y number))
+  (mapcar (lambda (x) (.mul x y)) x))
+
+(defmethod .mul ((x number) (y cons))
+  (mapcar (lambda (y) (.mul x y)) y))
+
+(defmethod .add ((x cons) (y cons))
+  (mapcar #'.add x y))
+
+(defmethod .add ((x cons) (y number))
+  (mapcar (lambda (x) (.add x y)) x))
+
+(defmethod .add ((x number) (y cons))
+  (mapcar (lambda (y) (.add x y)) y))
+
+(defmethod .sub ((x cons) (y cons))
+  (mapcar #'.sub x y))
+
+(defmethod .sub ((x cons) (y number))
+  (mapcar (lambda (x) (.sub x y)) x))
+
+(defmethod .sub ((x number) (y cons))
+  (mapcar (lambda (y) (.sub x y)) y))
+
+(defmethod .div ((x cons) (y cons))
+  (mapcar #'.div x y))
+
+(defmethod .div ((x cons) (y number))
+  (mapcar (lambda (x) (.div x y)) x))
+
+(defmethod .div ((x number) (y cons))
+  (mapcar (lambda (y) (.div x y)) y))
+
+(defmethod .expt ((x cons) (y cons))
+  (mapcar #'.expt x y))
+
+(defmethod .expt ((x cons) (y number))
+  (mapcar (lambda (x) (.expt x y)) x))
+
+(defmethod .expt ((x number) (y cons))
+  (mapcar (lambda (y) (.expt x y)) y))




More information about the lisplab-cvs mailing list