Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,25 @@
|
|||
DIM matrix(1,1), output(1,1)
|
||||
matrix() = 3, 2, 2, 1
|
||||
|
||||
FOR power% = 0 TO 9
|
||||
PROCmatrixpower(matrix(), output(), power%)
|
||||
PRINT "matrix()^" ; power% " = "
|
||||
FOR row% = 0 TO DIM(output(), 1)
|
||||
FOR col% = 0 TO DIM(output(), 2)
|
||||
PRINT output(row%,col%);
|
||||
NEXT
|
||||
PRINT
|
||||
NEXT row%
|
||||
NEXT power%
|
||||
END
|
||||
|
||||
DEF PROCmatrixpower(src(), dst(), pow%)
|
||||
LOCAL i%
|
||||
dst() = 0
|
||||
FOR i% = 0 TO DIM(dst(), 1) : dst(i%,i%) = 1 : NEXT
|
||||
IF pow% THEN
|
||||
FOR i% = 1 TO pow%
|
||||
dst() = dst() . src()
|
||||
NEXT
|
||||
ENDIF
|
||||
ENDPROC
|
||||
Loading…
Add table
Add a link
Reference in a new issue