bridge/class-master/depend/pari/src/language/sumiter.c
/* strictly increasing order [over integers] */
strictly increasing order [over integers]
strictly increasing order [ over integers ]
static GEN
_next_lt_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)
      {
        pari_sp av;
        GEN t;
        i++;
        if (cmpii(d->a[i-1], d->a[i]) < 0) continue;
        av = avma;
        t = addiu(d->a[i-1],1); if (cmpii(t, d->m[i]) < 0) t = d->m[i];
        d->a[i] = resetloop(d->a[i], t);
        avma = av;
      }
      return (GEN)d->a;
    }
    d->a[i] = resetloop(d->a[i], d->m[i]);
    if (--i <= 0) return NULL;
  }
}
static GEN _next_lt_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 ) { pari_sp av ; GEN t ; i ++ ; if ( cmpii ( d -> a [ i - 1 ] , d -> a [ i ] ) < 0 ) continue ; av = avma ; t = addiu ( d -> a [ i - 1 ] , 1 ) ; if ( cmpii ( t , d -> m [ i ] ) < 0 ) t = d -> m [ i ] ; d -> a [ i ] = resetloop ( d -> a [ i ] , t ) ; avma = av ; } return ( GEN ) d -> a ; } d -> a [ i ] = resetloop ( d -> a [ i ] , d -> m [ i ] ) ; if ( -- i <= 0 ) return NULL ; } }
strictly increasing order [over integers]
strictly increasing order [ over integers ]
/* m[i] < a[i] <= M[i] < M[i+1] */ /* M[i] > M[i-1] >= a[i-1] */ /*a[i]:=max(a[i-1]+1,m[i]) <= M[i]*/