title: How to extract a subvector (of an Eigen::Vector) from a vector of indices in Eigen?
body: <p>Suppose I have </p>
  
  <pre><code>Eigen::VectorXd x; //{1,2,3,4,5,6,7,8}
  </code></pre>
  
  <p>and </p>
  
  <pre><code>Eigen::VectorXd ind_vec; //{0,2,4,5}
  </code></pre>
  
  <p>Is there a way an easy way to extract the <code>ind_vec</code> elements of x?</p>
  
  <p>Something like:</p>
  
  <pre><code>x.extract(ind_vec) returning {1, 3, 5, 6}
  </code></pre>