main()
{ long ntrials; int i, j, k; double x, e, merr;
merr = 0.0;
ntrials = 0;
loop:
/* Fill A[] with random numbers */
k = N*(N+1)/2; for( i=0; i<k; i++ )
{
drand( &x );
x -= 1.5;
x = x + x;
A[i] = x;
} /* Unpack A into a symmetric matrix A0 */
tritosquare( N, A, A0 );
/* Multiply the original matrix by the eigenvectors */
mmmpy( N, N, A0, RR, D ); /* Divide each result vector by the corresponding eigenvalue. */
k = 0; for( i=0; i<N; i++ )
{
x = B[i]; for( j=0; j<N; j++ )
{
D[k] /= x;
k += 1;
}
}
/* Compare the result with the computed eigenvector */
mtransp( N, D, D );
e = 0.0; for( i=0; i<N*N; i++ )
{
x = D[i] - RR[i]; if( x < 0 )
x = -x; if( x > e )
e = x;
} if( e > merr )
merr = e;
ntrials += 1;
printf( "%4ld %.3e\n", ntrials, merr ); goto loop;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.8 Sekunden
(vorverarbeitet am 2026-06-14)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.