Documentation of 'hep.physics.matrix.MatrixOp' Java class
MatrixOp
hep.physics.matrix

Class MatrixOp



  • public class MatrixOp
    extends java.lang.Object
    Simple operations on matrices
    • Method Detail

      • inverse

        public static Matrix inverse(Matrix m)
        Convenience method to invert a matrix in one step.
        Parameters:
        m - matrix to be inverted. This remains unchanged by this operation
        Returns:
        inverted matrix
      • toString

        public static java.lang.String toString(Matrix m)
      • det

        public static double det(Matrix mIn)
      • transposed

        public static void transposed(Matrix mIn,
                                      MutableMatrix mOut)
        Traspose matrix mIn and write it to matrix mOut. For a square matrix this method allows both arguments to be the same, e.g. transposed(this,this);
      • transposed

        public static Matrix transposed(Matrix m)
        Returns the transpose of the matrix.
        Parameters:
        m - matrix to be transposed
        Returns:
        transposed matrix
      • add

        public static Matrix add(Matrix a,
                                 Matrix b)
        Add two matrices together. Matrices must have the same dimensions.
        Parameters:
        a - first matrix
        b - second matrix
        Returns:
        sum of the two matrices
      • sub

        public static Matrix sub(Matrix a,
                                 Matrix b)
        Subtract matrix b from matrix a. Matrices must have the same dimensions.
        Parameters:
        a - starting matrix
        b - matrix to be subtracted
        Returns:
        difference (a - b)
      • mult

        public static Matrix mult(double c,
                                  Matrix m)
        Multiply a matrix by a scaler constant.
        Parameters:
        c - constant that will mutliply the matrix
        m - matrix to be scaled
        Returns:
        scaled matrix (c * m)
      • setSubMatrix

        public static void setSubMatrix(MutableMatrix mat,
                                        Matrix sub,
                                        int row,
                                        int col)
        Fill in part of a matrix with the contents of another matrix.
        Parameters:
        mat - matrix to be modified
        sub - submatrix to be inserted
        row - row where insertion is to take place
        col - column where insertion is to take place
      • getSubMatrix

        public static Matrix getSubMatrix(Matrix m,
                                          int row,
                                          int col,
                                          int nrow,
                                          int ncol)
        Extract part of a matrix.
        Parameters:
        m - matrix containing the desired submatrix
        row - row where the submatrix is located
        col - column where the submatrix is located
        nrow - number of rows in the submatrix
        ncol - number of columns in the submatrix
        Returns:
        submatrix
      • as3Vector

        public static Hep3Vector as3Vector(Matrix m)
        Convenience method to turn a 3 row column matrix into a vector.
        Parameters:
        m - column matrix
        Returns:
        vector containing contents of column matrix

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.