52.7 How to Extend a Table Library

If you have some ordinary character tables which are not (or not yet) in a GAP table library, but which you want to treat as library tables, e.g., assign them to variables using CharTable CharTable, you can include these tables. For that, two things must be done:

First you must notify each table, i.e., tell GAP on which file it can be found, and which names are admissible; this can be done using

NotifyCharTable( firstname, filename, othernames ),

with strings firstname (the identifier component of the table) and filename (the name of the file containing the table, relative to TBLNAME, and without extension .tbl), and a list othernames of strings which are other admissible names of the table (see CharTable).

NotifyCharTable will add the necessary information to LIBLIST. A warning is printed for each table libtbl that was already accessible by some of the names, and these names are ignored for the new tables. Of course this affects only the value of LIBLIST in the current GAP session, not that on the file.

Note that an error is raised if you want to notify a table with firstname or name in othernames which is already the identifier component of a library table.

    gap> Append( TBLNAME, ";tables/" );
    # tells {\GAP} that the directory 'tables' is a place to look for
    # library tables
    gap> NotifyCharTable( "Private", "mytables", [ "My" ] );
    # tells {\GAP} that the table with names '\"Private\"' and '\"My\"'
    # is stored on file 'mytables.tbl'
    gap> FirstNameCharTable( "My" );
    "Private"
    gap> FileNameCharTable( "My" );
    "mytables"

The second condition is that each file must contain tables in library format as described in Organization of the Table Libraries; in the example, the contents of the file tables/mytables.tbl may be this:

    SET_TABLEFILENAME("mytables");
    ALN:= Ignore;
    MOT("Private",
    [
    "my private character table"
    ],
    [2,2],
    [],
    [[1,1],[1,-1]],
    []);
    ALN("Private",["my"]);
    LIBTABLE.LOADSTATUS.("mytables"):="loaded";

We simulate reading this file by explicitly assigning some of the components.

    gap> LIBTABLE.("mytables"):= rec(
    > Private:= rec( identifier:= "Private",
    >                centralizers:= [2,2],
    >                irreducibles:= [[1,1],[1,-1]] ) );;
    gap> LIBTABLE.LOADSTATUS.("mytables"):="loaded";;

Now the private table is a library table:

    gap> CharTable( "My" );
    CharTable( "Private" ) 

To append the table tbl in library format to the file with name file, use

PrintToLib( file, tbl ).

Note that here file is the absolute name of the file, not the name relative to TBLNAME. Thus the filename in the row with the assignment to LIBTABLE must be adjusted to make the file a library file.

Previous Up Top Next
Index

GAP 3.4.4
April 1997