Package org.lemsml.jlems.core.run
Class Matrix
- java.lang.Object
-
- org.lemsml.jlems.core.run.Matrix
-
- All Implemented Interfaces:
java.lang.Cloneable
public final class Matrix extends java.lang.Object implements java.lang.Cloneable
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(double d)voidadd(Matrix m)static Matrix[]average(Matrix[] ma, Matrix[] mb, double f)static Matrixaverage(Matrix ma, Matrix mb, double f)Matrixcopy()double[][]copyMat()MatrixcrudeExpOf(double t)doubledet()intdim()java.lang.Stringdump()double[]ev1vec(int np)MatrixexpOf(double t)double[]flatten()double[][]getArray()double[]getColumn(int ic)double[][]getData()double[]getFlat()voididentise()Matrixidentity()Matrixinverse()voidinvert()voidlu()double[]lubksb(double[] b)Columnlubksb(Column v)static double[]luSolve(double[][] m, double[] R)ColumnluSolve(Column r)double[]lvprod(double[] v)doublemaxAbsElt()voidmpyBy(double d)voidmpyBy(Matrix m)voidmultiplyBy(double dt)voidmultiplyInto(double[] v)voidnegate()Matrixpower(int p)java.lang.Stringprint()java.lang.StringprintDiag()Matrixprod(Matrix m)voidrect2rvprod(double[] v, double[] r1, double[] r2)voidround()voidround(double d)double[]rvprod(double[] v)doublervprodOneElt(double[] v, int elt)voidset(int i, int j, double d)voidsetDims(int d1, int d2)voidsubtractIdentity()Matrixsum(Matrix m)voidsysPrint(java.lang.String s)Columntimes(Column v)Matrixtranspose()voidzero()
-
-
-
Method Detail
-
getData
public double[][] getData()
-
flatten
public double[] flatten()
-
sysPrint
public void sysPrint(java.lang.String s) throws MatrixException- Throws:
MatrixException
-
dim
public int dim()
-
copy
public Matrix copy()
-
setDims
public void setDims(int d1, int d2)
-
identise
public void identise()
-
zero
public void zero()
-
identity
public Matrix identity()
-
add
public void add(double d)
-
add
public void add(Matrix m) throws MatrixException
- Throws:
MatrixException
-
sum
public Matrix sum(Matrix m) throws MatrixException
- Throws:
MatrixException
-
mpyBy
public void mpyBy(double d)
-
mpyBy
public void mpyBy(Matrix m) throws MatrixException
- Throws:
MatrixException
-
prod
public Matrix prod(Matrix m) throws MatrixException
- Throws:
MatrixException
-
lvprod
public double[] lvprod(double[] v) throws MatrixException- Throws:
MatrixException
-
times
public Column times(Column v) throws MatrixException
- Throws:
MatrixException
-
rvprod
public double[] rvprod(double[] v) throws MatrixException- Throws:
MatrixException
-
multiplyInto
public void multiplyInto(double[] v)
-
rect2rvprod
public void rect2rvprod(double[] v, double[] r1, double[] r2)
-
rvprodOneElt
public double rvprodOneElt(double[] v, int elt)
-
transpose
public Matrix transpose()
-
det
public double det() throws MatrixException- Throws:
MatrixException
-
copyMat
public double[][] copyMat()
-
lu
public void lu() throws MatrixException- Throws:
MatrixException
-
inverse
public Matrix inverse() throws MatrixException
- Throws:
MatrixException
-
luSolve
public static double[] luSolve(double[][] m, double[] R) throws MatrixException- Throws:
MatrixException
-
luSolve
public Column luSolve(Column r) throws MatrixException
- Throws:
MatrixException
-
invert
public void invert() throws MatrixException- Throws:
MatrixException
-
lubksb
public double[] lubksb(double[] b)
-
round
public void round(double d)
-
round
public void round()
-
print
public java.lang.String print()
-
maxAbsElt
public double maxAbsElt()
-
power
public Matrix power(int p) throws MatrixException
- Throws:
MatrixException
-
crudeExpOf
public Matrix crudeExpOf(double t) throws MatrixException
- Throws:
MatrixException
-
expOf
public Matrix expOf(double t) throws MatrixException
- Throws:
MatrixException
-
getColumn
public double[] getColumn(int ic)
-
ev1vec
public double[] ev1vec(int np) throws MatrixException- Throws:
MatrixException
-
multiplyBy
public void multiplyBy(double dt)
-
subtractIdentity
public void subtractIdentity()
-
negate
public void negate()
-
set
public void set(int i, int j, double d)
-
dump
public java.lang.String dump()
-
getArray
public double[][] getArray()
-
getFlat
public double[] getFlat()
-
printDiag
public java.lang.String printDiag()
-
-