NZMATH  1.2.0 About: NZMATH is a Python based number theory oriented calculation system.   Fossies Dox: NZMATH-1.2.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)
nzmath.bigrange Namespace Reference

## Functions

def count (n=0)

def range (start, stop=None, step=None)

def arithmetic_progression (init, difference)

def geometric_progression (init, ratio)

def _iterate (func, init)

def multirange (triples)

def _split_triples (triples)

def _empty (starts, stops, steps)

def _range_exhausted (i, values, steps, stops)

def multirange_restrictions (triples, ascending=(), descending=(), strictly_ascending=(), strictly_descending=())

def _violate_ascending (values, ascending)

def _violate_strictly_ascending (values, ascending)

def _violate_descending (values, descending)

def _violate_strictly_descending (values, descending)

## Detailed Description

```bigrange

Generators for range like sequences.
```

## ◆ _empty()

 def nzmath.bigrange._empty ( starts, stops, steps )
private
```Report whether there is an empty range in the triples or not.
```

Definition at line 127 of file bigrange.py.

Referenced by nzmath.bigrange.multirange(), and nzmath.bigrange.multirange_restrictions().

## ◆ _iterate()

 def nzmath.bigrange._iterate ( func, init )
private
```Generate (infinitely) a sequence (init, func(init), func(func(init)), ...)
```

Definition at line 65 of file bigrange.py.

## ◆ _range_exhausted()

 def nzmath.bigrange._range_exhausted ( i, values, steps, stops )
private
```Check if a range at i is exhausted.
```

Definition at line 136 of file bigrange.py.

Referenced by nzmath.bigrange.multirange(), and nzmath.bigrange.multirange_restrictions().

## ◆ _split_triples()

 def nzmath.bigrange._split_triples ( triples )
private
```Convert a list of triples into three lists each consists of 1st,
2nd and 3rd element of each triples.

The range triples may be doubles (start, stop) or single (stop,),
but they have to be always tuples.
```

Definition at line 104 of file bigrange.py.

Referenced by nzmath.bigrange.multirange(), and nzmath.bigrange.multirange_restrictions().

## ◆ _violate_ascending()

 def nzmath.bigrange._violate_ascending ( values, ascending )
private
```Check if values violate ascending restrictions.
```

Definition at line 179 of file bigrange.py.

Referenced by nzmath.bigrange.multirange_restrictions().

## ◆ _violate_descending()

 def nzmath.bigrange._violate_descending ( values, descending )
private
```Check if values violate descending restrictions.
```

Definition at line 197 of file bigrange.py.

Referenced by nzmath.bigrange.multirange_restrictions().

## ◆ _violate_strictly_ascending()

 def nzmath.bigrange._violate_strictly_ascending ( values, ascending )
private
```Check if values violate strictly-ascending restrictions.
```

Definition at line 188 of file bigrange.py.

Referenced by nzmath.bigrange.multirange_restrictions().

## ◆ _violate_strictly_descending()

 def nzmath.bigrange._violate_strictly_descending ( values, descending )
private
```Check if values violate strictly-descending restrictions.
```

Definition at line 206 of file bigrange.py.

Referenced by nzmath.bigrange.multirange_restrictions().

## ◆ arithmetic_progression()

 def nzmath.bigrange.arithmetic_progression ( init, difference )
```Generate an arithmetic progression start form 'init' and
'difference' step.
```

Definition at line 49 of file bigrange.py.

References nzmath.bigrange._iterate().

## ◆ count()

 def nzmath.bigrange.count ( n = `0` )
```Count up infinitely from 'n' (default to 0),

see itertools.count
```

Definition at line 8 of file bigrange.py.

## ◆ geometric_progression()

 def nzmath.bigrange.geometric_progression ( init, ratio )
```Generate a geometric progression start form 'init' and multiplying
'ratio'.
```

Definition at line 57 of file bigrange.py.

References nzmath.bigrange._iterate().

## ◆ multirange()

 def nzmath.bigrange.multirange ( triples )
```multirange(list of range triples) is an iterator over cartesian
product of elements of ranges.

For example, multirange([(1, 10, 3), (1, 10, 4)]) yields
(1, 1), (1, 5), (1, 9), (4, 1), (4, 5), (4, 9), (7, 1), (7, 5),
and (7, 9).

The range triples may be doubles (start, stop) or single (stop,),
but they have to be always tuples.

Be cautious that using this module usually means you are trying to
do brute force looping.
```

Definition at line 75 of file bigrange.py.

## ◆ multirange_restrictions()

 def nzmath.bigrange.multirange_restrictions ( triples, ascending = `()`, descending = `()`, strictly_ascending = `()`, strictly_descending = `()` )
```multirange_restrictions is an iterator similar to the multirange
but putting restrictions on each ranges.  A restriction ascending
is a sequence that specifies the indices where the number emitted
by the range should be greater than or equal to the number at the
previous index.  Other restrictions descending, strictly_ascending
and strictly_descending are similar.

For example, while multirange([(1, 10, 3), (1, 10, 4)]) yields
(1, 1), (1, 5), (1, 9), (4, 1), (4, 5), (4, 9), (7, 1), (7, 5),
and (7, 9),
multirange_restrictions([(1, 10, 3), (1, 10, 4)], ascending=(1,))
yields only (1, 1), (1, 5), (1, 9), (4, 5), (4, 9) and (7, 9).

The range triples may be doubles (start, stop) or single (stop,),
but they have to be always tuples.
```

Definition at line 143 of file bigrange.py.