[lisplab-cvs] r77 - src/matrix

Jørn Inge Vestgården jivestgarden at common-lisp.net
Sat Aug 8 19:37:35 UTC 2009


Author: jivestgarden
Date: Sat Aug  8 15:37:35 2009
New Revision: 77

Log:
drandom

Modified:
   src/matrix/level2-constructors.lisp

Modified: src/matrix/level2-constructors.lisp
==============================================================================
--- src/matrix/level2-constructors.lisp	(original)
+++ src/matrix/level2-constructors.lisp	Sat Aug  8 15:37:35 2009
@@ -23,6 +23,7 @@
 	  fmat
 	  mat col row
 	  dmat dnew dcol drow
+	  drandom
 	  zmat znew zcol zrow))
 
 (defmethod copy ((a matrix-base))
@@ -84,6 +85,10 @@
 
 ;;; Constructors for matrix-dge
 
+(defun drandom (rows cols)
+  "Creates a double matrix with random element between 0 and 1."
+  (mmap t #'random (dnew 1.0 rows cols)))
+
 (defmacro dmat (&body args)
   "Creates a matrix-dge matrix."
   `(mat 'matrix-dge , at args))




More information about the lisplab-cvs mailing list