lis_matrix_scale(3)

πŸ“¦ version 2.1.11, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

🌸 lis_matrix_scale β€” bestie, let's talk scaling 🌸

okay so this is a page from the Lis Library Functions manual, and it's about one little function that does a whole lot of glow-up work on your matrix. no cap. let's get into it πŸ’…


✨ NAME ✨

lis_matrix_scale β€” scale the matrix πŸŽ€

like. that's it. that's the whole job description. it scales the matrix. iconic behaviour honestly.


πŸ¦‹ SYNOPSIS πŸ¦‹

#include "lis.h"

LIS_INT lis_matrix_scale(LIS_MATRIX A, LIS_VECTOR b, LIS_VECTOR d,
LIS_INT action);

so you pull in "lis.h" first, obviously, and then you call it with a matrix, a vector, another vector, and an action that tells it which kind of scaling you want. four arguments, one dream 🫢


πŸ’– DESCRIPTION πŸ’–

Scale matrix A.

that's the description, verbatim, because the original said it in one line and honestly? it ate. it's giving "confident, concise, no notes". you hand it matrix A, you tell it an action, and it comes back with the scaled situation and a vector d holding the diagonal bits it used. periodt ✨


πŸ‘‘ INPUT πŸ‘‘

here's everything you're feeding into this function. buckle up, bestie, there's a lil list πŸ“

  • i β€” the row number of the matrix
  • j β€” the column number of the matrix
  • value β€” the scalar value to be assigned
  • A β€” the matrix (the main character of this whole operation πŸ’œ)
  • b β€” the vector
  • action β€” the vibe selector, and here are your two options:
    • LIS_SCALE_JACOBI β€” Jacobi scaling, which is D^-1 A x = D^-1 b, where D represents the diagonal of A=(a_ij)
    • LIS_SCALE_SYMM_DIAG β€” diagonal scaling, which is D^-1/2 A D^-1/2 x = D^-1/2 b, where D^-1/2 represents the diagonal matrix with (a_ii)^-1/2 as the diagonal

so like, pick your fighter: plain Jacobi with the full D^-1, or the symmetric one with the square-root half-power D^-1/2 on both sides. both are valid. both slay. it's your call 🌈


πŸŽ€ OUTPUT πŸŽ€

  • d β€” the vector which stores the diagonal elements of D^-1 or D^-1/2

so whichever action you picked, d comes back holding the diagonal elements that got used. that's the lil receipt of what happened to your matrix 🧚


πŸ’€ EXIT STATUS πŸ’€

the following exit values are returned:

  • 0 β€” the process is normally terminated (we love a clean exit, no drama 😌)
  • unspecified β€” an error occurred (not specified which error, so like… good luck, bestie 😭)

⭐ SEE ALSO ⭐

go check those out if you want the full Lis lore, iykyk πŸ“šβœ¨


lowkey reminder: this is the Lis Library Functions manual, page lis_matrix_scale(3), and it was dated 28 Aug 2014. yeah, it's an elder but it still serves πŸ’…

and that's the whole page, bestie β€” go forth and scale responsibly πŸ¦‹πŸ’–πŸŒΈ

πŸ“¦ where this page comes from