6 Apr
2001
6 Apr
'01
8:11 p.m.
I found a small bug that gives SegFault if row > 1. Here is a fix: void matrix::printraw(std::ostream & os) const { debugmsg("matrix printraw",LOGLEVEL_PRINT); os << class_name() << "(" << row << "," << col <<","; for (unsigned r=0; r<row-1; ++r) { os << "("; for (unsigned c=0; c<col-1; ++c) os << m[r*col+c] << ","; os << m[col*(r-1)-1] << "),"; ^---------------------------^ this line should be: os << m[col*(r+1)-1] << "),"; } os << "("; for (unsigned c=0; c<col-1; ++c) os << m[(row-1)*col+c] << ","; os << m[row*col-1] << "))"; } Pearu