BLAS/SRC/chpr2.f(3)
π BLAS/SRC/chpr2.f β bestie's guide to CHPR2 π
okay so this is a page from the LAPACK library manual (that's the Linear Algebra PACKage, the manual name, iykyk) and it's literally the docs for one single Fortran subroutine: chpr2. it does hermitian rank-2 updates on a packed matrix and it ate. let's get into it π«Ά
β¨ NAME β¨
BLAS/SRC/chpr2.f β that's the file, that's the whole vibe. it's the BLAS Level 2 source file for chpr2. periodt.
π¦ SYNOPSIS π¦
Functions/Subroutines
subroutine chpr2 (uplo, n, alpha, x, incx, y, incy, ap)β yeah that's her. that's CHPR2.
πΈ Function/Subroutine Documentation πΈ
subroutine chpr2 (character uplo, integer n, complex alpha, complex,
dimension(*) x, integer incx, complex, dimension(*) y, integer incy,
complex, dimension(*) ap)
CHPR2 π
π Purpose π
ngl this is the whole point of the function, so lock in:
CHPR2 performs the hermitian rank 2 operation
A := alpha*x*y**H + conjg( alpha )*y*x**H + A,
where alpha is a scalar, x and y are n element vectors and A is an n by n hermitian matrix, supplied in packed form.
like, it takes your matrix A, your two vectors, your scalar, and it adds that whole rank-2 hermitian mess right on top. iconic honestly β¨
π Parameters π
okay so here's every single one, no skips, no cap:
UPLOβ this one isCHARACTER*1. on entry,UPLOspecifies whether the upper or lower triangular part of the matrixAis supplied in the packed arrayAP, like this:UPLO = 'U' or 'u'β the upper triangular part ofAis supplied inAP.UPLO = 'L' or 'l'β the lower triangular part ofAis supplied inAP.
Nβ this one isINTEGER. on entry,Nspecifies the order of the matrixA. andNmust be at least zero. that's the law π¨ALPHAβ this one isCOMPLEX. on entry,ALPHAspecifies the scalaralpha. that's it, that's the whole parameter. main character scalar energy πXβ this one isCOMPLEX array, dimension at least( 1 + ( n - 1 )*abs( INCX ) ). before entry, the incremented arrayXmust contain thenelement vectorx.INCXβ this one isINTEGER. on entry,INCXspecifies the increment for the elements ofX.INCXmust not be zero. fr fr, do not pass zero.Yβ this one isCOMPLEX array, dimension at least( 1 + ( n - 1 )*abs( INCY ) ). before entry, the incremented arrayYmust contain thenelement vectory.INCYβ this one isINTEGER. on entry,INCYspecifies the increment for the elements ofY.INCYmust not be zero. same rule bestie, zero is not the move π«APβ this one isCOMPLEX array, dimension at least( ( n*( n + 1 ) )/2 ). this is the packed matrix and it has rules, so listen up:- before entry with
UPLO = 'U' or 'u', the arrayAPmust contain the upper triangular part of the hermitian matrix packed sequentially, column by column, so thatAP( 1 )containsa( 1, 1 ),AP( 2 )andAP( 3 )containa( 1, 2 )anda( 2, 2 )respectively, and so on. on exit, the arrayAPis overwritten by the upper triangular part of the updated matrix. - before entry with
UPLO = 'L' or 'l', the arrayAPmust contain the lower triangular part of the hermitian matrix packed sequentially, column by column, so thatAP( 1 )containsa( 1, 1 ),AP( 2 )andAP( 3 )containa( 2, 1 )anda( 3, 1 )respectively, and so on. on exit, the arrayAPis overwritten by the lower triangular part of the updated matrix. - and note that the imaginary parts of the diagonal elements need not be set β they're assumed to be zero, and on exit they are set to zero. cute little cleanup detail π§
- before entry with
side note bestie: AP gets overwritten on exit. it's not giving "I'll preserve your input," it's giving "your input is now the answer." plan accordingly π
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
the whole squad showed up for this one π«Ά
β Further Details β
- Level 2 Blas routine.
-- 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.
1986!! they were doing this before most of us were even a thought. legends, honestly π
π Definition at line 144 of file chpr2.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code. (not a human, just a little robot doing its best π€π)
and that's the whole page!! LAPACK Version 3.12.0, BLAS/SRC/chpr2.f(3) β go forth and update your hermitian matrices in packed form, bestie. slay π
β¨π
π¦ where this page comes from
- arch rolling: lapack-doc 3.12.1-2 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms