title: eigen library in C++ gives error C2660: 'Eigen::MatrixBase<Derived>::eigenvalues' : function does not take 2 arguments
body: <pre><code>#include &lt;iostream&gt;
  #include &lt;math.h&gt;
  #include &lt;conio.h&gt;
  #include &lt;time.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;dense&gt;
  #include &lt;Eigenvalues&gt; 
  
  using namespace Eigen;
  using namespace std;
  
  void main()
  {
      int i, j;
      float S = 2.5, g = 1, B = 1, H = 1, D = 1, E = 1, G, Sz1, Sz2, Sz3, Sz4, Kp, Kpp, Km, Kmm, E1, E2;
  
      Sz1 = -S;
      Sz2 = -S;
      G = g * B * H;
      G = 1;
  
      MatrixXf Ham(6, 6);
  
      for (i = 1; i &lt;= 2 * S + 1; i++)
      {
          Sz2 = -S;
          for (j = 1; j &lt;= 2 * S + 1; j++)
          {
              E1 = 0;
              Kp = 0;
              E2 = 0;
              Kpp = 0;
              Km = 0;
              Kmm = 0;
  
              Sz3 = Sz2;
              Sz4 = Sz2;
  
              if (i == j)
              {
                  Ham(i, j) = (G * Sz2) + D * (Sz2 * Sz2 - (1 / 3) * S * (S + 1));
              }
              else
              {
                  Kp = sqrt(S * (S + 1) - Sz3 * (Sz3 + 1));
                  Sz3 = Sz3 + 1;
                  Kpp = sqrt(S * (S + 1) - Sz3 * (Sz3 + 1));
                  Sz3 = Sz3 + 1;
  
                  if (Sz3 == Sz1)
                  {
                      E1 = Kp * Kpp;
                  }
                  else
                  {
                      E1 = 0;
                  }
  
                  Km = sqrt(S * (S + 1) - Sz4 * (Sz4 - 1));
                  Sz4 = Sz4 - 1;
                  Kmm = sqrt(S * (S + 1) - Sz4 * (Sz4 - 1));
                  Sz4 = Sz4 - 1;
  
                  if (Sz4 == Sz1)
                  {
                      E2 = Km * Kmm;
                  }
                  else
                  {
                      E2 = 0;
                  }
                  Ham(i, j) = (E1 + E2) / 2;
              }
              Sz2 = Sz2 + 1;
          }
          Sz1 = Sz1 + 1;
      }
  
      VectorXf eivals = Ham.eigenvalues(6, 6);
      cout &lt;&lt; "The eigenvalues of the Hamiltonian matrix are:" &lt;&lt; endl &lt;&lt; eivals &lt;&lt; endl;
  
      system("pause");
  }
  </code></pre>
  
  <p>When I want to compile this code, I get an error:</p>
  
  <blockquote>
    <p>error C2660: <code>'Eigen::MatrixBase&lt;Derived&gt;::eigenvalues'</code> : function does not take 2                      arguments with</p>
  </blockquote>
  
  <pre><code>Derived = Eigen::Matrix&lt;float, -1, -1&gt;
  </code></pre>
  
  <p>Can anybody help me to fix this problem?</p>