ILIAS
eassessment Revision 61809
|
Example of use of Matrix Class, featuring magic squares. More...
Public Member Functions | |
magic ($n) | |
Generate magic square test matrix. | |
microtime_float () | |
Simple function to replicate PHP 5 behaviour. | |
main () | |
Tests LU, QR, SVD and symmetric Eig decompositions. |
Example of use of Matrix Class, featuring magic squares.
Definition at line 11 of file MagicSquareExample.php.
MagicSquareExample::magic | ( | $n | ) |
Generate magic square test matrix.
int | n dimension of matrix |
Definition at line 17 of file MagicSquareExample.php.
References $t.
Referenced by main().
MagicSquareExample::main | ( | ) |
Tests LU, QR, SVD and symmetric Eig decompositions.
n = order of magic square. trace = diagonal sum, should be the magic sum, (n^3 + n)/2. max_eig = maximum eigenvalue of (A + A')/2, should equal trace. rank = linear algebraic rank, should equal n if n is odd, be less than n if n is even. cond = L_2 condition number, ratio of singular values. lu_res = test of LU factorization, norm1(L*U-A(p,:))/(n*eps). qr_res = test of QR factorization, norm1(Q*R-A)/(n*eps).
Definition at line 100 of file MagicSquareExample.php.
References $d, $res, $t, magic(), main(), microtime_float(), and n.
Referenced by main().
MagicSquareExample::microtime_float | ( | ) |
Simple function to replicate PHP 5 behaviour.
Definition at line 83 of file MagicSquareExample.php.
Referenced by main().