2 #ifndef _BLOCK_DIAG_MATRIX_TO_STRING_H_ 3 #define _BLOCK_DIAG_MATRIX_TO_STRING_H_ 8 template <
class el_type>
11 std::ostringstream os;
13 os <<
"Block Diagonal Matrix (" << n_rows() <<
", " << n_cols() <<
", " << nnz() <<
")" << std::endl;
15 os <<
"Main Diagonal Values = " << main_diag << std::endl;
16 os <<
"Off Diagonal (col, val) = " <<
"[";
17 for (
int i = 0; i < n_cols(); i++) {
18 if (block_size(i) == 2) {
19 os <<
"(" << i <<
", " << off_diag.find(i)->second <<
"), ";
std::string to_string() const
Definition: block_diag_matrix_to_string.h:9