The Jama distribution comes with a magic square example that is used to test and benchmark the LU, QR, SVD and symmetric Eig decompositions. The example outputs a multi-column table with these column headings:
Running the Java-based version of the matix square example produces these results:
The magic square example does not fare well when run as a PHP script. For a 32x32 matrix array it takes around a second to complete just the last row of computations in the above table. Hopefully this result will spur PHP developers to find optimizations and better attuned algorithms to speed things up. Matrix algebra is a great testing ground for ideas about time and memory performance optimation. Keep in perspective that PHP JAMA scripts are still plenty fast for use as a tool for learning about matrix algebra and quickly extending your knowledge with new scripts to apply knowledge.
To learn more about the subject of magic squares you can visit the Drexel Math Forum on Magic Squares. You can also learn more by carefully examining the MagicSquareExample.php source code below.
MagicSquareExample.php