 : norm-gram-schmidt ( seq -- orthonormal )
     gram-schmidt [ normalize ] map ;
 
-: m^n ( m n -- n ) 
+: m^n ( m n -- n )
     make-bits over first length identity-matrix
     [ [ dupd m. ] when [ dup m. ] dip ] reduce nip ;
 


: set-indices ( object sequence matrix -- )
    '[ _ set-index ] with each ; inline
    

: matrix-map ( matrix quot -- )
    '[ _ map ] map ; inline

: lower-matrix-indices ( matrix -- matrix' )
    dimension-range [ head-slice >array ] 2map concat ;

: make-lower-matrix ( object m n -- matrix )
    zero-matrix [ lower-matrix-indices ] [ set-indices ] [ ] tri ;

