JSci.maths.matrices.RingMatrix Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsci Show documentation
Show all versions of jsci Show documentation
JSci is a set of open source Java packages. The aim is to encapsulate scientific methods/principles in the most natural way possible. As such they should greatly aid the development of scientific based software.
It offers: abstract math interfaces, linear algebra (support for various matrix and vector types), statistics (including probability distributions), wavelets, newtonian mechanics, chart/graph components (AWT and Swing), MathML DOM implementation, ...
Note: some packages, like javax.comm, for the astro and instruments package aren't listed as dependencies (not available).
The newest version!
package JSci.maths.matrices;
import JSci.GlobalSettings;
import JSci.maths.groups.AbelianGroup;
import JSci.maths.algebras.*;
import JSci.maths.fields.*;
/**
* The RingMatrix class provides an object for encapsulating matrices over an arbitrary ring.
* @version 1.1
* @author Mark Hale
*/
public class RingMatrix extends Matrix {
/**
* Array containing the elements of the matrix.
*/
protected Ring.Member matrix[][];
/**
* Constructs a matrix.
*/
protected RingMatrix(final int rows, final int cols) {
super(rows,cols);
}
/**
* Constructs a matrix by wrapping an array.
* @param array an assigned value
*/
public RingMatrix(final Ring.Member array[][]) {
this(array.length,array[0].length);
matrix=array;
}
/**
* Compares two matrices for equality.
* @param m a matrix
*/
public boolean equals(Object m) {
if(m!=null && (m instanceof RingMatrix) &&
numRows==((RingMatrix)m).rows() && numCols==((RingMatrix)m).columns()) {
final RingMatrix rm=(RingMatrix)m;
for(int j,i=0;i=0 && i=0 && j=0 && i=0 && j