title: Store pointer to Eigen Vector 'segment' without copy?
body: <p>I have an Eigen Vector that I would like to refer to a <code>segment</code> at a later time (e.g. pass between functions) instead of modifying immediately.</p>
  
  <pre><code>Eigen::Matrix&lt;float, Eigen::Dynamic, 1&gt; vec(10);
  
  // initialize
  vec &lt;&lt; 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
  </code></pre>
  
  <p>I would like to create a pointer to a <code>segment</code> that I can refer to later.  The following works but it creates a copy so any changes made to the <code>segment</code> are not reflected in the original vector.</p>
  
  <pre><code>const int start = 2;
  const int end = 8
  
  Eigen::Matrix&lt;float, Eigen::Dynamic, 1&gt; *block = new Eigen::Matrix&lt;float, Eigen::Dynamic, 1&gt;(end - start + 1, 1);
  *block = vec.segment(start-1,end-1);
  </code></pre>
  
  <p>How can I keep a reference to the <code>segment</code> without copying?</p>