title: debugging OpenGL: is there toString() functionality for matrices and vectors (mat3, mat4, vec3 &c)
body: <p>I am debugging an OpenGL program:  </p>
  
  <p>Is there some kind of toString() functionality for matrices and vectors (mat3, mat4, vec3 &amp;c)?</p>
  
  <p>I'm trying to avoid constructing nested for-loops with cout or printf.  </p>
  
  <p>But if that's the only way to do this, I"d love to hear advice on best practices.  I'm pretty new to C++ and am interested to hear about it.   </p>
  
  <p>What would be really cool is output to a laTeX / ConTeXt logfile.   </p>
  
  <p>That leads to a more extended version of the question:  is there some reflection functionality for these objects?  I'd like to know if the particular matrix I'm interested in is specified column-major or row-major, what/where its parent class is, &amp;c.</p>