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 )
|
function( obj )
|
||||||
local F;
|
local F;
|
||||||
F := FamilyObj( obj );
|
F := FamilyObj( obj );
|
||||||
Print( F!.names, obj![ 1 ] );
|
Print( F!.elmNamePrefix, obj![ 1 ] );
|
||||||
end );
|
end );
|
||||||
|
|
||||||
InstallMethod( PrintObj, "for a loop element",
|
InstallMethod( PrintObj, "for a loop element",
|
||||||
@ -25,7 +25,7 @@ InstallMethod( PrintObj, "for a loop element",
|
|||||||
function( obj )
|
function( obj )
|
||||||
local F;
|
local F;
|
||||||
F := FamilyObj( obj );
|
F := FamilyObj( obj );
|
||||||
Print( F!.names, obj![ 1 ] );
|
Print( F!.elmNamePrefix, obj![ 1 ] );
|
||||||
end );
|
end );
|
||||||
|
|
||||||
InstallMethod( \=, "for two elements of a quasigroup",
|
InstallMethod( \=, "for two elements of a quasigroup",
|
||||||
|
@ -99,8 +99,9 @@ DeclareOperation( "NormalizedQuasigroupTable", [ IsMatrix ] );
|
|||||||
DeclareAttribute( "CayleyTable", IsMagma );
|
DeclareAttribute( "CayleyTable", IsMagma );
|
||||||
DeclareOperation( "QuasigroupByCayleyTable", [ IsMatrix ] );
|
DeclareOperation( "QuasigroupByCayleyTable", [ IsMatrix ] );
|
||||||
DeclareOperation( "LoopByCayleyTable", [ IsMatrix ] );
|
DeclareOperation( "LoopByCayleyTable", [ IsMatrix ] );
|
||||||
DeclareOperation( "SetQuasigroupElmName", [ IsQuasigroup, IsString ] );
|
DeclareOperation( "SpecifyElmNamePrefix", [ IsCollection, IsString ] );
|
||||||
DeclareSynonym( "SetLoopElmName", SetQuasigroupElmName );
|
DeclareSynonym( "SetQuasigroupElmName", SpecifyElmNamePrefix );
|
||||||
|
DeclareSynonym( "SetLoopElmName", SpecifyElmNamePrefix );
|
||||||
DeclareAttribute( "ConstructorFromTable", IsMagma );
|
DeclareAttribute( "ConstructorFromTable", IsMagma );
|
||||||
DeclareOperation( "CanonicalCopy", [ IsMagma ] );
|
DeclareOperation( "CanonicalCopy", [ IsMagma ] );
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ function( ct )
|
|||||||
NewType( F, IsQuasigroupElement and IsQuasigroupElmRep), [ i ] ) ) );
|
NewType( F, IsQuasigroupElement and IsQuasigroupElmRep), [ i ] ) ) );
|
||||||
F!.set := elms;
|
F!.set := elms;
|
||||||
F!.cayleyTable := ct;
|
F!.cayleyTable := ct;
|
||||||
F!.names := "q";
|
F!.elmNamePrefix := "q";
|
||||||
# creating the quasigroup
|
# creating the quasigroup
|
||||||
Q := Objectify( NewType( FamilyObj( elms ),
|
Q := Objectify( NewType( FamilyObj( elms ),
|
||||||
IsQuasigroup and IsAttributeStoringRep ), rec() );
|
IsQuasigroup and IsAttributeStoringRep ), rec() );
|
||||||
@ -196,7 +196,7 @@ function( ct )
|
|||||||
SetAsSSortedList( Q, elms );
|
SetAsSSortedList( Q, elms );
|
||||||
SetParent( Q, Q );
|
SetParent( Q, Q );
|
||||||
SetCayleyTable( Q, ct );
|
SetCayleyTable( Q, ct );
|
||||||
SetConstructorFromTable(QuasigroupByCayleyTable);
|
SetConstructorFromTable(Q, QuasigroupByCayleyTable);
|
||||||
return Q;
|
return Q;
|
||||||
end );
|
end );
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ function( ct )
|
|||||||
NewType( F, IsLoopElement and IsLoopElmRep), [ i ] ) ) );
|
NewType( F, IsLoopElement and IsLoopElmRep), [ i ] ) ) );
|
||||||
F!.set := elms;
|
F!.set := elms;
|
||||||
F!.cayleyTable := ct;
|
F!.cayleyTable := ct;
|
||||||
F!.names := "l";
|
F!.elmNamePrefix := "l";
|
||||||
# creating the loop
|
# creating the loop
|
||||||
L := Objectify( NewType( FamilyObj( elms ),
|
L := Objectify( NewType( FamilyObj( elms ),
|
||||||
IsLoop and IsAttributeStoringRep ), rec() );
|
IsLoop and IsAttributeStoringRep ), rec() );
|
||||||
@ -235,22 +235,24 @@ function( ct )
|
|||||||
SetParent( L, L );
|
SetParent( L, L );
|
||||||
SetCayleyTable( L, ct );
|
SetCayleyTable( L, ct );
|
||||||
SetOne( L, elms[ 1 ] );
|
SetOne( L, elms[ 1 ] );
|
||||||
SetConstructorFromTable(LoopByCayleyTable);
|
SetConstructorFromTable(L, LoopByCayleyTable);
|
||||||
return L;
|
return L;
|
||||||
end );
|
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",
|
InstallMethod( SpecifyElmNamePrefix, "for collection and string",
|
||||||
[ IsQuasigroup, IsString ],
|
[ IsCollection, IsString ],
|
||||||
function( Q, name )
|
function( Q, name )
|
||||||
local F;
|
local F;
|
||||||
F := FamilyObj( Elements( Q )[ 1 ] );
|
F := FamilyObj( Representative( Q ) );
|
||||||
F!.names := name;
|
F!.elmNamePrefix := name;
|
||||||
end);
|
end);
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
Loading…
Reference in New Issue
Block a user