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 > Libraries

    PDL::LinearAlgebra::Complex 0.03

    Download button

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

    License / Price:

    Last Updated:

    Category:
    Grégory Vanuxem | More programs
    Perl Artistic License / FREE
    June 27th, 2007, 22:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    PDL::LinearAlgebra::Complex description

    PDL::LinearAlgebra::Complex is a PDL interface to the lapack linear algebra programming library (complex number).

    PDL::LinearAlgebra::Complex is a PDL interface to the lapack linear algebra programming library (complex number).

    SYNOPSIS

    use PDL::Complex
    use PDL::LinearAlgebra::Complex;

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

    This module provide an interface to parts of the lapack library (complex number). These routine accept either float or double piddles.

    EOD

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

    extern int cgesvd_(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, float *rwork,
    integer *info);
    float *rwork;
    float tmp_work[2];
    %}
    types(D) %{

    extern int zgesvd_(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, double *rwork,
    integer *info);
    double *rwork;
    double tmp_work[2];
    %}
    lwork = ($PRIV(__m_size) < $PRIV(__n_size)) ? 5*$PRIV(__m_size) : 5*$PRIV(__n_size);
    types(F) %{
    rwork = (float *)malloc(lwork * sizeof(float));
    %}
    types(D) %{
    rwork = (double *)malloc(lwork * sizeof(double));
    %}
    lwork = -1;


    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(cgesvd_,zgesvd_)(
    &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[0],
    &lwork,
    rwork,
    $P(info));

    lwork = (integer )tmp_work[0];
    {
    types(F) %{

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

    double *work = (double *)malloc(2*lwork * sizeof(double));
    %}
    $TFD(cgesvd_,zgesvd_)(
    &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,
    rwork,
    $P(info));
    free(work);
    }
    free(rwork);
    ',
    Doc=>'

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    PDL interface | linear algebra | programming library | PDL::LinearAlgebra:: | PDL | interface

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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