jsci.maths.groups
Class DihedralGroup
- java.lang.Object
-
- jsci.maths.groups.FiniteGroup
-
- jsci.maths.groups.DihedralGroup
-
public final class DihedralGroup extends FiniteGroup
The DihedralGroup class represents the nth dihedral group. Elements are represented by rotations and reflections.
-
-
Constructor Summary
Constructors Constructor and Description DihedralGroup(int n)Constructs a dihedral 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.Group.Member[]getElements()Returns the elements of this group.inthashCode()Monoid.Memberidentity()Returns the identity element.booleanisIdentity(Monoid.Member a)Returns true if the element is the identity element of this group.booleanisInverse(Group.Member a, Group.Member b)Returns true if one element is the inverse of the other.java.lang.StringtoString()-
Methods inherited from class jsci.maths.groups.FiniteGroup
order
-
-
-
-
Constructor Detail
-
DihedralGroup
public DihedralGroup(int n)
Constructs a dihedral group.- Parameters:
n- the number of rotations/reflections
-
-
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
-
getElements
public Group.Member[] getElements()
Returns the elements of this group.- Specified by:
getElementsin classFiniteGroup
-
identity
public Monoid.Member identity()
Returns the identity element.
-
isIdentity
public boolean isIdentity(Monoid.Member a)
Returns true if the element is the identity element of this group.- Parameters:
a- a group element
-
isInverse
public boolean isInverse(Group.Member a, Group.Member b)
Returns true if one element is the inverse of the other.- Parameters:
a- a group elementb- a group element
-
-
DMelt 3.0 © DataMelt by jWork.ORG