|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcayleytable.groupMatrix
public class groupMatrix
Class used as a storage device for all groups. Stores the Cayley table as an ArrayList of ArrayList of Strings where each row in the table is one of the ArrayList of Strings and each cell is represented by one String. The class also has analysis functions to determine if the Cayley Table has group characteristics such as an Identity element, inverse for each element, and associativity.
Field Summary | |
---|---|
private java.util.ArrayList<java.util.ArrayList<java.lang.String>> |
matrixRows
ArrayList of ArrayList of Strings used for storing the Cayley Table where each row in the table is one of the ArrayList of Strings and each cell is represented by one String. |
private int |
order
Order of the group being stored refers to the number of rows and columns in the Cayley Table. |
Constructor Summary | |
---|---|
groupMatrix()
Creates a new instance of groupMatrix with an empty Cayley Table (order 0). |
|
groupMatrix(int n)
Creates a new instance of groupMatrix with a Cayley Table of a specific given order. |
Method Summary | |
---|---|
private boolean |
checkArray(int[] values,
int size)
Method to check if a given array has a unique set of elements that never repeat. |
boolean |
checkComplete()
Method to determine if all of the cells in the Cayley Table have a value. |
boolean |
checkForIdentity()
Method to determine if the Cayley Table contains an identity element |
boolean |
checkForInverse()
Method to determine if all elements in the Cayley Table have an inverse element. |
boolean |
checkForUniquenessInRowAndCol()
Method to determine if all rows and columns in the Cayley Table have unique elements for each cell in the row or column. |
boolean |
checkIfAssociative()
Method to determine if all operations in the Cayley Table are associative. |
boolean |
checkIfCommutative()
Method to determine if all operations in the Cayley Table are commutative. |
int |
findIdentity()
Method to determine the identity element of the group stored in the Cayley Table. |
int |
findInverse(int element)
Method to return inverse of an element in the group |
int |
getEntry(int row,
int col)
Method to get the value of a specific cell in the Cayley Table. |
int |
getOrder()
Method to return value of order in this instance of groupMatrix |
boolean |
isEqual(groupMatrix check)
Method to determine if another groupMatrix object is equal to the
current group stored in this groupMatrix instance. |
void |
resetGroup(groupMatrix reset)
Method to update the matrixRows and order of
the current group with the values from a new groupMatrix object. |
void |
resetSize(int size)
Method to reset the groupMatrix object to an Cayley Table of a given order filled with all -1 values. |
void |
setEntry(int row,
int col,
int value)
Method to set the value of a specific cell in the Cayley Table to a given value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.ArrayList<java.util.ArrayList<java.lang.String>> matrixRows
private int order
Constructor Detail |
---|
public groupMatrix()
public groupMatrix(int n)
n
- Order of group to create.Method Detail |
---|
public void resetGroup(groupMatrix reset)
matrixRows
and order
of
the current group with the values from a new groupMatrix
object.
reset
- groupMatrix
object that contains new group to update the current group.public boolean isEqual(groupMatrix check)
groupMatrix
object is equal to the
current group stored in this groupMatrix
instance.
check
- groupMatrix
object to compare to this instance.
public void resetSize(int size)
size
- New order of the Cayley Table.public void setEntry(int row, int col, int value)
row
- integer containing row of the cell to change in the Cayley Tablecol
- integer containing column of the cell to change in the Cayley Tablevalue
- integer containing new value of the cell stored in the Cayley Tablepublic int getEntry(int row, int col)
row
- integer containing row of the cell to retrieve in the Cayley Tablecol
- integer containing column of the cell to retrieve in the Cayley Table
public boolean checkComplete()
public int getOrder()
order
in this instance of groupMatrix
order
of the Cayley Table.public int findIdentity()
public int findInverse(int element)
element
- integer element in group of which to find inverse
public boolean checkForIdentity()
public boolean checkForInverse()
public boolean checkIfAssociative()
public boolean checkIfCommutative()
public boolean checkForUniquenessInRowAndCol()
private boolean checkArray(int[] values, int size)
values
- Array of integers that is being checked.size
- integer size of array being checked
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |