bridge/class-master/depend/pari/src/basemath/qfisom.c
/* return the length of the orbit of pt under the first nG matrices in G */
return the length of the orbit of pt under the first nG matrices in G
return the length of the orbit of pt under the first nG matrices in G
static long
orbitlen(long pt, long orblen, GEN G, long nG, GEN V)
{
  pari_sp av = avma;
  long i, len, cnd;
  long n = lg(V)-1;
  GEN orb, flag;
  flag = zero_Flv(2*n + 1)+n+1;
  orb  = zero_Flv(orblen);
  orb[1] = pt;
  flag[pt] = 1;
  len = 1;
  for(cnd = 1; cnd <= len  &&  len < orblen; ++cnd)
    for (i = 1; i <= nG  &&  len < orblen; ++i)
    {
      long im = operate(orb[cnd], gel(G,i), V);
      if (flag[im] == 0)
      {
        orb[++len] = im;
        flag[im] = 1;
      }
    }
  avma = av;
  return len;
}
static long orbitlen ( long pt , long orblen , GEN G , long nG , GEN V ) { pari_sp av = avma ; long i , len , cnd ; long n = lg ( V ) - 1 ; GEN orb , flag ; flag = zero_Flv ( 2 * n + 1 ) + n + 1 ; orb = zero_Flv ( orblen ) ; orb [ 1 ] = pt ; flag [ pt ] = 1 ; len = 1 ; for ( cnd = 1 ; cnd <= len && len < orblen ; ++ cnd ) for ( i = 1 ; i <= nG && len < orblen ; ++ i ) { long im = operate ( orb [ cnd ] , gel ( G , i ) , V ) ; if ( flag [ im ] == 0 ) { orb [ ++ len ] = im ; flag [ im ] = 1 ; } } avma = av ; return len ; }
return the length of the orbit of pt under the first nG matrices in G
return the length of the orbit of pt under the first nG matrices in G
/* if flag[i + n+1] = 1, -n <= i <= n, then the point i is already in the
     orbit */ /* the image is a new point in the orbit */