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.

Function Documentation

◆ _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.

Referenced by nzmath.bigrange.arithmetic_progression(), and nzmath.bigrange.geometric_progression().

◆ _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.

References nzmath.bigrange._empty(), nzmath.bigrange._range_exhausted(), and nzmath.bigrange._split_triples().

◆ 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.

References nzmath.bigrange._empty(), nzmath.bigrange._range_exhausted(), nzmath.bigrange._split_triples(), nzmath.bigrange._violate_ascending(), nzmath.bigrange._violate_descending(), nzmath.bigrange._violate_strictly_ascending(), and nzmath.bigrange._violate_strictly_descending().

◆ range()

def nzmath.bigrange.range (   start,
  stop = None,
  step = None 
)
Generate range like finite integer sequence but can generate more
than sys.maxint elements.

Definition at line 19 of file bigrange.py.

Referenced by nzmath.poly.array.ArrayPoly.__add__(), nzmath.algfield.BasicAlgNumber.__add__(), nzmath.round2.ModuleWithDenominator.__add__(), nzmath.prime.Zeta.__add__(), nzmath.matrix.RingMatrix.__add__(), nzmath.algfield.MatAlgNumber.__add__(), nzmath.matrix.Matrix.__call__(), nzmath.matrix.Matrix.__contains__(), nzmath.matrix.Matrix.__eq__(), nzmath.permute.Permute.__eq__(), nzmath.permute.ExPermute.__eq__(), nzmath.prime.Zeta.__eq__(), nzmath.permute.ExPermute.__getitem__(), nzmath.matrix.Matrix.__hash__(), nzmath.prime.Zeta.__hash__(), nzmath.matrix.RingMatrix.__mod__(), nzmath.algfield.NumberField.__mul__(), nzmath.permute.Permute.__mul__(), nzmath.poly.array.ArrayPoly.__mul__(), nzmath.poly.array.ArrayPolyMod.__mul__(), nzmath.algfield.BasicAlgNumber.__mul__(), nzmath.prime.Zeta.__mul__(), nzmath.matrix.RingMatrix.__mul__(), nzmath.algfield.MatAlgNumber.__mul__(), nzmath.algfield.BasicAlgNumber.__neg__(), nzmath.algfield.MatAlgNumber.__neg__(), nzmath.matrix.Matrix.__nonzero__(), nzmath.prime.Zeta.__pos__(), nzmath.permute.Permute.__pow__(), nzmath.permute.ExPermute.__pow__(), nzmath.algfield.BasicAlgNumber.__pow__(), nzmath.algfield.MatAlgNumber.__pow__(), nzmath.matrix.Matrix.__repr__(), nzmath.matrix.RingMatrix.__rmul__(), nzmath.matrix.Matrix.__str__(), nzmath.poly.array.ArrayPoly.__sub__(), nzmath.matrix.RingMatrix.__sub__(), nzmath.algfield.MatAlgNumber.__sub__(), nzmath.algfield.BasicAlgNumber.__truediv__(), nzmath.algfield.MatAlgNumber.__truediv__(), nzmath.prime._aks_mod(), nzmath.prime_decomp._algnumber_to_vector(), nzmath.module._base_multiplication(), nzmath.prime_decomp._check_H(), nzmath.round2._coeff_list(), nzmath.matrix.FieldMatrix._cohensSimplify(), nzmath.round2._default_omega(), nzmath.prime_decomp._div_mod_pO(), nzmath.prime_decomp._easy_prime_decomp(), nzmath.algfield._easy_prime_decomp(), nzmath.finitefield._findroot(), nzmath.ecpp._generate_params_for_minus3(), nzmath.ecpp._generate_params_for_minus4(), nzmath.module.Submodule._HNF_solve(), nzmath.equation._initialize(), nzmath.round2._kernel_of_qpow(), nzmath.prime_decomp._main_prime_decomp(), nzmath.prime_decomp._matrix_mul_by_base_mul(), nzmath.prime_decomp._matrix_to_algnumber_list(), nzmath.module.Module._module_mul(), nzmath.arygcd._n_pow_i(), nzmath.round2._null_linear_combination(), nzmath.round2._p_module(), nzmath.round2._p_radical(), nzmath.poly.uniutil.DivisionProvider._populate_reduced(), nzmath.module.Ideal._precompute_for_different(), nzmath.module.Module._scalar_mul(), nzmath.elliptic.ECoverGF._Schoof_mod_l(), nzmath.prime_decomp._separable_algebra(), nzmath.equation._SimMethod(), nzmath.matrix.RingMatrix._SimplifyHNF(), nzmath.finitefield.ExtendedField._small_irriducible(), nzmath.prime_decomp._squarefree_decomp(), nzmath.elliptic.ECoverGF._step(), nzmath.prime_decomp._two_element_repr_prime_ideal(), nzmath.quad._update_subgrps(), nzmath.prime_decomp._vect_mul_by_base_mul(), nzmath.finitefield.affine_multiple_method(), nzmath.equation.allroots_Fp(), nzmath.quad.babyspcv(), nzmath.combinatorial.bell(), nzmath.combinatorial.bernoulli(), nzmath.combinatorial.binomial(), nzmath.elliptic.ECoverGF.BSGS(), nzmath.algfield.MatAlgNumber.ch_basic(), nzmath.algfield.BasicAlgNumber.ch_matrix(), nzmath.module.Module.change_base_module(), nzmath.algfield.changetype(), nzmath.poly.array.ArrayPoly.coefficients_to_dict(), nzmath.matrix.FieldMatrix.columnEchelonForm(), nzmath.combinatorial.combination_index_generator(), nzmath.group.AbelianGenerate.computeStructure(), nzmath.rational.continued_fraction_expansion(), nzmath.matrix.Matrix.copy(), nzmath.module.Module.copy(), nzmath.arith1.CRT(), nzmath.quad.crt(), nzmath.round2.Dedekind(), nzmath.matrix.Matrix.deleteColumn(), nzmath.round2.ModuleWithDenominator.determinant(), nzmath.matrix.RingSquareMatrix.determinant(), nzmath.matrix.FieldSquareMatrix.determinant(), nzmath.algfield.NumberField.disc(), nzmath.algfield.disc(), nzmath.factor.misc.FactoredInteger.divisors(), nzmath.prime.FactoredInteger.divisors(), nzmath.elliptic.ECGeneric.divPoly(), nzmath.combinatorial.dyck_word_generator(), nzmath.equation.e3(), nzmath.factor.ecm.ecm(), nzmath.combinatorial.euler(), nzmath.matrix.RingMatrix.exthermiteNormalForm(), nzmath.matrix.RingSquareMatrix.extsmithNormalForm(), nzmath.combinatorial.factorial(), nzmath.combinatorial.fallingfactorial(), nzmath.poly.array.FFT(), nzmath.poly.array.ArrayPoly.FFT_mul(), nzmath.poly.array.ArrayPolyMod.FFT_mul(), nzmath.algfield.NumberField.field_discriminant(), nzmath.poly.hensel.HenselLiftSimultaneously.first_lift(), nzmath.factor.mpqs.Elimination.gaussian(), nzmath.gcd.gcd_of_list(), nzmath.poly.hensel.HenselLiftSimultaneously.general_lift(), nzmath.prime.generator_eratosthenes(), nzmath.algfield.BasicAlgNumber.getApprox(), nzmath.matrix.Matrix.getBlock(), nzmath.algfield.BasicAlgNumber.getCharPoly(), nzmath.matrix.RingMatrix.getCoefficientRing(), nzmath.matrix.Matrix.getColumn(), nzmath.module.Submodule.getGenerators(), nzmath.poly.multiutil.PolynomialRingAnonymousVariables.getQuotientField(), nzmath.permute.Permute.getValue(), nzmath.permute.ExPermute.getValue(), nzmath.matrix.RingMatrix.hermiteNormalForm(), nzmath.matrix.FieldSquareMatrix.hessenbergForm(), nzmath.ecpp.hilbert_mpmath(), nzmath.matrix.FieldMatrix.image(), nzmath.module.Module.index(), nzmath.vector.innerProduct(), nzmath.matrix.Matrix.insertColumn(), nzmath.permute.Permute.inverse(), nzmath.permute.ExPermute.inverse(), nzmath.algfield.BasicAlgNumber.inverse(), nzmath.algfield.MatAlgNumber.inverse(), nzmath.matrix.FieldSquareMatrix.inverse(), nzmath.matrix.FieldMatrix.inverseImage(), nzmath.matrix.RingSquareMatrix.isAlternatingMatrix(), nzmath.lattice.Lattice.isCyclic(), nzmath.quad.isfinished_bsgscv(), nzmath.lattice.Lattice.isIdeal(), nzmath.matrix.SquareMatrix.isLowerTriangularMatrix(), nzmath.matrix.SquareMatrix.isScalarMatrix(), nzmath.matrix.SquareMatrix.isSymmetricMatrix(), nzmath.matrix.SquareMatrix.isUpperTriangularMatrix(), nzmath.matrix.FieldMatrix.kernel(), nzmath.matrix.RingMatrix.kernelAsModule(), nzmath.poly.multiutil.NestProvider.leading_variable(), nzmath.squarefree.lenstra_ternary(), nzmath.poly.hensel.HenselLiftMulti.lift_factors(), nzmath.poly.hensel.HenselLiftMulti.lift_ladder(), nzmath.module.Submodule.linear_combination(), nzmath.round2.ModuleWithDenominator.linear_combination(), nzmath.lattice.LLL(), nzmath.matrix.FieldSquareMatrix.LUDecomposition(), nzmath.prime.JacobiSum.make(), nzmath.prime.JacobiSum.makefx(), nzmath.matrix.Matrix.map(), nzmath.prime.miller(), nzmath.prime.millerRabin(), nzmath.arith1.modsqrt(), nzmath.ecpp.Elliptic.mul(), nzmath.elliptic.ECGeneric.mul(), nzmath.elliptic.ECoverGF.naive(), nzmath.equation.Newton(), nzmath.poly.groebner.normal_strategy(), nzmath.permute.Permute.numbering(), nzmath.elliptic.ECoverGF.order(), nzmath.combinatorial.partition_numbers_upto(), nzmath.poly.array.perfect_shuffle(), nzmath.combinatorial.permutation_generator(), nzmath.permute.Permute.permute(), nzmath.permute.ExPermute.permute(), nzmath.algfield.NumberField.POLRED(), nzmath.poly.array.ArrayPoly.power(), nzmath.poly.array.ArrayPolyMod.power(), nzmath.prime.Zeta.promote(), nzmath.prime.properDivisors(), nzmath.bigrandom.randrange(), nzmath.matrix.Matrix.reduce(), nzmath.poly.ring.PolynomialIdeal.reduce(), nzmath.ring.CommutativeRing.registerModuleAction(), nzmath.group.AbelianGenerate.relationLattice(), nzmath.module.Module.represent_element(), nzmath.combinatorial.risingfactorial(), nzmath.equation.root_Fp(), nzmath.matrix.Matrix.set(), nzmath.matrix.Matrix.setColumn(), nzmath.quad.setind(), nzmath.permute.Permute.setKey(), nzmath.permute.ExPermute.setKey(), nzmath.multiplicative.sigma(), nzmath.matrix.RingSquareMatrix.smithNormalForm(), nzmath.matrix.FieldMatrix.solve(), nzmath.poly.array.ArrayPoly.split_at(), nzmath.poly.uniutil.PrimeCharacteristicFunctionsProvider.split_same_degrees(), nzmath.factor.mpqs.sqroot_power(), nzmath.poly.uniutil.FinitePrimeFieldPolynomial.square(), nzmath.factor.ecm.stage2(), nzmath.combinatorial.stirling1(), nzmath.combinatorial.stirling2_negative(), nzmath.prime.Status.subodd(), nzmath.matrix.Subspace.supplementBasis(), nzmath.matrix.Matrix.swapColumn(), nzmath.group.GroupElement.t_order(), nzmath.module.Ideal_with_generator.to_HNFRepresentation(), nzmath.permute.Permute.ToCyclic(), nzmath.permute.Permute.ToMatrix(), nzmath.permute.ExPermute.ToNormal(), nzmath.algfield.BasicAlgNumber.trace(), nzmath.matrix.RingSquareMatrix.trace(), nzmath.elliptic.ECoverGF.trace(), nzmath.matrix.Matrix.transpose(), nzmath.quad.trbabysp(), nzmath.factor.find.trialDivision(), nzmath.matrix.FieldSquareMatrix.triangulate(), nzmath.module.Ideal_with_generator.twoElementRepresentation(), nzmath.permute.Permute.types(), nzmath.matrix.unitMatrix(), nzmath.poly.factor.upper_bound_of_coefficient(), and nzmath.algorithm.window_powering().