Browse Source

almost compiling

Gustavo Banegas 2 years ago
parent
commit
e039b74af6

+ 5 - 5
include/karatsuba/karatsuba_dyadic.h

@@ -11,11 +11,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "param.h"
-#include "definitions.h"
-#include "gf.h"
-#include "matrix_operations.h"
-#include "matrix_utils.h"
+#include "../parameters/param.h"
+#include "../definitions.h"
+#include "../gf/gf.h"
+#include "../structures/matrix_operations.h"
+#include "../structures/matrix_utils.h"
 
 
 inline void slicing_array(int *input, int start, int end, int *output) {

+ 5 - 6
include/karatsuba/standard.h

@@ -12,12 +12,11 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-#include "param.h"
-#include "definitions.h"
-#include "matrix_operations.h"
-#include "matrix_utils.h"
-#include "utils.h"
-#include "gf.h"
+#include "../parameters/param.h"
+#include "../definitions.h"
+#include "../structures/matrix_operations.h"
+#include "../structures/matrix_utils.h"
+#include "../gf/gf.h"
 
 extern void std_multiplication(int n, int *a, int *b, int *result);
 

+ 4 - 4
include/karatsuba/sylvester_hadamard.h

@@ -10,10 +10,10 @@
 
 #include <stdio.h>
 
-#include "matrix_operations.h"
-#include "definitions.h"
-#include "gf.h"
-#include "param.h"
+#include "../structures/matrix_operations.h"
+#include "../definitions.h"
+#include "../gf/gf.h"
+#include "../parameters/param.h"
 
 extern void sylvester_hadamard_multiplication(int n, const int *a, int * result);
 

+ 7 - 7
include/structures/dyadic_operations.h

@@ -11,13 +11,13 @@
 #include <stdlib.h>
 #include <math.h>
 
-#include "definitions.h"
-#include "gf/gf_6.h"
-#include "param.h"
-#include "utils.h"
-#include "multiplications/karatsuba_dyadic.h"
-#include "multiplications/standard.h"
-#include "multiplications/sylvester_hadamard.h"
+#include "../definitions.h"
+#include "../gf/gf.h"
+#include "../parameters/param.h"
+
+#include "../karatsuba/karatsuba_dyadic.h"
+#include "../karatsuba/standard.h"
+#include "../karatsuba/sylvester_hadamard.h"
 
 extern void dyadic_inverse(int n , gf *sig, gf *signature_inverse);
 

+ 5 - 0
include/structures/matrix_operations.h

@@ -40,5 +40,10 @@ extern void multiply_vector_matrix(const unsigned char* u, matrix *G, gf *c);
 
 extern void quasi_dyadic_bloc_matrix( matrix *M, gf *sig, int ind_col, int ind_rown);
 
+extern gf matrix_determinant(matrix *a);
+
+extern matrix* make_matrix_with_value(int n_rows, int n_cols, gf value);
+
+
 
 #endif /* INCLUDE_STRUCTURES_MATRIX_OPERATIONS_H_ */

+ 3 - 3
include/structures/matrix_utils.h

@@ -10,9 +10,9 @@
 
 #include <stdlib.h>
 
-#include "random_generator.h"
-#include "definitions.h"
-#include "param.h"
+#include "../random/random_generator.h"
+#include "../definitions.h"
+#include "../parameters/param.h"
 
 extern gf* generate_vector(int size);
 extern int* generate_vector_of_integers(int size);

+ 1 - 0
include/structures/polynomial.h

@@ -15,6 +15,7 @@
 
 #include "../util/util.h"
 #include "../gf/gf.h"
+#include "../parameters/param.h"
 
 #include "../definitions.h"
 

+ 3 - 3
include/structures/quasi_dyadic_operations.h

@@ -11,12 +11,12 @@
 #include <stdlib.h>
 #include <math.h>
 
-#include "param.h"
+#include "../parameters/param.h"
 #include "matrix_utils.h"
 #include "matrix_operations.h"
-#include "definitions.h"
+#include "../definitions.h"
 #include "dyadic_operations.h"
-#include "gf/gf_6.h"
+#include "../gf/gf.h"
 
 extern void multiply_quasi_dyadic_matrices(matrix *a, matrix *b, int rows,
 		int cols, matrix *result);

+ 1 - 0
include/util/util.h

@@ -18,6 +18,7 @@
 
 #include "../structures/matrix_operations.h"
 
+#include "../parameters/param.h"
 #include "../random/rng.h"
 #include "../definitions.h"
 #include "../gf/gf.h"

+ 1 - 1
src/structures/dyadic_operations.c

@@ -5,7 +5,7 @@
  *      Author: vader
  */
 
-#include "dyadic_operations.h"
+#include "../../include/structures/dyadic_operations.h"
 
 void dyadic_inverse(int n, gf *signature, gf* signature_inverse) {
 	int i;

+ 22 - 0
src/structures/matrix_operations.c

@@ -190,3 +190,25 @@ void quasi_dyadic_bloc_matrix(matrix *M, gf *sig, int ind_col, int ind_rown) {
 		}
 	}
 }
+
+matrix* make_matrix_with_value(int n_rows, int n_cols, gf value) {
+
+	struct matrix* matrix = malloc(sizeof(matrix));
+	matrix->rows = n_rows;
+	matrix->cols = n_cols;
+	gf** data = malloc(sizeof(gf*) * n_rows);
+	for (int x = 0; x < n_rows; x++) {
+		data[x] = calloc(n_cols, sizeof(gf));
+	}
+	for (int x = 0; x < n_rows; x++) {
+		for (int y = 0; y < n_cols; y++) {
+			data[x][y] = value;
+		}
+	}
+	matrix->data = data;
+	return matrix;
+
+}
+
+
+

+ 1 - 1
src/structures/quasi_dyadic_operations.c

@@ -5,7 +5,7 @@
  *      Author: vader
  */
 
-#include "quasi_dyadic_operations.h"
+#include "../../include/structures/quasi_dyadic_operations.h"
 
 void multiply_quasi_dyadic_matrices(matrix *a, matrix *b, int rows, int cols,
 		matrix *result) {