/* AUTO-GENERATED */ package jsci.maths.matrices; import jsci.maths.DimensionException; import jsci.maths.ExtraMath; import jsci.maths.Mapping; import jsci.maths.MaximumIterationsExceededException; import jsci.maths.algebras.*; import jsci.maths.fields.*; import jsci.maths.groups.AbelianGroup; import jsci.maths.vectors.AbstractDoubleVector; import jsci.maths.vectors.DoubleVector; /** * The DoubleDiagonalMatrix class provides an object for encapsulating double diagonal matrices. * @version 2.2 * @author Mark Hale */ public class DoubleDiagonalMatrix extends AbstractDoubleSquareMatrix implements DiagonalMatrix { /** * Diagonal data. */ protected final double diag[]; /** * Constructs an empty matrix. * @param size the number of rows/columns */ public DoubleDiagonalMatrix(final int size) { this(new double[size]); } /** * Constructs a matrix from an array. * Any non-diagonal elements in the array are ignored. * @param array an assigned value * @exception MatrixDimensionException If the array is not square. */ public DoubleDiagonalMatrix(final double array[][]) { this(array.length); for(int i=0;i* to hold the pivot information (null if not interested). * The last array element will contain the parity. * @return an array with [0] containing the L-matrix * and [1] containing the U-matrix. */ public AbstractDoubleSquareMatrix[] luDecompose(int pivot[]) { if(LU!=null) { if(pivot!=null) System.arraycopy(LUpivot,0,pivot,0,pivot.length); return LU; } if(pivot==null) pivot=new int[numRows+1]; for(int i=0;i=0 && i =0 && j =0 && i =0 && j -norm. * @author Taber Smith */ public double infNorm() { double result=Math.abs(diag[0]); double tmpResult; for(int i=1;i
result) result=tmpResult; } return result; } /** * Returns the Frobenius (l2) norm. * @author Taber Smith */ public double frobeniusNorm() { double result=diag[0]; for(int i=1;i rows()+1
Ads help maintain this website.