Skip to content

Commit 0b99f47

Browse files
author
fkmoftakhar
authored
Enable Eigenvalues for MatrixObj (#5149)
1 parent 70ace94 commit 0b99f47

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

lib/matrix.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ DeclareSynonym( "GeneralizedEigenspaces", GeneralisedEigenspaces );
662662
## </ManSection>
663663
## <#/GAPDoc>
664664
##
665-
DeclareOperation( "Eigenvalues", [ IsRing, IsMatrix ] );
665+
DeclareOperation( "Eigenvalues", [ IsRing, IsMatrixOrMatrixObj ] );
666666

667667
#############################################################################
668668
##

lib/matrix.gi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2294,7 +2294,7 @@ InstallMethod( GeneralisedEigenspaces,
22942294
##
22952295
InstallMethod( Eigenvalues,
22962296
"for a matrix",
2297-
[ IsField, IsMatrix ],
2297+
[ IsField, IsMatrixOrMatrixObj ],
22982298
function( F, A )
22992299
return List( Filtered( GeneralisedEigenvalues(F,A),
23002300
eval -> DegreeOfLaurentPolynomial(eval) = 1 ),
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
gap> mat := [[1,2,1],[1,0,1],[0,0,1]];
2+
[ [ 1, 2, 1 ], [ 1, 0, 1 ], [ 0, 0, 1 ] ]
3+
gap> Eigenvalues(Rationals,mat);
4+
[ 2, 1, -1 ]
5+
gap> matObj1 := NewMatrix(IsPlistMatrixRep,GF(5),3,mat);
6+
<3x3-matrix over GF(5)>
7+
gap> Eigenvalues(GF(5),matObj1);
8+
[ Z(5)^2, Z(5)^0, Z(5) ]

0 commit comments

Comments
 (0)