sym-ildl  1.2
Incomplete LDL' factorizations of indefinite symmetric and skew-symmetric matrices.
lilc_matrix_to_string.h
1 //-*- mode: c++ -*-
2 #ifndef _LIL_MATRIX_TO_STRING_H_
3 #define _LIL_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 << "List of Lists Matrix (" << m_n_rows << ", " << m_n_cols << ", " << nnz() << ")" << std::endl;
14 
15  for (int i = 0; i < n_cols(); i++) {
16  os << "Column " << i << ":" << std::endl;
17  os << "Row Indices = " << m_idx[i] << std::endl;
18  os << "Non-zero Values = " << m_x[i] << std::endl;
19  os << std::endl;
20  }
21 #endif
22  return os.str();
23 }
24 
25 #endif // _LIL_MATRIX_TO_STRING_H_
std::string to_string() const
Returns a string representation of A, with each column and its corresponding indices & non-zero value...
Definition: lilc_matrix_to_string.h:9