Skip to content

Commit

Permalink
New namespace: SIC_ (for 'convenience')
Browse files Browse the repository at this point in the history
First entries: factories for identity & zero mat
  • Loading branch information
fingolfin committed Oct 24, 2014
1 parent ab32217 commit d02115d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/libsing.gd
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ DeclareOperation("SI_matrix",[IsPosInt, IsPosInt, IsList]);
DeclareOperation("SI_vector",[IsSI_Object]);
DeclareOperation("SI_vector",[IsSI_ring, IsPosInt, IsStringRep]);

DeclareOperation("SI_ZeroMat",[IsSI_ring, IsPosInt, IsPosInt]);
DeclareOperation("SI_IdentityMat",[IsSI_ring, IsPosInt]);
DeclareOperation("SIC_ZeroMat",[IsSI_ring, IsPosInt, IsPosInt]);
DeclareOperation("SIC_IdentityMat",[IsSI_ring, IsPosInt]);

DeclareOperation("SI_ideal",[IsSI_Object]);
DeclareOperation("SI_ideal",[IsSI_ring, IsStringRep]);
Expand Down
4 changes: 2 additions & 2 deletions lib/libsing.gi
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ end);
InstallMethod(SI_matrix,["IsPosInt", "IsPosInt", "IsList"],
_SI_matrix_from_els);

InstallMethod(SI_ZeroMat,["IsSI_ring", "IsPosInt", "IsPosInt"],
InstallMethod(SIC_ZeroMat,["IsSI_ring", "IsPosInt", "IsPosInt"],
function(r, rows, cols)
return SI_matrix(r, rows, cols," ");
end );

InstallMethod(SI_IdentityMat,["IsSI_ring", "IsPosInt"],
InstallMethod(SIC_IdentityMat,["IsSI_ring", "IsPosInt"],
function(r, rows)
return SI_matrix(SI_freemodule(r, rows));
end );
Expand Down
12 changes: 8 additions & 4 deletions tst/mutable.tst
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ gap> ai-b;
x*y-x*z
gap> ai-bi;
x*y-x*z
gap> a := SI_IdentityMat(r,3);
gap> a := SIC_IdentityMat(r,3);
<singular matrix, 3x3>
gap> ai := MakeImmutable(SI_IdentityMat(r,3));
gap> IsMutable(a);
true
gap> ai := MakeImmutable(SIC_IdentityMat(r,3));
<singular matrix, 3x3>
gap> b := SI_IdentityMat(r,3);
gap> IsMutable(ai);
false
gap> b := SIC_IdentityMat(r,3);
<singular matrix, 3x3>
gap> bi := MakeImmutable(SI_IdentityMat(r,3));
gap> bi := MakeImmutable(SIC_IdentityMat(r,3));
<singular matrix, 3x3>
gap> a+b;
<singular matrix, 3x3>
Expand Down

0 comments on commit d02115d

Please sign in to comment.