Esempio n. 1
0
VOID eispack_rs P9C(int, nm,
                    int, n,
                    double *, a,
                    double *, w,
                    int, matz,
                    double *, z,
                    double *, fv1,
                    double *, fv2,
                    int *, ierr)
{
    /* this subroutine calls the recommended sequence of */
    /* subroutines from the eigensystem subroutine package (eispack) */
    /* to find the eigenvalues and eigenvectors (if desired) */
    /* of a real symmetric matrix. */

    /* on input */

    /*    nm  must be set to the row dimension of the two-dimensional */
    /*    array parameters as declared in the calling program */
    /*    dimension statement. */

    /*    n  is the order of the matrix  a. */

    /*    a  contains the real symmetric matrix. */

    /*    matz  is an integer variable set equal to zero if */
    /*    only eigenvalues are desired.  otherwise it is set to */
    /*    any non-zero integer for both eigenvalues and eigenvectors. */

    /* on output */

    /*    w  contains the eigenvalues in ascending order. */

    /*    z  contains the eigenvectors if matz is not zero. */

    /*    ierr  is an integer output variable set equal to an error */
    /*       completion code described in the documentation for tqlrat */
    /*       and tql2.  the normal completion code is zero. */

    /*    fv1  and  fv2  are temporary storage arrays. */

    /* questions and comments should be directed to burton s. garbow, */
    /* mathematics and computer science div, argonne national laboratory */

    /* this version dated august 1983. */

    /* ------------------------------------------------------------------ */

    if (n <= nm) {
        goto L10;
    }
    *ierr = n * 10;
    goto L50;

L10:
    if (matz != 0) {
        goto L20;
    }
    /* .......... find eigenvalues only .......... */
    tred1(nm, n, a, w, fv1, fv2);
    /*  tqlrat encounters catastrophic underflow on the Vax */
    /* call  tqlrat(n,w,fv2,ierr) */
    tql1(n, w, fv1, ierr);
    goto L50;
    /* .......... find both eigenvalues and eigenvectors .......... */
L20:
    tred2(nm, n, a, w, fv1, z);
    tql2(nm, n, w, fv1, z, ierr);
L50:
    return;
}
Esempio n. 2
0
void EigenValues(const SymmetricMatrix& X, DiagonalMatrix& D,
   SymmetricMatrix& A)
{ DiagonalMatrix E; tred3(X,D,E,A); tql1(D,E); }