English
Forum

traditional Matrixmultiplikation, with nProc speed

 

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 11
Computer: 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
 
09/02/12  
 




p.specht

alternative to that Perform of handoptimiertem Assemblercode LookupAccountName, not published...
 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
09/02/12  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

3.831 Views

Untitledvor 0 min.
p.specht07/17/22
Thomas Freier05/17/22
E.T.01/23/22
Georg Teles01/22/22
More...

Themeninformationen

this Topic has 2 subscriber:

p.specht (2x)
funkheld (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie