Exemple #1
0
void al2_cc(int cos)
  {
  int i,j;
  Wlelt *lelt;

  /* Build & printout the representative */

  if (!al1_bldrep(cos))
    { al2_continue("unable to build rep've"); }

  fprintf(fop, "Coset #%d: ", cos);
  for (i = 0; i < repsiz; i++)
    {
    j = colgen[currrep[i]];
    if (!galpha)
      { fprintf(fop, "%d ", j); }
    else
      { fprintf(fop, "%c", (j > 0) ? algen[j] : toupper(algen[-j])); }
    }
  fprintf(fop, "\n");

  /* Add the rep to the subgroup generators */

  if ((lelt = al1_newelt()) == NULL)
    { al2_continue("unable to create new subgrp gen'r"); }

  lelt->len = repsiz;
  if ((lelt->word = (int*)malloc((lelt->len+1)*sizeof(int))) == NULL)
    {
    free(lelt);
    al2_continue("unable to create subgrp gen'r word"); 
    }
  lelt->exp = 1;

  for (i = 0; i < repsiz; i++)
    { lelt->word[i+1] = colgen[currrep[i]]; }

  /* Add the new element to the (possibly non-existent) gen list */

  if (genlst == NULL)
    {
    if ((genlst = al1_newwl()) == NULL)
      {
      free(lelt->word);
      free(lelt);
      al2_continue("unable to create subgrp gen'r list"); 
      }
    }
  al1_addwl(genlst,lelt);
  nsgpg++;

  /* Reset enumeration status & `remind' the user */

  okcont  = FALSE;
  tabinfo = tabindex = FALSE;

  fprintf(fop, "* Subgroup generators have been augmented\n");
  }
Exemple #2
0
void al2_sc(int arg)
  {
  int i,j,k, aarg;
  Logic found;

  if (arg < 0)
    { aarg = -arg; }
  else
    { aarg = arg; }

  found = FALSE;
  for (i = 2; i < nextdf; i++)
    {
    if (COL1(i) >= 0)
      {
      if (al2_normal(i))
        {
        if (!found)
          {
          found = TRUE;
          if (arg <= 0)
            { fprintf(fop, "Stabilising cosets (+ reps):\n"); }
          else
            { fprintf(fop, "Stabilising cosets:\n"); }
          }

        fprintf(fop, "%7d", i);
        if (arg <= 0)
          {
          if (!al1_bldrep(i))
            { al2_continue("unable to build coset rep've"); }
          fprintf(fop, "  ");
          for (j = 0; j < repsiz; j++)
            {
            k = colgen[currrep[j]];
            if (!galpha)
              { fprintf(fop, "%d ", k); }
            else
              { fprintf(fop, "%c", 
                             (k > 0) ? algen[k] : toupper(algen[-k])); }
            }
          }
        fprintf(fop, "\n");

        if ((aarg != 0) && (--aarg == 0))
          { break; }
        }
      }
    }

  if (!found)
    { fprintf(fop, "* Nothing found\n"); }
  }
Exemple #3
0
void al2_oo(int arg)
  {
  int i,j,k, aarg, ord;
  Logic found;

  if (arg < 0)
    { aarg = -arg; }
  else
    { aarg = arg; }

  found = FALSE;
  for (i = 2; i < nextdf; i++)
    {
    if (COL1(i) >= 0)
      {
      if (al1_bldrep(i))
        { 
        if ((ord = al1_ordrep()) == 0)
          { continue; }
        if ((arg == 0) || (ord%aarg == 0))
          {
          if (!found)
            {
            found = TRUE;
            fprintf(fop, "  coset |  order  rep\n");
            fprintf(fop, "--------+------------\n");
            }

          fprintf(fop, "%7d | %6d  ", i, ord);
          for (j = 0; j < repsiz; j++)
            {
            k = colgen[currrep[j]];             /* generator number */
            if (!galpha)
              { fprintf(fop, "%d ", k); }
            else
              { fprintf(fop, "%c", 
                             (k > 0) ? algen[k] : toupper(algen[-k])); }
            }
          fprintf(fop, "\n");

          if ((arg > 0) && (ord%aarg == 0))
            { break; }
          }
        }
      else
        { al2_continue("unable to build coset rep've"); }
      }
    }

  if (!found)
    { fprintf(fop, "* Nothing found\n"); }
  }
Exemple #4
0
void al1_prtct(int f, int l, int s, Logic c, Logic or)
  {
  int i, j, row;

  if (f < 1)
    { f = 1; }
  if (l > nextdf-1)
    { l = nextdf-1; }
  if (s < 1)
    { s = 1; }

  fprintf(fop, " coset |");		/* above coset number */
  if (!galpha)
    {
    for (i = 1; i <= ncol; i++) 
      { fprintf(fop, " %6d", colgen[i]); }
    }
  else
    {
    for (i = 1; i <= ncol; i++) 
      { fprintf(fop, "      %c", (colgen[i] > 0) 
                        ? algen[colgen[i]] : toupper(algen[-colgen[i]])); }
    }
  if (or) 
    { fprintf(fop,"   order   rep've"); }
  fprintf(fop, "\n");

  fprintf(fop, "-------+");
  for (i = 1; i <= ncol; i++) 
    { fprintf(fop, "-------"); }
  if (or) 
    { fprintf(fop,"-----------------"); }
  fprintf(fop, "\n");

  row = f;
  if (!c)
    {
    while (row < nextdf && COL1(row) < 0)
      { row++; }
    }
  while (row <= l)
    {
    fprintf(fop, "%6d |", row);
    for (i = 1; i <= ncol; i++) 
      { fprintf(fop, " %6d", CT(row,i)); }
    if (or && row != 1)
      {
      if (COL1(row) < 0)
        { fprintf(fop, "       -   -"); }
      else
        {
        if (al1_bldrep(row))
          {
          fprintf(fop, " %7d   ", al1_ordrep());
          for (i = 0; i < repsiz; i++)
            {
            j = colgen[currrep[i]];		/* generator number */
            if (!galpha)
              { fprintf(fop, "%d ", j); }
            else
              { fprintf(fop, "%c", 
                             (j > 0) ? algen[j] : toupper(algen[-j])); }
            }
          }
        else
          { fprintf(fop, "       ?   ?"); }
        }
      }
    fprintf(fop, "\n");

    /* If we're printing *all* rows, we can just incr row by s.  If not, we
    have to jump over non-redundant rows. */

    if (c)
      { row += s; }
    else
      {
      for (i = 1; i <= s; i++)
        {
        row++;
        while (row < nextdf && COL1(row) < 0)
          { row++; }
        if (row == nextdf)
          { break; }
        }
      }
    }
  }