bridge/class-master/depend/pari/src/basemath/ifactor1.c
/* Defragment: squeeze out unoccupied slots above *where. Unoccupied slots
 * arise when a composite factor dissolves completely whilst dividing off a
 * prime, or when ifac_resort() spots a coincidence and merges two factors.
 * Update *where */
squeeze out unoccupied slots above *where. Unoccupied slots
arise when a composite factor dissolves completely whilst dividing off a
prime, or when ifac_resort() spots a coincidence and merges two factors.
Update *where
squeeze out unoccupied slots above * where . Unoccupied slots arise when a composite factor dissolves completely whilst dividing off a prime or when ifac_resort () spots a coincidence and merges two factors . Update * where
static void
ifac_defrag(GEN *partial, GEN *where)
{
  GEN scan_new = LAST(*partial), scan_old;
  for (scan_old = scan_new; scan_old >= *where; scan_old -= 3)
  {
    if (!VALUE(scan_old)) continue; 
    if (scan_old < scan_new) SHALLOWCOPY(scan_old, scan_new);
    scan_new -= 3; 
  }
  scan_new += 3; 
  *where = scan_new;
  while ((scan_new -= 3) > *partial) ifac_delete(scan_new); 
}
static void ifac_defrag ( GEN * partial , GEN * where ) { GEN scan_new = LAST ( * partial ) , scan_old ; for ( scan_old = scan_new ; scan_old >= * where ; scan_old -= 3 ) { if ( ! VALUE ( scan_old ) ) continue ; if ( scan_old < scan_new ) SHALLOWCOPY ( scan_old , scan_new ) ; scan_new -= 3 ; } scan_new += 3 ; * where = scan_new ; while ( ( scan_new -= 3 ) > * partial ) ifac_delete ( scan_new ) ; }
Defragment: squeeze out unoccupied slots above *where.
Defragment : squeeze out unoccupied slots above * where .
/* empty slot */ /* point at next slot to be written */ /* back up to last slot written */ /* erase junk */