sievetools.ResidueClassExpression

Inheritance diagram of abjad.tools.sievetools.ResidueClassExpression.ResidueClassExpression.ResidueClassExpression

class abjad.tools.sievetools.ResidueClassExpression.ResidueClassExpression.ResidueClassExpression(rcs, operator='or')[source]

Read-only Properties

ResidueClassExpression.operator[source]

Operator of residue class expression.

ResidueClassExpression.period[source]
ResidueClassExpression.rcs[source]

Residue classes of expression.

ResidueClassExpression.representative_boolean_train[source]
ResidueClassExpression.representative_congruent_bases[source]

Methods

ResidueClassExpression.get_boolean_train(*min_max)[source]

Returns a boolean train with 0s mapped to the integers that are not congruent bases of the RC expression and 1s mapped to those that are. The method takes one or two integer arguments. If only one is given, it is taken as the max range and min is assumed to be 0.

Example:

abjad> from abjad.tools.sievetools import ResidueClass as RC
abjad> e = RC(3, 0) | RC(2, 0)
abjad> e.get_boolean_train(6)
[1, 0, 1, 1, 1, 0]
abjad> e.get_congruent_bases(-6, 6)
[-6, -4, -3, -2, 0, 2, 3, 4, 6]

Return list.

ResidueClassExpression.get_congruent_bases(*min_max)[source]

Returns all the congruent bases of this RC expression within the given range. The method takes one or two integer arguments. If only one it given, it is taken as the max range and min is assumed to be 0.

Example:

abjad> from abjad.tools.sievetools import ResidueClass as RC
abjad> e = RC(3, 0) | RC(2, 0)
abjad> e.get_congruent_bases(6)
[0, 2, 3, 4, 6]
abjad> e.get_congruent_bases(-6, 6)
[-6, -4, -3, -2, 0, 2, 3, 4, 6]

Return list.

ResidueClassExpression.is_congruent_base(integer)[source]

Special Methods

ResidueClassExpression.__and__(arg)

Note

Inherited from sievetools._BaseResidueClass

ResidueClassExpression.__delattr__()

x.__delattr__(‘name’) <==> del x.name

Note

Inherited from __builtin__.object

ResidueClassExpression.__eq__(arg)

True when id(self) equals id(arg).

Return boolean.

Note

Inherited from abctools.AbjadObject

ResidueClassExpression.__ge__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

ResidueClassExpression.__gt__(arg)

Abjad objects by default do not implement this method.

Raise exception

Note

Inherited from abctools.AbjadObject

ResidueClassExpression.__hash__() <==> hash(x)

Note

Inherited from __builtin__.object

ResidueClassExpression.__le__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

ResidueClassExpression.__lt__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

ResidueClassExpression.__ne__(arg)

True when id(self) does not equal id(arg).

Return boolean.

Note

Inherited from abctools.AbjadObject

ResidueClassExpression.__or__(arg)

Note

Inherited from sievetools._BaseResidueClass

ResidueClassExpression.__repr__()[source]
ResidueClassExpression.__setattr__()

x.__setattr__(‘name’, value) <==> x.name = value

Note

Inherited from __builtin__.object

ResidueClassExpression.__str__() <==> str(x)

Note

Inherited from __builtin__.object

ResidueClassExpression.__xor__(arg)

Note

Inherited from sievetools._BaseResidueClass

Table Of Contents

This Page