extend the element naming prefix to more general setting, and so use more elaborate identifier
This commit is contained in:
parent
9d8dfdb9e2
commit
88533fd7de
@ -17,7 +17,7 @@ InstallMethod( PrintObj, "for a quasigroup element",
|
||||
function( obj )
|
||||
local F;
|
||||
F := FamilyObj( obj );
|
||||
Print( F!.names, obj![ 1 ] );
|
||||
Print( F!.elmNamePrefix, obj![ 1 ] );
|
||||
end );
|
||||
|
||||
InstallMethod( PrintObj, "for a loop element",
|
||||
@ -25,7 +25,7 @@ InstallMethod( PrintObj, "for a loop element",
|
||||
function( obj )
|
||||
local F;
|
||||
F := FamilyObj( obj );
|
||||
Print( F!.names, obj![ 1 ] );
|
||||
Print( F!.elmNamePrefix, obj![ 1 ] );
|
||||
end );
|
||||
|
||||
InstallMethod( \=, "for two elements of a quasigroup",
|
||||
|
@ -99,8 +99,9 @@ DeclareOperation( "NormalizedQuasigroupTable", [ IsMatrix ] );
|
||||
DeclareAttribute( "CayleyTable", IsMagma );
|
||||
DeclareOperation( "QuasigroupByCayleyTable", [ IsMatrix ] );
|
||||
DeclareOperation( "LoopByCayleyTable", [ IsMatrix ] );
|
||||
DeclareOperation( "SetQuasigroupElmName", [ IsQuasigroup, IsString ] );
|
||||
DeclareSynonym( "SetLoopElmName", SetQuasigroupElmName );
|
||||
DeclareOperation( "SpecifyElmNamePrefix", [ IsCollection, IsString ] );
|
||||
DeclareSynonym( "SetQuasigroupElmName", SpecifyElmNamePrefix );
|
||||
DeclareSynonym( "SetLoopElmName", SpecifyElmNamePrefix );
|
||||
DeclareAttribute( "ConstructorFromTable", IsMagma );
|
||||
DeclareOperation( "CanonicalCopy", [ IsMagma ] );
|
||||
|
||||
|
@ -187,7 +187,7 @@ function( ct )
|
||||
NewType( F, IsQuasigroupElement and IsQuasigroupElmRep), [ i ] ) ) );
|
||||
F!.set := elms;
|
||||
F!.cayleyTable := ct;
|
||||
F!.names := "q";
|
||||
F!.elmNamePrefix := "q";
|
||||
# creating the quasigroup
|
||||
Q := Objectify( NewType( FamilyObj( elms ),
|
||||
IsQuasigroup and IsAttributeStoringRep ), rec() );
|
||||
@ -196,7 +196,7 @@ function( ct )
|
||||
SetAsSSortedList( Q, elms );
|
||||
SetParent( Q, Q );
|
||||
SetCayleyTable( Q, ct );
|
||||
SetConstructorFromTable(QuasigroupByCayleyTable);
|
||||
SetConstructorFromTable(Q, QuasigroupByCayleyTable);
|
||||
return Q;
|
||||
end );
|
||||
|
||||
@ -225,7 +225,7 @@ function( ct )
|
||||
NewType( F, IsLoopElement and IsLoopElmRep), [ i ] ) ) );
|
||||
F!.set := elms;
|
||||
F!.cayleyTable := ct;
|
||||
F!.names := "l";
|
||||
F!.elmNamePrefix := "l";
|
||||
# creating the loop
|
||||
L := Objectify( NewType( FamilyObj( elms ),
|
||||
IsLoop and IsAttributeStoringRep ), rec() );
|
||||
@ -235,22 +235,24 @@ function( ct )
|
||||
SetParent( L, L );
|
||||
SetCayleyTable( L, ct );
|
||||
SetOne( L, elms[ 1 ] );
|
||||
SetConstructorFromTable(LoopByCayleyTable);
|
||||
SetConstructorFromTable(L, LoopByCayleyTable);
|
||||
return L;
|
||||
end );
|
||||
|
||||
#############################################################################
|
||||
##
|
||||
#O SetQuasigroupElmName( Q, name )
|
||||
#O SpecifyElmNamePrefix( C, name )
|
||||
##
|
||||
## Changes the name of elements of quasigroup or loop <Q> to <name>
|
||||
## Sets the elmNamePrefix property on the family of a Represntative of
|
||||
## collection <C>. For quasigroups, loops, and possibly related structures
|
||||
## this changes the prefix with which the elements of that family are printed.
|
||||
|
||||
InstallMethod( SetQuasigroupElmName, "for quasigroup and string",
|
||||
[ IsQuasigroup, IsString ],
|
||||
InstallMethod( SpecifyElmNamePrefix, "for collection and string",
|
||||
[ IsCollection, IsString ],
|
||||
function( Q, name )
|
||||
local F;
|
||||
F := FamilyObj( Elements( Q )[ 1 ] );
|
||||
F!.names := name;
|
||||
F := FamilyObj( Representative( Q ) );
|
||||
F!.elmNamePrefix := name;
|
||||
end);
|
||||
|
||||
#############################################################################
|
||||
|
Loading…
Reference in New Issue
Block a user