# matrix solving - PERL Beginners

Hi, I want to use perl to do the matrix solving such as matrix inversion and and matrix multiplication, matrix addition and matrix substraction. However, i have no idea how to do it in perl. Any there anyone who can give me some suggestion how to solve this? Thank you & best regards, ABC...

1. ## matrix solving

Hi,
I want to use perl to do the matrix solving such as matrix inversion and and matrix multiplication, matrix addition and matrix substraction. However, i have no idea how to do it in perl. Any there anyone who can give me some suggestion how to solve this?

Thank you & best regards,

ABC

Boon Guest

2. ## RE: matrix solving

Hi,
Can some one provide an example sample on how to use it?

Thank you & best regards,
ABC

-----Original Message-----
From: Jose Alves de Castro [mailto:pt]
Sent: Friday, May 21, 2004 6:24 PM
To: Boon Chong Ang
Cc: org
Subject: Re: matrix solving

Try using Math::Matrix (you can find it on CPAN)

On Fri, 2004-05-21 at 11:18, Boon Chong Ang wrote:
--
José Alves de Castro <pt>
Telbit - Tecnologias de Informação

Boon Guest

3. ## Re: matrix solving

On Tue, 25 May 2004 13:47:07 +0800, com (Boon Chong Ang)
wrote:

Here is a simple intro tutorial to solving simultaneous equations
with matrices. There are some pitfalls to watch out for, and I try
to point them out.

http://perlmonks.org/index.pl?node_id=347877

--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
Zentara Guest

4. ## RE: matrix solving

There is an example at the bottom of the docs for the module,

http://search.cpan.org/~ulpfr/Math-Matrix-0.4/Matrix.pm#EXAMPLE

http://danconia.org
[/ref]
and and matrix multiplication, matrix addition and matrix substraction.
However, i have no idea how to do it in perl. Any there anyone who can
give me some suggestion how to solve this?
> --
> José Alves de Castro <pt>
> Telbit - Tecnologias de Informação
>
>
> --
> To unsubscribe, e-mail: org
> For additional commands, e-mail: org
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>[/ref]

Wiggins Guest

5. ## RE: matrix solving

Hi,
I have download the matrix cpan testers.cpan.org. The problem is, is there any way I can auto feed in the matrix data in array format? Well, I have post process the data into array and when I feed the data into matrix module, I received error message as it can only accept scalar input. Is there any work around solution that you all can suggest?
The matrix size that I try to solve can be varies from 16x16 to 256x256, that is why I put the data into array format.

Thank you & best regards,
ABC

-----Original Message-----
From: perl.org [mailto:perl.org] On Behalf Of zentara
Sent: Tuesday, May 25, 2004 9:50 PM
To: org
Subject: Re: matrix solving

On Tue, 25 May 2004 13:47:07 +0800, com (Boon Chong Ang)
wrote:

Here is a simple intro tutorial to solving simultaneous equations
with matrices. There are some pitfalls to watch out for, and I try
to point them out.

http://perlmonks.org/index.pl?node_id=347877

--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html

--
To unsubscribe, e-mail: org
<http://learn.perl.org/> <http://learn.perl.org/first-response>

Boon Guest

6. ## Re: matrix solving

On Sun, 30 May 2004 15:07:29 +0800, com (Boon Chong Ang)
wrote:

Read perldoc Math::MatrixReal. It has ways of setting the numbers
of \$rows and \$columns, and for using array slices. There is no
easy premade solution, you will have to hack out the logic to

FROM the perldoc:

"\$new_matrix = \$some_matrix->""new(\$rows,\$columns);"

Another way of calling the matrix object constructor method.

Matrix "\$some_matrix" is not changed by this in any way.

"\$new_matrix = \$matrix->new_from_cols( [ \$column_vec-
tor|\$array_ref|\$string, ... ] )"

Creates a new matrix given a reference to an array of any of the
following:

* column vectors ( n by 1 Math::MatrixReal matrices )
* references to arrays
* strings properly formatted to create a column with
Math::MatrixReal's "new_from_string" command

You may mix and match these as you wish. However, all must be of
the same dimension--no padding happens automatically. Example:

my \$matrix = Math::MatrixReal->new_from_cols( [ [1,2], [3,4] ]
);
print \$matrix;

--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
Zentara Guest

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•