sginfo.c: Simple_hklList()


static void Simple_hklList(T_SgInfo *SgInfo, int Maxh, int Maxk, int Maxl,
                           int ListSysAbsent)
{
  int        h, k, l, iList, restriction, M, n, i;
  int        Minh, Mink, Minl;
  int        uvw[3];
  int        CCMx_PL[9], deterCCMx_LP, hP, kP, lP;


  if (SgInfo->LatticeInfo->Code != 'P')
  {
    deterCCMx_LP = deterRotMx(SgInfo->CCMx_LP);
                 InverseRotMx(SgInfo->CCMx_LP, CCMx_PL);

    if (deterCCMx_LP < 1)
      goto ReturnError;
  }

  SetListMin_hkl(SgInfo, Maxk, Maxl, &Minh, &Mink, &Minl);

  fprintf(stdout, ">Begin hklList\n");

  for (h = Minh; h <= Maxh; h++)
  for (k = Mink; k <= Maxk; k++)
  for (l = Minl; l <= Maxl; l++)
  {
    iList = IsSysAbsent_hkl(SgInfo, h, k, l, &restriction);
    if (SgError != NULL)
      return;

    M = BuildEq_hkl(SgInfo, NULL, h, k, l);
    if (SgError != NULL)
      return;

    if (iList == 0)
    {
      if ((iList = IsSuppressed_hkl(SgInfo, Minh, Mink, Minl,
                                                  Maxk, Maxl,
                                               h,    k,    l)) != 0)
        n = fprintf(stdout, "# %3d %3d %3d  %3d  [%d]",
                            h, k, l, M, iList);
      else
        n = fprintf(stdout, "  %3d %3d %3d  %3d",
                            h, k, l, M);

      if (restriction >= 0)
      {
        while (n < 27) { n++; putc(' ', stdout); }
        n += fprintf(stdout, " %2d/%d", restriction, STBF);
      }

      while (n < 34) { n++; putc(' ', stdout); }
      if (Is_si(SgInfo, h, k, l) == 1)
        n += fprintf(stdout, " s.i.");

      while (n < 41) { n++; putc(' ', stdout); }
      Set_uvw(SgInfo, h, k, l, uvw);
      for (i = 0; i < SgInfo->n_si_Vector; i++)
        n += fprintf(stdout, " %3d", uvw[i]);

      if (SgInfo->LatticeInfo->Code != 'P')
      {
        hP = h * CCMx_PL[0] + k * CCMx_PL[3] + l * CCMx_PL[6];
        kP = h * CCMx_PL[1] + k * CCMx_PL[4] + l * CCMx_PL[7];
        lP = h * CCMx_PL[2] + k * CCMx_PL[5] + l * CCMx_PL[8];

        if (hP % deterCCMx_LP || kP % deterCCMx_LP || lP % deterCCMx_LP)
          goto ReturnError;

        hP /= deterCCMx_LP;
        kP /= deterCCMx_LP;
        lP /= deterCCMx_LP;

        while (n < 55) { n++; putc(' ', stdout); }
          n += fprintf(stdout, " P  %3d %3d %3d",
                               hP, kP, lP);
      }

      putc('\n', stdout);
    }
    else if (ListSysAbsent)
      fprintf(stdout, "# %3d %3d %3d  %3d  (%d)\n",
                      h, k, l, M, iList);
  }

  fprintf(stdout, ">End hklList\n");

  return;

  ReturnError:

  SetSgError("Internal Error: Simple_hklList()");
  return;
}

Ralf W. Grosse-Kunstleve <rwgkio+sginfo@gmail.com>