Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Math::Cephes::Matrix 0.47

    Download button

    No screenshots available
    Downloads: 424  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Randy Kobes | More programs
    Perl Artistic License / FREE
    July 20th, 2007, 09:05 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Math::Cephes::Matrix description

    A Perl interface to the cephes matrix routines.

    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; $inew($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; $inew([ [1, 2, 3], [2, 2, 3], [3, 3, 4]]);
    my ($E, $EV1) = $S->eigens();
    my $EV = $EV1->coef;
    for (my $i=0; $i[$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.


    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    cephes routines | matrix routines | Perl module | Math | cephes | matrix

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM