JSci.maths.matrices.ComplexMatrix 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.Complex;
import JSci.maths.ComplexMapping;
import JSci.maths.DimensionException;
import JSci.maths.vectors.AbstractComplexVector;
import JSci.maths.vectors.ComplexVector;
import JSci.maths.groups.AbelianGroup;
import JSci.maths.algebras.*;
import JSci.maths.fields.*;
/**
* The ComplexMatrix class provides an object for encapsulating matrices containing complex numbers.
* @version 2.2
* @author Mark Hale
*/
public class ComplexMatrix extends AbstractComplexMatrix {
/**
* Arrays containing the elements of the matrix.
*/
protected double matrixRe[][],matrixIm[][];
/**
* Constructs an empty matrix.
* @param rows the number of rows
* @param cols the number of columns
*/
public ComplexMatrix(final int rows,final int cols) {
super(rows,cols);
matrixRe=new double[rows][cols];
matrixIm=new double[rows][cols];
}
/**
* Constructs a matrix by wrapping two arrays.
* @param arrayRe an array of real values
* @param arrayIm an array of imaginary values
*/
public ComplexMatrix(final double arrayRe[][],final double arrayIm[][]) {
this(arrayRe.length,arrayRe[0].length);
matrixRe=arrayRe;
matrixIm=arrayIm;
}
/**
* Constructs a matrix from an array.
* @param array an assigned value
*/
public ComplexMatrix(final Complex array[][]) {
this(array.length,array[0].length);
for(int j,i=0;i=0 && i=0 && j=0 && i=0 && j=0 && i=0 && j=0 && i=0 && j=0 && i=0 && j-norm.
* @author Taber Smith
*/
public double infNorm() {
double result=0.0,tmpResult;
for(int i=0;iresult)
result=tmpResult;
}
return result;
}
/**
* Returns the Frobenius or Hilbert-Schmidt (l2) norm.
* @jsci.planetmath FrobeniusMatrixNorm
* @author Taber Smith
*/
public double frobeniusNorm() {
double result=0.0;
for(int j,i=0;i