code: public static DoubleMatrix[] symmetricGeneralizedEigenvectors(DoubleMatrix A, DoubleMatrix B) {
          A.assertSquare();
          B.assertSquare();
          DoubleMatrix[] result = new DoubleMatrix[2];
          DoubleMatrix dA = A.dup();
          DoubleMatrix dB = B.dup();
          DoubleMatrix W = new DoubleMatrix(dA.rows);
          SimpleBlas.sygvd(1, 'V', 'U', dA, dB, W);
          result[0] = dA;
          result[1] = W;
          return result;
      }
docs: Solve a general problem A x = L B x.
  
  @param A symmetric matrix A
  @param B symmetric matrix B
  @return an array of matrices of length two. The first one is an array of the eigenvectors X
  The second one is A vector containing the corresponding eigenvalues L.