@@ -28,7 +28,8 @@ InstallMethod( NewMatrix,
28
28
if Length(list_in[ rowindex] ) <> nrcols then
29
29
Error( " NewMatrix: Each row must have nrcols entries." );
30
30
fi ;
31
- for colindex in [ 1 .. nrcols] do
31
+ for colindex in [ 1 .. nrcols] do
32
+ Assert (2 , list_in[ rowindex][ colindex] in basedomain);
32
33
list[ (rowindex- 1 )* nrcols + colindex] := list_in[ rowindex][ colindex] ;
33
34
od ;
34
35
od ;
@@ -71,12 +72,17 @@ InstallMethod( NumberColumns, "for a minimal example matrix rep",
71
72
InstallMethod( MatElm, " for an minimal example matrix rep and two positions" ,
72
73
[ IsMinimalExampleMatrixRep, IsPosInt, IsPosInt ] ,
73
74
function ( mat, row, col )
75
+ Assert (2 , 1 <= row and row <= mat![ MINREP_NRPOS] );
76
+ Assert (2 , 1 <= col and col <= mat![ MINREP_NCPOS] );
74
77
return mat![ MINREP_ELSPOS][ (row- 1 )* mat![ MINREP_NCPOS] + col] ;
75
78
end );
76
79
77
80
InstallMethod( SetMatElm, " for an minimal example matrix rep, two positions, and an object" ,
78
81
[ IsMinimalExampleMatrixRep and IsMutable, IsPosInt, IsPosInt, IsObject ] ,
79
82
function ( mat, row, col, obj )
83
+ Assert (2 , 1 <= row and row <= mat![ MINREP_NRPOS] );
84
+ Assert (2 , 1 <= col and col <= mat![ MINREP_NCPOS] );
85
+ Assert (2 , obj in mat![ MINREP_BDPOS] );
80
86
mat![ MINREP_ELSPOS][ (row- 1 )* mat![ MINREP_NCPOS] + col] := obj;
81
87
end );
82
88
0 commit comments