org.jscience.mathematics.algebraic.groups
Class CyclicGroup

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

public final class CyclicGroup
extends FiniteGroup
implements AbelianGroup

The CyclicGroup class represents the nth cyclic group. Elements are represented by the integers mod n.


Field Summary
 
Fields inherited from class org.jscience.mathematics.algebraic.groups.FiniteGroup
order
 
Constructor Summary
CyclicGroup(int n)
          Constructs a cyclic group.
 
Method Summary
 boolean equals(java.lang.Object o)
          Returns true if this group is isomorphic to another.
 org.jscience.mathematics.algebraic.groups.CyclicGroup.Member getElement(int i)
          Returns an element from the group.
 Group.Member[] getElements()
          Returns the elements of this group.
 Monoid.Member identity()
          Returns the identity element.
 boolean isIdentity(Monoid.Member g)
          Returns true if the member is the identity element of this group.
 boolean isInverse(Group.Member a, Group.Member b)
          Returns true if one member is the inverse of the other.
 boolean isNegative(AbelianGroup.Member a, AbelianGroup.Member b)
          Returns true if one member is the negative (inverse) of the other.
 boolean isZero(AbelianGroup.Member g)
          Returns true if the member is the identity element of this group.
 java.lang.String toString()
           
 AbelianGroup.Member zero()
          Returns the identity element.
 
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

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

toString

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

getElement

public org.jscience.mathematics.algebraic.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:
getElements in class FiniteGroup

zero

public AbelianGroup.Member zero()
Returns the identity element.

Specified by:
zero in interface AbelianGroup
Returns:
DOCUMENT ME!

isZero

public boolean isZero(AbelianGroup.Member g)
Returns true if the member is the identity element of this group.

Specified by:
isZero in interface AbelianGroup
Parameters:
g - a group member
Returns:
DOCUMENT ME!

isNegative

public boolean isNegative(AbelianGroup.Member a,
                          AbelianGroup.Member b)
Returns true if one member is the negative (inverse) of the other.

Specified by:
isNegative in interface AbelianGroup
Parameters:
a - a group member
b - a group member
Returns:
DOCUMENT ME!

identity

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

Specified by:
identity in interface Monoid
Returns:
DOCUMENT ME!

isIdentity

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

Specified by:
isIdentity in interface Monoid
Parameters:
g - a group member
Returns:
DOCUMENT ME!

isInverse

public boolean isInverse(Group.Member a,
                         Group.Member b)
Returns true if one member is the inverse of the other.

Specified by:
isInverse in interface Group
Parameters:
a - a group member
b - a group member
Returns:
DOCUMENT ME!