⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tmadmin.tmi

📁 GAP源码
💻 TMI
📖 第 1 页 / 共 2 页
字号:
#############################################################################
##
#W  tmadmin.tmi         GAP table of marks library           Thomas Merkwitz
##
#H  @(#)$Id: tmadmin.tmi,v 1.8 2003/10/30 08:03:15 gap Exp $
##
#Y  Copyright (C)  1997,  Lehrstuhl D fuer Mathematik,  RWTH Aachen,  Germany
##
##  This file contains the implementation part of all functions to
##  handle the table of marks library
##
Revision.( "tomlib/gap/tmadmin_tmi" ) :=
    "@(#)$Id: tmadmin.tmi,v 1.8 2003/10/30 08:03:15 gap Exp $";


#############################################################################
##
#F  ReadTom( <name> ) . . . . . . . . . . . . . . . . . tables of marks files
##
##  This function is used to read data files of the tables of marks library.
##
BindGlobal( "ReadTom",
    name -> ReadPkg( "tomlib", Concatenation( "data/", name ) ) );


#############################################################################
##
#M  FusionCharTableTom( <tbl>, <tom> )  . . . . . . . . . . .  element fusion
##
InstallMethod( FusionCharTableTom,
    "for library character table and library table of marks",
    [ IsOrdinaryTable and IsLibraryCharacterTableRep,
      IsTableOfMarks and IsLibTomRep ],
    function( tbl, tom )

    local fus,
          i, j, h, hh, orders, cycs, ll, ind, p, pow, subs,
          marks, powermap;

    # If the fusion is stored on `tbl' then take it.
    if not IsBound( tbl!.tomfusion ) then
      TryNextMethod();
    fi;

    fus:= tbl!.tomfusion.map;
    if HasPermutationTom( tom ) then
      fus:= OnTuples( fus, PermutationTom( tom ) );
    fi;
    if HasClassPermutation( tbl ) then
      fus:= Permuted( fus, ClassPermutation( tbl ) );
    fi;

    return fus;
    end );


#############################################################################
##
#V  LIBTOMLIST
##
##  `LIBTOMLIST' provides all necessary information about the library of
##  table of marks.
##  It is a record with information about admissible names, fusion sources
##  etc. of all library tables;
##  The record is stored in the file `data/tmprimar.tom'.
##
DeclareAutoreadableVariables( "tomlib", "data/tmprimar.tom",
    [ "LIBTOMLIST" ] );


#############################################################################
##
#F  IsNameOfNoninstalledTableOfMarks( <string> )
##
BindGlobal( "IsNameOfNoninstalledTableOfMarks", function( string )
    if LowercaseString( string ) in LIBTOMLIST.noninstalled then
      Info( InfoTom, 1,
            "The table of marks for ", string , " is not installed",
            " on your system!" );
      return true;
    fi;
    return false;
    end );


#############################################################################
##
#F  MakeLIBTOMLIST
##
##  adds additional components to LIBTOMLIST to make things easier.
##
InstallGlobalFunction( MakeLIBTOMLIST, function()
    local name, i, j, dir, nonexisting;

    # Check which files exist and are readable.
    dir:= DirectoriesPackageLibrary( "tomlib", "data" );
    nonexisting:= [];
    for i in [ 1 .. Length( LIBTOMLIST.files ) ] do
      name:= Filename( dir, Concatenation( LIBTOMLIST.files[i], ".tom" ) );
      if name = fail or IsReadableFile( name ) <> true then
        Add( nonexisting, i );
      fi;
    od;

    LIBTOMLIST.names:=[];
    if not IsBound(LIBTOMLIST.noninstalled) then
        LIBTOMLIST.noninstalled := [];
    fi;
    LIBTOMLIST.positions:=[];

    for i in [1..Length(LIBTOMLIST.namelist)] do
        for j in [1..Length(LIBTOMLIST.namelist[i])] do
            for name in LIBTOMLIST.namelist[i][j] do
                if i in nonexisting then
                    Add( LIBTOMLIST.noninstalled , name );
#T Better turn names to lower case here,
#T instead of expecting that the lower case version is in the list!
                else
                    Add(LIBTOMLIST.positions,[i,j]);
                    Add(LIBTOMLIST.names,name);
                fi;
            od;
        od;
    od;

    LIBTOMLIST.namelist{ nonexisting } := List( nonexisting, x -> [] );
    LIBTOMLIST.fusions{ nonexisting }  := List( nonexisting, x -> [] );
end );


#############################################################################
##
#F  TableOfMarksFromLibrary( <string> )
##
InstallGlobalFunction( TableOfMarksFromLibrary, function( string )
    local pos, name, file, number, filenumber;

    # first get the correct file
    name:=LowercaseString(string);
    pos:=Position(LIBTOMLIST.names,name);
    if pos = fail then
      if IsNameOfNoninstalledTableOfMarks( string ) then
        return fail;
      else
        Info( InfoTom, 1,
              "no table of marks with name ", string, " found" );
        return fail;
      fi;
    fi;

    filenumber:=LIBTOMLIST.positions[pos][1];
    file:=LIBTOMLIST.files[filenumber];
    number:=LIBTOMLIST.positions[pos][2];

    # is it necessary to read a new file?
    if not IsBound(LIBTOMKNOWN.(file)) or LIBTOMKNOWN.LOADSTATUS.(file)[1] =
                                      "unloaded" then
      # change the loadstatus of the files and remove one if necessary
      # and allowed
      if  LIBTOMKNOWN.UNLOAD then
        # find the oldest file which is not userloaded and remove it
        for name in RecNames(LIBTOMKNOWN.LOADSTATUS) do
          LIBTOMKNOWN.LOADSTATUS.(name)[2]:=
                            LIBTOMKNOWN.LOADSTATUS.(name)[2]-1;
          if LIBTOMKNOWN.LOADSTATUS.(name)[2] = 0 then
            LIBTOMKNOWN.(name):=rec();
            LIBTOMKNOWN.LOADSTATUS.(name)[1]:="unloaded";
          fi;
        od;
      fi;

      # read it
      ReadTom( Concatenation( file, ".tom" ) );

      # reset the load status
      if LIBTOMKNOWN.UNLOAD then
        LIBTOMKNOWN.LOADSTATUS.(file):=["loaded",LIBTOMKNOWN.MAX];
      fi;
    fi;

    return LIBTOMKNOWN.(file)[number];
    end );


#############################################################################
##
#F  ConvertToLibTom( <record> )
##
InstallGlobalFunction( ConvertToLibTom, function( record )
    ConvertToTableOfMarks( record );
    SetFilterObj( record, IsLibTomRep );
   return record;
end );


#############################################################################
##
#F  SetActualLibFileName( <string> )
##
InstallGlobalFunction( SetActualLibFileName, function( file )
    LIBTOMKNOWN.(file):= [];
    LIBTOMKNOWN.ACTUAL:= file;
    LIBTOMKNOWN.LOADSTATUS.(file):= [ "userloaded", 0 ];
end );


#############################################################################
##
#F  LIBTOM( <arg> )
##
InstallGlobalFunction( LIBTOM, function( arg )
    local record, entry, nrgens, i, name;

    # Make the components.
    record:= rec( Identifier                  := arg[1],
                  SubsTom                     := arg[2],
                  MarksTom                    := arg[3],
                  NrSubsTom                   := arg[4],
                  OrdersTom                   := arg[5],
                  NormalizersTom              := arg[6],
                  DerivedSubgroupsTomUnique   := arg[7],
                  UnderlyingGroup             := arg[8],
                  StraightLineProgramsTom     := arg[9] );

    if Length( arg ) = 11 then
      record.GeneratorsSubgroupsTom:= [ arg[10], arg[11] ];
    fi;

    if IsList( record.UnderlyingGroup ) then

      # Store the underlying group if it is known.
      record.UnderlyingGroup:= GroupWithGenerators( record.UnderlyingGroup );

      # If standard generators are known then store them in the table.
      for entry in LIBTOMKNOWN.STDGEN do
        if record.Identifier = entry[1] then
          record.StandardGeneratorsInfo:= [ rec(
              generators  := entry[3],
              description := entry[4],
              script      := ScriptFromString( entry[4] ),
              ATLAS       := ( entry[2] = "Y" ) ) ];
          break;
        fi;
      od;

    fi;

    # Construct the straight line programs.
    if record.StraightLineProgramsTom <> 0 then
      nrgens:= Length( GeneratorsOfGroup( record.UnderlyingGroup ) );
      for i in [ 1 .. Length( record.StraightLineProgramsTom ) ] do
        if arg[9][i] = [[[]]] then
          # special case for the trivial subgroup
          record.StraightLineProgramsTom[i]:=
              StraightLineProgram( [[]], nrgens );
        else
          record.StraightLineProgramsTom[i]:= List( arg[9][i],
              x -> StraightLineProgram( x, nrgens ) );
        fi;
      od;
    fi;

    # Remove superfluous components.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -