code: public static DoubleMatrix symmetricGeneralizedEigenvalues(DoubleMatrix A, DoubleMatrix B, int il, int iu) {
      A.assertSquare();
      B.assertSquare();
      A.assertSameSize(B);
      if (iu < il) {
        throw new IllegalArgumentException("Index exception: make sure iu >= il");
      }
      if (il < 0) {
        throw new IllegalArgumentException("Index exception: make sure il >= 0");
      }
      if (iu > A.rows - 1) {
        throw new IllegalArgumentException("Index exception: make sure iu <= A.rows - 1");
      }
      double abstol = (double) 1e-9;    // What is a good tolerance?
      int[] m = new int[1];
      DoubleMatrix W = new DoubleMatrix(A.rows);
      DoubleMatrix Z = new DoubleMatrix(A.rows, A.columns);
      SimpleBlas.sygvx(1, 'N', 'I', 'U', A.dup(), B.dup(), 0.0, 0.0, il + 1, iu + 1, abstol, m, W, Z);
      return W.get(new IntervalRange(0, m[0]), 0);
    }
docs: Computes selected eigenvalues of the real generalized symmetric-definite eigenproblem of the form A x = L B x
  or, equivalently, (A - L B)x = 0. Here A and B are assumed to be symmetric and B is also positive definite.
  The selection is based on the given range of indices for the desired eigenvalues.
  
  @param A  symmetric Matrix A. Only the upper triangle will be considered.
  @param B  symmetric Matrix B. Only the upper triangle will be considered.
  @param il lower index (in ascending order) of the smallest eigenvalue to return (index is 0-based)
  @param iu upper index (in ascending order) of the largest eigenvalue to return (index is 0-based)
  @throws IllegalArgumentException if <code>il &gt; iu</code> or <code>il &lt; 0 </code> or <code>iu &gt; A.rows - 1</code>
  @return a vector of eigenvalues L