Module JNISpice
Package spice.basic

Class Matrix66


  • public class Matrix66
    extends java.lang.Object
    Class Matrix66 represents 6 by 6 double precision matrices.

    Version 1.0.0 22-DEC-2009 (NJB)

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double[][] m  
    • Constructor Summary

      Constructors 
      Constructor Description
      Matrix66()
      Construct a zero-filled matrix.
      Matrix66​(double[] array36)
      Construct a Matrix66 from an array of type double[].The array elements are assumed to be arin row-major order.
      Matrix66​(double[][] array6x6)
      Construct a Matrix66 from an array of type double[][].
      Matrix66​(Matrix33 r, Vector3 av)
      Create a Matrix66 from a rotation matrix and an angular velocity vector.
      Matrix66​(Matrix66 matrix)
      Construct a Matrix66 from another Matrix66.This method creates a deep copy.
    • Method Summary

      Modifier and Type Method Description
      Matrix66 add​(Matrix66 m2)
      Add this instance to another Matrix66 instance.
      private Matrix66 createMatrix66​(double[][] array6x6)
      Private utility to construct a Matrix66 from an array of type double[][].
      double dist​(Matrix66 m2)
      Return the vector (L2) distance between this instance and another Matrix66 instance.
      Matrix33 getBlock​(int blockRow, int blockCol)
      Return a specified 3x3 block from this instance.
      double getElt​(int i, int j)
      Return the element of this instance at index [i][j].
      static Matrix66 identity()
      Return the identity matrix.
      Matrix66 mxm​(Matrix66 m2)
      Left-multiply a second Matrix66 instance by this instance.
      Vector6 mxv​(Vector6 vin)
      Left-multiply a 6-dimensional double precision vector by a 6x6 double precision matrix.
      double norm()
      Compute the vector (L2) norm of this instance.
      Matrix66 scale​(double s)
      Multiply this instance by a scalar.
      Matrix66 sub​(Matrix66 m2)
      Subtract another Matrix66 instance from this instance.
      double[][] toArray()
      Return a 6x6 array containing the contents of a Matrix66 instance.
      double[] toArray1D()
      Return a one-dimensional array containing the contents of a Matrix66 instance.The contents of the array are arranged in row-major order.
      java.lang.String toString()
      Utility for displaying a Matrix66.This method overrides Object's toString() method.
      Matrix66 transposeByBlocks()
      Transpose the 3x3 blocks of this Matrix66 instance.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • m

        private double[][] m
    • Constructor Detail

      • Matrix66

        public Matrix66()
        Construct a zero-filled matrix.
      • Matrix66

        public Matrix66​(Matrix66 matrix)
        Construct a Matrix66 from another Matrix66.This method creates a deep copy.
        Parameters:
        matrix - Matrix66
      • Matrix66

        public Matrix66​(double[][] array6x6)
                 throws SpiceException
        Construct a Matrix66 from an array of type double[][].
        Parameters:
        array6x6 - double[][]
        Throws:
        SpiceException - exception
      • Matrix66

        public Matrix66​(double[] array36)
                 throws SpiceException
        Construct a Matrix66 from an array of type double[].The array elements are assumed to be arin row-major order.
        Parameters:
        array36 - double[]
        Throws:
        SpiceException - exception
    • Method Detail

      • createMatrix66

        private Matrix66 createMatrix66​(double[][] array6x6)
        Private utility to construct a Matrix66 from an array of type double[][]. Caution: this utility does no error checking.
      • identity

        public static Matrix66 identity()
        Return the identity matrix.
        Returns:
        Matrix33
      • toArray

        public double[][] toArray()
        Return a 6x6 array containing the contents of a Matrix66 instance.
        Returns:
        double[][]
      • toArray1D

        public double[] toArray1D()
        Return a one-dimensional array containing the contents of a Matrix66 instance.The contents of the array are arranged in row-major order.
        Returns:
        double[]
      • getElt

        public double getElt​(int i,
                             int j)
                      throws SpiceException
        Return the element of this instance at index [i][j].
        Parameters:
        i - int
        j - int
        Returns:
        double
        Throws:
        SpiceException - exception
      • getBlock

        public Matrix33 getBlock​(int blockRow,
                                 int blockCol)
                          throws SpiceException
        Return a specified 3x3 block from this instance.

        The arguments `blockRow' and `blockCol' refer to row and column indices of the matrix when considered as a 2x2 matrix of 3x3 blocks. The range of `blockRow' and `blockCol' is 0:1.

        Parameters:
        blockRow - int
        blockCol - int
        Returns:
        Matrix33
        Throws:
        SpiceException - exception
      • mxm

        public Matrix66 mxm​(Matrix66 m2)
        Left-multiply a second Matrix66 instance by this instance.
        Parameters:
        m2 - Matrix66
        Returns:
        Matrix66
      • mxv

        public Vector6 mxv​(Vector6 vin)
                    throws SpiceException
        Left-multiply a 6-dimensional double precision vector by a 6x6 double precision matrix.
        Parameters:
        vin - Vector6
        Returns:
        Vector6
        Throws:
        SpiceException - exception
      • add

        public Matrix66 add​(Matrix66 m2)
        Add this instance to another Matrix66 instance.
        Parameters:
        m2 - Matrix66
        Returns:
        Matrix66
      • sub

        public Matrix66 sub​(Matrix66 m2)
        Subtract another Matrix66 instance from this instance.
        Parameters:
        m2 - Matrix66
        Returns:
        Matrix66
      • scale

        public Matrix66 scale​(double s)
        Multiply this instance by a scalar.
        Parameters:
        s - double
        Returns:
        Matrix66
      • norm

        public double norm()
        Compute the vector (L2) norm of this instance.
        Returns:
        double
      • dist

        public double dist​(Matrix66 m2)
        Return the vector (L2) distance between this instance and another Matrix66 instance.
        Parameters:
        m2 - Matrix66
        Returns:
        double
      • transposeByBlocks

        public Matrix66 transposeByBlocks()
                                   throws SpiceException
        Transpose the 3x3 blocks of this Matrix66 instance.

        This transformation inverts a state transformation matrix.

        Returns:
        Matrix66
        Throws:
        SpiceException - exception
      • toString

        public java.lang.String toString()
        Utility for displaying a Matrix66.This method overrides Object's toString() method.
        Overrides:
        toString in class java.lang.Object
        Returns:
        String