Softpedia
 


LINUX CATEGORIES:



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

    PDL::LinearAlgebra::Real 0.06

    Download button

    No screenshots available
    Downloads: 325  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.6/5)
    8 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Grégory Vanuxem | More programs
    Perl Artistic License / FREE
    December 19th, 2007, 21:06 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    PDL::LinearAlgebra::Real description

    PDL::LinearAlgebra::Real is a PDL interface to the real lapack linear algebra programming library.

    PDL::LinearAlgebra::Real is a PDL interface to the real lapack linear algebra programming library.

    SYNOPSIS

    use PDL::LinearAlgebra::Real;

    $a = random (100,100);
    $s = zeroes(100);
    $u = zeroes(100,100);
    $v = zeroes(100,100);
    $info = 0;
    $job = 0;
    gesdd($a, $job, $info, $s , $u, $v);

    Blas vector routine use increment.

    This module provides an interface to parts of the real lapack library. These routines accept either float or double piddles.

    EOD
    pp_def("gesvd", HandleBad => 0, RedoDimsCode => '$SIZE(r) = $PDL(A)->ndims > 1 ? min($PDL(A)->dims[0], $PDL(A)->dims[1]) : 1;', Pars => '[io,phys]A(m,n); int jobu(); int jobvt(); [o,phys]s(r); [o,phys]U(p,q); [o,phys]VT(s,t); int [o,phys]info()', GenericTypes => [F,D], Code => generate_code '
    types(F) %{

    extern int sgesvd_(char *jobu, char *jobvt, integer *m, integer *n, float *a,
    integer *lda, float *s, float *u, int *ldu,
    float *vt, integer *ldvt, float *work, integer *lwork,
    integer *info);

    float tmp_work;
    %}
    types(D) %{

    extern int dgesvd_(char *jobz,char *jobvt, integer *m, integer *n,
    double *a, integer *lda, double *s, double *u, int *ldu,
    double *vt, integer *ldvt, double *work, integer *lwork,
    integer *info);

    double tmp_work;
    %}
    integer lwork = -1;
    char trau, travt;

    switch ($jobu())
    {
    case 1: trau = 'A';
    break;
    case 2: trau = 'S';
    break;
    case 3: trau = 'O';
    break;
    default: trau = 'N';
    }
    switch ($jobvt())
    {
    case 1: travt = 'A';
    break;
    case 2: travt = 'S';
    break;
    case 3: travt = 'O';
    break;
    default: travt = 'N';
    }



    $TFD(sgesvd_,dgesvd_)(
    &trau,
    &travt,
    &$PRIV(__m_size),
    &$PRIV(__n_size),
    $P(A),
    &$PRIV(__m_size),
    $P(s),
    $P(U),
    &$PRIV(__p_size),
    $P(VT),
    &$PRIV(__s_size),
    &tmp_work,
    &lwork,
    $P(info));

    lwork = (integer )tmp_work;
    {
    types(F) %{

    float *work = (float *)malloc(lwork * sizeof(float));
    %}
    types(D) %{

    double *work = (double *)malloc(lwork * sizeof(double));
    %}
    $TFD(sgesvd_,dgesvd_)(
    &trau,
    &travt,
    &$PRIV(__m_size),
    &$PRIV(__n_size),
    $P(A),
    &$PRIV(__m_size),
    $P(s),
    $P(U),
    &$PRIV(__p_size),
    $P(VT),
    &$PRIV(__s_size),
    work,
    &lwork,
    $P(info));
    free(work);
    }
    ',
    Doc => '

    Computes the singular value decomposition (SVD) of a real M-by-N matrix A.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    PDL interface | algebra programming | Perl module | PDL | interface | algebra

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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