|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectMatrixModp
Square matrices with byte entries modulo a
rational prime p. All
operations returning mod p values (entries of the matrix,
entries of the inverse matrix, etc.) will return least positive
residues. The constructors convert all matrix entries to their
least positive residues. If p is negative, it's silently
made positive.
It follows that this implementation requires 2 ≤ p ≤ 127. For example, if you try to set p to 131, it will be wrapped to -125, which will be rejected because its absolute value is not prime.
Operations on two MatrixModps will throw
IllegalArgumentException if the degrees or the primes
don't match.
| Constructor Summary | |
MatrixModp(byte[][] x,
byte p)
Builds a matrix with entries taken from the square array x mod p. |
|
MatrixModp(int n,
byte[] x,
byte p)
Inspired by APL's ravel function ρ (rho),
this constructor returns the n by n matrix whose
entries, in row major order, come from x. |
|
| Method Summary | |
boolean |
commutesWith(GroupElt y)
Whether this and y commute. |
int |
compareTo(Object o)
Compares matrices lexicographically, taking the entries as least positive residues mod p in row-major order; however, a matrix in Jordan canonical form always comes before one that's not. |
GroupElt |
conjugate(GroupElt y)
Returns y * this * y^(-1). |
GroupElt |
conjugateYinvXY(GroupElt y)
Returns y^(-1) * this * y. |
byte |
det()
Returns the determinant. |
static byte |
det(byte[][] a,
byte p)
Returns the determinant of a mod p.
|
boolean |
equals(Object o)
Tests for equality in the mathematical sense, not by ==. |
byte |
getEntry(int i,
int j)
Returns the (i,j)-th entry. |
GroupElt |
getIdentity()
Returns the identity element of the same class as this. |
int |
getOrder(Group G)
Returns the order of this element. |
byte |
getP()
Returns the prime p. |
int |
getSize()
If this matrix is n-by-n, returns n. |
int |
hashCode()
Must be consistent with equals(java.lang.Object). |
GroupElt |
inverse()
Returns the inverse element for this. |
boolean |
isDiagonal()
|
boolean |
isIdentity()
Tests whether this is the identity element among GroupElts of its class. |
boolean |
isJordanCanonical()
Whether this is in Jordan canonical form. |
boolean |
isPermShaped()
Whether the matrix has exactly one non-zero entry in each row and in each column. |
boolean |
isSignedPerm()
Whether the matrix has exactly one non-zero entry in each row and in each column, and each non-zero entry is either 1 or -1. |
boolean |
isUnipotentUpperTriangular()
Whether the matrix is upper-triangular with 1's on the diagonal. |
boolean |
isUpperTriangular()
|
static void |
main(String[] args)
For testing. |
GroupElt |
mult(GroupElt y)
Returns the product this * y. |
GroupElt |
power(int i)
Returns the i-th power of this element. |
String |
toString()
For example, prints a 2 by 2 matrix as [a b; c d]. |
| Methods inherited from class Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public MatrixModp(byte[][] x,
byte p)
IllegalArgumentException - If x is not square
or p is not prime.
public MatrixModp(int n,
byte[] x,
byte p)
ravel function ρ (rho),
this constructor returns the n by n matrix whose
entries, in row major order, come from x. If
x is too short, we cycle through it from the
beginning as often as necessary. x must have
length at least 1. Entries are converted to their least
positive residues mod p.
| Method Detail |
public byte det()
public static byte det(byte[][] a,
byte p)
a mod p.
Doesn't change a.
public GroupElt mult(GroupElt y)
GroupEltthis * y. The operation must
be associative.
mult in interface GroupEltpublic GroupElt inverse()
GroupEltthis.
inverse in interface GroupEltpublic boolean equals(Object o)
GroupElt==.
equals in interface GroupEltpublic final int hashCode()
GroupEltGroupElt.equals(java.lang.Object).
hashCode in interface GroupEltpublic boolean isIdentity()
GroupEltGroupElts of its class.
isIdentity in interface GroupEltpublic GroupElt getIdentity()
GroupEltthis.
getIdentity in interface GroupEltpublic GroupElt conjugate(GroupElt y)
GroupElty * this * y^(-1). Compare GroupElt.conjugateYinvXY(repthy.GroupElt).
conjugate in interface GroupEltpublic GroupElt conjugateYinvXY(GroupElt y)
GroupElty^(-1) * this * y. Compare GroupElt.conjugate(repthy.GroupElt).
conjugateYinvXY in interface GroupEltpublic boolean commutesWith(GroupElt y)
GroupEltthis and y commute.
commutesWith in interface GroupEltpublic int getOrder(Group G)
GroupEltGroup.getEltOrder(GroupElt, Group). However,
if code needs to compute the order for many elements of a fixed
group, Group.getEltOrder(GroupElt, int, int[][]) may be
more efficient.
getOrder in interface GroupEltG - A group containing this element. It can be null, but
if it's not, we can use a more efficient algorithm.public GroupElt power(int i)
GroupEltGroup.power(repthy.GroupElt, int), which uses an efficient
squaring algorithm.
power in interface GroupEltpublic final int getSize()
public final byte getP()
public final byte getEntry(int i,
int j)
public String toString()
[a b; c d].
public int compareTo(Object o)
compareTo in interface Comparablepublic boolean isJordanCanonical()
this is in Jordan canonical form.
public boolean isDiagonal()
public boolean isSignedPerm()
public boolean isPermShaped()
public boolean isUpperTriangular()
public boolean isUnipotentUpperTriangular()
public static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||