PSVop_oi Sieve pattern for arbitrary set operations of integer generators with offsets and interval output
Part of: miSCellaneous
Inherits from: Psieve
Pattern for arbitrary set operations of integer generators with offsets and interval output.
See also: Sieves and Psieve patterns, Sieve, PSVunion, PSVunion_i, PSVunion_o, PSVunion_oi, PSVsect, PSVsect_i, PSVsect_o, PSVsect_oi, PSVsymdif, PSVsymdif_i, PSVsymdif_o, PSVsymdif_oi, PSVdif, PSVdif_i, PSVdif_o, PSVdif_oi, PSVop, PSVop_i, PSVop_o
Creation / Class Methods
*new (genList, op, difIndex, maxLength, limit)
Creates a new PSVop_oi 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 constant intervals.
Offsets must be integers.
op - One of the Symbols 'u', 's', 'sd', 'd' as abbreviations for set operations 'union',
'sect', 'symdif', 'dif' or a Pattern/Stream to produce such. Defaults to 'u'.
difIndex - Integer or a Pattern/Stream to produce such.
Determines the generator from which will be subtracted in case of operation 'dif'.
Defaults to 0.
maxLength - Integer. Maximum number of items, which the stream will return.
Defaults to inf.
limit - Integer. Limit up to which intervals can be returned by the stream.
If no limit is passed, integer intervals might be returned up to default summation limit of 65536.
Examples
// equivalent
x = PSVop_oi([3, 1, 5, 0], \sd)
y = PSVsymdif_oi([3, 1, 5, 0])
x.asStream.nextN(15)
y.asStream.nextN(15)
// sequencing of logical operations
p = PSVop_oi([3, 1, 2, 0], Pseq([\s, \u, \u], inf))
p.asStream.nextN(15)
// specify difference
q = PSVop_oi([3, 1, 5, 0], \d, 1)
q.asStream.nextN(10)
r = PSVop_oi([3, 1, 5, 0], \d, 0)
r.asStream.nextN(10)