| |
|
|
p.specht
| with manchen Tasks, The through Matrizenrechnung resolved go should, is the product R = X' X of/ one Matrix demand. with X' becomes known The Transponierte (= The around the Hauptdiagonale left-supra to right-under gewendete Matrix) marks. with Eigenmultiplikationen can itself these Transposition as well as The Berechnung all downstairs Diagonalelemente the Ergebnismatrix R but save, there with this Operationen always a quadratische, diagonalsymmetrische Matrix herauskommt. the following Programmstück erspart means a crowd semidetached-gemoppel and, particularly with more Matrizen, plenty Rechenzeit.
Info: On quadratic-symmetrische Matrizen can too others Operationen particularly efficient utilize, about The Spiegelungsoperationen the Algorithmus of Alston Scott Householder, the Jacobiverfahren, The Givens-Rotation or The schrittweise Eigenwert-Faktorenermittlung to Von_Mises.
Window Title "Beschleunigte Eigenmultiplikation R=X'X of/ one Matrix X"
Windowstyle 24:Window 0,0-%maxx,%maxy
set("decimals",17):set("numwidth",26)
var n&=4:var m&=3
declare x![n&-1,m&-1],k&,x#
dim x#,8*m&*n&:k&=x#:x#=addr(x![0,0]):float x#,0=\
1,2,1, 2,3,3, 3,2,1, 2,1,1
' 1.1 , 2.2 , 3.33/10^2 ,\
' 4 , 5 , 6.6 ,\
' 7.7E2, 8.88, 9.9999 ,\
'10.0 ,11.11,12.3456
x#=k&:dispose x#
declare i&,j&,s!,R![m&-1,m&-1]
whileloop 0,m&-1:k&=&Loop:s!=0
Whileloop 0,n&-1
s!=s!+SQR(x![&Loop,k&])
endwhile
R![k&,k&]=s!
endwhile
Whileloop 0,m&-1:k&=&Loop
Whileloop k&+1,m&-1:j&=&Loop:s!=0
whileloop 0,n&-1:i&=&Loop
s!=s!+x![i&,j&]*x![i&,k&]
endwhile
R![j&,k&]=s!
R![k&,j&]=s!
endwhile
endwhile
'Show
whileloop 0,m&-1:i&=&Loop
whileloop 0,m&-1:k&=&Loop
print tab(k&*28);R![i&,k&],
endwhile:print
endwhile
waitinput
|
|
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 05/19/21 ▲ |
|
|
|