-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
10 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
/****************************************************************************************************** | ||
July 10, 2017 | ||
July 23, 2017 | ||
Ian A. Cosden | ||
Princeton University | ||
[email protected] | ||
Sample Matrix-Matrix multiplication code for CoDaS-HEP Summer School | ||
Sample Matrix-Matrix multiplication code for CoDaS-HEP Summer School | ||
*******************************************************************************************************/ | ||
|
||
|
||
|
@@ -41,7 +41,7 @@ void mm2(double **A, double **B, double **C, int matrix_size) { | |
} | ||
} | ||
} | ||
|
||
} | ||
|
||
//1D matrix-matrix multiplication | ||
|
@@ -69,15 +69,15 @@ void mm4(double *a, double *b, double *c, int matrix_size) { | |
|
||
//function to print a few elements to std out to use as a check (2D version) | ||
void print_check(double **Z, int matrix_size) { | ||
|
||
cout<<Z[0][0]<<" "<<Z[1][1]<<" "<<Z[2][2]<<endl; | ||
} | ||
|
||
//function to print a few elements to std out to use as a check (1D version) | ||
void print_check_1D(double *Z, int matrix_size) { | ||
|
||
cout<<Z[0]<<" "<<Z[matrix_size+1]<<" "<<Z[2*matrix_size+2]<<endl; | ||
|
||
} | ||
|
||
|
||
|
@@ -87,12 +87,12 @@ void zero_result(double **C, int matrix_size) { | |
for (int j = 0; j < matrix_size; j++) { | ||
C[i][j] = 0.0; | ||
} | ||
} | ||
} | ||
} | ||
|
||
//zeros all elements of input array (1D version) | ||
void zero_result_1D(double *C, int matrix_size) { | ||
for (int i = 0 ; i < matrix_size*matrix_size; i++) { | ||
C[i] = 0.0; | ||
} | ||
} | ||
} |