September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
16
Task/Identity-matrix/Forth/identity-matrix.fth
Normal file
16
Task/Identity-matrix/Forth/identity-matrix.fth
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
S" fsl-util.fs" REQUIRED
|
||||
|
||||
: build-identity ( 'p n -- 'p ) \ make an NxN identity matrix
|
||||
0 DO
|
||||
I 1+ 0 DO
|
||||
I J = IF 1.0E0 DUP I J }} F!
|
||||
ELSE
|
||||
0.0E0 DUP J I }} F!
|
||||
0.0E0 DUP I J }} F!
|
||||
THEN
|
||||
LOOP
|
||||
LOOP ;
|
||||
|
||||
6 6 float matrix a{{
|
||||
a{{ 6 build-identity
|
||||
6 6 a{{ }}fprint
|
||||
Loading…
Add table
Add a link
Reference in a new issue