bridge/class-master/depend/pari/src/basemath/ifactor1.c
/* Determine primality or compositeness of all current unknowns, and set
 * class Q primes to finished (class P) if everything larger is already
 * known to be prime.  When after_crack >= 0, only look at the
 * first after_crack things in the list (do nothing when it's 0) */
Determine primality or compositeness of all current unknowns, and set
class Q primes to finished (class P) if everything larger is already
known to be prime.  When after_crack >= 0, only look at the
first after_crack things in the list (do nothing when it's 0)
Determine primality or compositeness of all current unknowns and set class Q primes to finished ( class P ) if everything larger is already known to be prime . When after_crack > = 0 only look at the first after_crack things in the list ( do nothing when it ' s 0 )
static void
ifac_whoiswho(GEN *partial, GEN *where, long after_crack)
{
  GEN scan, scan_end = LAST(*partial);
#ifdef IFAC_DEBUG
  ifac_check(*partial, *where);
#endif
  if (after_crack == 0) return;
  if (after_crack > 0) 
    scan = *where + 3*(after_crack - 1); 
  else
    for (scan = scan_end; scan >= *where; scan -= 3)
    {
      if (CLASS(scan))
      { 
        if (CLASS(scan) == gen_0) break;
        if (CLASS(scan) == gen_1)
        {
          if (DEBUGLEVEL>=3)
          {
            err_printf("IFAC: factor %Ps\n\tis prime (no larger composite)\n",
                       VALUE(*where));
            err_printf("IFAC: prime %Ps\n\tappears with exponent = %ld\n",
                       VALUE(*where), itos(EXPON(*where)));
          }
          CLASS(scan) = gen_2;
        }
        continue;
      }
      if (!ifac_checkprime(scan)) break; 
      CLASS(scan) = gen_2; 
      if (DEBUGLEVEL>2) ifac_factor_dbg(scan);
    }
  for (; scan >= *where; scan -= 3)
  {
    if (CLASS(scan)) continue;
    (void)ifac_checkprime(scan); 
  }
}
static void ifac_whoiswho ( GEN * partial , GEN * where , long after_crack ) { GEN scan , scan_end = LAST ( * partial ) ; #ifdef IFAC_DEBUG ifac_check ( * partial , * where ) ; #endif if ( after_crack == 0 ) return ; if ( after_crack > 0 ) scan = * where + 3 * ( after_crack - 1 ) ; else for ( scan = scan_end ; scan >= * where ; scan -= 3 ) { if ( CLASS ( scan ) ) { if ( CLASS ( scan ) == gen_0 ) break ; if ( CLASS ( scan ) == gen_1 ) { if ( DEBUGLEVEL >= 3 ) { err_printf ( " \n \t \n " , VALUE ( * where ) ) ; err_printf ( " \n \t \n " , VALUE ( * where ) , itos ( EXPON ( * where ) ) ) ; } CLASS ( scan ) = gen_2 ; } continue ; } if ( ! ifac_checkprime ( scan ) ) break ; CLASS ( scan ) = gen_2 ; if ( DEBUGLEVEL > 2 ) ifac_factor_dbg ( scan ) ; } for ( ; scan >= * where ; scan -= 3 ) { if ( CLASS ( scan ) ) continue ; ( void ) ifac_checkprime ( scan ) ; } }
Determine primality or compositeness of all current unknowns, and set
 class Q primes to finished (class P) if everything larger is already
 known to be prime.
Determine primality or compositeness of all current unknowns and set class Q primes to finished ( class P ) if everything larger is already known to be prime .
/* check at most after_crack entries */ /* assert(scan <= scan_end) */ /* known class of factor */ /* must disable Q-to-P */ /* P_i, finished prime */ /* go on, Q-to-P trick now disabled */ /* Qj | Ck */