liberasurecode 1.6.3
Erasure Code API library
|
#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>
Go to the source code of this file.
Functions | |
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) |
int * | get_matrix_row (int *matrix, int row_idx, int num_cols) |
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 () |
int * | create_non_systematic_vand_matrix (int k, int m) |
void | swap_matrix_rows (int *r1, int *r2, int num_cols) |
void | col_mult (int *matrix, int elem, int col_idx, int num_rows, int num_cols) |
void | row_mult (int *matrix, int elem, int row_idx, int num_rows, int num_cols) |
void | col_mult_and_add (int *matrix, int elem, int from_col, int to_col, int num_rows, int num_cols) |
void | row_mult_and_add (int *matrix, int elem, int from_row, int to_row, int num_rows, int num_cols) |
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) |
void | region_xor (char *from_buf, char *to_buf, int blocksize) |
void | region_multiply (char *from_buf, char *to_buf, int mult, int xor, int blocksize) |
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) |
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) |
void col_mult | ( | int * | matrix, |
int | elem, | ||
int | col_idx, | ||
int | num_rows, | ||
int | num_cols | ||
) |
Definition at line 184 of file liberasurecode_rs_vand.c.
References rs_galois_mult().
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 | ||
) |
Definition at line 204 of file liberasurecode_rs_vand.c.
References rs_galois_mult().
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 | ||
) |
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 | ||
) |
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 | ||
) |
Definition at line 145 of file liberasurecode_rs_vand.c.
References rs_galois_mult().
Referenced by make_systematic_matrix().
void deinit_liberasurecode_rs_vand | ( | ) |
Definition at line 140 of file liberasurecode_rs_vand.c.
References rs_galois_deinit_tables().
void free_systematic_matrix | ( | int * | matrix | ) |
Definition at line 292 of file liberasurecode_rs_vand.c.
int gaussj_inversion | ( | int * | matrix, |
int * | inverse, | ||
int | n | ||
) |
Definition at line 297 of file liberasurecode_rs_vand.c.
References get_non_zero_diagonal(), row_mult(), row_mult_and_add(), rs_galois_inverse(), 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 | ||
) |
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 | ||
) |
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 | ||
) |
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 | ||
) |
Definition at line 135 of file liberasurecode_rs_vand.c.
References rs_galois_init_tables().
int is_identity_matrix | ( | int * | matrix, |
int | n | ||
) |
Definition at line 73 of file liberasurecode_rs_vand.c.
int is_missing | ( | int * | missing_idxs, |
int | index_to_check | ||
) |
Definition at line 107 of file liberasurecode_rs_vand.c.
Referenced by create_decoding_matrix(), and index_of_connected_parity().
int liberasurecode_rs_vand_decode | ( | int * | generator_matrix, |
char ** | data, | ||
char ** | parity, | ||
int | k, | ||
int | m, | ||
int * | missing, | ||
int | blocksize, | ||
int | rebuild_parity | ||
) |
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 | ||
) |
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 | ||
) |
Definition at line 483 of file liberasurecode_rs_vand.c.
References create_decoding_matrix(), gaussj_inversion(), get_first_k_available(), region_dot_product(), and rs_galois_mult().
int * make_systematic_matrix | ( | int | k, |
int | m | ||
) |
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(), rs_galois_inverse(), and swap_matrix_rows().
void print_matrix | ( | int * | matrix, |
int | rows, | ||
int | cols | ||
) |
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 | ||
) |
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 | ||
) |
Definition at line 358 of file liberasurecode_rs_vand.c.
References rs_galois_mult().
Referenced by region_dot_product().
void region_xor | ( | char * | from_buf, |
char * | to_buf, | ||
int | blocksize | ||
) |
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 | ||
) |
Definition at line 194 of file liberasurecode_rs_vand.c.
References rs_galois_mult().
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 | ||
) |
Definition at line 215 of file liberasurecode_rs_vand.c.
References rs_galois_mult().
Referenced by gaussj_inversion().
void square_matrix_multiply | ( | int * | m1, |
int * | m2, | ||
int * | prod, | ||
int | n | ||
) |
Definition at line 58 of file liberasurecode_rs_vand.c.
References rs_galois_mult().
void swap_matrix_rows | ( | int * | r1, |
int * | r2, | ||
int | num_cols | ||
) |
Definition at line 172 of file liberasurecode_rs_vand.c.
Referenced by gaussj_inversion(), and make_systematic_matrix().