The ring module is a module for rings.
There are the following base classes defined.
These classes are used to make a derived classes, and thus have no direct instances. There are also classes for elements of them:
They also have no direct instances.
There are some properties of commutative rings, algorithms should be chosen accordingly. To express such properties, there is a class CommutativeRingProperties. CommutativeRingProperties class treats
Euclidean(Euclidean domain),
PID(Principal Ideal Domain),
UFD(Unique Factorization Domain),
Noetherian(Noetherian ring (domain)),
field(Field)
If one specify a stronger property, then it implies to weaker properties:
>>> prop = CommutativeRingProperties() >>> prop.setIspid(True) >>> prop.ispid() True >>> prop.isufd() True
Methods like ispid return three kinds of values;True, False, None. The meanings of True and False are obvious, but None means unknown here. When it is used like:
if prop.ispid(): do_something()
None means same as False i.e. negative, and do_something is done if the result is clearly True. We don't recommend but it is possible to write a code for each of False and None.
The class represents an ideal of a commutative ring is Ideal*1*2.
Currently, the ideal should be represented by its generator elements. There are, therefore, irrepresentable ideals for non-Noetherian commutative rings. Moreover, ideals defined other than their generators cannot be instanciated without explicit generators.
The class is also used as a base class.
A class defines a ring of residue classes by a ring and an ideal is ResidueClassRing. Its elements are ResidueClass.
Return a ring to which 'obj' belongs.
Mainly for python built-in objects such as int or float.
(new in 0.4.1)