bridge/class-master/depend/pari/src/language/sumiter.c
/* non-decreasing order [over integers] */
non-decreasing order [over integers]
non - decreasing order [ over integers ]
static GEN
_next_le_i(forvec_t *d)
{
  long i = d->n;
  if (d->first) { d->first = 0; return (GEN)d->a; }
  for (;;) {
    if (cmpii(d->a[i], d->M[i]) < 0)
    {
      d->a[i] = incloop(d->a[i]);
      while (i < d->n)
      {
        GEN t;
        i++;
        if (cmpii(d->a[i-1], d->a[i]) <= 0) continue;
        t = d->a[i-1]; if (cmpii(t, d->m[i]) < 0) t = d->m[i];
        d->a[i] = resetloop(d->a[i], t);
      }
      return (GEN)d->a;
    }
    d->a[i] = resetloop(d->a[i], d->m[i]);
    if (--i <= 0) return NULL;
  }
}
static GEN _next_le_i ( forvec_t * d ) { long i = d -> n ; if ( d -> first ) { d -> first = 0 ; return ( GEN ) d -> a ; } for ( ; ; ) { if ( cmpii ( d -> a [ i ] , d -> M [ i ] ) < 0 ) { d -> a [ i ] = incloop ( d -> a [ i ] ) ; while ( i < d -> n ) { GEN t ; i ++ ; if ( cmpii ( d -> a [ i - 1 ] , d -> a [ i ] ) <= 0 ) continue ; t = d -> a [ i - 1 ] ; if ( cmpii ( t , d -> m [ i ] ) < 0 ) t = d -> m [ i ] ; d -> a [ i ] = resetloop ( d -> a [ i ] , t ) ; } return ( GEN ) d -> a ; } d -> a [ i ] = resetloop ( d -> a [ i ] , d -> m [ i ] ) ; if ( -- i <= 0 ) return NULL ; } }
non-decreasing order [over integers]
non - decreasing order [ over integers ]
/* m[i] < a[i] <= M[i] <= M[i+1] */ /* a[i] < a[i-1] <= M[i-1] <= M[i] */ /*a[i]:=max(a[i-1],m[i])*/