#############################################################################
##
#A  genVshow             CHEVIE library          Meinolf Geck & Frank L"ubeck
##
#Y  Copyright 1992--1993,  Lehrstuhl D f"ur Mathematik,    RWTH Aachen,   and
#Y                         IWR   der   Universit"at    Heidelberg,   Germany.
##
####################################################################
##
##  
## 
Status:=proc(t)
   local nr;
   nr:=tablenumber(t);
   lprint(` `);
   lprint(`Status of`,t);
   lprint(` `);
   lprint(`=======================================================`);
## lprint(`Table number               :`,nr);
   lprint(`Order                      :`,t[-2,1]);
   lprint(`Number of character types  :`,t[-2,2]);
   lprint(`Number of rows available   :`,t[-2,3]);
   lprint(`Number of class types      :`,t[-2,4]);
   lprint(`Number of columns available:`,t[-2,5]);
   NULL;
end:            


####################################################################
##
##  PrintInfoTab(t)
## 
PrintInfoTab:=proc(t)
  local nr, n;
  nr:=tablenumber(t);
  n:=Information.nr;
  if n<>evaln(Information.nr) then
    print(n);
  else
    lprint(`No information available`);
  fi;
  NULL;
end:




####################################################################
##
##  PrintVal(t,i)
##  PrintVal(t,l)
##  PrintVal(t)
## 
PrintVal:=proc(t)
   local i,ct,ll1,ll2;
   tablenumber(t);
   if nargs = 1 then 
     ll1 := [$ 1..t[-2,2]];
     ll2 := [$ 1..t[-2,4]];
   elif nargs = 2 then 
     ll1 := makelist(args[2]);
     ll2 := [$ 1..t[-2,4]];
   else 
     ll1 := makelist(args[2]);
     ll2 := makelist(args[3]);
   fi;
   for i to nops(ll1) do 
     lprint();
     lprint('clt',`Value of character type `,ll1[i],
                                  ` on class type clt`);
     lprint();
     for ct to nops(ll2) do
       lprint(ll2[ct],t[ll1[i],ll2[ct]]);
     od;
   od;
   NULL;
end:


####################################################################
##
##  PrintInfoClass(t,i)
##  PrintInfoClass(t,l)
##  PrintInfoClass(t)
## 
PrintInfoClass:=proc(t)
  local i, ll, noinf, inf, s;
  tablenumber(t);
  if nargs = 1 then 
    ll := [$ 1..t[-2,4]]
  else 
    ll := makelist(args[2])
  fi;
  lprint();
  lprint('clt','Information');
  lprint();
  lprint(`======================================================`);
  for i in ll do
    lprint(i,t[-1,i]);
  od;
  NULL;
end:


####################################################################
##
##  PrintInfoChar(t,i)
##  PrintInfoChar(t,l)
##  PrintInfoChar(t)
## 
PrintInfoChar:=proc(t)
  local i, ll, noinf, inf, s;
  tablenumber(t);
  if nargs = 1 then 
    ll := [$ 1..t[-2,2]]
  else 
    ll := makelist(args[2])
  fi;
  lprint();
  lprint('cht','Information');
  lprint();
  lprint(`======================================================`);
  for i in ll do
    lprint(i,t[i,-1]);
  od;
  NULL;
end:




####################################################################
##
##  
## 
PrintCharParam:=proc(t)
   local i,ll,Exceptions,Parameter,Parameters,Substitutions,sk;
   tablenumber(t);
   if op(Char.t.Parameter) = evaln(Char.t.Parameter) then
     lprint(`Sorry, information not yet available.`);
     RETURN(NULL);
   fi;
   if nargs = 1  then 
     ll := [$ 1..t[-2,2]]
   else 
     ll := makelist(args[2])
   fi;
   # Testen, ob Substitutionen vorkommen:
   sk:=false;
   for i in ll do
     if nops(Char.t.Parameter[i])=3 then
       sk:=true;
     fi;
   od;
   lprint();
   if sk=true then 
     lprint('cht',`Parameters`,`Exceptions`,`Substitutions`);
   else
     lprint('cht',`Parameters`,`Exceptions`);
   fi;
   lprint();
   lprint(`=======================================================`);
   for i to nops(ll)
   do
#     xX := t[ll[i],-1][1];
#     print();
#     print();
      if nops(Char.t.Parameter[ll[i]])=3 then 
        lprint(ll[i], Char.t.Parameter[ll[i]][1],
                    Char.t.Parameter[ll[i]][2],
                    Char.t.Parameter[ll[i]][3]);
      else
        lprint(ll[i], Char.t.Parameter[ll[i]][1],
                    Char.t.Parameter[ll[i]][2]);
      fi;
   od;
   NULL;
end:


####################################################################
##
##  
## 
PrintClassParam:=proc(t)
   local i,ll,Exceptions,Parameter,Parameters,Substitutions,sk;
   tablenumber(t);
   if op(Klassen.t.Parameter) = evaln(Klassen.t.Parameter) then 
     lprint(`Sorry, information not yet available.`); 
     RETURN(NULL); 
   fi;
   if nargs = 1
       then ll := [$ 1..t[-2,4]]
       else ll := makelist(args[2])
   fi;
   # Testen, ob Substitutionen vorkommen:
   sk:=false;
   for i in ll do
     if nops(Klassen.t.Parameter[i])=3 then
       sk:=true;
     fi;
   od;
   lprint(` `);
   if sk=true then 
     lprint('clt',`Parameters`,`Exceptions`,`Substitutions`);
   else
     lprint('clt',`Parameters`,`Exceptions`);
   fi;
   lprint(` `);
   lprint(`=======================================================`);
   for i from 1 to nops(ll)
   do 
#     xX := t[-1,ll[i]][1];
#     print();
#     print();
      if nops(Klassen.t.Parameter[ll[i]])=3 then 
        lprint(ll[i], Klassen.t.Parameter[ll[i]][1],
                    Klassen.t.Parameter[ll[i]][2],
                    Klassen.t.Parameter[ll[i]][3]);
      else
        lprint(ll[i], Klassen.t.Parameter[ll[i]][1],
                    Klassen.t.Parameter[ll[i]][2]);
      fi;
   od;
   NULL;
end:



####################################################################
##
##  The following procedures just print some usefull information
##  about classes or characters if they are called with a list
##  as argument.
##  If they are called with integer argument, they return the
##  corresponding value.


####################################################################
##
##  
## 
CentOrd:=proc(t)
  local iI, xX, yY , ll:
  tablenumber(t);
  if nargs = 1 then 
    ll := [$ 1..t[-2,4]]
  else 
    if type(args[2],integer) then
      RETURN(factor(t[-2,1]/t[0,args[2]]));
    else
      ll := makelist(args[2]);
    fi;
  fi;
  lprint();
  lprint('clt',`Order of centralizer(s)`);
  lprint();
  lprint(`=======================================================`);
  for iI from 1 to nops(ll) do
#    xX := t[-1,ll[iI]][1]:
    yY := factor(t[-2,1]/t[0,ll[iI]]):
#    lprint(ll[iI], `class`, xX, `:`, yY);
    lprint(ll[iI], yY);
  od:
  NULL;
end:

####################################################################
##
##  
## 
CharDeg:=proc(t)
  local iI, xX, yY , ll:
  tablenumber(t);
  if nargs = 1 then 
    ll := [$ 1..t[-2,2]]
  else 
    if type(args[2],integer) then
      RETURN(factor(t[args[2],0]));
    else
      ll := makelist(args[2]);
    fi;
  fi;
  lprint();
  lprint('cht',`Degree of character(s)`);
  lprint();
  lprint(`=======================================================`);
  for iI from 1 to nops(ll) do
#    xX := t[ll[iI],-1][1]:
    yY := factor(t[ll[iI],0]):
#    lprint(ll[iI], `character`, xX, `:`, yY);
    lprint(ll[iI], yY);
  od:
  NULL;
end:



####################################################################
##
##  
## 
NrChars:=proc(t)
  local iI, xX, yY , ll, nr, eins:
  nr:=tablenumber(t);
  eins:=[[[1,0,1]],[[1,0,1]]];
  if nargs = 1 then 
    ll := [$ 1..t[-2,2]]
  else 
    if type(args[2],integer) then
      if NurPolynom.nr=true then
        RETURN(1);
      else
        setCongruence.nr;
        iI:=args[2];
        yY:=qscew2GEW(Char.nr.Summe.iI(eins));
        unsetCongruence.nr;
        RETURN(factor(eval(yY)));
      fi;
    else
      ll := makelist(args[2]);
    fi;
  fi;
  lprint();
  lprint('cht',`Number of characters in this type`);
  lprint();
  lprint(`=======================================================`);
  for iI from 1 to nops(ll) do
#    xX := t[ll[iI],-1][1]:
    yY := NrChars(t,ll[iI]):
#    lprint(ll[iI], `character`, xX, `:`, yY);
    lprint(ll[iI], yY);
  od:
  NULL;
end:



####################################################################
##
##  
## 
NrClasses:=proc(t)
  local iI, xX, yY , ll, nr, eins:
  nr:=tablenumber(t);
  eins:=[[[1,0,1]],[[1,0,1]]];
  if nargs = 1 then 
    ll := [$ 1..t[-2,4]]
  else 
    if type(args[2],integer) then
      if NurPolynom.nr=true then
        RETURN(factor(KlassentypOrd.nr[args[2]]));
      else
        setCongruence.nr;
        iI:=args[2];
        yY:=qscew2GEW(Klassen.nr.Summe.iI(eins));
        unsetCongruence.nr;
        RETURN(factor(eval(yY)));
      fi;
    else
      ll := makelist(args[2]);
    fi;
  fi;
  lprint();
  lprint('clt',`Number of classes in this type`);
  lprint();
  lprint(`=======================================================`);
  for iI from 1 to nops(ll) do
#    xX := t[ll[iI],-1][1]:
    yY := NrClasses(t,ll[iI]):
#    lprint(ll[iI], `character`, xX, `:`, yY);
    lprint(ll[iI], yY);
  od:
  NULL;
end:
