jsci.maths.groups
Class CyclicGroup
- java.lang.Object
-
- jsci.maths.groups.FiniteGroup
-
- jsci.maths.groups.CyclicGroup
-
- All Implemented Interfaces:
- AbelianGroup, Group, Monoid
public final class CyclicGroup extends FiniteGroup implements AbelianGroup
The CyclicGroup class represents the nth cyclic group. Elements are represented by the integers mod n.
-
-
Constructor Summary
Constructors Constructor and Description CyclicGroup(int n)Constructs a cyclic group.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object o)Returns true if this group is isomorphic to another.jsci.maths.groups.CyclicGroup.MembergetElement(int i)Returns an element from the group.Group.Member[]getElements()Returns the elements of this group.inthashCode()Monoid.Memberidentity()Returns the identity element.booleanisIdentity(Monoid.Member g)Returns true if the member is the identity element of this group.booleanisInverse(Group.Member a, Group.Member b)Returns true if one member is the inverse of the other.booleanisNegative(AbelianGroup.Member a, AbelianGroup.Member b)Returns true if one member is the negative (inverse) of the other.booleanisZero(AbelianGroup.Member g)Returns true if the member is the identity element of this group.java.lang.StringtoString()AbelianGroup.Memberzero()Returns the identity element.-
Methods inherited from class jsci.maths.groups.FiniteGroup
order
-
-
-
-
Constructor Detail
-
CyclicGroup
public CyclicGroup(int n)
Constructs a cyclic group.- Parameters:
n- the order of the group
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
Returns true if this group is isomorphic to another.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getElement
public jsci.maths.groups.CyclicGroup.Member getElement(int i)
Returns an element from the group.- Parameters:
i- the integer representing the element
-
getElements
public Group.Member[] getElements()
Returns the elements of this group.- Specified by:
getElementsin classFiniteGroup
-
zero
public AbelianGroup.Member zero()
Returns the identity element.- Specified by:
zeroin interfaceAbelianGroup
-
isZero
public boolean isZero(AbelianGroup.Member g)
Returns true if the member is the identity element of this group.- Specified by:
isZeroin interfaceAbelianGroup- Parameters:
g- a group member
-
isNegative
public boolean isNegative(AbelianGroup.Member a, AbelianGroup.Member b)
Returns true if one member is the negative (inverse) of the other.- Specified by:
isNegativein interfaceAbelianGroup- Parameters:
a- a group memberb- a group member
-
identity
public Monoid.Member identity()
Returns the identity element.
-
isIdentity
public boolean isIdentity(Monoid.Member g)
Returns true if the member is the identity element of this group.- Specified by:
isIdentityin interfaceMonoid- Parameters:
g- a group member
-
isInverse
public boolean isInverse(Group.Member a, Group.Member b)
Returns true if one member is the inverse of the other.
-
-
DMelt 3.0 © DataMelt by jWork.ORG