|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.mathematics.algebraic.AbstractHypermatrix
org.jscience.mathematics.algebraic.AbstractMatrix
org.jscience.mathematics.algebraic.matrices.RingMatrix
public class RingMatrix
The RingMatrix class provides an object for encapsulating matrices over an arbitrary ring.
| Constructor Summary | |
|---|---|
RingMatrix(int numRows,
int numCols)
Constructs an empty matrix. |
|
RingMatrix(Ring.Member[][] array)
Constructs a matrix by wrapping an array. |
|
RingMatrix(RingMatrix mat)
Copy constructor. |
|
| Method Summary | |
|---|---|
AbelianGroup.Member |
add(AbelianGroup.Member m)
Returns the addition of this matrix and another. |
RingMatrix |
add(RingMatrix m)
Returns the addition of this matrix and another. |
java.lang.Object |
clone()
Clone matrix into a new matrix. |
RingMatrix |
directSum(RingMatrix m)
Returns the direct sum of this matrix and another. |
boolean |
equals(java.lang.Object m)
Compares two matrices for equality. |
RingVector |
getColumn(int j)
Returns the ith column. |
java.lang.Number |
getElement(int i,
int j)
Returns an element of the matrix. |
Ring.Member[][] |
getElements()
Returns a projection of this matrix. |
Ring.Member |
getPrimitiveElement(int i,
int j)
Returns an element of the matrix (fastest method). |
RingVector |
getRow(int i)
Returns the ith row. |
RingMatrix |
mapElements(NumberMapping f)
Applies a function on all the matrix elements. |
Ring.Member |
multiply(Ring.Member m)
Returns the multiplication of this matrix and another. |
RingMatrix |
multiply(RingMatrix m)
Returns the multiplication of this matrix and another. |
AbelianGroup.Member |
negate()
Returns the negative of this matrix. |
VectorSpace.Member |
scalarDivide(Field.Member x)
Returns the division of this matrix by a scalar. |
Module.Member |
scalarMultiply(Ring.Member r)
Returns the multiplication of this matrix by a scalar. |
void |
setAllElements(Ring.Member m)
Sets the value of all elements of the matrix. |
void |
setColumn(int j,
RingVector v)
Sets the ith column. |
void |
setElement(int i,
int j,
Ring.Member r)
Sets the value of an element of the matrix. |
void |
setRow(int i,
RingVector v)
Sets the ith row. |
AbelianGroup.Member |
subtract(AbelianGroup.Member m)
Returns the subtraction of this matrix and another. |
RingMatrix |
subtract(RingMatrix m)
Returns the subtraction of this matrix and another. |
RingMatrix |
tensorProduct(RingMatrix m)
Returns the tensor product of this matrix and another. |
java.lang.Object |
toArray()
Returns a flat projection of this matrix, given "row first". |
Ring.Member[][] |
toPrimitiveArray()
Projects the matrix to an array. |
java.lang.String |
toString()
Returns a string representing this matrix. |
Matrix |
transpose()
Returns the transpose of this matrix. |
| Methods inherited from class org.jscience.mathematics.algebraic.AbstractMatrix |
|---|
getElement, getInvalidElementMsg, numColumns, numRows, print, print, print, print, toArray |
| Methods inherited from class org.jscience.mathematics.algebraic.AbstractHypermatrix |
|---|
getDimensions, numDimensions, numElements, numElements, toArray |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jscience.mathematics.algebraic.Hypermatrix |
|---|
getDimensions, numDimensions, numElements, numElements, toArray |
| Constructor Detail |
|---|
public RingMatrix(int numRows,
int numCols)
numRows - the number of rowsnumCols - the number of columnspublic RingMatrix(Ring.Member[][] array)
array - an assigned valuepublic RingMatrix(RingMatrix mat)
mat - an assigned value| Method Detail |
|---|
public boolean equals(java.lang.Object m)
equals in class java.lang.Objectm - a matrix
public java.lang.String toString()
toString in class java.lang.Objectpublic Ring.Member[][] getElements()
public java.lang.Object toArray()
toArray in interface HypermatrixtoArray in class AbstractMatrix
public java.lang.Number getElement(int i,
int j)
getElement in interface Matrixi - row index of the elementj - column index of the element
public Ring.Member getPrimitiveElement(int i,
int j)
i - row index of the elementj - column index of the element
IllegalDimensionException - If attempting to access an invalid
element.public RingVector getRow(int i)
getRow in interface Matrixi - DOCUMENT ME!
IllegalDimensionException - DOCUMENT ME!public RingVector getColumn(int j)
getColumn in interface Matrixj - DOCUMENT ME!
IllegalDimensionException - DOCUMENT ME!
public void setRow(int i,
RingVector v)
i - DOCUMENT ME!v - DOCUMENT ME!
IllegalDimensionException - DOCUMENT ME!
public void setColumn(int j,
RingVector v)
j - DOCUMENT ME!v - DOCUMENT ME!
IllegalDimensionException - DOCUMENT ME!
public void setElement(int i,
int j,
Ring.Member r)
throws IllegalDimensionException
i - row index of the elementj - column index of the elementr - a ring element
IllegalDimensionException - If attempting to access an invalid
element.public void setAllElements(Ring.Member m)
m - a ring elementpublic AbelianGroup.Member negate()
negate in interface AbelianGroup.Memberpublic AbelianGroup.Member add(AbelianGroup.Member m)
add in interface AbelianGroup.Memberm - DOCUMENT ME!
java.lang.IllegalArgumentException - DOCUMENT ME!
public RingMatrix add(RingMatrix m)
throws IllegalDimensionException
m - a matrix
IllegalDimensionException - If the matrices are different sizes.public AbelianGroup.Member subtract(AbelianGroup.Member m)
subtract in interface AbelianGroup.Memberm - DOCUMENT ME!
java.lang.IllegalArgumentException - DOCUMENT ME!
public RingMatrix subtract(RingMatrix m)
throws IllegalDimensionException
m - a matrix
IllegalDimensionException - If the matrices are different sizes.public Module.Member scalarMultiply(Ring.Member r)
scalarMultiply in interface Module.Memberr - a ring element.
public VectorSpace.Member scalarDivide(Field.Member x)
scalarDivide in interface VectorSpace.Memberx - a field element.
public Ring.Member multiply(Ring.Member m)
multiply in interface Ring.Memberm - DOCUMENT ME!
java.lang.IllegalArgumentException - DOCUMENT ME!
public RingMatrix multiply(RingMatrix m)
throws IllegalDimensionException
m - a matrix
IllegalDimensionException - If the matrices are incompatible.public RingMatrix directSum(RingMatrix m)
m - DOCUMENT ME!
public RingMatrix tensorProduct(RingMatrix m)
m - DOCUMENT ME!
public Matrix transpose()
transpose in interface Matrixpublic RingMatrix mapElements(NumberMapping f)
f - a user-defined function
java.lang.IllegalArgumentException - DOCUMENT ME!public java.lang.Object clone()
clone in class java.lang.Objectpublic Ring.Member[][] toPrimitiveArray()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||