PSVsect_o Sieve pattern for intersection of integer generators with offsets and point output
Part of: miSCellaneous
Inherits from: Psieve
Pattern for intersection of integer generators with offsets and point output. Corresponds to Sieve's method 'sect_o'.
See also: Sieves and Psieve patterns, Sieve, PSVunion, PSVunion_i, PSVunion_o, PSVunion_oi, PSVsect, PSVsect_i, PSVsect_oi, PSVsymdif, PSVsymdif_i, PSVsymdif_o, PSVsymdif_oi, PSVdif, PSVdif_i, PSVdif_o, PSVdif_oi, PSVop, PSVop_i, PSVop_o, PSVop_oi
Creation / Class Methods
*new (genList, maxLength, limit)
Creates a new PSVsect_o object.
genList - An array of generators and corresponding offsets.
Allowed generators: Integers, Streams or Patterns producing intervals or Sieves itself.
Integers and Stream/Pattern output must be strictly positive.
Integers as generators produce zero and its positive multiples.
Offsets must be integers.
maxLength - Integer. Maximum number of items, which the stream will return.
Defaults to inf.
limit - Integer. Limit up to which integers can be returned by the stream.
If no limit is passed, returned integers might go up to default limit 65536.
Examples
p = PSVsect_o([3, 1, 5, -2], 10)
p.asStream.nextN(15)
a = Sieve(4, 200)
q = PSVsect_o([a, 90, 10, 100], 20)
q.asStream.all
r = PSVunion_o([a, 50, 10, -100], limit: 100)
r.asStream.all