29 lines
522 B
Plaintext
29 lines
522 B
Plaintext
'generic with striding pointers
|
|
'def typ float
|
|
typedef float typ
|
|
'
|
|
function MatMul(typ *r,*a,*b, int n=4) 'NxN MATRIX : N=1..
|
|
============================================================
|
|
int ystep=sizeof typ
|
|
int xstep=n*sizeof typ
|
|
int i,j,k
|
|
sys px
|
|
for i=1 to n
|
|
px=@a
|
|
for j=1 to n
|
|
r=0
|
|
for k=1 to n
|
|
r+=(a*b)
|
|
@a+=xstep
|
|
@b+=ystep
|
|
next
|
|
@r+=ystep
|
|
px+=ystep
|
|
@a=px
|
|
@b-=xstep
|
|
next
|
|
@a-=xstep
|
|
@b+=xstep
|
|
next
|
|
end function
|