All Downloads are FREE. Search and download functionalities are using the official Maven repository.

JSci.maths.matrices.AbstractComplexMatrix.vm Maven / Gradle / Ivy

Go to download

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.MathDouble;
import JSci.maths.MathInteger;
import JSci.maths.${classType};
import JSci.maths.${classType}Mapping;
import JSci.maths.DimensionException;
import JSci.maths.vectors.Abstract${classType}Vector;
import JSci.maths.vectors.${classType}Vector;
import JSci.maths.groups.AbelianGroup;
import JSci.maths.algebras.*;
import JSci.maths.fields.*;

/**
* The Abstract${classType}Matrix class provides an object for encapsulating matrices containing complex numbers.
* @version 2.2
* @author Mark Hale
*/
public abstract class Abstract${classType}Matrix extends Matrix {
        /**
        * Constructs a matrix.
        */
        protected Abstract${classType}Matrix(final int rows,final int cols) {
                super(rows,cols);
        }
        /**
        * Compares two complex matrices for equality.
        * @param obj a complex matrix
        */
        public final boolean equals(Object obj) {
                if(obj instanceof Abstract${classType}Matrix) {
                        return equals((Abstract${classType}Matrix)obj);
                } else {
                        return false;
                }
        }
        /**
        * Compares two complex 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 complex matrix
        */
        public final boolean equals(Abstract${classType}Matrix m) {
		return equals(m, GlobalSettings.ZERO_TOL);
        }
	public boolean equals(Abstract${classType}Matrix m, double tol) {
                if(m != null && numRows == m.rows() && numCols == m.columns()) {
			double sumSqr = 0.0;
                        for(int i=0;iinfinity-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 i=0;i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy