`coxeter/text/name_of` := TEXT(`    `,
`FUNCTION:  name_of - name of a root system or Coxeter group`,`    `,
`CALLING SEQUENCE:  name_of(R);`,`                   name_of(R,'pi');`,`    `,
`PARAMETERS:  R = a root system data structure`,
`            pi = (optional) a name`,`   `,`SYNOPSIS:   `,
`  name_of(R) returns the name of the isomorphism type of the root system`,
`  or Coxeter group specified by R; i.e., a monomial in the names of the`,
`  irreducible root systems. If a second argument is specified, it will be`,
`  assigned a permutation [p_1,...,p_n] of [1,2,..,n] (n=rank(R)). This`,
`  permutation indicates an ordering of base(R) that is isomorphic to the`,
`  ordering used by base(N) and diagram(N), where N = name_of(R). Thus if`,
`  the permutation is [2,3,1] and S=base(R), then [S[2],S[3],S[1]] will be`,
`  an ordered base isomorphic to base(name_of(R)).`,`   `,
`  If R is a Coxeter matrix, then the assigned permutation (if requested)`,
`  indicates a re-ordering of the rows and columns of R that agrees with`,
`  cox_matrix(N), where N = name_of(R). Note also that in this case, the`,
`  name_of function cannot distinguish between B.n and C.n, or G2 and I2[6],`,
`  or B2 and I2[4]. In these cases, the name returned will be the first`,
`  member of each of these pairs.`,`   `,
`  If R is a list of simple roots, the name_of function will confirm that`,
`  R is a base for some root system, but in most cases does not attempt to`,
`  distinguish between crystallographic and non-crystallographic bases that`,
`  generate the same reflection group. Exceptions occur in rank two: if the`,
`  list uses floating-point coordinates and generates a reflection group of`,
`  order 8 or 12, then the name returned is I2[4] or I2[6], respectively.`,
`   `,`  If R is not a matrix or list, it is assumed that R itself is a root`,
`  system name and name_of(R) simply returns R. The assigned permutation`,
`  (if requested) is [1,2,...,n], where n=rank(R).`,`     `,
`  For a description of root system data structures, see coxeter[structure].`,
`   `,`EXAMPLES:   `,
`  name_of([e1+e2,e1-e2]);                    yields       A1^2`,
`  S:=base(F4); r:=highest_root(F4);`,
`  name_of([-r,S[2],S[3],S[4]],'pi'), pi;     yields   B4, [2,3,4,1]`,
`  m:=array([[1,5],[5,1]]);`,
`  name_of(m);                                yields       I2[5] `,
`  name_of(E5);                               yields        E5`,
`  m:=cartan_matrix(E5); name_of(m);          yields        D5`,`   `,
`SEE ALSO:  base, cartan_matrix, cox_matrix, diagram, rank, structure`):

if `+`(0)=0 then # Maple V.4 or later
  print(INTERFACE_HELP(insert, topic=`coxeter/name_of`,
  helpfile=HomeLib, text=`coxeter/text/name_of`))
elif ceil(0)=0 then # Maple V.2 or V.3
  `help/coxeter/text/name_of`:=`coxeter/text/name_of`:
  save `help/coxeter/text/name_of`, cat(HomeLib,`/help/coxeter/text/name_of.m`);
fi:
