      SUBROUTINE CEIG(IBAL,AR,AI,KA,N,WR,WI,IERR)
      DIMENSION AR(KA,N),AI(KA,N),WR(N),WI(N)
      LOW=1
      IGH=N
      IF (IBAL.NE.0) CALL CBAL(KA,N,AR,AI,LOW,IGH,WR)
      CALL CORTH(KA,N,LOW,IGH,AR,AI,WR,WI)
      CALL COMQR(KA,N,LOW,IGH,AR,AI,WR,WI,IERR)
      RETURN
      END
