Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

eis_rs.c

Go to the documentation of this file.
00001 /* rs.f -- translated by f2c (version 19961017).
00002    You must link the resulting object file with the libraries:
00003         -lf2c -lm   (in that order)
00004 */
00005 
00006 #include "f2c.h"
00007 
00008 /* Subroutine */ int rs_(integer *nm, integer *n, doublereal *a, doublereal *
00009         w, integer *matz, doublereal *z__, doublereal *fv1, doublereal *fv2, 
00010         integer *ierr)
00011 {
00012     /* System generated locals */
00013     integer a_dim1, a_offset, z_dim1, z_offset;
00014 
00015     /* Local variables */
00016     extern /* Subroutine */ int tred1_(integer *, integer *, doublereal *, 
00017             doublereal *, doublereal *, doublereal *), tred2_(integer *, 
00018             integer *, doublereal *, doublereal *, doublereal *, doublereal *)
00019             , tqlrat_(integer *, doublereal *, doublereal *, integer *), 
00020             tql2_(integer *, integer *, doublereal *, doublereal *, 
00021             doublereal *, integer *);
00022 
00023 
00024 
00025 /*     THIS SUBROUTINE CALLS THE RECOMMENDED SEQUENCE OF */
00026 /*     SUBROUTINES FROM THE EIGENSYSTEM SUBROUTINE PACKAGE (EISPACK) */
00027 /*     TO FIND THE EIGENVALUES AND EIGENVECTORS (IF DESIRED) */
00028 /*     OF A REAL SYMMETRIC MATRIX. */
00029 
00030 /*     ON INPUT */
00031 
00032 /*        NM  MUST BE SET TO THE ROW DIMENSION OF THE TWO-DIMENSIONAL */
00033 /*        ARRAY PARAMETERS AS DECLARED IN THE CALLING PROGRAM */
00034 /*        DIMENSION STATEMENT. */
00035 
00036 /*        N  IS THE ORDER OF THE MATRIX  A. */
00037 
00038 /*        A  CONTAINS THE REAL SYMMETRIC MATRIX. */
00039 
00040 /*        MATZ  IS AN INTEGER VARIABLE SET EQUAL TO ZERO IF */
00041 /*        ONLY EIGENVALUES ARE DESIRED.  OTHERWISE IT IS SET TO */
00042 /*        ANY NON-ZERO INTEGER FOR BOTH EIGENVALUES AND EIGENVECTORS. */
00043 
00044 /*     ON OUTPUT */
00045 
00046 /*        W  CONTAINS THE EIGENVALUES IN ASCENDING ORDER. */
00047 
00048 /*        Z  CONTAINS THE EIGENVECTORS IF MATZ IS NOT ZERO. */
00049 
00050 /*        IERR  IS AN INTEGER OUTPUT VARIABLE SET EQUAL TO AN ERROR */
00051 /*           COMPLETION CODE DESCRIBED IN THE DOCUMENTATION FOR TQLRAT */
00052 /*           AND TQL2.  THE NORMAL COMPLETION CODE IS ZERO. */
00053 
00054 /*        FV1  AND  FV2  ARE TEMPORARY STORAGE ARRAYS. */
00055 
00056 /*     QUESTIONS AND COMMENTS SHOULD BE DIRECTED TO BURTON S. GARBOW, */
00057 /*     MATHEMATICS AND COMPUTER SCIENCE DIV, ARGONNE NATIONAL LABORATORY 
00058 */
00059 
00060 /*     THIS VERSION DATED AUGUST 1983. */
00061 
00062 /*     ------------------------------------------------------------------ 
00063 */
00064 
00065     /* Parameter adjustments */
00066     --fv2;
00067     --fv1;
00068     z_dim1 = *nm;
00069     z_offset = z_dim1 + 1;
00070     z__ -= z_offset;
00071     --w;
00072     a_dim1 = *nm;
00073     a_offset = a_dim1 + 1;
00074     a -= a_offset;
00075 
00076     /* Function Body */
00077     if (*n <= *nm) {
00078         goto L10;
00079     }
00080     *ierr = *n * 10;
00081     goto L50;
00082 
00083 L10:
00084     if (*matz != 0) {
00085         goto L20;
00086     }
00087 /*     .......... FIND EIGENVALUES ONLY .......... */
00088     tred1_(nm, n, &a[a_offset], &w[1], &fv1[1], &fv2[1]);
00089     tqlrat_(n, &w[1], &fv2[1], ierr);
00090     goto L50;
00091 /*     .......... FIND BOTH EIGENVALUES AND EIGENVECTORS .......... */
00092 L20:
00093     tred2_(nm, n, &a[a_offset], &w[1], &fv1[1], &z__[z_offset]);
00094     tql2_(nm, n, &w[1], &fv1[1], &z__[z_offset], ierr);
00095 L50:
00096     return 0;
00097 } /* rs_ */
00098 
 

Powered by Plone

This site conforms to the following standards: