SGEMV(3)
π¦ 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,
wherealphaandbetaare scalars,xandyare vectors andAis 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β aCHARACTER*1. On entry,TRANSspecifies 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β anINTEGER. On entry,Mspecifies the number of rows of the matrixA. And listen:Mmust be at least zero. No negative row counts, babe. π«Nβ anINTEGER. On entry,Nspecifies the number of columns of the matrixA. And again,Nmust be at least zero. Same energy. πΈALPHAβ aREAL. On entry,ALPHAspecifies the scalar alpha. That's it. That's the whole description. Iconic minimalism. πAβ aREALarray, dimension( LDA, N ). Before entry, the leading m by n part of the arrayAmust contain the matrix of coefficients. So fill it in before you call, bestie. Don't come empty-handed. πLDAβ anINTEGER. On entry,LDAspecifies the first dimension ofAas declared in the calling (sub) program. And here's the rule:LDAmust be at leastmax( 1, m ). So it's at least 1, and it's at leastm. Whichever is bigger. Slay. π₯Xβ aREALarray, dimension at least( 1 + ( n - 1 )*abs( INCX ) )whenTRANS = 'N'or'n'and at least( 1 + ( m - 1 )*abs( INCX ) )otherwise. Before entry, the incremented arrayXmust contain the vector x. Note the way the dimension flips depending onTRANSβ it's giving conditional main character energy. πINCXβ anINTEGER. On entry,INCXspecifies the increment for the elements ofX. AndINCXmust not be zero. Fr fr. Zero stride is not the vibe. βBETAβ aREAL. On entry,BETAspecifies the scalar beta. And here's a cute detail: whenBETAis supplied as zero thenYneed not be set on input. So you can skip preppingYifBETAis zero. Obsessed with that for you. πYβ aREALarray, dimension at least( 1 + ( m - 1 )*abs( INCY ) )whenTRANS = 'N'or'n'and at least( 1 + ( n - 1 )*abs( INCY ) )otherwise. Before entry withBETAnon-zero, the incremented arrayYmust contain the vector y. On exit,Yis overwritten by the updated vector y. And if eithermornis zero, thenYis not referenced and the function performs a quick return. So zero-size inputs get the VIP fast lane. π¨INCYβ anINTEGER. On entry,INCYspecifies the increment for the elements ofY. And likeINCX,INCYmust 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 whenN = 0, orM = 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
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms