*  =====================================================================
*
*  Purpose
*  =======
*
*  SLAUUM computes the product U * U**T or L**T * L, where the triangular
*  factor U or L is stored in the upper or lower triangular part of
*  the array A.
*
*  If UPLO = 'U' or 'u' then the upper triangle of the result is stored,
*  overwriting the factor U in A.
*  If UPLO = 'L' or 'l' then the lower triangle of the result is stored,
*  overwriting the factor L in A.
*
*  Arguments
*  =========
*
*  UPLO    (input) CHARACTER*1
*          Specifies whether the triangular factor stored in the array A
*          is upper or lower triangular:
*          = 'U':  Upper triangular
*          = 'L':  Lower triangular
*
*  N       (input) INTEGER
*          The order of the triangular factor U or L.  N >= 0.
*
*  A       (input/output) REAL array, dimension (LDA,N)
*          On entry, the triangular factor U or L.
*          On exit, if UPLO = 'U', the upper triangle of A is
*          overwritten with the upper triangle of the product U * U**T;
*          if UPLO = 'L', the lower triangle of A is overwritten with
*          the lower triangle of the product L**T * L.
*
*  LDA     (input) INTEGER
*          The leading dimension of the array A.  LDA >= max(1,N).
*
*  INFO    (unused, present only for compatibility reasons)
*
*  =====================================================================
*
      SUBROUTINE SLAUUM(UPLO,N,A,LDA,INFO)
      IMPLICIT NONE
      CHARACTER UPLO
      INTEGER I,J,N,LDA,INFO
      REAL A(LDA,*),AII
      REAL SDOT
      LOGICAL LSAME

      IF( LSAME( UPLO, 'U' ) ) THEN
        DO 125 I = N,2,-1
          DO 115 J = I,2,-1
            A(J,I) = SDOT(MIN(I,J),A(1,I),1,A(1,J),1)
  115     CONTINUE
  125   CONTINUE
        AII = A(1,1)
        DO 113 I = 1,N
          A(1,I) = A(1,I)*AII
  113   CONTINUE
      ELSE
        DO 120 J = N,2,-1
          DO 110 I = N,J,-1
            A(I,J) = SDOT(J,A(I,1),LDA,A(J,1),LDA)
  110     CONTINUE
  120   CONTINUE
        AII = A(1,1)
        DO 111 I = 1,N
          A(I,1) = A(I,1)*AII
  111   CONTINUE
      END IF
      RETURN
*     End of SLAUUM
      END

