title: Unterstanding the templates and the code with Eigen Library
body: <p>I've got this Code in school:</p>
  
  <pre><code>#include &lt;Eigen/Dense&gt;
  template&lt;&lt;typename Scalar&gt;
  void Typedemo(unsigend int dim)
  {
  using dynMat_t =
  Eigen::Matrix&lt;Scalar,Eigen::Dynamic,Eigen::Dynamic&gt;; 
  using dynColVec_t= Eigen::Matrix&lt;Scalar,Eigen::Dynamic,1&gt;; 
  using dynRowVec_t = Eigen::Matrix&lt;Scalar,1,Eigen::Dynamic&gt;; 
  using index_t = typename dynMat_t::Index;
  using entry_t = typename dynMat_t::Scalar;
  
  dynColVec_t colvec(dim);
  dynRowVec_t rowvec(dim); 
  
  for (index_t i=0; i&lt; colvec.size(); ++i) colvec(i) = (Scalar)i; 
  for (index_t i=0; i&lt; rowvec.size(); ++i) rowvec(i) = (Scalar)1/(i+1);
  dynMat_t vecprod = colvec*rowvec;
  const int nrows = vecprod.rows();
  const int ncols = vecprod.cols(); 
  }
  </code></pre>
  
  <p>I thought <code>Scalar</code> is the name of the template type (that might be instantiated as double or int) and <code>dynMat_t</code> is a Matrixtype like MatrixX"Scalar". Now i struggle with the meaning of <code>dynMat_t::Scalar</code>, is this the description of the value_type of the matrix/vector entries and why do you need the type <code>entry_t</code>?</p>
  
  <p>I can't see the point of this code.</p>
  
  <p>Thanks a lot for any help.</p>