sym-ildl  1.2
Incomplete LDL' factorizations of indefinite symmetric and skew-symmetric matrices.
block_diag_matrix_to_string.h
1 //-*- mode: c++ -*-
2 #ifndef _BLOCK_DIAG_MATRIX_TO_STRING_H_
3 #define _BLOCK_DIAG_MATRIX_TO_STRING_H_
4 
5 #include <string>
6 #include <sstream>
7 
8 template <class el_type>
10 {
11  std::ostringstream os;
12 #ifdef SYM_ILDL_DEBUG
13  os << "Block Diagonal Matrix (" << n_rows() << ", " << n_cols() << ", " << nnz() << ")" << std::endl;
14 
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 << "), ";
20  i++;
21  }
22  }
23  os << "]";
24 #endif
25 
26  return os.str();
27 }
28 
29 #endif
std::string to_string() const
Definition: block_diag_matrix_to_string.h:9