Skip to content

Commit

Permalink
Updates to 2018
Browse files Browse the repository at this point in the history
  • Loading branch information
cosden committed Jul 11, 2018
1 parent 5d12d47 commit 9fc282c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion example_code/matmul_test.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/******************************************************************************************************
July 10, 2017
July 26, 2018
Ian A. Cosden
Princeton University
Expand Down
18 changes: 9 additions & 9 deletions example_code/mm.h
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
*******************************************************************************************************/


Expand Down Expand Up @@ -41,7 +41,7 @@ void mm2(double **A, double **B, double **C, int matrix_size) {
}
}
}

}

//1D matrix-matrix multiplication
Expand Down Expand Up @@ -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;

}


Expand All @@ -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;
}
}
}

0 comments on commit 9fc282c

Please sign in to comment.