fun with PERL Math::Matrix
Wanting to do some matrix math, I installed the Math::Matrix module from CPAN . There's some nice instructions on installing CPAN modules on about.com . A common tool people use for matrix manipulation is MATLAB . I'm deeply embarrassed I have virtually no skills in MATLAB. However, this module is pretty cool. What makes it so nice it is uses overloading of the basic mathematical operators. So that makes it easy to add, subtract, and multiply matrices, as well as a string conversion when it's accessed in a scalar context. Here's an example: use Math::Matrix; use strict; my $a = new Math::Matrix ([1, 0, -1], [-1, 1, 0], [0, -1, 1]); warn("a =\n$a\n"); my $at = $a->transpose; warn("at =\n$at\n"); warn("at * a =\n", $at * $a, "\n"); The result: a = 1.00000 0.00000 -1.00000 -1.00000 1.00000 0.00000 0.00000 -1.00000 1.00000 at = 1.00000 -1.00000 0.00000 0.00000 1.00000 -1.0000...