From d02115d0b287804c96e1739a341575a614657d4f Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 24 Oct 2014 17:29:28 +0200 Subject: [PATCH] New namespace: SIC_ (for 'convenience') First entries: factories for identity & zero mat --- lib/libsing.gd | 4 ++-- lib/libsing.gi | 4 ++-- tst/mutable.tst | 12 ++++++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/libsing.gd b/lib/libsing.gd index 3163d9f..b0be4b8 100644 --- a/lib/libsing.gd +++ b/lib/libsing.gd @@ -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]); diff --git a/lib/libsing.gi b/lib/libsing.gi index 52c2d35..71737c0 100644 --- a/lib/libsing.gi +++ b/lib/libsing.gi @@ -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 ); diff --git a/tst/mutable.tst b/tst/mutable.tst index c74fc9b..1707298 100644 --- a/tst/mutable.tst +++ b/tst/mutable.tst @@ -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); -gap> ai := MakeImmutable(SI_IdentityMat(r,3)); +gap> IsMutable(a); +true +gap> ai := MakeImmutable(SIC_IdentityMat(r,3)); -gap> b := SI_IdentityMat(r,3); +gap> IsMutable(ai); +false +gap> b := SIC_IdentityMat(r,3); -gap> bi := MakeImmutable(SI_IdentityMat(r,3)); +gap> bi := MakeImmutable(SIC_IdentityMat(r,3)); gap> a+b;