\ Matrix utilities MARKER -mutil : .V ( V{ I{ -- ) \ displat a column vector LOCALS| I{ v{ | v{ _len 0 DO CR v{ I{ I } @ } F@ F. LOOP ; \ Example: V{ Irow{ .V : .M ( M{{ I{ -- ) \ display matrix OVER 2 CELLS + @ ( -- M{{ I{ [#cols * #rows] ) >R OVER @ ( -- M{{ I{ #cols ) R> OVER / ( -- M{{ I{ #cols #rows) LOCALS| #rows #cols I{ M{{ | \ local names #rows 0 DO CR \ newline #cols 0 DO M{{ I{ J } @ I }} F@ F. LOOP \ print row LOOP ; \ Example: A{{ Irow{ .M : get_f# ( f: -- x) [CHAR] , PARSE >FLOAT 0= ABORT" Wrong fp# format!" ; : TAB->VEC ( V{ n -- ) \ input vector from a table LOCALS| N v{ | N 0 DO get_f# v{ I } F! LOOP ; : TAB->MAT ( M{{ #rows #cols -- ) \ input matrix from a table LOCALS| #cols #rows M{{ | #rows 0 DO #cols 0 DO get_f# M{{ J I }} F! LOOP REFILL DROP LOOP ;