JSci.maths.matrices.IntegerMatrix 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.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 IntegerMatrix class provides an object for encapsulating integer matrices.
* @version 2.2
* @author Mark Hale
*/
public class IntegerMatrix extends AbstractIntegerMatrix {
/**
* Array containing the elements of the matrix.
*/
protected final int matrix[][];
/**
* Constructs a matrix by wrapping an array.
* @param array an assigned value
*/
public IntegerMatrix(final int array[][]) {
super(array.length, array[0].length);
matrix=array;
}
/**
* Constructs an empty matrix.
*/
public IntegerMatrix(final int rows,final int cols) {
this(new int[rows][cols]);
}
/**
* Constructs a matrix from an array of vectors (columns).
* @param array an assigned value
*/
public IntegerMatrix(final AbstractIntegerVector array[]) {
this(array[0].dimension(), array.length);
for(int i=0;i=0 && i=0 && j=0 && i=0 && j-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