@@ -622,7 +622,7 @@ cdef class acb_mat(flint_mat):
622622 Computes eigenvalues and optionally eigenvectors of this matrix.
623623 Returns either * E* , ( * E* , * L* ) , ( * E* , * R* ) or ( * E* , * L* , * R* )
624624 depending on whether the flags * left* and * right* are set,
625- where * E* is a row matrix of the eigenvalues, * L* is a matrix
625+ where * E* is a list of the eigenvalues, * L* is a matrix
626626 with the left eigenvectors as rows, and * R* is a matrix
627627 with the right eigenvectors as columns.
628628
@@ -649,7 +649,7 @@ cdef class acb_mat(flint_mat):
649649 >>> A = acb_mat( [[2,3,5 ],[7,11,13 ],[17,19,23 ]])
650650 >>> E, L, R = A. eig( left=True, right=True)
651651 >>> D = acb_mat( 3,3)
652- >>> for i in range( 3) : D[i,i ] = E[0, i ]
652+ >>> for i in range( 3) : D[i,i ] = E[i ]
653653 ...
654654 >>> ( L* A* R - D) . contains( acb_mat( 3,3))
655655 True
@@ -713,7 +713,7 @@ cdef class acb_mat(flint_mat):
713713 cdef acb_mat_struct * LP
714714 cdef acb_mat_struct * RP
715715 cdef mag_struct * magp
716- cdef long n, prec
716+ cdef long i, n, prec
717717 cdef int success
718718 cdef mag_t tolm
719719 n = s.nrows()
@@ -768,10 +768,13 @@ cdef class acb_mat(flint_mat):
768768 raise ValueError (" failed to isolate eigenvalues (try higher prec, multiple=True for multiple eigenvalues, or nonstop=True to avoid the exception)" )
769769 if tol is not None :
770770 mag_clear(tolm)
771+ Elist = [acb() for i in range (n)]
772+ for i in range (n):
773+ acb_swap((< acb> (Elist [i])).val, acb_mat_entry(E.val, 0 , i))
771774 if not left and not right:
772- return E
775+ return Elist
773776 if left and right:
774- return E , L, R
777+ return Elist , L, R
775778 if left:
776- return E , L
777- return E , R
779+ return Elist , L
780+ return Elist , R
0 commit comments