JSci.maths.matrices.AbstractIntegerMatrix 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!
/* AUTO-GENERATED */
package JSci.maths.matrices;
import JSci.GlobalSettings;
import JSci.maths.ExtraMath;
import JSci.maths.Mapping;
import JSci.maths.DimensionException;
import JSci.maths.vectors.AbstractIntegerVector;
import JSci.maths.vectors.IntegerVector;
import JSci.maths.groups.AbelianGroup;
import JSci.maths.algebras.*;
import JSci.maths.fields.*;
/**
* The AbstractIntegerMatrix class provides an object for encapsulating integer matrices.
* @version 2.2
* @author Mark Hale
*/
public abstract class AbstractIntegerMatrix extends Matrix {
/**
* Constructs a matrix.
*/
protected AbstractIntegerMatrix(final int rows,final int cols) {
super(rows, cols);
}
/**
* Compares two ${nativeTyp} matrices for equality.
* @param obj a int matrix
*/
public final boolean equals(Object obj) {
if(obj instanceof AbstractIntegerMatrix) {
return equals((AbstractIntegerMatrix)obj);
} else {
return false;
}
}
/**
* Compares two ${nativeTyp} matrices for equality.
* Two matrices are considered to be equal if the Frobenius norm of their difference is within the zero tolerance.
* @param m a int matrix
*/
public final boolean equals(AbstractIntegerMatrix m) {
return equals(m, GlobalSettings.ZERO_TOL);
}
public boolean equals(AbstractIntegerMatrix m, double tol) {
if(m != null && numRows == m.rows() && numCols == m.columns()) {
int sumSqr = 0;
for(int i=0;i-norm.
* @author Taber Smith
*/
public int infNorm() {
int result=0,tmpResult;
for(int i=0;iresult)
result=tmpResult;
}
return result;
}
/**
* Returns the Frobenius or Hilbert-Schmidt (l2) norm.
* @jsci.planetmath FrobeniusMatrixNorm
*/
public double frobeniusNorm() {
double result=0.0;
for(int j,i=0;i