  
  [1X3. Private Extensions of the [5XAtlasRep[0X[1X Package[0X
  
  It  may  be  interesting  to use the functions of the [5XGAP[0X interface also for
  representations  or  programs  that  are  [13Xnot[0X  part  of  the  [5XATLAS[0X of Group
  Representations. This chapter describes how to achieve this.
  
  The  main idea is that users can notify directories containing the "private"
  data files, which may consist of
  
  (1)   new  representations and programs for groups that are declared already
        in the "official" [5XATLAS[0X of Group Representations,
  
  (2)   the  declaration  of  groups  that  are not declared in the "official"
        [5XATLAS[0X  of  Group Representations, and representations and programs for
        them, and
  
  (3)   the definition of new kinds of representations and programs.
  
  The  first two kinds are dealt with in Section [14X3.1[0X and Section [14X3.2[0X. The last
  is described in Section [14X5.5[0X.
  
  Finally, an example of using private extensions is given in Section [14X3.3[0X.
  
  Several  of  the sanity checks for the official part of the [5XAtlasRep[0X package
  make   sense   also   for  private  extensions,  see  Section [14X5.8[0X  for  more
  information.
  
  
  [1X3.1 Adding a Private Data Directory[0X
  
  After the [5XAtlasRep[0X package has been loaded into the [5XGAP[0X session, one can add
  private  data.  However,  one should [13Xnot[0X add private files to the local data
  directories  of the package, or modify files in these directories. It should
  be  noted  that  a data file is fetched from a server only if the local data
  directories  do  not  contain  a  file  with  this  name, independent of the
  contents  of the files. (As a consequence, corrupted files in the local data
  directories are [13Xnot[0X automatically replaced by a correct server file.)
  
  [1X3.1-1 AtlasOfGroupRepresentationsNotifyPrivateDirectory[0X
  
  [2X> AtlasOfGroupRepresentationsNotifyPrivateDirectory( [0X[3Xdir[, dirid][0X[2X ) [0Xfunction
  [6XReturns:[0X  [9Xtrue[0X  if  none  of  the  filenames  with  admissible format in the
            directory  [3Xdir[0X  is  contained in other data directories and if the
            data  belongs  to groups whose names have been declared, otherwise
            [9Xfalse[0X.
  
  Let  [3Xdir[0X  be a directory (see [14X'Reference: Directories'[0X) or a string denoting
  the  name of a directory (such that the [5XGAP[0X object describing this directory
  can  be  obtained  by  calling  [2XDirectory[0X  ([14XReference:  Directory[0X)  with the
  argument  [3Xdir[0X).  In the following, let [3Xdirname[0X be the name of the directory.
  So  [3Xdirname[0X can be an absolute path or a path relative to the home directory
  of  the  user  (starting with a tilde character [10X~[0X) or a path relative to the
  directory where [5XGAP[0X was started.
  
  If  the second argument [3Xdirid[0X is given, it must be a string. This value will
  be  used  in  the  [10Xidentifier[0X components of the records that are returned by
  interface  functions  (see  Section [14X2.5[0X) for data contained in the directory
  [3Xdir[0X. Note that the directory name may be different in different [5XGAP[0X sessions
  or  for  different  users  who  want  to  access  the same data, whereas the
  [10Xidentifier[0X  components shall be independent of such differences. The default
  for [3Xdirid[0X is [3Xdirname[0X.
  
  [2XAtlasOfGroupRepresentationsNotifyPrivateDirectory[0X  notifies  the data in the
  directory  [3Xdir[0X to the [5XAtlasRep[0X package. First the pair [10X[ [3Xdirname[0X, [3Xdirid[0X ][0X is
  added  to  the [10Xprivate[0X component of [2XAtlasOfGroupRepresentationsInfo[0X ([14X5.1-5[0X).
  If the directory contains a file with the name [11Xtoc.g[0X then this file is read;
  this  file  is  useful for adding new group names (see [2XAGRGNAN[0X ([14X5.7-1[0X)), for
  adding field information for characteristic zero representations (see [2XAGRRNG[0X
  ([14X5.7-2[0X)),  or for adding new data types (see Section [14X5.5[0X). Next the table of
  contents  of the private directory is built from the list of files contained
  in the private directory or in its subdirectories (one layer deep).
  
  Only  those files are considered whose names match an admissible format (see
  Section [14X5.6[0X). Filenames that are already contained in another data directory
  of  the [5XAtlasRep[0X package are ignored, and messages about these filenames are
  printed if the info level of [2XInfoAtlasRep[0X ([14X5.1-1[0X) is at least 1.
  
  Note  that  this implies that the files of the "official" (i.e. non-private)
  data directories have priority over files in private directories.
  
  If  the  directory  contains  files  for  groups  whose  names have not been
  declared  before and if the info level of [2XInfoAtlasRep[0X ([14X5.1-1[0X) is at least 1
  then a message about these names is printed.
  
  For  convenience,  the  user  may  collect the notifications of private data
  directories in the file [11X.gaprc[0X (see Section [14X'Reference: The .gaprc file'[0X).
  
  [1X3.1-2 AtlasOfGroupRepresentationsForgetPrivateDirectory[0X
  
  [2X> AtlasOfGroupRepresentationsForgetPrivateDirectory( [0X[3Xdirid[0X[2X ) _______[0Xfunction
  
  If  [3Xdirid[0X  is  the  identifier  of  a  private  data directory that has been
  notified with [2XAtlasOfGroupRepresentationsNotifyPrivateDirectory[0X ([14X3.1-1[0X) then
  [2XAtlasOfGroupRepresentationsForgetPrivateDirectory[0X removes the directory from
  the  list of notified private directories; this means that from then on, the
  data in this directory cannot be accessed anymore in the current session.
  
  
  [1X3.2 The Effect of Private Extensions on the User Interface[0X
  
  First suppose that only new groups or new data for known groups are added.
  
  In this case, [2XDisplayAtlasInfo[0X ([14X2.5-1[0X) lists the private representations and
  programs  in  the same way as the "official" data, except that private parts
  are   marked  with  the  string  stored  in  the  component  [10Xmarkprivate[0X  of
  [2XAtlasOfGroupRepresentationsInfo[0X  ([14X5.1-5[0X);  by default, this is a star [10X*[0X. The
  ordering of representations listed by [2XDisplayAtlasInfo[0X ([14X2.5-1[0X) (and referred
  to   by  [2XAtlasGenerators[0X  ([14X2.5-2[0X))  will  in  general  change  when  private
  directories  are  notified. If several private directories are used then the
  ordering  of data may depend on the ordering of notifications. For the other
  interface  functions  described  in  Chapter [14X2.[0X, the only difference is that
  also  the  private  data  can  be  accessed. In particular the "free format"
  [10X[3Xgroupname[0XG[3Xi[0X-X[3Xdescr[0XW[3Xn[0X[0X  for  straight  line  programs (see Section [14X5.6[0X) may be
  used  in  private  directories;  the  data can be accessed with [2XAtlasProgram[0X
  ([14X2.5-3[0X), where the last two arguments are the strings [10X"other"[0X and [3Xdescr[0X.
  
  If  also private data types are introduced (see Section [14X5.5[0X) then additional
  columns  or  rows  can appear in the output of [2XDisplayAtlasInfo[0X ([14X2.5-1[0X), and
  new  inputs  can become meaningful for all interface functions. Examples for
  these changes can be found in Section [14X3.3[0X.
  
  
  [1X3.3 An Example of Extending the [5XAtlasRep[0X[1X Package[0X
  
  In the beginning we set the info level of [2XInfoAtlasRep[0X ([14X5.1-1[0X) to 1.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> level:= InfoLevel( InfoAtlasRep );;[0X
    [4Xgap> SetInfoLevel( InfoAtlasRep, 1 );[0X
  [4X------------------------------------------------------------------[0X
  
  Let  us assume that the directory [11Xprivdir[0X contains data for the cyclic group
  C_4  of  order  4 and for the symmetric group S_5 on 5 points, respectively.
  Note  that  it  is obvious what the term "standard generators" means for the
  group C_4.
  
  Further let us assume that [11Xprivdir[0X contains the following files.
  
  [8X[11XC4G1-p4B0.m1[0X[0X
        a faithful permutation representation of C_4 on 4 points,
  
  [8X[11XC4G1-max1W1[0X[0X
        the straight line program that returns the square of its unique input,
  
  [8X[11XC4G1-a2W1[0X[0X
        the  straight  line  program that applies an outer automorphism to its
        unique input,
  
  [8X[11XC4G1-XtestW1[0X[0X
        the straight line program that returns the square of its unique input,
  
  [8X[11XS5G1-p2B0.m1[0X and [11XS5G1-p2B0.m2[0X[0X
        the  permutation representation of the commutator factor group of S_5,
        on 2 points.
  
  The directory and the files can be created as follows.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> pkg:= Filename( DirectoriesPackageLibrary( "atlasrep", "" ), "" );;[0X
    [4Xgap> prv:= DirectoryTemporary( "privdir" );;[0X
    [4Xgap> FileString( Filename( prv, "C4G1-p4B0.m1" ),[0X
    [4X>                MeatAxeString( [ (1,2,3,4) ], 4 ) );;[0X
    [4Xgap> FileString( Filename( prv, "C4G1-max1W1" ),[0X
    [4X>                "inp 1\npwr 2 1 2\noup 1 2\n" );;[0X
    [4Xgap> FileString( Filename( prv, "C4G1-XtestW1" ),[0X
    [4X>                "inp 1\npwr 2 1 2\noup 1 2\n" );;[0X
    [4Xgap> FileString( Filename( prv, "C4G1-a2W1" ),[0X
    [4X>                "inp 1\npwr 3 1 2\noup 1 2\n" );;[0X
    [4Xgap> FileString( Filename( prv, "C4G1-Ar1aB0.g" ),[0X
    [4X>                "return rec( generators:= [ [[E(4)]] ] );\n" );;[0X
    [4Xgap> FileString( Filename( prv, "S5G1-p2B0.m1" ),[0X
    [4X>                MeatAxeString( [ (1,2) ], 2 ) );;[0X
    [4Xgap> FileString( Filename( prv, "S5G1-p2B0.m2" ),[0X
    [4X>                MeatAxeString( [ (1,2) ], 2 ) );;[0X
  [4X------------------------------------------------------------------[0X
  
  (We  could also introduce intermediate directories [11XC4[0X and [11XS5[0X, say, each with
  the  data  for  one  group  only.  Here we do not show this because creating
  directories seems to be not possible without the [5XGAP[0X package [5XIO[0X.)
  
  Now  we create a file whose name is not admissible because it occurs already
  in the official part of the database. (This will cause an info line below.)
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> FileString( Filename( prv, "S5G1-p5B0.m1" ),[0X
    [4X>                MeatAxeString( [ (1,2) ], 5 ) );;[0X
  [4X------------------------------------------------------------------[0X
  
  The official part of the [5XAtlasRep[0X package does not contain information about
  C_4,  so  we  first notify this group, in the file [11Xprivdir/toc.g[0X. (The group
  S_5 is known with name [10XA5.2[0X in the official part of the [5XAtlasRep[0X package, so
  it cannot be notified.)
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> FileString( Filename( prv, "toc.g" ),[0X
    [4X>                "AGRGNAN(\"C4\",\"C4\");\n" );;[0X
  [4X------------------------------------------------------------------[0X
  
  Then we notify the private directory.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> AtlasOfGroupRepresentationsNotifyPrivateDirectory( prv, "priv" );[0X
    [4X#I  file `S5G1-p5B0.m1' was already in another t.o.c.[0X
    [4Xfalse[0X
  [4X------------------------------------------------------------------[0X
  
  (The  nonadmissible  filename  [10XS5G1-p5B0.m1[0X  was  ignored  for  the  private
  directory.  If this file would not be present then the return value would be
  [9Xtrue[0X.)  Now we can use the interface functions for accessing the data in the
  private directory.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> DisplayAtlasInfo( [ "C4" ] );[0X
    [4Xgroup    #  maxes  cl  cyc  out  find  check  pres[0X
    [4X--------------------------------------------------[0X
    [4XC4*      2      1   -    -    2     -      -     -[0X
    [4Xgap> DisplayAtlasInfo( "C4" );[0X
    [4XRepresentations for G = C4:    (all refer to std. generators 1)[0X
    [4X---------------------------[0X
    [4X1: G <= Sym(4)*[0X
    [4X2: G <= GL(1a,C)*[0X
    [4X[0X
    [4XPrograms for G = C4:    (all refer to std. generators 1)[0X
    [4X--------------------[0X
    [4Xavailable maxes of G:  [ 1 ]*[0X
    [4Xavailable automorphisms:  [ "2" ]*[0X
    [4Xavailable other scripts:[0X
    [4X   "test"*[0X
    [4Xgap> DisplayAtlasInfo( "C4", IsPermGroup, true );[0X
    [4XRepresentations for G = C4:    (all refer to std. generators 1)[0X
    [4X---------------------------[0X
    [4X1: G <= Sym(4)*[0X
    [4Xgap> DisplayAtlasInfo( "C4", IsMatrixGroup );[0X
    [4XRepresentations for G = C4:    (all refer to std. generators 1)[0X
    [4X---------------------------[0X
    [4X2: G <= GL(1a,C)*[0X
    [4Xgap> DisplayAtlasInfo( "C4", Dimension, 2 );[0X
    [4Xgap> DisplayAtlasInfo( "A5.2", NrMovedPoints, 2 );[0X
    [4XRepresentations for G = A5.2:    (all refer to std. generators 1)[0X
    [4X-----------------------------[0X
    [4X4: G <= Sym(2)*[0X
    [4Xgap> info:= OneAtlasGeneratingSetInfo( "C4" );[0X
    [4Xrec( groupname := "C4", repnr := 1, [0X
    [4X  identifier := [ [ "priv", "C4" ], [ "C4G1-p4B0.m1" ], 1, 4 ], p := 4, [0X
    [4X  id := "" )[0X
    [4Xgap> AtlasGenerators( info.identifier );[0X
    [4Xrec( generators := [ (1,2,3,4) ], groupname := "C4", standardization := 1,[0X
    [4X  repnr := 1, identifier := [ [ "priv", "C4" ], [ "C4G1-p4B0.m1" ], 1, 4 ], [0X
    [4X  p := 4, id := "" )[0X
    [4Xgap> AtlasProgram( "C4", 1 );[0X
    [4Xrec( program := <straight line program>, standardization := 1, [0X
    [4X  identifier := [ [ "priv", "C4" ], "C4G1-max1W1", 1 ], groupname := "C4" )[0X
    [4Xgap> AtlasProgram( "C4", "maxes", 1 );[0X
    [4Xrec( program := <straight line program>, standardization := 1, [0X
    [4X  identifier := [ [ "priv", "C4" ], "C4G1-max1W1", 1 ], groupname := "C4" )[0X
    [4Xgap> AtlasProgram( "C4", "maxes", 2 );[0X
    [4Xfail[0X
    [4Xgap> AtlasGenerators( "C4", 1 );[0X
    [4Xrec( generators := [ (1,2,3,4) ], groupname := "C4", standardization := 1,[0X
    [4X  repnr := 1, identifier := [ [ "priv", "C4" ], [ "C4G1-p4B0.m1" ], 1, 4 ], [0X
    [4X  p := 4, id := "" )[0X
    [4Xgap> AtlasGenerators( "C4", 2 );[0X
    [4Xrec( generators := [ [ [ E(4) ] ] ], groupname := "C4", standardization := 1,[0X
    [4X  repnr := 2, identifier := [ [ "priv", "C4" ], "C4G1-Ar1aB0.g", 1, 1 ], [0X
    [4X  dim := 1, id := "a" )[0X
    [4Xgap> AtlasGenerators( "C4", 3 );[0X
    [4Xfail[0X
    [4Xgap> AtlasProgram( "C4", "other", "test" );[0X
    [4Xrec( program := <straight line program>, standardization := 1, [0X
    [4X  identifier := [ [ "priv", "C4" ], "C4G1-XtestW1", 1 ], groupname := "C4" )[0X
  [4X------------------------------------------------------------------[0X
  
  For  checking the data in the private directory, we apply some of the sanity
  checks (see Section [14X5.8[0X).
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> AtlasOfGroupRepresentationsTestWords( "priv" );[0X
    [4Xtrue[0X
    [4Xgap> AtlasOfGroupRepresentationsTestFileHeaders( "priv" );[0X
    [4Xtrue[0X
  [4X------------------------------------------------------------------[0X
  
  Finally, we "uninstall" the private directory, and reset the info level that
  had  been set to 1 in the beginning. (Also the group name [10XC4[0X is removed this
  way,  which  is  an  advantage  of  using  a [11Xtoc.g[0X file over calling [2XAGRGNAN[0X
  ([14X5.7-1[0X)  directly.),  Note that we need not remove the data in the temporary
  directory, [5XGAP[0X will do this automatically.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> AtlasOfGroupRepresentationsForgetPrivateDirectory( "priv" );[0X
    [4Xgap> SetInfoLevel( InfoAtlasRep, level );[0X
  [4X------------------------------------------------------------------[0X
  
