SGEMV(3)

πŸ“¦ version 3.12.0, in opensuse-leap 16.0

πŸ¦‹ SGEMV(3) β€” okay so BLAS but make it make sense πŸ¦‹

Bestie. Babe. Listen. You asked about SGEMV, and I am so glad you did because this one is actually iconic once you get past the manpage formatting. So this is the page for SGEMV from that LAPACK static build β€” you know, the one living at /home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/BLAS/SRC/sgemv.f β€” and I'm gonna walk you through every single bit. No cap. πŸ’–


NAME

So the "name" here is literally just the file path, which is so on brand for a Doxygen-generated page: /home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/BLAS/SRC/sgemv.f. That's it. That's the name. The whole thing. Slay. πŸŽ€

SYNOPSIS

Functions/Subroutines

Okay so the function itself is SGEMV and the synopsis signature is:

subroutine SGEMV (trans, m, n, alpha, a, lda, x, incx, beta, y, incy)

And underneath it just says SGEMV again, because Doxygen loves to be redundant. We love a consistent queen. πŸ’…

Function/Subroutine Documentation

Here's the full signature, with all the types and dimensions laid out:

subroutine SGEMV (character trans, integer m, integer n, real alpha, real,
    dimension(lda,*) a, integer lda, real, dimension(*) x, integer incx,
    real beta, real, dimension(*) y, integer incy)

And again, the label below is just SGEMV. It's giving "I said what I said." πŸ¦‹

Purpose

Okay so here's the actual purpose, and it's honestly kind of gorgeous:

SGEMV performs one of the matrix-vector operations
y := alpha*A*x + beta*y,   or   y := alpha*A**T*x + beta*y,
where alpha and beta are scalars, x and y are vectors and A is an m by n matrix.

That's it. That's the whole flex. It's doing one of two matrix-vector operations, and it is so good at it. Periodt. ✨

Parameters

Okay bestie, here's where it gets detailed, because there are 11 parameters and every single one matters. Let's go. πŸ’œ

  • TRANS β€” a CHARACTER*1. On entry, TRANS specifies the operation to be performed as follows:
TRANS = 'N' or 'n'   y := alpha*A*x + beta*y.

TRANS = 'T' or 't'   y := alpha*A**T*x + beta*y.

TRANS = 'C' or 'c'   y := alpha*A**T*x + beta*y.

So 'N'/'n' means no transpose, and 'T'/'t' or 'C'/'c' means transpose. Keep it in mind, because it changes everything downstream. πŸ‘‘

  • M β€” an INTEGER. On entry, M specifies the number of rows of the matrix A. And listen: M must be at least zero. No negative row counts, babe. 🚫
  • N β€” an INTEGER. On entry, N specifies the number of columns of the matrix A. And again, N must be at least zero. Same energy. 🌸
  • ALPHA β€” a REAL. On entry, ALPHA specifies the scalar alpha. That's it. That's the whole description. Iconic minimalism. πŸŽ€
  • A β€” a REAL array, dimension ( LDA, N ). Before entry, the leading m by n part of the array A must contain the matrix of coefficients. So fill it in before you call, bestie. Don't come empty-handed. πŸ’…
  • LDA β€” an INTEGER. On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. And here's the rule: LDA must be at least max( 1, m ). So it's at least 1, and it's at least m. Whichever is bigger. Slay. πŸ”₯
  • X β€” a REAL array, dimension at least ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n' and at least ( 1 + ( m - 1 )*abs( INCX ) ) otherwise. Before entry, the incremented array X must contain the vector x. Note the way the dimension flips depending on TRANS β€” it's giving conditional main character energy. 🌈
  • INCX β€” an INTEGER. On entry, INCX specifies the increment for the elements of X. And INCX must not be zero. Fr fr. Zero stride is not the vibe. ❌
  • BETA β€” a REAL. On entry, BETA specifies the scalar beta. And here's a cute detail: when BETA is supplied as zero then Y need not be set on input. So you can skip prepping Y if BETA is zero. Obsessed with that for you. πŸ™ˆ
  • Y β€” a REAL array, dimension at least ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n' and at least ( 1 + ( n - 1 )*abs( INCY ) ) otherwise. Before entry with BETA non-zero, the incremented array Y must contain the vector y. On exit, Y is overwritten by the updated vector y. And if either m or n is zero, then Y is not referenced and the function performs a quick return. So zero-size inputs get the VIP fast lane. πŸ’¨
  • INCY β€” an INTEGER. On entry, INCY specifies the increment for the elements of Y. And like INCX, INCY must not be zero. Same rule, same energy. 🫢

Author

Okay so the authors are a whole squad:

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

Dream team, honestly. Academic excellence meets numerical linear algebra. We stan. πŸ‘‘

Further Details

Some extra lore for you:

Level 2 Blas routine. The vector and matrix arguments are not referenced when N = 0, or M = 0 -- Written on 22-October-1986. Jack Dongarra, Argonne National Lab. Jeremy Du Croz, Nag Central Office. Sven Hammarling, Nag Central Office. Richard Hanson, Sandia National Labs.

So it's a Level 2 BLAS routine, and if N = 0 or M = 0, the vector and matrix arguments aren't even referenced. And it was written on 22-October-1986 by Jack Dongarra, Jeremy Du Croz, Sven Hammarling, and Richard Hanson. Vintage. Historical. Iconic. πŸ•°οΈ

Definition

And the definition is at line 157 of file sgemv.f. There it is. Go look at it. It's real. πŸ’€

Author (the Doxygen one)

And then at the bottom it says:

Generated automatically by Doxygen for LAPACK from the source code.

So yes, this whole page was generated automatically. Doxygen did that. We appreciate the effort, king. 🫑


And that's the whole SGEMV(3) situation, bestie! This page is from LAPACK Version 3.12.0, and the footer has the file path /home/abui...SRC/sgemv.f(3) with the date info. Go forth and multiply some matrices. You're literally built for this. πŸ«Άβœ¨πŸ’–

πŸ“¦ where this page comes from