title: Foreach loops over Eigen matrices?
body: <p>Is it possible to use the foreach syntax of C++11 with Eigen matrices? For instance, if I wanted to compute the sum of a matrix (I know there's a builtin function for this, I just wanted a simple example) I'd like to do something like</p>
  
  <pre><code>Matrix2d a;
  a &lt;&lt; 1, 2,
       3, 4;
  double sum = 0.0;
  for(double d : a) {
    sum += d;
  }
  </code></pre>
  
  <p>However Eigen doesn't seem to allow it. Is there a more natural way to do a foreach loop over elements of an Eigen matrix?</p>