December 2008 Archives

Matrix Eigenvalues in Perl Don't Get Much Easier

| | Comments (0) | TrackBacks (0)
The Matrix subsystem has really grown up in the last few days since the 0.16 release, including easy-to-use methods to calculate Matrix eigenvalues. All kinds of other methods are now available, like
my $det1 = $A->det;      # determinant
my $det2 = abs $A;       # determinant

my $inv = $A->inverse;  
my @eigs = $A->eigenvalues;

my ($eigenvalues, $eigenvectors) = $matrix->eigenpair;
my ($eig1,$eig2) = @$eigenvalues;
my ($u,$v)       = @$eigenvectors;
Compare this new script for calculating eigenvalues and eigenvectors of a nonsymmetric matrix to the old version. Yes, quite an improvement and quite pleasing to the eye now. Note that $A->eigenvalues; returns a list of Math::Complex objects because in general the eigenvalues of a real matrix can be complex. Only if your matrix is symmetric are you guaranteed real eigenvalues.
I just pushed Math::GSL 0.16 to CPAN, it should be showing up here Real Soon Now, depending on how much traffic the dump trucks hit on the intertubes

  • Fixed RT#40947: configure_requires ExtUtils::PkgConfig bug
  • Operator overloading for addition, multiplication and subtraction on Matrix objects (Thierry)
  • Fix an include bug in Histogram2D which caused the build to fail (Thierry)
  • Added reverse() and swap() methods to VectorComplex objects with tests and docs
  • as_list() and get() now work on VectorComplex objects
    • as_list() returns a list of Math::Complex objects
    • get() returns a list of Math::GSL::Complex objects
  • Math::GSL::Test::ok_status() now takes an optional message argument
  • Added KNOWN_BUGS
  • Added Math::GSL::Test::is_status_ok()
  • New subsytems: VectorComplex and MatrixComplex
  • Operator overloading for addition and subtraction with vectors
  • Added example: examples/matrix/nonsymmetric_eigen
    • Shows how to find the eigenvalues of a nonsymmetric matrix
  • Added copy() method to vectors
  • Improved Vector docs
  • Sped up vector dot products by 15x using BLAS function gsl_blas_ddot
    • NOTE: using gsl_blas_ddot($x->raw,$y->raw) directly is still about 10 times faster than $x * $y due to error checking and function call overhead
  • Separated POD and Perl code out of SWIG interface files, yay for proper syntax highlighting
  • Added stub test files for Heapsort, IEEEUtils, Multimin, Siman, Wavelet2D
  • All test files now keep track of how many tests should run

Back on track

| | Comments (0) | TrackBacks (0)
I haven't been able to add code to Math::GSL since about a month because of a tricky bug I had with the build process. Not only was it tricky, it was well hidden and pretty stupid to fix once I saw it.

Now that it's fixed I've been able to commit some code concerning overloading operators + and - in Math::GSL::Matrix. It's been tested and documented but it could still enjoy more documentation. End term exams are coming pretty fast to me so I won't finish overloading multiplication of matrices before one or two weeks.

Ho and Math::GSL 0.16 should be out soon, stay tuned!

Math::GSL 0.15_05

| | Comments (0) | TrackBacks (0)
I just pushed Math::GSL 0.15_05 to CPAN, which includes these fixes since 0.15_04 : 

  • Fixed RT#40947: configure_requires ExtUtils::PkgConfig bug 
  • Added reverse() method to VectorComplex objects with tests and docs 
  • as_list() and get() now work on VectorComplex objects 
    • as_list() returns a list of Math::Complex objects 
    • get() returns a list of Math::GSL::Complex objects

Enjoy!

About this Archive

This page is an archive of entries from December 2008 listed from newest to oldest.

November 2008 is the previous archive.

February 2009 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Screw you, spammers! Clicky Web Analytics