Sieve:
Filter:
miSCellaneous_lib/Classes (extension) | Libraries > miSCellaneous > Sieves and Psieve Patterns | Streams-Patterns-Events > Sieves and Psieve Patterns

Sieve
ExtensionExtension

Container class for sieve lists

Description

Container for a list of ascending integers as 'points' or 'intervals'. For an introduction and more examples see Sieves_and_Psieve_patterns.

Class Methods

.newEmpty

Creates a new empty Sieve object.

.new

Creates a new Sieve object in mode 'points'.

Arguments:

gen

A generator. 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.

limit

An integer limit, which is included when reached. If no limit is passed, returned integers might go up to default limit 65536.

.new_i

Creates a new Sieve object in mode 'intervals'.

Arguments:

gen

A generator. 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.

limit

If no limit is passed, integer intervals might be collected up to default summation limit of 65536.

.new_o

Creates a new Sieve object in mode 'points' with offset.

Arguments:

gen

A generator. 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.

offset

An Integer.

limit

An integer limit, which is included when reached. If no limit is passed, returned integers might go up to default limit 65536.

.new_oi

Creates a new Sieve object in mode 'intervals' with offset.

Arguments:

gen

A generator. 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.

offset

An Integer.

limit

If no limit is passed, integer intervals might be collected up to default summation limit of 65536.

.union

Creates a new Sieve object in mode 'points', generated by the union of sets of integers.

Arguments:

... data

Generators and an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, returned integers might go up to default limit 65536.

.union_i

Creates a new Sieve object in mode 'intervals', generated by the union of sets of integers.

Arguments:

... data

Generators and an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, integer intervals might be collected up to default summation limit of 65536.

.union_o

Creates a new Sieve object in mode 'points' with offsets, generated by the union of sets of integers.

Arguments:

... data

Alternating generators and integer offsets plus an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, returned integers might go up to default limit 65536.

.union_oi

Creates a new Sieve object in mode 'intervals' with offsets, generated by the union of sets of integers.

Arguments:

... data

Alternating generators and integer offsets plus an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, integer intervals might be collected up to default summation limit of 65536.

.sect

Creates a new Sieve object in mode 'points', generated by the intersection of sets of integers.

Arguments:

... data

Generators and an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, returned integers might go up to default limit 65536.

.sect_i

Creates a new Sieve object in mode 'intervals', generated by the intersection of sets of integers.

Arguments:

... data

Generators and an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, integer intervals might be collected up to default summation limit of 65536.

.sect_o

Creates a new Sieve object in mode 'points' with offsets, generated by the intersection of sets of integers.

Arguments:

... data

Alternating generators and integer offsets plus an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, returned integers might go up to default limit 65536.

.sect_oi

Creates a new Sieve object in mode 'intervals' with offsets, generated by the intersection of sets of integers.

Arguments:

... data

Alternating generators and integer offsets plus an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, integer intervals might be collected up to default summation limit of 65536.

.symdif

Creates a new Sieve object in mode 'points', generated by the symmetrical difference of sets of integers.

Arguments:

... data

Generators and an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, returned integers might go up to default limit 65536.

.symdif_i

Creates a new Sieve object in mode 'intervals', generated by the symmetrical difference of sets of integers.

Arguments:

... data

Generators and an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, integer intervals might be collected up to default summation limit of 65536.

.symdif_o

Creates a new Sieve object in mode 'points' with offsets, generated by the symmetrical difference of sets integers.

Arguments:

... data

Alternating generators and integer offsets plus an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, returned integers might go up to default limit 65536.

.symdif_oi

Creates a new Sieve object in mode 'intervals' with offsets, generated by the symmetrical difference of sets of integers.

Arguments:

... data

Alternating generators and integer offsets plus an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, integer intervals might be collected up to default summation limit of 65536.

.dif

Creates a new Sieve object in mode 'points', generated by the difference of sets of integers.

Arguments:

... data

Generators and an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, returned integers might go up to default limit 65536.

.dif_i

Creates a new Sieve object in mode 'intervals', generated by the difference of sets of integers.

Arguments:

... data

Generators and an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, integer intervals might be collected up to default summation limit of 65536.

.dif_o

Creates a new Sieve object in mode 'points' with offsets, generated by the difference of sets of integers.

Arguments:

... data

Alternating generators and integer offsets plus an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, returned integers might go up to default limit 65536.

.dif_oi

Creates a new Sieve object in mode 'intervals' with offsets, generated by the difference of sets of integers.

Arguments:

... data

Alternating generators and integer offsets plus an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, integer intervals might be collected up to default summation limit of 65536.

.limit

Get the global limit of Class Sieve. Set the global limit of Class Sieve to an integer value.

Instance Methods

.union

Creates a new Sieve object in mode 'points', generated by the union of the receiver and sets of integers.

Arguments:

... data

Generators and an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, returned integers might go up to default limit 65536.

|

Binary operator for instance method union. Creates a new Sieve object in mode 'points', generated by the union of the receiver and a generator.

Arguments:

gen

A generator. 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. Returned integers might go up to default limit 65536.

.union_i

Creates a new Sieve object in mode 'intervals', generated by the union of the receiver and sets of integers.

Arguments:

... data

Generators and an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, integer intervals might be collected up to default summation limit of 65536.

|*

Binary operator for instance method union_i. Creates a new Sieve object in mode 'intervals', generated by the union of the receiver and a generator.

Arguments:

gen

A generator. 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. Integer intervals might be collected up to default summation limit of 65536.

.union_o

Creates a new Sieve object in mode 'points' with offsets, generated by the union of the receiver and sets of integers.

Arguments:

... data

Alternating integer offsets and generators plus an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, returned integers might go up to default limit 65536.

.union_oi

Creates a new Sieve object in mode 'intervals' with offsets, generated by the union of the receiver and sets of integers.

Arguments:

... data

Alternating integer offsets and generators plus an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, integer intervals might be collected up to default summation limit of 65536.

.sect

Creates a new Sieve object in mode 'points', generated by the intersection of the receiver and sets of integers.

Arguments:

... data

Generators and an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, returned integers might go up to default limit 65536.

&

Binary operator for instance method sect. Creates a new Sieve object in mode 'points', generated by the intersection of the receiver and a generator.

Arguments:

gen

A generator. 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. Returned integers might go up to default limit 65536.

.sect_i

Creates a new Sieve object in mode 'intervals', generated by the intersection of the receiver and sets of integers.

Arguments:

... data

Generators and an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, integer intervals might be collected up to default summation limit of 65536.

&*

Binary operator for instance method sect_i. Creates a new Sieve object in mode 'intervals', generated by the intersection of the receiver and a generator.

Arguments:

gen

A generator. 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. Integer intervals might be collected up to default summation limit of 65536.

.sect_o

Creates a new Sieve object in mode 'points' with offsets, generated by the intersection of the receiver and sets of integers.

Arguments:

... data

Alternating integer offsets and generators plus an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, returned integers might go up to default limit 65536.

.sect_oi

Creates a new Sieve object in mode 'intervals' with offsets, generated by the intersection of the receiver and sets of integers.

Arguments:

... data

Alternating integer offsets and generators plus an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, integer intervals might be collected up to default summation limit of 65536.

.symdif

Creates a new Sieve object in mode 'points', generated by the symmetrical difference of the receiver and sets of integers.

Arguments:

... data

Generators and an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, returned integers might go up to default limit 65536.

--

Binary operator for instance method symdif. Creates a new Sieve object in mode 'points', generated by the symmetric difference of the receiver and a generator.

Arguments:

gen

A generator. 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. Returned integers might go up to default limit 65536.

.symdif_i

Creates a new Sieve object in mode 'intervals', generated by the symmetrical difference of the receiver and sets of integers.

Arguments:

... data

Generators and an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, integer intervals might be collected up to default summation limit of 65536.

--*

Binary operator for instance method symdif_i. Creates a new Sieve object in mode 'intervals', generated by the symmetric difference of the receiver and a generator.

Arguments:

gen

A generator. 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. Integer intervals might be collected up to default summation limit of 65536.

.symdif_o

Creates a new Sieve object in mode 'points' with offsets, generated by the symmetrical difference of the receiver and sets of integers.

Arguments:

... data

Alternating integer offsets and generators plus an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, returned integers might go up to default limit 65536.

.symdif_oi

Creates a new Sieve object in mode 'intervals' with offsets, generated by the symmetrical difference of the receiver and sets of integers.

Arguments:

... data

Alternating integer offsets and generators plus an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, integer intervals are collected up to default summation limit of 65536.

.dif

Creates a new Sieve object in mode 'points', generated by the difference of the receiver and sets of integers.

Arguments:

... data

Generators and an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, returned integers might go up to default limit 65536.

-

Binary operator for instance method dif. Creates a new Sieve object in mode 'points', generated by the difference of the receiver and a generator.

Arguments:

gen

A generator. 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. Returned integers might go up to default limit 65536.

.dif_i

Creates a new Sieve object in mode 'intervals', generated by the difference of the receiver and sets of integers.

Arguments:

... data

Generators and an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, integer intervals might be collected up to default summation limit of 65536.

-*

Binary operator for instance method dif_i. Creates a new Sieve object in mode 'intervals', generated by the difference of the receiver and a generator.

Arguments:

gen

A generator. 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. Integer intervals might be collected up to default summation limit of 65536.

.dif_o

Creates a new Sieve object in mode 'points' with offsets, generated by the difference of the receiver and sets of integers.

Arguments:

... data

Alternating integer offsets and generators plus an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, returned integers might go up to default limit 65536.

.dif_oi

Creates a new Sieve object in mode 'intervals' with offsets, generated by the difference of the receiver and sets of integers.

Arguments:

... data

Alternating integer offsets and generators plus an optional integer limit, wrapped into a Ref, which is included when reached. 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. If no limit is passed, integer intervals might be collected up to default summation limit of 65536.

.plot

Plot the Sieve's list.

.size

The Sieve's list size.

.toPoints

Convert the Sieve to mode 'points' and set first point to offset.

.toIntervals

Convert the Sieve to mode 'intervals' and set offset to first point.

.shift

Shift the Sieve's list by addOffset.

Arguments:

addOffset

An Integer.

>>

Binary operator for instance method shift. Shift the Sieve's list by addOffset.

Arguments:

addOffset

An Integer.

.shiftTo

Shift the Sieve's list to targetOffset.

Arguments:

targetOffset

An Integer.

>>!

Binary operator for instance method shiftTo. Shift the Sieve's list to targetOffset.

Arguments:

targetOffset

An Integer.

.shiftToZero

Shift the Sieve's list to offset zero.

.weakCopy

Returns a new Sieve with same list object.

.copy

Returns a new Sieve with copied list object.

.copyWith

Takes over mode and offset from receiver and passes an appropriate SequenceableCollection.

Arguments:

seqCollection

SequenceableCollection.

withCheck

Boolean. Determines if seqCollection is checked according to mode. Defaults to true.

.copyApplyTo

Apply operator (Symbol of method or Function) to the Sieve's list and pass the result to a new Sieve with copied mode and offset.

Arguments:

operator

Symbol of method or Function.

withCheck

Boolean. Determines if result of the operation is checked according to mode. Defaults to true.

==

Equality check. Sieves of different mode are equal iff the lists resulting from conversion are equal.

Arguments:

that

Object to compare.

.segmentGreaterEqual

Returns a new Sieve of mode 'points' with Integers greater than or equal lo.

Arguments:

lo

Integer.

>=!

Binary operator for segmentGreaterEqual.

Arguments:

lo

Integer.

.segmentGreater

Returns a new Sieve of mode 'points' with Integers greater than lo.

Arguments:

lo

Integer.

>!

Binary operator for segmentGreater.

Arguments:

lo

Integer.

.segmentLessEqual

Returns a new Sieve of mode 'points' with Integers less than or equal hi.

Arguments:

hi

Integer.

<=!

Binary operator for segmentLessEqual.

Arguments:

hi

Integer.

.segmentLess

Returns a new Sieve of mode 'points' with Integers less than hi.

Arguments:

hi

Integer.

<!

Binary operator for segmentLess.

Arguments:

hi

Integer.

.segmentBetweenEqual

Returns a new Sieve of mode 'points' with Integers greater than or equal lo and less than or equal hi. This method is more efficient than applying segmentGreaterEqual plus segmentLessEqual.

Arguments:

lo

Integer.

hi

Integer.

<>=!

Binary operator for segmentBetweenEqual.

Arguments:

bounds

Must be an array with integers lo and hi.

.segmentBetween

Returns a new Sieve of mode 'points' with Integers greater than lo and less than hi. This method is more efficient than applying segmentGreater plus segmentLess.

Arguments:

lo

Integer.

hi

Integer.

<>!

Binary operator for segmentBetween.

Arguments:

bounds

Must be an array with integers lo and hi.

.checkSymmetricPeriods

Checks the list of a Sieve for symmetric periods and returns an array [periods, symmetries, completions], where periods is the clumped list of periods, symmetries a corresponding array of Symbols and completions a corresponding array of Booleans, indicating if periods are complete. periods can contains Symbols 'sym', 'asym', 'quasisym' and 'identic'. See Sieves_and_Psieve_patterns: 3b for a characterisation of these types. It is assumed that the receiver has a periodic list, changes between periodic and aperiodic segments are not detected, so also aperiodic prefixes of periodic lists.

.checkCharacteristicPeriod

Checks the first complete period based on the data returned by checkSymmetricPeriods. It returns an array [characteristicPeriod, offset, oddEven, symmetry], where characteristicPeriod denotes the first complete period, offset the index at which it starts in the receiver's list, oddEven one of the Symbols 'odd' and 'even' and symmetry the symmetry type as in checkSymmetricPeriods.

.plotCharacteristicPeriod

Plots the characteristic period returned by checkCharacteristicPeriod.

.list

Get the Sieve's list.

.offset

Get the Sieve's offset.

.mode

Get the Sieve's mode.

Examples

For conversion, segmentation and transformation examples see Sieves_and_Psieve_patterns.