LIBERASURECODE_RS_VAND.C(3)
π
liberasurecode β liberasurecode_rs_vand.c(3) π
okay so bestie, welcome to the vand book. this is the manual page (section 3, the library-functions girlys) for liberasurecode_rs_vand.c, living its best life inside the liberasurecode project. β¨
πΈ NAME πΈ
/build/source/src/builtin/rs_vand/liberasurecode_rs_vand.c
that's it. that's the name. the whole entire path, no cap. she said "identify as my full filesystem location" and honestly? iconic. π
β¨ SYNOPSIS β¨
bestie, gather round, these are the headers your code needs to be friends with first:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <rs_galois.h>
#include <liberasurecode_rs_vand.h>
#include <unistd.h>
#include <fcntl.h>
π«Ά Functions
here's the full roster, in order, every single one, and yes we're doing all 26 because that's what the page says and we don't skip. periodt. π
void print_matrix (int *matrix, int rows, int cols)
void square_matrix_multiply (int *m1, int *m2, int *prod, int n)
int is_identity_matrix (int *matrix, int n)
static int * get_matrix_row (int *matrix, int row_idx, int num_cols)
static void copy_row (int *from_matrix, int *to_matrix, int from_row_idx, int to_row_idx, int num_cols)
int is_missing (int *missing_idxs, int index_to_check)
int create_decoding_matrix (int *gen_matrix, int *dec_matrix, int *missing_idxs, int k, int m)
void init_liberasurecode_rs_vand (int k, int m)
void deinit_liberasurecode_rs_vand (void)
static int * create_non_systematic_vand_matrix (int k, int m)
static void swap_matrix_rows (int *r1, int *r2, int num_cols)
static void col_mult (int *matrix, int elem, int col_idx, int num_rows, int num_cols)
static void row_mult (int *matrix, int elem, int row_idx, int num_rows, int num_cols)
static void col_mult_and_add (int *matrix, int elem, int from_col, int to_col, int num_rows, int num_cols)
static void row_mult_and_add (int *matrix, int elem, int from_row, int to_row, int num_rows, int num_cols)
static int get_non_zero_diagonal (int *matrix, int row, int num_rows, int num_cols)
int * make_systematic_matrix (int k, int m)
void free_systematic_matrix (int *matrix)
int gaussj_inversion (int *matrix, int *inverse, int n)
static void region_xor (char *from_buf, char *to_buf, int blocksize)
static void region_multiply (char *from_buf, char *to_buf, int mult, int xor, int blocksize)
static void region_dot_product (char **from_bufs, char *to_buf, int *matrix_row, int num_entries, int blocksize)
int liberasurecode_rs_vand_encode (int *generator_matrix, char **data, char **parity, int k, int m, int blocksize)
static char ** get_first_k_available (char **data, char **parity, int *missing, int k)
int liberasurecode_rs_vand_decode (int *generator_matrix, char **data, char **parity, int k, int m, int *missing, int blocksize, int rebuild_parity)
int liberasurecode_rs_vand_reconstruct (int *generator_matrix, char **data, char **parity, int k, int m, int *missing, int destination_idx, int blocksize)
π Function Documentation π
nnn okay so now the main character energy part. each entry tells you exactly where she's defined (the Definition at line N of file liberasurecode_rs_vand.c. bit), who she calls (References), and who calls her (Referenced by). don't skip the line numbers, they're lore. π₯
π void col_mult (int * matrix, int elem, int col_idx, int num_rows, int num_cols) [static]
she does a column multiply. static, so she's lowkey private, keep it in the family. π
Definition at line 184 of file liberasurecode_rs_vand.c.
Referenced by make_systematic_matrix().
π void col_mult_and_add (int * matrix, int elem, int from_col, int to_col, int num_rows, int num_cols) [static]
multiply a column and then add it somewhere else. two jobs, one function, she's versatile like that. π
Definition at line 204 of file liberasurecode_rs_vand.c.
Referenced by make_systematic_matrix().
π void copy_row (int * from_matrix, int * to_matrix, int from_row_idx, int to_row_idx, int num_cols) [static]
copies a whole row from one matrix into another. it's giving relocation era. π¦
Definition at line 99 of file liberasurecode_rs_vand.c.
References get_matrix_row().
Referenced by create_decoding_matrix().
π₯ int create_decoding_matrix (int * gen_matrix, int * dec_matrix, int * missing_idxs, int k, int m)
the moment the decoding matrix is born. takes the generator matrix, the missing indexes, k, m, and serves you a decoding matrix. main character behavior honestly. π
Definition at line 119 of file liberasurecode_rs_vand.c.
References copy_row(), and is_missing().
Referenced by liberasurecode_rs_vand_decode(), and liberasurecode_rs_vand_reconstruct().
π§ int * create_non_systematic_vand_matrix (int k, int m) [static]
builds the non-systematic Vandermonde matrix from k and m. she's the origin story bestie, the systematic one gets made from her. πΈ
Definition at line 145 of file liberasurecode_rs_vand.c.
Referenced by make_systematic_matrix().
π void deinit_liberasurecode_rs_vand (void)
teardown era. no args, void all the way, she just leaves. wave bye π
Definition at line 140 of file liberasurecode_rs_vand.c.
β void free_systematic_matrix (int * matrix)
frees the systematic matrix. memory hygiene queen, we stan a responsible icon. π«Ά
Definition at line 292 of file liberasurecode_rs_vand.c.
π int gaussj_inversion (int * matrix, int * inverse, int n)
Gauss-Jordan inversion, the math flex. she inverts your matrix into inverse at size n. do not ask her to do it in her head, she uses row ops like a civilized legend. β¨
Definition at line 297 of file liberasurecode_rs_vand.c.
References get_non_zero_diagonal(), row_mult(), row_mult_and_add(), and swap_matrix_rows().
Referenced by liberasurecode_rs_vand_decode(), and liberasurecode_rs_vand_reconstruct().
π char ** get_first_k_available (char ** data, char ** parity, int * missing, int k) [static]
hunts down the first k chunks that actually survived β checking data and parity against missing. survival-of-the-available, fr fr. π
Definition at line 414 of file liberasurecode_rs_vand.c.
Referenced by liberasurecode_rs_vand_decode(), and liberasurecode_rs_vand_reconstruct().
π int * get_matrix_row (int * matrix, int row_idx, int num_cols) [static]
hands you a pointer to row number row_idx. num_cols keeps her honest. she's the plug for copy_row(). π
Definition at line 94 of file liberasurecode_rs_vand.c.
Referenced by copy_row().
π int get_non_zero_diagonal (int * matrix, int row, int num_rows, int num_cols) [static]
scans a row looking for a diagonal element that isn't zero. because you literally cannot divide by zero and she refuses to try. π
Definition at line 227 of file liberasurecode_rs_vand.c.
Referenced by gaussj_inversion(), and make_systematic_matrix().
πΈ void init_liberasurecode_rs_vand (int k, int m)
setup szn. takes k and m and gets everything ready. no return value because she already knows she's fine. π
Definition at line 135 of file liberasurecode_rs_vand.c.
π¦ int is_identity_matrix (int * matrix, int n)
the vibe check: is this n-sized matrix literally the identity matrix? yes or no, no essays. β
Definition at line 73 of file liberasurecode_rs_vand.c.
π int is_missing (int * missing_idxs, int index_to_check)
is index_to_check in missing_idxs? that's the whole function. she's a simple girl and she knows it. π
Definition at line 107 of file liberasurecode_rs_vand.c.
Referenced by create_decoding_matrix().
π int liberasurecode_rs_vand_decode (int * generator_matrix, char ** data, char ** parity, int k, int m, int * missing, int blocksize, int rebuild_parity)
THE decode. takes the generator matrix, the data, the parity, k, m, the missing list, the blocksize, and a rebuild_parity flag, and puts your data back together. big main-character energy, no notes. π₯
Definition at line 428 of file liberasurecode_rs_vand.c.
References create_decoding_matrix(), gaussj_inversion(), get_first_k_available(), and region_dot_product().
π int liberasurecode_rs_vand_encode (int * generator_matrix, char ** data, char ** parity, int k, int m, int blocksize)
the encode. takes data and produces parity using the generator_matrix, for k, m and blocksize. she makes redundancy happen, we love a provider. β¨
Definition at line 401 of file liberasurecode_rs_vand.c.
References region_dot_product().
π§ int liberasurecode_rs_vand_reconstruct (int * generator_matrix, char ** data, char ** parity, int k, int m, int * missing, int destination_idx, int blocksize)
glow-up arc: she rebuilds ONE specific chunk, the one at destination_idx, using the same crew β generator_matrix, data, parity, k, m, missing, blocksize. targeted repair, very precise, very cunty. π―
Definition at line 483 of file liberasurecode_rs_vand.c.
References create_decoding_matrix(), gaussj_inversion(), get_first_k_available(), and region_dot_product().
π int * make_systematic_matrix (int k, int m)
takes k and m and gives you back a freshly baked systematic matrix. she calls in the whole squad to do it. π
Definition at line 242 of file liberasurecode_rs_vand.c.
References col_mult(), col_mult_and_add(), create_non_systematic_vand_matrix(), get_non_zero_diagonal(), and swap_matrix_rows().
π void print_matrix (int * matrix, int rows, int cols)
debug queen π«Ά she prints the matrix with the given rows and cols. purely for the plot.
Definition at line 44 of file liberasurecode_rs_vand.c.
π void region_dot_product (char ** from_bufs, char * to_buf, int * matrix_row, int num_entries, int blocksize) [static]
the actual number-crunching girlie. she dots the from_bufs against matrix_row across num_entries, writing into to_buf, using blocksize. referenced by basically everyone, which is so real of her. π
Definition at line 387 of file liberasurecode_rs_vand.c.
References region_multiply(), and region_xor().
Referenced by liberasurecode_rs_vand_decode(), liberasurecode_rs_vand_encode(), and liberasurecode_rs_vand_reconstruct().
π
void region_multiply (char * from_buf, char * to_buf, int mult, int xor, int blocksize) [static]
multiplies a region by mult into to_buf, with an xor flag, over blocksize. π
Definition at line 358 of file liberasurecode_rs_vand.c.
Referenced by region_dot_product().
π₯ void region_xor (char * from_buf, char * to_buf, int blocksize) [static]
XORs those regions, from_buf into to_buf, blocksize bytes at a time. tiny function, huge impact. β
Definition at line 340 of file liberasurecode_rs_vand.c.
Referenced by region_dot_product().
π¦ void row_mult (int * matrix, int elem, int row_idx, int num_rows, int num_cols) [static]
row multiply. elem times row row_idx, sized num_rows by num_cols. exclusively for gaussj_inversion()'s use, she's taken. π
Definition at line 194 of file liberasurecode_rs_vand.c.
Referenced by gaussj_inversion().
π void row_mult_and_add (int * matrix, int elem, int from_row, int to_row, int num_rows, int num_cols) [static]
multiply from_row by elem and add it into to_row. the classic row-op combo meal, num_rows Γ num_cols sized. π
Definition at line 215 of file liberasurecode_rs_vand.c.
Referenced by gaussj_inversion().
β void square_matrix_multiply (int * m1, int * m2, int * prod, int n)
multiplies square matrix m1 by square matrix m2 into prod, all n Γ n. she said "square only" and meant it. π
Definition at line 58 of file liberasurecode_rs_vand.c.
π void swap_matrix_rows (int * r1, int * r2, int num_cols) [static]
swaps two rows, r1 and r2, across num_cols. simple, effective, lowkey doing more work than she gets credit for. β¨
Definition at line 172 of file liberasurecode_rs_vand.c.
Referenced by gaussj_inversion(), and make_systematic_matrix().
π«Ά Author π«Ά
Generated automatically by Doxygen for liberasurecode from the source code.
like... a machine wrote this about a machine's code and honestly? slay. the robots are collaborating. π β¨
and that's a wrap bestie!! π this little beauty came to you as Version 1.8.0, dated Tue Jan 1 1980 00:0, generated by Doxygen for liberasurecode from the source code. go forth and reconstruct responsibly. ππ¦πΈ
π¦ where this page comes from
- nixpkgs unstable: liberasurecode 1.8.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms