Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Don't ask to ask, just ask
 
PerlMonks  

Re: numeric computing

by chunlou (Curate)
on Aug 04, 2003 at 16:34 UTC ( #280731=note: print w/ replies, xml ) Need Help??


in reply to numeric computing

It happens that there's Statistics::LTU. In general, look for the solution that lets Perl interface with other external software.

Inline::Octave may be useful.

Pari (a number theory package) may also be of use.

Omegahat has a bunch of bi-directional interfaces for general programming languages and math software.

Math::MatrixReal can solve linear equations alright. It can't deal with eigensystem in general, only the symmetric case. But it's not hard to implement your own power method to find real (as opposed to complex) eigen values.

use constant eps => 0.00001; my $m; sub eigen { $m = shift; # assume a Math::MatrixReal object return _eigen(-1e300, $m->column(1)->each(sub{1})); } sub _eigen { my $v = $_[1]; $v = $m*$v; my $eigen = $v->norm_max(); $v = $v*(1/$eigen); abs($eigen - $_[0]) > eps ? _eigen($eigen,$v) : return($eigen,$v); }


__________________
Caveat. Power method may go on forever if no real eigenvalues exist unless you explicitly limit the number of iteration.


Comment on Re: numeric computing
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://280731]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2014-04-20 09:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls