[lisplab-cvs] r123 -
Jørn Inge Vestgården
jivestgarden at common-lisp.net
Sun Dec 13 15:20:02 UTC 2009
Author: jivestgarden
Date: Sun Dec 13 10:20:02 2009
New Revision: 123
Log:
changed function matrix constructors from macro to function
Modified:
example.lisp
Modified: example.lisp
==============================================================================
--- example.lisp (original)
+++ example.lisp Sun Dec 13 10:20:02 2009
@@ -1,6 +1,6 @@
;;; A simple demonstration of how to use lisplab
-(in-package :ll)
+(in-package :ll-user)
;;; 19 ways to create a matrix
(defparameter *test-matrices*
@@ -29,14 +29,16 @@
(zmat (0 #C(0 2) -2) (1 3 -5) (-2 %i 0))
;; Setting of structure
- (funmat '(4 4) (i j) (if (= i j) 1 0))
- (fmat 'matrix-dge '(3 4) (i j) (if (< i j) 1 0.5))
+ (funmat '(4 4) (lambda (i j)
+ (if (= i j) 1 0)))
+ (fmat 'matrix-dge '(3 4) (lambda (i j)
+ (if (< i j) 1 0.5)))
;; From another matrix
(copy (dmat (1 4) (-2 3)))
(mcreate (dmat (1 4) (-2 3)))
(convert '((3 2 4) (1 4 2)) 'matrix-dge)
- (convert (funmat '(3 3) (i j) (random 1.0)) 'matrix-dge)
+ (convert (funmat '(3 3) (lambda (i j) (random 1.0))) 'matrix-dge)
(mmap '(:z :ge :any) #'random (mnew '(:d :ge :any) 1 3 3))
(.+ 3 (dmat (2 3) (-2 9)))))
More information about the lisplab-cvs
mailing list