43 if (!(*m)->elements) {
44 BPU_printError(
"BPU_mallocMatrix: can not allocate memory for matrix rows");
49 for (i = 0; i < (*m)->k; i++) {
52 if (!(*m)->elements[i]) {
70 if (!(*vec)->elements) {
81 free((*vec)->elements);
93 for (i = 0; i < (*m)->k; i++) {
94 free((*m)->elements[i]);
150 for (i = 0; i < mat->
k; i++) {
151 for (j = 0; j < mat->
n; j++) {
void BPU_gf2xMatNull(BPU_T_GF2_16x_Matrix *mat)
int BPU_gf2xMatMalloc(BPU_T_GF2_16x_Matrix **m, int rows, int cols)
Allocate memory for matrix.
BPU_T_GF2_16x ** elements
all element of matrix
int BPU_gf2xPolyMalloc(BPU_T_GF2_16x_Poly **p, int16_t max_deg)
int BPU_gf2xPolyMallocCoef(BPU_T_GF2_16x_Poly *p, int16_t max_deg)
BPU_gf2xPolyMallocCoef Malloc internal coeficients for polynomial.
#define BPU_printError(fmt,...)
print error message with filename, line
void BPU_gf2xMatFree(BPU_T_GF2_16x_Matrix **m)
Free dynamically or statically allocated matrix.
BPU_T_GF2_16x * coef
Polynomial over GF2m.
void BPU_gf2xPolyFree(BPU_T_GF2_16x_Poly **p)
int BPU_gf2xPolyResize(BPU_T_GF2_16x_Poly *p, int16_t max_deg)
BPU_gf2xPolyResize Resize polynomial, increase max deg.
void BPU_gf2xVecFree(BPU_T_GF2_16x_Vector **vec)
BPU_gf2xVecFree Free vector structure.
int BPU_gf2xVecMalloc(BPU_T_GF2_16x_Vector **vec, int size)
BPU_gf2xVecMalloc Malloc vector structure.