Class Matrix3x3


  • @GwtCompatible
    final class Matrix3x3
    extends java.lang.Object
    A simple 3x3 matrix.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int cols  
      private int rows  
      private double[] values  
    • Constructor Summary

      Constructors 
      Constructor Description
      Matrix3x3​(int cols, double... values)
      Constructs a 2D matrix of the given width and values.
      Matrix3x3​(int rows, int cols)
      Constructs a 2D matrix of a fixed size.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int cols()
      Returns the number of columns in this matrix.
      boolean equals​(java.lang.Object o)  
      static Matrix3x3 fromCols​(S2Point... columns)
      Constructs a matrix from a series of column vectors.
      static Matrix3x3 fromCols​(java.util.List<S2Point> frame)
      Constructs a matrix from a series of column vectors.
      double get​(int row, int col)
      Gets a value.
      S2Point getCol​(int col)
      Return the vector of the given column.
      int hashCode()  
      Matrix3x3 mult​(Matrix3x3 m)
      Returns the result of multiplying this x m.
      int rows()
      Returns the number of rows in this matrix.
      void set​(int row, int col, double value)
      Sets a value.
      Matrix3x3 transpose()
      Returns the transpose of this.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • values

        private final double[] values
      • rows

        private final int rows
      • cols

        private final int cols
    • Constructor Detail

      • Matrix3x3

        public Matrix3x3​(int cols,
                         double... values)
        Constructs a 2D matrix of the given width and values.
      • Matrix3x3

        public Matrix3x3​(int rows,
                         int cols)
        Constructs a 2D matrix of a fixed size.
    • Method Detail

      • fromCols

        public static Matrix3x3 fromCols​(S2Point... columns)
        Constructs a matrix from a series of column vectors.
      • fromCols

        public static Matrix3x3 fromCols​(java.util.List<S2Point> frame)
        Constructs a matrix from a series of column vectors.
      • rows

        public int rows()
        Returns the number of rows in this matrix.
      • cols

        public int cols()
        Returns the number of columns in this matrix.
      • set

        public void set​(int row,
                        int col,
                        double value)
        Sets a value.
      • get

        public double get​(int row,
                          int col)
        Gets a value.
      • transpose

        @CheckReturnValue
        public Matrix3x3 transpose()
        Returns the transpose of this.
      • mult

        @CheckReturnValue
        public Matrix3x3 mult​(Matrix3x3 m)
        Returns the result of multiplying this x m.
      • getCol

        public S2Point getCol​(int col)
        Return the vector of the given column.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object