org.jscience.mathematics.algebraic.groups
Class DihedralGroup

java.lang.Object
  extended by org.jscience.mathematics.algebraic.groups.FiniteGroup
      extended by org.jscience.mathematics.algebraic.groups.DihedralGroup
All Implemented Interfaces:
Group, Magma, Monoid, Semigroup

public final class DihedralGroup
extends FiniteGroup

The DihedralGroup class represents the nth dihedral group. Elements are represented by rotations and reflections.


Field Summary
 
Fields inherited from class org.jscience.mathematics.algebraic.groups.FiniteGroup
order
 
Constructor Summary
DihedralGroup(int n)
          Constructs a dihedral group.
 
Method Summary
 boolean equals(java.lang.Object o)
          Returns true if this group is isomorphic to another.
 Group.Member[] getElements()
          Returns the elements of this group.
 Monoid.Member identity()
          Returns the identity element.
 boolean isIdentity(Monoid.Member a)
          Returns true if the element is the identity element of this group.
 boolean isInverse(Group.Member a, Group.Member b)
          Returns true if one element is the inverse of the other.
 java.lang.String toString()
           
 
Methods inherited from class org.jscience.mathematics.algebraic.groups.FiniteGroup
order
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getElements

public Group.Member[] getElements()
Returns the elements of this group.

Specified by:
getElements in class FiniteGroup

identity

public Monoid.Member identity()
Returns the identity element.

Returns:
DOCUMENT ME!

isIdentity

public boolean isIdentity(Monoid.Member a)
Returns true if the element is the identity element of this group.

Parameters:
a - a group element
Returns:
DOCUMENT ME!

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 element
b - a group element
Returns:
DOCUMENT ME!