| |
|
|
p.specht
| Window Title "Beschleunigte Matrixmultiplikation" CompileMarkSeparation' (CL) Copyleft 2012-09 P.Specht(at)gmx.at
if 0
$DEFINE XPSE
$IFDEF xpse
{$cleq}
$ENDIF
$IFDEF xpia
$MAKE CL
$ENDIF
endif
windowstyle 1048
window 0,0-%maxx,%maxy
randomize
font 2
cls rnd(8^8)
set("decimals",15)
set("numwidth",27)
declare z&,s&,t&,i&,j&,k&,status&
z&=1000
s&=1000
t&=400
dec z&:dec s&:dec t&
declare a![z&,s&],b![s&,t&],c![z&,t&]
whileLoop 0,s&
a![&Loop,&Loop]=-1
endwhile
status&=show(z&,s&,a![]):print
b![]=rnd(1000)*10^(rnd(5)*(1-2*rnd(2)))
status&=show(s&,t&,b![]):print
var tm&=&GetTickCount
status&=Multipli(z&,s&,t&,addr(a![0,0]),addr(b![0,0]),addr(c![0,0]))
tm&=&GetTickCount-tm&
status&=show(s&,t&,c![]):print
print tm&/1000,"sec.\nREADY."
Waitinput
End
proc show
parameters u&,v&,m![]
if u&>5
print u&+1;" Werte pro Zeile"
else
declare mm!
whileloop 0,u&:i&=&Loop
whileloop 0,v&:j&=&Loop
mm!=m![i&,j&]
'if (mm!<10^10) and (mm!>10^-11) and (mm!<>0)
print m![i&,j&],
'else : print format$("%e",m![i&,j&]), : endif
endwhile
print
if %csrlin>30:waitinput:cls rnd(8^8):endif
endwhile
print
endif
return 1
endproc
$IFDEF xpse
NProc Multipli
parameters z&,s&,t&,a_&,b_&,c_&
declare sum!,prod!,aa!,bb!,cc!,i&,j&,k&
WhileLoop 0,z&:i&=&Loop
WhileLoop 0,t&:k&=&Loop
sum!=0.0
WhileLoop 0,s&:j&=&Loop
aa!=getfloat(a_&,8*(i&+(z&+1)*j&))
bb!=getfloat(b_&,8*(j&+(s&+1)*k&))
prod!=aa!*bb!
sum!=sum!+prod!
endwhile
setfloat(c_&,8*(i&+(s&+1)*k&),sum!)
endwhile
endwhile
return 0
endproc
$ENDIF
/*
Proc Multipli
parameters z&,s&,t&,a_&,b_&,c_&
declare sum!,prod!,aa!,bb!,cc!,i&,j&,k&
WhileLoop 0,z&
i&=&Loop
WhileLoop 0,t&
k&=&Loop
sum!=0
WhileLoop 0,s&
j&=&Loop
sum!=sum!+a![i&,j&]*b![j&,k&]
endwhile
c![i&,k&]=sum!
endwhile
locate 2,2:print trim$(str$(i&));endwhile
return 0
endproc
*/
|
|
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 09/02/12 ▲ |
|
|
|
|
funkheld | Hm..,, which task undertaking next to XPSE now too yet XPIA ?
greeting |
|
|
| |
|
|
|
p.specht
| alternative to that Perform of handoptimiertem Assemblercode LookupAccountName, not published... |
|
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 09/02/12 ▲ |
|
|
|