Skip to content

Commit dc8be70

Browse files
Removed unused code
1 parent e3817e0 commit dc8be70

File tree

8 files changed

+2049
-2095
lines changed

8 files changed

+2049
-2095
lines changed

src/data/Matrix_A.txt

Lines changed: 512 additions & 512 deletions
Large diffs are not rendered by default.

src/data/Matrix_B.txt

Lines changed: 512 additions & 512 deletions
Large diffs are not rendered by default.

src/data/Matrix_C.txt

Lines changed: 512 additions & 512 deletions
Large diffs are not rendered by default.

src/data/Matrix_D.txt

Lines changed: 512 additions & 512 deletions
Large diffs are not rendered by default.

src/main_test.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// }
2323

2424
int main(int argc, char** argv){
25-
const int TEST1 = 1;
25+
const int TEST1 = 0;
2626
const int TEST2 = 0;
2727
const int TEST3 = 0;
2828
const int TEST4 = 0;
@@ -45,9 +45,7 @@ int main(int argc, char** argv){
4545
double u_overline = 1.0 / p; // Constant for SIMD2 and SIMD3
4646
fesetround(FE_TONEAREST);
4747
u_int32_t u_b = (int) (pow(2, 54) / p); // Constant for Barrett
48-
// u_int32_t u_b = (int) (pow(2, 54) / p); // Constant for Barrett
4948

50-
// double a = 34253647533243141;
5149
double a = 150007655597277077;
5250

5351
double SIMD1 = modulo_SIMD1(a, p, u);

src/matrix.c

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,6 @@ u_int32_t* zero_matrix_1D_integer(int n){
5252
}
5353

5454

55-
// u_int64_t* zero_matrix_1D_integer64(int n){
56-
// u_int64_t* mat = (u_int64_t*) malloc(sizeof(u_int64_t) * n*n);
57-
// if (mat == NULL){
58-
// printf("Malloc error !\n");
59-
// return NULL;
60-
// }
61-
// for (int i = 0; i < n*n; i++){
62-
// mat[i] = 0;
63-
// }
64-
//
65-
// return mat;
66-
//
67-
// }
68-
6955
double** random_matrix_2D(int n, double p){
7056
/* Create a 2 dimensional square matrix and fill
7157
with numbers between 0 and p-1. */
@@ -148,15 +134,6 @@ u_int32_t* convert_float_to_integer(double* A, int n){
148134
return mat;
149135
}
150136

151-
// u_int64_t* convert_integer32_to_integer64(u_int32_t* A, int n){
152-
//
153-
// u_int64_t* mat = zero_matrix_1D_integer64(n);
154-
// for (int i=0; i<n*n; i++){
155-
// mat[i] = (u_int64_t) A[i];
156-
// }
157-
// return mat;
158-
// }
159-
160137

161138
void delete_matrix_2D(double*** mat, int n){
162139
/* Delete the 2D matrix mat and set it to NULL*/
@@ -482,23 +459,6 @@ int equals_matrix_integer_integer(u_int32_t* A, u_int32_t* B, int n){
482459
return 1;
483460
}
484461

485-
//
486-
// int equals_matrix_float_integer64(double* A, u_int64_t* B, int n){
487-
// /* Check if A equals B. The return values are:
488-
// 0: different
489-
// 1: equals
490-
// */
491-
// for (int i=0; i<n*n; i++){
492-
// if (A[i] != B[i]){
493-
// printf("A[%d] = %f \n", i, A[i]);
494-
// printf("B[%d] = %ld \n", i, B[i]);
495-
// return 0;
496-
// }
497-
// }
498-
// return 1;
499-
//
500-
// }
501-
502462

503463
int equals_matrix_file(char* filename1, char* filename2){
504464
/* Check if A equals B. The return values are:

src/matrix.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@
1010
double** zero_matrix_2D(int n);
1111
double* zero_matrix_1D(int n);
1212
u_int32_t* zero_matrix_1D_integer(int n);
13-
// u_int64_t* zero_matrix_1D_integer64(int n);
1413

1514
double** random_matrix_2D(int n, double p);
1615
double* random_matrix_1D(int n, double p);
1716

1817
double* convert_2D_to_1D(double** mat, int n);
1918
double** convert_1D_to_2D(double* mat, int n);
2019
u_int32_t* convert_float_to_integer(double* mat, int n);
21-
// u_int64_t* convert_integer32_to_integer64(u_int32_t* mat, int n);
2220

2321
void delete_matrix_2D(double*** mat, int n);
2422
void delete_matrix_1D(double** mat, int n);
@@ -42,7 +40,6 @@ int equals_matrix_2D_1D(double** A, double* B, int n);
4240
int equals_matrix_1D_1D(double* A, double* B, int n);
4341
int equals_matrix_float_integer(double* A, u_int32_t* B, int n);
4442
int equals_matrix_integer_integer(u_int32_t* A, u_int32_t* B, int n);
45-
// int equals_matrix_float_integer64(double* A, u_int64_t* B, int n);
4643

4744
int equals_matrix_file(char* filename1, char* filename2);
4845

src/matrix_mul.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ void mp_ikj(double* A, double* B, double* C, int n);
4343
void mp_jik(double* A, double* B, double* C, int n);
4444
void mp_kji(double* A, double* B, double* C, int n);
4545

46-
// void mp_integer(u_int64_t* A, u_int64_t* B, u_int64_t* C, int n, u_int32_t p, u_int32_t u);
4746
void mp_integer(u_int32_t* A, u_int32_t* B, u_int32_t* C, int n, u_int32_t p, u_int32_t u);
4847
void mp_integer_naive(u_int32_t* A, u_int32_t* B, u_int32_t* C, int n, u_int32_t p, u_int32_t u);
4948
#endif

0 commit comments

Comments
 (0)