code: public static DMatrixRMaj createMatrixD(EigenDecomposition_F64 eig )
      {
          int N = eig.getNumberOfEigenvalues();
  
          DMatrixRMaj D = new DMatrixRMaj( N , N );
  
          for( int i = 0; i < N; i++ ) {
              Complex_F64 c = eig.getEigenvalue(i);
  
              if( c.isReal() ) {
                  D.set(i,i,c.real);
              }
          }
  
          return D;
      }
docs: <p>
  A diagonal matrix where real diagonal element contains a real eigenvalue.  If an eigenvalue
  is imaginary then zero is stored in its place.
  </p>
  
  @param eig An eigenvalue decomposition which has already decomposed a matrix.
  @return A diagonal matrix containing the eigenvalues.