Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://280731]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (13)
As of 2017-04-27 15:56 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (510 votes). Check out past polls.