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 is CHARACTER*1. on entry, UPLO specifies whether the upper or lower triangular part of the matrix A is supplied in the packed array AP, like this:
    • UPLO = 'U' or 'u' β†’ the upper triangular part of A is supplied in AP.
    • UPLO = 'L' or 'l' β†’ the lower triangular part of A is supplied in AP.
  • N β€” this one is INTEGER. on entry, N specifies the order of the matrix A. and N must be at least zero. that's the law 🚨
  • ALPHA β€” this one is COMPLEX. on entry, ALPHA specifies the scalar alpha. that's it, that's the whole parameter. main character scalar energy πŸ‘‘
  • X β€” this one is COMPLEX array, dimension at least ( 1 + ( n - 1 )*abs( INCX ) ). before entry, the incremented array X must contain the n element vector x.
  • INCX β€” this one is INTEGER. on entry, INCX specifies the increment for the elements of X. INCX must not be zero. fr fr, do not pass zero.
  • Y β€” this one is COMPLEX array, dimension at least ( 1 + ( n - 1 )*abs( INCY ) ). before entry, the incremented array Y must contain the n element vector y.
  • INCY β€” this one is INTEGER. on entry, INCY specifies the increment for the elements of Y. INCY must not be zero. same rule bestie, zero is not the move 🚫
  • AP β€” this one is COMPLEX 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 array AP must contain the upper triangular part of the hermitian matrix packed sequentially, column by column, so that AP( 1 ) contains a( 1, 1 ), AP( 2 ) and AP( 3 ) contain a( 1, 2 ) and a( 2, 2 ) respectively, and so on. on exit, the array AP is overwritten by the upper triangular part of the updated matrix.
    • before entry with UPLO = 'L' or 'l', the array AP must contain the lower triangular part of the hermitian matrix packed sequentially, column by column, so that AP( 1 ) contains a( 1, 1 ), AP( 2 ) and AP( 3 ) contain a( 2, 1 ) and a( 3, 1 ) respectively, and so on. on exit, the array AP is 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 🧚
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