dlaqr1.c
Go to the documentation of this file.
00001 /* dlaqr1.f -- translated by f2c (version 20061008).
00002    You must link the resulting object file with libf2c:
00003         on Microsoft Windows system, link with libf2c.lib;
00004         on Linux or Unix systems, link with .../path/to/libf2c.a -lm
00005         or, if you install libf2c.a in a standard place, with -lf2c -lm
00006         -- in that order, at the end of the command line, as in
00007                 cc *.o -lf2c -lm
00008         Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
00009 
00010                 http://www.netlib.org/f2c/libf2c.zip
00011 */
00012 
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015 
00016 /* Subroutine */ int dlaqr1_(integer *n, doublereal *h__, integer *ldh, 
00017         doublereal *sr1, doublereal *si1, doublereal *sr2, doublereal *si2, 
00018         doublereal *v)
00019 {
00020     /* System generated locals */
00021     integer h_dim1, h_offset;
00022     doublereal d__1, d__2, d__3;
00023 
00024     /* Local variables */
00025     doublereal s, h21s, h31s;
00026 
00027 
00028 /*  -- LAPACK auxiliary routine (version 3.2) -- */
00029 /*     Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd.. */
00030 /*     November 2006 */
00031 
00032 /*     .. Scalar Arguments .. */
00033 /*     .. */
00034 /*     .. Array Arguments .. */
00035 /*     .. */
00036 
00037 /*       Given a 2-by-2 or 3-by-3 matrix H, DLAQR1 sets v to a */
00038 /*       scalar multiple of the first column of the product */
00039 
00040 /*       (*)  K = (H - (sr1 + i*si1)*I)*(H - (sr2 + i*si2)*I) */
00041 
00042 /*       scaling to avoid overflows and most underflows. It */
00043 /*       is assumed that either */
00044 
00045 /*               1) sr1 = sr2 and si1 = -si2 */
00046 /*           or */
00047 /*               2) si1 = si2 = 0. */
00048 
00049 /*       This is useful for starting double implicit shift bulges */
00050 /*       in the QR algorithm. */
00051 
00052 
00053 /*       N      (input) integer */
00054 /*              Order of the matrix H. N must be either 2 or 3. */
00055 
00056 /*       H      (input) DOUBLE PRECISION array of dimension (LDH,N) */
00057 /*              The 2-by-2 or 3-by-3 matrix H in (*). */
00058 
00059 /*       LDH    (input) integer */
00060 /*              The leading dimension of H as declared in */
00061 /*              the calling procedure.  LDH.GE.N */
00062 
00063 /*       SR1    (input) DOUBLE PRECISION */
00064 /*       SI1    The shifts in (*). */
00065 /*       SR2 */
00066 /*       SI2 */
00067 
00068 /*       V      (output) DOUBLE PRECISION array of dimension N */
00069 /*              A scalar multiple of the first column of the */
00070 /*              matrix K in (*). */
00071 
00072 /*     ================================================================ */
00073 /*     Based on contributions by */
00074 /*        Karen Braman and Ralph Byers, Department of Mathematics, */
00075 /*        University of Kansas, USA */
00076 
00077 /*     ================================================================ */
00078 
00079 /*     .. Parameters .. */
00080 /*     .. */
00081 /*     .. Local Scalars .. */
00082 /*     .. */
00083 /*     .. Intrinsic Functions .. */
00084 /*     .. */
00085 /*     .. Executable Statements .. */
00086     /* Parameter adjustments */
00087     h_dim1 = *ldh;
00088     h_offset = 1 + h_dim1;
00089     h__ -= h_offset;
00090     --v;
00091 
00092     /* Function Body */
00093     if (*n == 2) {
00094         s = (d__1 = h__[h_dim1 + 1] - *sr2, abs(d__1)) + abs(*si2) + (d__2 = 
00095                 h__[h_dim1 + 2], abs(d__2));
00096         if (s == 0.) {
00097             v[1] = 0.;
00098             v[2] = 0.;
00099         } else {
00100             h21s = h__[h_dim1 + 2] / s;
00101             v[1] = h21s * h__[(h_dim1 << 1) + 1] + (h__[h_dim1 + 1] - *sr1) * 
00102                     ((h__[h_dim1 + 1] - *sr2) / s) - *si1 * (*si2 / s);
00103             v[2] = h21s * (h__[h_dim1 + 1] + h__[(h_dim1 << 1) + 2] - *sr1 - *
00104                     sr2);
00105         }
00106     } else {
00107         s = (d__1 = h__[h_dim1 + 1] - *sr2, abs(d__1)) + abs(*si2) + (d__2 = 
00108                 h__[h_dim1 + 2], abs(d__2)) + (d__3 = h__[h_dim1 + 3], abs(
00109                 d__3));
00110         if (s == 0.) {
00111             v[1] = 0.;
00112             v[2] = 0.;
00113             v[3] = 0.;
00114         } else {
00115             h21s = h__[h_dim1 + 2] / s;
00116             h31s = h__[h_dim1 + 3] / s;
00117             v[1] = (h__[h_dim1 + 1] - *sr1) * ((h__[h_dim1 + 1] - *sr2) / s) 
00118                     - *si1 * (*si2 / s) + h__[(h_dim1 << 1) + 1] * h21s + h__[
00119                     h_dim1 * 3 + 1] * h31s;
00120             v[2] = h21s * (h__[h_dim1 + 1] + h__[(h_dim1 << 1) + 2] - *sr1 - *
00121                     sr2) + h__[h_dim1 * 3 + 2] * h31s;
00122             v[3] = h31s * (h__[h_dim1 + 1] + h__[h_dim1 * 3 + 3] - *sr1 - *
00123                     sr2) + h21s * h__[(h_dim1 << 1) + 3];
00124         }
00125     }
00126     return 0;
00127 } /* dlaqr1_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:46