better implementation of zero-matrix

db4
Doug Coleman 2009-06-07 20:12:18 -04:00
parent 44850e6533
commit 989cb7d5df
1 changed files with 3 additions and 3 deletions

View File

@ -1,12 +1,12 @@
! Copyright (C) 2005, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: arrays kernel math math.order math.vectors
USING: arrays fry kernel math math.order math.vectors
sequences sequences.private accessors columns ;
IN: math.matrices
! Matrices
: zero-matrix ( m n -- matrix )
[ nip 0 <array> ] curry map ;
'[ _ 0 <array> ] replicate ;
: identity-matrix ( n -- matrix )
#! Make a nxn identity matrix.
@ -60,4 +60,4 @@ PRIVATE>
gram-schmidt [ normalize ] map ;
: cross-zip ( seq1 seq2 -- seq1xseq2 )
[ [ 2array ] with map ] curry map ;
[ [ 2array ] with map ] curry map ;