lapacke_example_aux.c(3)

πŸ“¦ version 3.9.0, in centos-stream 9

πŸ’– lapacke_example_aux.c πŸ’–

ok so bestie, welcome to lapacke_example_aux.c β€” it's a little helper file from the LAPACK fam (yes, that LAPACK, the linear-algebra icon πŸ‘‘), and it's honestly giving "supporting cast that carries the whole show." It's not a program you run, it's a trio of lil utility functions that print your matrices and vectors so you can actually see what your math did. No cap, debugging LAPACK without these is a nightmare 😭


✨ NAME ✨

lapacke_example_aux.c β€” the auxiliary example file. That's it, that's the name, she's lowkey humble about it πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

So first things first, you gotta pull in the headers, like:

#include <lapacke.h>
#include <stdio.h>

<lapacke.h> is the LAPACKE main character header, and <stdio.h> is there because... girl, we're printing πŸ’…

🌸 Functions 🌸

Here's the whole squad, all three of them, exactly as declared:

void print_matrix_rowmajor (char *desc, lapack_int m, lapack_int n,
    double *mat, lapack_int ldm)
void print_matrix_colmajor (char *desc, lapack_int m, lapack_int n,
    double *mat, lapack_int ldm)
void print_vector (char *desc, lapack_int n, lapack_int *vec)

Three functions, three vibes: two matrix printers (row-major girlie and col-major girlie, they are not the same, do not confuse them πŸ™ˆ) and one vector printer. iykyk.


⭐ Function Documentation ⭐

πŸŽ€ void print_matrix_colmajor (char * desc, lapack_int m, lapack_int n, double * mat, lapack_int ldm)

Definition at line 17 of file lapacke_example_aux.c.

The column-major printer!! This is the one where the data is stored column by column (Fortran energy fr fr πŸ’œ). You hand it a desc, the dimensions m and n, the mat pointer, and the leading dimension ldm. It's gonna do the print thing.

πŸ”₯ void print_matrix_rowmajor (char * desc, lapack_int m, lapack_int n, double * mat, lapack_int ldm)

Definition at line 5 of file lapacke_example_aux.c.

Same exact signature as her sister above, but this one reads your mat in row-major order β€” the C way, the way your brain probably pictures it. Same params: desc, m, n, mat, ldm. Slay.

πŸ¦‹ void print_vector (char * desc, lapack_int n, lapack_int * vec)

Definition at line 28 of file lapacke_example_aux.c.

Not a matrix this time bestie, it's a vector β€” vec, with n elements, plus your desc label. Note the type: it's a lapack_int *, not a double *. Different printer, different type, keep up πŸ’…βœ¨


🌈 Author 🌈

Generated automatically by Doxygen for LAPACK from the source code. (So like, don't come for the prose, a robot wrote it πŸ€–πŸ’–)


Lowkey the whole point of this page: these are auxiliary examples, so they're here to show how it's done, not to be some fancy library API. Treat them as teaching material and you're golden 🫢

Version 3.8.0 Β· Tue Nov 14 2017 Β· manual page lapacke_example_aux.c(3) β€” okay that's the whole thing, mwah, go print some matrices πŸ’‹πŸŽ€πŸ’œ

πŸ“¦ where this page comes from