public class MatrixOp extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MatrixOp.IndeterminateMatrixException |
static class |
MatrixOp.InvalidMatrixException |
Modifier and Type | Method and Description |
---|---|
static Matrix |
add(Matrix a,
Matrix b)
Add two matrices together.
|
static Hep3Vector |
as3Vector(Matrix m)
Convenience method to turn a 3 row column matrix into a vector.
|
static double |
det(Matrix mIn) |
static Matrix |
getSubMatrix(Matrix m,
int row,
int col,
int nrow,
int ncol)
Extract part of a matrix.
|
static Matrix |
inverse(Matrix m)
Convenience method to invert a matrix in one step.
|
static void |
inverse(Matrix mIn,
MutableMatrix mOut)
Invert matrix mIn and write it to matrix mOut.
|
static Matrix |
mult(double c,
Matrix m)
Multiply a matrix by a scaler constant.
|
static Matrix |
mult(Matrix m1,
Matrix m2) |
static void |
setSubMatrix(MutableMatrix mat,
Matrix sub,
int row,
int col)
Fill in part of a matrix with the contents of another matrix.
|
static Matrix |
sub(Matrix a,
Matrix b)
Subtract matrix b from matrix a.
|
static String |
toString(Matrix m) |
static Matrix |
transposed(Matrix m)
Returns the transpose of the matrix.
|
static void |
transposed(Matrix mIn,
MutableMatrix mOut)
Traspose matrix mIn and write it to matrix mOut.
|
public static void inverse(Matrix mIn, MutableMatrix mOut) throws MatrixOp.InvalidMatrixException
inverse(this,this);
This method currently only supports square matrices.MatrixOp.InvalidMatrixException
public static Matrix inverse(Matrix m)
m
- matrix to be inverted. This remains unchanged by this operationpublic static double det(Matrix mIn)
public static void transposed(Matrix mIn, MutableMatrix mOut)
transposed(this,this);
public static Matrix transposed(Matrix m)
m
- matrix to be transposedpublic static Matrix add(Matrix a, Matrix b)
a
- first matrixb
- second matrixpublic static Matrix sub(Matrix a, Matrix b)
a
- starting matrixb
- matrix to be subtractedpublic static Matrix mult(double c, Matrix m)
c
- constant that will mutliply the matrixm
- matrix to be scaledpublic static void setSubMatrix(MutableMatrix mat, Matrix sub, int row, int col)
mat
- matrix to be modifiedsub
- submatrix to be insertedrow
- row where insertion is to take placecol
- column where insertion is to take placepublic static Matrix getSubMatrix(Matrix m, int row, int col, int nrow, int ncol)
m
- matrix containing the desired submatrixrow
- row where the submatrix is locatedcol
- column where the submatrix is locatednrow
- number of rows in the submatrixncol
- number of columns in the submatrixpublic static Hep3Vector as3Vector(Matrix m)
m
- column matrixJas4pp 1.5 © Java Analysis Studio for Particle Physics