Math::Cephes::Matrix 0.44
Sponsored Links
Math::Cephes::Matrix 0.44 Ranking & Summary
File size:
0.29 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
828
Date added:
2007-07-20
Publisher:
Randy Kobes
Math::Cephes::Matrix 0.44 description
Math::Cephes::Matrix is a Perl interface to the cephes matrix routines.
SYNOPSIS
use Math::Cephes::Matrix qw(mat);
# mat is a shortcut for Math::Cephes::Matrix->new
my $M = mat([ [1, 2, -1], [2, -3, 1], [1, 0, 3]]);
my $C = mat([ [1, 2, 4], [2, 9, 2], [6, 2, 7]]);
my $D = $M->add($C); # D = M + C
my $Dc = $D->coef;
for (my $i=0; $i<3; $i++) {
print "row $i:n";
for (my $j=0; $j<3; $j++) {
print "tcolumn $j: $Dc->[$i]->[$j]n";
}
}
This module is a layer on top of the basic routines in the cephes math library for operations on square matrices. In the following, a Math::Cephes::Matrix object is created as
my $M = Math::Cephes::Matrix->new($arr_ref);
where $arr_ref is a reference to an array of arrays, as in the following example:
$arr_ref = [ [1, 2, -1], [2, -3, 1], [1, 0, 3] ]
which represents
/ 1 2 -1
| 2 -3 1 |
1 0 3 /
A copy of a Math::Cephes::Matrix object may be done as
my $M_copy = $M->new();
Methods
coef: get coefficients of the matrix
SYNOPSIS:
my $c = $M->coef;
DESCRIPTION:
This returns an reference to an array of arrays containing the coefficients of the matrix.
clr: set all coefficients equal to a value.
SYNOPSIS:
$M->clr($n);
DESCRIPTION:
This sets all the coefficients of the matrix identically to $n. If $n is not given, a default of 0 is used.
add: add two matrices
SYNOPSIS:
$P = $M->add($N);
DESCRIPTION:
This sets $P equal to $M + $N.
sub: subtract two matrices
SYNOPSIS:
$P = $M->sub($N);
DESCRIPTION:
This sets $P equal to $M - $N.
mul: multiply two matrices or a matrix and a vector
SYNOPSIS:
$P = $M->mul($N);
DESCRIPTION:
This sets $P equal to $M * $N. This method can handle matrix multiplication, when $N is a matrix, as well as matrix-vector multiplication, where $N is an array reference representing a column vector.
div: divide two matrices
SYNOPSIS:
$P = $M->div($N);
DESCRIPTION:
This sets $P equal to $M * ($N)^(-1).
inv: invert a matrix
SYNOPSIS:
$I = $M->inv();
DESCRIPTION:
This sets $I equal to ($M)^(-1).
transp: transpose a matrix
SYNOPSIS:
$T = $M->transp();
DESCRIPTION:
This sets $T equal to the transpose of $M.
simq: solve simultaneous equations
SYNOPSIS:
my $M = Math::Cephes::Matrix->new([ [1, 2, -1], [2, -3, 1], [1, 0, 3]]);
my $B = [2, -1, 10];
my $X = $M->simq($B);
for (my $i=0; $i<3; $i++) {
print "X[$i] is $X->[$i]n";
}
where $M is a Math::Cephes::Matrix object, $B is an input array reference, and $X is an output array reference.
DESCRIPTION:
A set of N simultaneous equations may be represented in matrix form as
M X = B
where M is an N x N square matrix and X and B are column vectors of length N.
eigens: eigenvalues and eigenvectors of a real symmetric matrix
SYNOPSIS:
my $S = Math::Cephes::Matrix->new([ [1, 2, 3], [2, 2, 3], [3, 3, 4]]);
my ($E, $EV1) = $S->eigens();
my $EV = $EV1->coef;
for (my $i=0; $i<3; $i++) {
print "For i=$i, with eigenvalue $E->[$i]n";
my $v = [];
for (my $j=0; $j<3; $j++) {
$v->[$j] = $EV->[$i]->[$j];
}
print "The eigenvector is @$vn";
}
where $M is a Math::Cephes::Matrix object representing a real symmetric matrix. $E is an array reference containing the eigenvalues of $M, and $EV is a Math::Cephes::Matrix object representing the eigenvalues, the ith row corresponding to the ith eigenvalue.
DESCRIPTION:
If M is an N x N real symmetric matrix, and X is an N component column vector, the eigenvalue problem
M X = lambda X
will in general have N solutions, with X the eigenvectors and lambda the eigenvalues.
SYNOPSIS
use Math::Cephes::Matrix qw(mat);
# mat is a shortcut for Math::Cephes::Matrix->new
my $M = mat([ [1, 2, -1], [2, -3, 1], [1, 0, 3]]);
my $C = mat([ [1, 2, 4], [2, 9, 2], [6, 2, 7]]);
my $D = $M->add($C); # D = M + C
my $Dc = $D->coef;
for (my $i=0; $i<3; $i++) {
print "row $i:n";
for (my $j=0; $j<3; $j++) {
print "tcolumn $j: $Dc->[$i]->[$j]n";
}
}
This module is a layer on top of the basic routines in the cephes math library for operations on square matrices. In the following, a Math::Cephes::Matrix object is created as
my $M = Math::Cephes::Matrix->new($arr_ref);
where $arr_ref is a reference to an array of arrays, as in the following example:
$arr_ref = [ [1, 2, -1], [2, -3, 1], [1, 0, 3] ]
which represents
/ 1 2 -1
| 2 -3 1 |
1 0 3 /
A copy of a Math::Cephes::Matrix object may be done as
my $M_copy = $M->new();
Methods
coef: get coefficients of the matrix
SYNOPSIS:
my $c = $M->coef;
DESCRIPTION:
This returns an reference to an array of arrays containing the coefficients of the matrix.
clr: set all coefficients equal to a value.
SYNOPSIS:
$M->clr($n);
DESCRIPTION:
This sets all the coefficients of the matrix identically to $n. If $n is not given, a default of 0 is used.
add: add two matrices
SYNOPSIS:
$P = $M->add($N);
DESCRIPTION:
This sets $P equal to $M + $N.
sub: subtract two matrices
SYNOPSIS:
$P = $M->sub($N);
DESCRIPTION:
This sets $P equal to $M - $N.
mul: multiply two matrices or a matrix and a vector
SYNOPSIS:
$P = $M->mul($N);
DESCRIPTION:
This sets $P equal to $M * $N. This method can handle matrix multiplication, when $N is a matrix, as well as matrix-vector multiplication, where $N is an array reference representing a column vector.
div: divide two matrices
SYNOPSIS:
$P = $M->div($N);
DESCRIPTION:
This sets $P equal to $M * ($N)^(-1).
inv: invert a matrix
SYNOPSIS:
$I = $M->inv();
DESCRIPTION:
This sets $I equal to ($M)^(-1).
transp: transpose a matrix
SYNOPSIS:
$T = $M->transp();
DESCRIPTION:
This sets $T equal to the transpose of $M.
simq: solve simultaneous equations
SYNOPSIS:
my $M = Math::Cephes::Matrix->new([ [1, 2, -1], [2, -3, 1], [1, 0, 3]]);
my $B = [2, -1, 10];
my $X = $M->simq($B);
for (my $i=0; $i<3; $i++) {
print "X[$i] is $X->[$i]n";
}
where $M is a Math::Cephes::Matrix object, $B is an input array reference, and $X is an output array reference.
DESCRIPTION:
A set of N simultaneous equations may be represented in matrix form as
M X = B
where M is an N x N square matrix and X and B are column vectors of length N.
eigens: eigenvalues and eigenvectors of a real symmetric matrix
SYNOPSIS:
my $S = Math::Cephes::Matrix->new([ [1, 2, 3], [2, 2, 3], [3, 3, 4]]);
my ($E, $EV1) = $S->eigens();
my $EV = $EV1->coef;
for (my $i=0; $i<3; $i++) {
print "For i=$i, with eigenvalue $E->[$i]n";
my $v = [];
for (my $j=0; $j<3; $j++) {
$v->[$j] = $EV->[$i]->[$j];
}
print "The eigenvector is @$vn";
}
where $M is a Math::Cephes::Matrix object representing a real symmetric matrix. $E is an array reference containing the eigenvalues of $M, and $EV is a Math::Cephes::Matrix object representing the eigenvalues, the ith row corresponding to the ith eigenvalue.
DESCRIPTION:
If M is an N x N real symmetric matrix, and X is an N component column vector, the eigenvalue problem
M X = lambda X
will in general have N solutions, with X the eigenvectors and lambda the eigenvalues.
Math::Cephes::Matrix 0.44 Screenshot
Math::Cephes::Matrix 0.44 Keywords
SYNOPSIS
DESCRIPTION
Matrix 0.44
equal to
Perl Interface
interface to
n
2
matrix
1
m
M-
Math::Cephes::Matrix
MathCephesMatrix
Math::Cephes::Matrix 0.44
Libraries
Bookmark Math::Cephes::Matrix 0.44
Math::Cephes::Matrix 0.44 Copyright
WareSeeker periodically updates pricing and software information of Math::Cephes::Matrix 0.44 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Math::Cephes::Matrix 0.44 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
greater than or equal to sign
equal to or greater than
less than or equal to symbol
12 volts are equal to
equal to seven
unit equal to 3 scruples
equal to symbol
cannot resolve collation conflict for equal to operation
equal to the number of protons in a neutral atom
synopsis of psychiatry
descriptions now
matrix mris
5 is equal to how many euro
1310nm is equal too
equal to or greater than in excel
not equal to
jewel in the palace synopsis
job description
Related Software
Math::Cephes is a Perl interface to the cephes math library. Free Download
Math::Cephes::Complex is a Perl interface to the cephes complex number routines. Free Download
Math::Matrix can multiply and invert Matrices. Free Download
Math::Cephes::Polynomial is a Perl interface to the cephes math polynomial routines. Free Download
Math::Zap::Matrix is a Perl module for 3*3 matrix manipulation. Free Download
Math::Zap::Matrix2 is a Perl module for 2*2 matrix manipulation. Free Download
Math::MatrixReal is a nifty perl module for doing just about anything you could want with an NxN matrix. Free Download
Math::MatrixReal::Aug Perl module contains additional methods for Math::MatrixReal. Free Download
Latest Software
Popular Software
Favourite Software