Skip to content

Unused Triangular component in LAUUM #1415

Closed

Description

@jprhyne

For an application I am considering using LAUUM on a triangle matrix where the contract doesn't allow for modifying the part of the triangle that will not hold the final answer.

For example, if my routine computes an upper triangular matrix then the strictly lower triangular component must not be modified, however the documentation for LAUUM would suggest that this lower triangular component could be modified arbitrarily.

I think regardless of the choice, the documentation for LAUUM should be clarified.

Activity

  1. jprhyne commented on Sep 14, 2026

    @jprhyne
    ContributorAuthor

    For convenience, here is the documentation for DLAUUM currently in master

    *> \brief \b DLAUUM computes the product UUH or LHL, where U and L are upper or lower triangular matrices (blocked algorithm).
    *
    *  =========== DOCUMENTATION ===========
    *
    * Online html documentation available at
    *            http://www.netlib.org/lapack/explore-html/
    *
    *> Download DLAUUM + dependencies
    *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlauum.f">
    *> [TGZ]</a>
    *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlauum.f">
    *> [ZIP]</a>
    *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlauum.f">
    *> [TXT]</a>
    *
    *  Definition:
    *  ===========
    *
    *       SUBROUTINE DLAUUM( UPLO, N, A, LDA, INFO )
    *
    *       .. Scalar Arguments ..
    *       CHARACTER          UPLO
    *       INTEGER            INFO, LDA, N
    *       ..
    *       .. Array Arguments ..
    *       DOUBLE PRECISION   A( LDA, * )
    *       ..
    *
    *
    *> \par Purpose:
    *  =============
    *>
    *> \verbatim
    *>
    *> DLAUUM 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.
    *>
    *> This is the blocked form of the algorithm, calling Level 3 BLAS.
    *> \endverbatim
    *
    *  Arguments:
    *  ==========
    *
    *> \param[in] UPLO
    *> \verbatim
    *>          UPLO is CHARACTER*1
    *>          Specifies whether the triangular factor stored in the array A
    *>          is upper or lower triangular:
    *>          = 'U':  Upper triangular
    *>          = 'L':  Lower triangular
    *> \endverbatim
    *>
    *> \param[in] N
    *> \verbatim
    *>          N is INTEGER
    *>          The order of the triangular factor U or L.  N >= 0.
    *> \endverbatim
    *>
    *> \param[in,out] A
    *> \verbatim
    *>          A is DOUBLE PRECISION 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.
    *> \endverbatim
    *>
    *> \param[in] LDA
    *> \verbatim
    *>          LDA is INTEGER
    *>          The leading dimension of the array A.  LDA >= max(1,N).
    *> \endverbatim
    *>
    *> \param[out] INFO
    *> \verbatim
    *>          INFO is INTEGER
    *>          = 0: successful exit
    *>          < 0: if INFO = -k, the k-th argument had an illegal value
    *> \endverbatim
    *
    *  Authors:
    *  ========
    *
    *> \author Univ. of Tennessee
    *> \author Univ. of California Berkeley
    *> \author Univ. of Colorado Denver
    *> \author NAG Ltd.
    *
    *> \ingroup lauum
    *
    *  =====================================================================
    
  2. martin-frbg commented on Sep 14, 2026

    @martin-frbg
    Collaborator

    I don't think the current version of LAUUM's description (being careful to specify what of A is "overwritten") leaves room for anyone wanting to trash the unmentioned parts ?

  3. jprhyne commented on Sep 14, 2026

    @jprhyne
    ContributorAuthor

    My confusion is the inconsistency with other routines that have a triangular input/output. For example the subroutine DTRTRI the documentation for the array A states the following

    *> \param[in,out] A
    *> \verbatim
    *>          A is DOUBLE PRECISION array, dimension (LDA,N)
    *>          On entry, the triangular matrix A.  If UPLO = 'U', the
    *>          leading N-by-N upper triangular part of the array A contains
    *>          the upper triangular matrix, and the strictly lower
    *>          triangular part of A is not referenced.  If UPLO = 'L', the
    *>          leading N-by-N lower triangular part of the array A contains
    *>          the lower triangular matrix, and the strictly upper
    *>          triangular part of A is not referenced.  If DIAG = 'U', the
    *>          diagonal elements of A are also not referenced and are
    *>          assumed to be 1.
    *>          On exit, the (triangular) inverse of the original matrix, in
    *>          the same storage format.
    *> \endverbatim
    

    This explicitly states that the part of A that is not of interest is not referenced (which implies that it cannot be modified)

  4. langou commented on Sep 14, 2026

    @langou
    Contributor

    Hi @jprhyne, Good catch. I think we should add the TRTRI statement about the strictly lower (or upper) part of A being not referenced in LAUUM. Can you submit a PR? That'll fix this issue. Julien.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions