dlauu2.c
Go to the documentation of this file.
00001 /* dlauu2.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 /* Table of constant values */
00017 
00018 static doublereal c_b7 = 1.;
00019 static integer c__1 = 1;
00020 
00021 /* Subroutine */ int dlauu2_(char *uplo, integer *n, doublereal *a, integer *
00022         lda, integer *info)
00023 {
00024     /* System generated locals */
00025     integer a_dim1, a_offset, i__1, i__2, i__3;
00026 
00027     /* Local variables */
00028     integer i__;
00029     doublereal aii;
00030     extern doublereal ddot_(integer *, doublereal *, integer *, doublereal *, 
00031             integer *);
00032     extern /* Subroutine */ int dscal_(integer *, doublereal *, doublereal *, 
00033             integer *);
00034     extern logical lsame_(char *, char *);
00035     extern /* Subroutine */ int dgemv_(char *, integer *, integer *, 
00036             doublereal *, doublereal *, integer *, doublereal *, integer *, 
00037             doublereal *, doublereal *, integer *);
00038     logical upper;
00039     extern /* Subroutine */ int xerbla_(char *, integer *);
00040 
00041 
00042 /*  -- LAPACK auxiliary routine (version 3.2) -- */
00043 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00044 /*     November 2006 */
00045 
00046 /*     .. Scalar Arguments .. */
00047 /*     .. */
00048 /*     .. Array Arguments .. */
00049 /*     .. */
00050 
00051 /*  Purpose */
00052 /*  ======= */
00053 
00054 /*  DLAUU2 computes the product U * U' or L' * L, where the triangular */
00055 /*  factor U or L is stored in the upper or lower triangular part of */
00056 /*  the array A. */
00057 
00058 /*  If UPLO = 'U' or 'u' then the upper triangle of the result is stored, */
00059 /*  overwriting the factor U in A. */
00060 /*  If UPLO = 'L' or 'l' then the lower triangle of the result is stored, */
00061 /*  overwriting the factor L in A. */
00062 
00063 /*  This is the unblocked form of the algorithm, calling Level 2 BLAS. */
00064 
00065 /*  Arguments */
00066 /*  ========= */
00067 
00068 /*  UPLO    (input) CHARACTER*1 */
00069 /*          Specifies whether the triangular factor stored in the array A */
00070 /*          is upper or lower triangular: */
00071 /*          = 'U':  Upper triangular */
00072 /*          = 'L':  Lower triangular */
00073 
00074 /*  N       (input) INTEGER */
00075 /*          The order of the triangular factor U or L.  N >= 0. */
00076 
00077 /*  A       (input/output) DOUBLE PRECISION array, dimension (LDA,N) */
00078 /*          On entry, the triangular factor U or L. */
00079 /*          On exit, if UPLO = 'U', the upper triangle of A is */
00080 /*          overwritten with the upper triangle of the product U * U'; */
00081 /*          if UPLO = 'L', the lower triangle of A is overwritten with */
00082 /*          the lower triangle of the product L' * L. */
00083 
00084 /*  LDA     (input) INTEGER */
00085 /*          The leading dimension of the array A.  LDA >= max(1,N). */
00086 
00087 /*  INFO    (output) INTEGER */
00088 /*          = 0: successful exit */
00089 /*          < 0: if INFO = -k, the k-th argument had an illegal value */
00090 
00091 /*  ===================================================================== */
00092 
00093 /*     .. Parameters .. */
00094 /*     .. */
00095 /*     .. Local Scalars .. */
00096 /*     .. */
00097 /*     .. External Functions .. */
00098 /*     .. */
00099 /*     .. External Subroutines .. */
00100 /*     .. */
00101 /*     .. Intrinsic Functions .. */
00102 /*     .. */
00103 /*     .. Executable Statements .. */
00104 
00105 /*     Test the input parameters. */
00106 
00107     /* Parameter adjustments */
00108     a_dim1 = *lda;
00109     a_offset = 1 + a_dim1;
00110     a -= a_offset;
00111 
00112     /* Function Body */
00113     *info = 0;
00114     upper = lsame_(uplo, "U");
00115     if (! upper && ! lsame_(uplo, "L")) {
00116         *info = -1;
00117     } else if (*n < 0) {
00118         *info = -2;
00119     } else if (*lda < max(1,*n)) {
00120         *info = -4;
00121     }
00122     if (*info != 0) {
00123         i__1 = -(*info);
00124         xerbla_("DLAUU2", &i__1);
00125         return 0;
00126     }
00127 
00128 /*     Quick return if possible */
00129 
00130     if (*n == 0) {
00131         return 0;
00132     }
00133 
00134     if (upper) {
00135 
00136 /*        Compute the product U * U'. */
00137 
00138         i__1 = *n;
00139         for (i__ = 1; i__ <= i__1; ++i__) {
00140             aii = a[i__ + i__ * a_dim1];
00141             if (i__ < *n) {
00142                 i__2 = *n - i__ + 1;
00143                 a[i__ + i__ * a_dim1] = ddot_(&i__2, &a[i__ + i__ * a_dim1], 
00144                         lda, &a[i__ + i__ * a_dim1], lda);
00145                 i__2 = i__ - 1;
00146                 i__3 = *n - i__;
00147                 dgemv_("No transpose", &i__2, &i__3, &c_b7, &a[(i__ + 1) * 
00148                         a_dim1 + 1], lda, &a[i__ + (i__ + 1) * a_dim1], lda, &
00149                         aii, &a[i__ * a_dim1 + 1], &c__1);
00150             } else {
00151                 dscal_(&i__, &aii, &a[i__ * a_dim1 + 1], &c__1);
00152             }
00153 /* L10: */
00154         }
00155 
00156     } else {
00157 
00158 /*        Compute the product L' * L. */
00159 
00160         i__1 = *n;
00161         for (i__ = 1; i__ <= i__1; ++i__) {
00162             aii = a[i__ + i__ * a_dim1];
00163             if (i__ < *n) {
00164                 i__2 = *n - i__ + 1;
00165                 a[i__ + i__ * a_dim1] = ddot_(&i__2, &a[i__ + i__ * a_dim1], &
00166                         c__1, &a[i__ + i__ * a_dim1], &c__1);
00167                 i__2 = *n - i__;
00168                 i__3 = i__ - 1;
00169                 dgemv_("Transpose", &i__2, &i__3, &c_b7, &a[i__ + 1 + a_dim1], 
00170                          lda, &a[i__ + 1 + i__ * a_dim1], &c__1, &aii, &a[i__ 
00171                         + a_dim1], lda);
00172             } else {
00173                 dscal_(&i__, &aii, &a[i__ + a_dim1], lda);
00174             }
00175 /* L20: */
00176         }
00177     }
00178 
00179     return 0;
00180 
00181 /*     End of DLAUU2 */
00182 
00183 } /* dlauu2_ */


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