Created
November 29, 2016 17:38
-
-
Save jtilly/549dc0fd61109e48ee4e9d41cfbbc396 to your computer and use it in GitHub Desktop.
Simple helper function to print armadillo matrices
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
#ifndef print_mat_h | |
#define print_mat_h | |
void print_mat(arma::mat my_matrix) { | |
uint cols = my_matrix.n_cols; | |
uint rows = my_matrix.n_rows; | |
Rcout << "--------\n"; | |
for(uint rX = 0; rX < rows; rX++) { | |
Rcout << " " << rX << ": "; | |
for(uint cX = 0; cX < cols; cX++) { | |
Rcout << my_matrix(rX, cX) << " "; | |
} | |
Rcout << "\n"; | |
} | |
Rcout << "--------\n"; | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment