gemmtr(3)

πŸ“¦
version 3.12.1 Β· 5 versions
, in ubuntu stonking

πŸ’– gemmtr(3) πŸ’–

gemmtr β€” straight out of the LAPACK manual, and bestie, you're gonna eat this up ✨


πŸŽ€ NAME

gemmtr - gemmtr: general matrix-matrix multiply with triangular output πŸ’…


✨ SYNOPSIS

πŸ¦‹ Functions

Four routines, one for each flavour of yours truly β€” same job, different number type. Match the letter to your data and slay:

  • CGEMMTR β€” subroutine cgemmtr (uplo, transa, transb, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
  • DGEMMTR β€” subroutine dgemmtr (uplo, transa, transb, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
  • SGEMMTR β€” subroutine sgemmtr (uplo, transa, transb, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
  • ZGEMMTR β€” subroutine zgemmtr (uplo, transa, transb, n, k, alpha, a, lda, b, ldb, beta, c, ldc)

🌸 Detailed Description

Ok so this whole page lives under a bunch of doxygen groups, and the family tree looks like this, verbatim, no notes:

@defgroup hemm          {he,sy}mm:      Hermitian/symmetric matrix-matrix multiply
@defgroup herk          {he,sy}rk:      Hermitian/symmetric rank-k update
@defgroup her2k         {he,sy}r2k:     Hermitian/symmetric rank-2k update

@defgroup trmm          trmm:           triangular matrix-matrix multiply
@defgroup trsm          trsm:           triangular matrix-matrix solve
@}

πŸ”₯ Function Documentation

πŸ’œ subroutine cgemmtr

Here's the exact signature, wrapped exactly like the real thing, don't come for me:

subroutine cgemmtr (character uplo, character transa, character transb,
    integer n, integer k, complex alpha, complex, dimension(lda,*) a,
    integer lda, complex, dimension(ldb,*) b, integer ldb, complex beta,
    complex, dimension(ldc,*) c, integer ldc)

CGEMMTR πŸ‘‘

🫢 Purpose

CGEMMTR does one of the matrix-matrix operations, literally:

   C := alpha*op( A )*op( B ) + beta*C,

where op( X ) is one of

   op( X ) = X   or   op( X ) = X**T,

alpha and beta are scalars, and A, B and C are matrices, with op( A ) an n by k matrix, op( B ) a k by n matrix and C an n by n matrix. And here's the main character twist: the routine only accesses and updates the upper or lower triangular part of the result matrix C. That's the whole vibe check β€” you use this when you already know the resulting C is Hermitian or symmetric, so why waste the other half, right? πŸ’…

🌈 Parameters

  • UPLO β€” CHARACTER*1. On entry, UPLO says which triangle of C is being accessed and updated.
    • UPLO = 'L' or 'l' β†’ the lower triangular part of C is the one that's used.
    • UPLO = 'U' or 'u' β†’ the upper triangular part of C is the one that's used.
  • TRANSA β€” CHARACTER*1. On entry, TRANSA says what form of op( A ) we're using in the multiplication:
    • TRANSA = 'N' or 'n' β†’ op( A ) = A.
    • TRANSA = 'T' or 't' β†’ op( A ) = A**T.
    • TRANSA = 'C' or 'c' β†’ op( A ) = A**H.
  • TRANSB β€” CHARACTER*1. On entry, TRANSB says what form of op( B ) we're using in the multiplication:
    • TRANSB = 'N' or 'n' β†’ op( B ) = B.
    • TRANSB = 'T' or 't' β†’ op( B ) = B**T.
    • TRANSB = 'C' or 'c' β†’ op( B ) = B**H.
  • N β€” INTEGER. On entry, N specifies the number of rows and columns of the matrix C, the number of columns of op(B) and the number of rows of op(A). N must be at least zero.
  • K β€” INTEGER. On entry, K specifies the number of columns of the matrix op( A ) and the number of rows of the matrix op( B ). K must be at least zero.
  • ALPHA β€” COMPLEX. On entry, ALPHA specifies the scalar alpha.
  • A β€” COMPLEX array, dimension ( LDA, ka ), where ka is k when TRANSA = 'N' or 'n', and is n otherwise. Before entry with TRANSA = 'N' or 'n', the leading n by k part of the array A must contain the matrix A, otherwise the leading k by m part of the array A must contain the matrix A.
  • LDA β€” INTEGER. On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. When TRANSA = 'N' or 'n' then LDA must be at least max( 1, n ), otherwise LDA must be at least max( 1, k ).
  • B β€” COMPLEX array, dimension ( LDB, kb ), where kb is n when TRANSB = 'N' or 'n', and is k otherwise. Before entry with TRANSB = 'N' or 'n', the leading k by n part of the array B must contain the matrix B, otherwise the leading n by k part of the array B must contain the matrix B.
  • LDB β€” INTEGER. On entry, LDB specifies the first dimension of B as declared in the calling (sub) program. When TRANSB = 'N' or 'n' then LDB must be at least max( 1, k ), otherwise LDB must be at least max( 1, n ).
  • BETA β€” COMPLEX. On entry, BETA specifies the scalar beta. When BETA is supplied as zero then C need not be set on input.
Not me pointing out the free lunch: BETA zero means you don't gotta set C beforehand. Iconic behaviour honestly πŸ’–
  • C β€” COMPLEX array, dimension ( LDC, N ). Before entry, the leading n by n part of the array C must contain the matrix C, except when beta is zero, in which case C need not be set on entry. On exit, the upper or lower triangular part of the matrix C is overwritten by the n by n matrix
( alpha*op( A )*op( B ) + beta*C ).
  • LDC β€” INTEGER. On entry, LDC specifies the first dimension of C as declared in the calling (sub) program. LDC must be at least max( 1, n ).

✨ Author

Martin Koehler

🧚 Further Details

Level 3 Blas routine.

-- Written on 19-July-2023.
   Martin Koehler, MPI Magdeburg

πŸ’™ subroutine dgemmtr

The double precision one, aka the everyday baddie:

subroutine dgemmtr (character uplo, character transa, character transb,
    integer n, integer k, double precision alpha, double precision,
    dimension(lda,*) a, integer lda, double precision, dimension(ldb,*) b,
    integer ldb, double precision beta, double precision, dimension(ldc,*)
    c, integer ldc)

DGEMMTR πŸ‘‘

🫢 Purpose

DGEMMTR does one of the matrix-matrix operations:

   C := alpha*op( A )*op( B ) + beta*C,

where op( X ) is one of

   op( X ) = X   or   op( X ) = X**T,

alpha and beta are scalars, and A, B and C are matrices, with op( A ) an n by k matrix, op( B ) a k by n matrix and C an n by n matrix. Same deal as before: only the upper or lower triangular part of the result matrix C gets accessed and updated. You reach for this when the resulting C is known to be symmetric. No cap 🫢

🌈 Parameters

  • UPLO β€” CHARACTER*1. On entry, UPLO says whether the lower or the upper triangular part of C is being accessed and updated.
    • UPLO = 'L' or 'l' β†’ the lower triangular part of C is used.
    • UPLO = 'U' or 'u' β†’ the upper triangular part of C is used.
  • TRANSA β€” CHARACTER*1. On entry, TRANSA specifies the form of op( A ) used in the matrix multiplication:
    • TRANSA = 'N' or 'n' β†’ op( A ) = A.
    • TRANSA = 'T' or 't' β†’ op( A ) = A**T.
    • TRANSA = 'C' or 'c' β†’ op( A ) = A**T.
  • TRANSB β€” CHARACTER*1. On entry, TRANSB specifies the form of op( B ) used in the matrix multiplication:
    • TRANSB = 'N' or 'n' β†’ op( B ) = B.
    • TRANSB = 'T' or 't' β†’ op( B ) = B**T.
    • TRANSB = 'C' or 'c' β†’ op( B ) = B**T.
  • N β€” INTEGER. On entry, N specifies the number of rows and columns of the matrix C, the number of columns of op(B) and the number of rows of op(A). N must be at least zero.
  • K β€” INTEGER. On entry, K specifies the number of columns of the matrix op( A ) and the number of rows of the matrix op( B ). K must be at least zero.
  • ALPHA β€” DOUBLE PRECISION. On entry, ALPHA specifies the scalar alpha.
  • A β€” DOUBLE PRECISION array, dimension ( LDA, ka ), where ka is k when TRANSA = 'N' or 'n', and is n otherwise. Before entry with TRANSA = 'N' or 'n', the leading n by k part of the array A must contain the matrix A, otherwise the leading k by m part of the array A must contain the matrix A.
  • LDA β€” INTEGER. On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. When TRANSA = 'N' or 'n' then LDA must be at least max( 1, n ), otherwise LDA must be at least max( 1, k ).
  • B β€” DOUBLE PRECISION array, dimension ( LDB, kb ), where kb is n when TRANSB = 'N' or 'n', and is k otherwise. Before entry with TRANSB = 'N' or 'n', the leading k by n part of the array B must contain the matrix B, otherwise the leading n by k part of the array B must contain the matrix B.
  • LDB β€” INTEGER. On entry, LDB specifies the first dimension of B as declared in the calling (sub) program. When TRANSB = 'N' or 'n' then...

LDB

LDB is INTEGER πŸ’–

On entry, LDB is the first dimension of B, exactly as you declared it in the calling (sub) program. When TRANSB = 'N' or 'n' then LDB must be at least max( 1, k ) β€” otherwise LDB must be at least max( 1, n ). check it, bestie, she does not play. πŸ‘‘

BETA

BETA is DOUBLE PRECISION ✨

On entry, BETA is the scalar beta. And the lil glow-up moment: when BETA is supplied as zero then C need not be set on input. free pass, no cap. πŸŽ€

C

C is DOUBLE PRECISION array, dimension ( LDC, N ) πŸ’…

Before entry, the leading n by n part of the array C must contain the matrix C β€” except when beta is zero, in which case C need not be set on entry. On exit, the upper or lower triangular part of the matrix C is overwritten by the n by n matrix

( alpha*op( A )*op( B ) + beta*C ).

LDC

LDC is INTEGER 🌸

On entry, LDC specifies the first dimension of C as declared in the calling (sub) program. LDC must be at least max( 1, n ). that's the vibe check and you WILL pass it. ✨

Author

Martin Koehler

Further Details:

!>
!>  Level 3 Blas routine.
!>
!>  -- Written on 19-July-2023.
!>     Martin Koehler, MPI Magdeburg
!>

okay now we get to the other family members and honestly they're giving twins energy, it's serving matching outfits πŸ’œ β€” same job, different scalar types. let's go.

subroutine sgemmtr (character uplo, character transa, character transb,
    integer n, integer k, real alpha, real, dimension(lda,*) a, integer lda,
    real, dimension(ldb,*) b, integer ldb, real beta, real, dimension(ldc,*)
    c, integer ldc)

SGEMMTR

Purpose:

!>
!> SGEMMTR  performs one of the matrix-matrix operations
!>
!>    C := alpha*op( A )*op( B ) + beta*C,
!>
!> where  op( X ) is one of
!>
!>    op( X ) = X   or   op( X ) = X**T,
!>
!> alpha and beta are scalars, and A, B and C are matrices, with op( A )
!> an n by k matrix,  op( B )  a  k by n matrix and  C an n by n matrix.
!> Thereby, the routine only accesses and updates the upper or lower
!> triangular part of the result matrix C. This behaviour can be used if
!> the resulting matrix C is known to be symmetric.
!>

Parameters

UPLO

UPLO is CHARACTER*1 πŸ¦‹

On entry, UPLO says whether it's the lower or the upper triangular part of C that gets accessed and updated. pick a lane:

  • UPLO = 'L' or 'l' β†’ the lower triangular part of C is used. πŸ“
  • UPLO = 'U' or 'u' β†’ the upper triangular part of C is used. 🌸

TRANSA

TRANSA is CHARACTER*1 ✨

On entry, TRANSA picks the form of op( A ) for the multiply, like so:

  • TRANSA = 'N' or 'n', op( A ) = A. πŸ’…
  • TRANSA = 'T' or 't', op( A ) = A**T. πŸ”₯
  • TRANSA = 'C' or 'c', op( A ) = A**T. 🫢

TRANSB

TRANSB is CHARACTER*1 ✨

On entry, TRANSB picks the form of op( B ) for the multiply, as follows:

  • TRANSB = 'N' or 'n', op( B ) = B. πŸ’…
  • TRANSB = 'T' or 't', op( B ) = B**T. πŸ”₯
  • TRANSB = 'C' or 'c', op( B ) = B**T. 🫢

N

N is INTEGER πŸ’–

On entry, N specifies the number of rows and columns of the matrix C, the number of columns of op(B) and the number of rows of op(A). N must be at least zero. zero is allowed, negative is not, periodt. πŸ‘‘

K

K is INTEGER πŸ’–

On entry, K specifies the number of columns of the matrix op( A ) and the number of rows of the matrix op( B ). K must be at least zero. same rules, bestie. 🌈

ALPHA

ALPHA is REAL. ⭐

On entry, ALPHA is the scalar alpha. that's it, that's the whole thing. πŸ’œ

A

A is REAL array, dimension ( LDA, ka ), where ka is k when TRANSA = 'N' or 'n', and is n otherwise. πŸŽ€ Before entry with TRANSA = 'N' or 'n', the leading n by k part of the array A must contain the matrix A β€” otherwise the leading k by m part of the array A must contain the matrix A. (yes, m, bestie, that's literally what it says, we do not editorialise. πŸ™ˆ)

LDA

LDA is INTEGER 🌸

On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. When TRANSA = 'N' or 'n' then LDA must be at least max( 1, n ) β€” otherwise LDA must be at least max( 1, k ). πŸ”₯

B

B is REAL array, dimension ( LDB, kb ), where kb is n when TRANSB = 'N' or 'n', and is k otherwise. 🌸 Before entry with TRANSB = 'N' or 'n', the leading k by n part of the array B must contain the matrix B β€” otherwise the leading n by k part of the array B must contain the matrix B. πŸ’…

LDB

LDB is INTEGER πŸ¦‹

On entry, LDB specifies the first dimension of B as declared in the calling (sub) program. When TRANSB = 'N' or 'n' then LDB must be at least max( 1, k ) β€” otherwise LDB must be at least max( 1, n ). ✨

BETA

BETA is REAL. ⭐

On entry, BETA specifies the scalar beta. When BETA is supplied as zero then C need not be set on input. iconic shortcut, take it. πŸŽ€

C

C is REAL array, dimension ( LDC, N ) πŸ’–

Before entry, the leading n by n part of the array C must contain the matrix C, except when beta is zero, in which case C need not be set on entry. On exit, the upper or lower triangular part of the matrix C is overwritten by the n by n matrix

( alpha*op( A )*op( B ) + beta*C ).

LDC

LDC is INTEGER 🌸

On entry, LDC specifies the first dimension of C as declared in the calling (sub) program. LDC must be at least max( 1, n ). no notes. πŸ’…

Author

Martin Koehler

Further Details:

!>
!>  Level 3 Blas routine.
!>
!>  -- Written on 19-July-2023.
!>     Martin Koehler, MPI Magdeburg
!>

and now for the ✨deluxe✨ edition, the complex one, she's fancy and she knows it πŸ’œπŸ’…

subroutine zgemmtr (character uplo, character transa, character transb,
    integer n, integer k, complex*16 alpha, complex*16, dimension(lda,*) a,
    integer lda, complex*16, dimension(ldb,*) b, integer ldb, complex*16
    beta, complex*16, dimension(ldc,*) c, integer ldc)

ZGEMMTR

Purpose:

!>
!> ZGEMMTR  performs one of the matrix-matrix operations
!>
!>    C := alpha*op( A )*op( B ) + beta*C,
!>
!> where  op( X ) is one of
!>
!>    op( X ) = X   or   op( X ) = X**T,
!>
!> alpha and beta are scalars, and A, B and C are matrices, with op( A )
!> an n by k matrix,  op( B )  a  k by n matrix and  C an n by n matrix.
!> Thereby, the routine only accesses and updates the upper or lower
!> triangular part of the result matrix C. This behaviour can be used if
!> the resulting matrix C is known to be Hermitian or symmetric.
!>

Parameters

UPLO

UPLO is CHARACTER*1 πŸ¦‹

On entry, UPLO specifies whether the lower or the upper triangular part of C is access and updated. pick your side, babes:

  • UPLO = 'L' or 'l', the lower triangular part of C is used. πŸ“
  • UPLO = 'U' or 'u', the upper triangular part of C is used. 🌸

TRANSA

TRANSA is CHARACTER*1 ✨

On entry, TRANSA specifies the form of op( A ) to be used in the matrix multiplication as follows:

  • TRANSA = 'N' or 'n', op( A ) = A. πŸ’…
  • TRANSA = 'T' or 't', op( A ) = A**T. πŸ”₯
  • TRANSA = 'C' or 'c', op( A ) = A**H. πŸ‘‘ (conjugate transpose, she's fancy like that)

TRANSB

TRANSB is CHARACTER*1 ✨

On entry, TRANSB specifies the form of op( B ) to be used in the matrix multiplication as follows:

  • TRANSB = 'N' or 'n', op( B ) = B. πŸ’…
  • TRANSB = 'T' or 't', op( B ) = B**T. πŸ”₯
  • TRANSB = 'C' or 'c', op( B ) = B**H. πŸ‘‘

N

N is INTEGER πŸ’–

On entry, N specifies the number of rows and columns of the matrix C, the number of columns of op(B) and the number of rows of op(A). N must be at least zero. πŸ’œ

K

K is INTEGER πŸ’–

On entry, K specifies the number of columns of the matrix op( A ) and the number of rows of the matrix op( B ). K must be at least zero. 🌈

ALPHA

ALPHA is COMPLEX*16. ⭐

On entry, ALPHA specifies the scalar alpha. πŸ’…

A

A is COMPLEX*16 array, dimension ( LDA, ka ), where ka is k when TRANSA = 'N' or 'n', and is n otherwise. πŸŽ€ Before entry with TRANSA = 'N' or 'n', the leading n by k part of the array A must contain the matrix A β€” otherwise the leading k by m part of the array A must contain the matrix A. (yep, m again, we stay faithful bestie. πŸ™ˆ)

LDA

LDA is INTEGER 🌸

On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. When TRANSA = 'N' or 'n' then LDA must be at least max( 1, n ) β€” otherwise LDA must be at least max( 1, k ). πŸ”₯

B

  • B is a COMPLEX*16 array, dimension ( LDB, kb ), where kb is n when TRANSB = 'N' or 'n', and is k otherwise. πŸ¦‹ Before entry with TRANSB = 'N' or 'n', the leading k by n part of the array B must contain the matrix B, otherwise the leading n by k part of the array B must contain the matrix B. No cap, that's the whole vibe.
  • LDB β€” LDB is INTEGER. On entry, LDB specifies the first dimension of B as declared in the calling (sub) program. When TRANSB = 'N' or 'n' then LDB must be at least max( 1, k ), otherwise LDB must be at least max( 1, n ). Bestie, lowkey if you get this wrong the whole thing is giving chaos πŸ’…
  • BETA β€” BETA is COMPLEX*16. On entry, BETA specifies the scalar beta. When BETA is supplied as zero then C need not be set on input. ✨ (yes, you read that right β€” free pass on C, we love a shortcut)
  • C β€” C is COMPLEX*16 array, dimension ( LDC, N ). Before entry, the leading n by n part of the array C must contain the matrix C, except when beta is zero, in which case C need not be set on entry. On exit, the upper or lower triangular part of the matrix C is overwritten by the n by n matrix ( alpha*op( A )*op( B ) + beta*C ). πŸ”₯ she ate and left no crumbs, honestly.
  • LDC β€” LDC is INTEGER. On entry, LDC specifies the first dimension of C as declared in the calling (sub) program. LDC must be at least max( 1, n ). πŸŽ€

πŸ’– Author πŸ’–

Martin Koehler πŸ‘‘

🌸 Further Details 🌸

The page itself is very demure, very mindful about it:

  • Level 3 Blas routine.
  • -- Written on 19-July-2023.
  • Martin Koehler, MPI Magdeburg

The way it just drops the whole origin story at the end like an after-credits scene πŸ“

✨ Author ✨

Yeah so this whole thing? Generated automatically by Doxygen for LAPACK from the source code. πŸ€– Not a human typing out 400 lines at 2am β€” it's giving robot main character energy πŸ’€


🌈 And that's the entire page, bestie. This is gemmtr(3), LAPACK's finest, Version 3.12.0, stamped Mon Jul 6 2026 17:38:28. Go forth and multiply (matrices). Periodt. πŸ’…πŸŽ€πŸ«Ά
πŸ“¦ where this page comes from