Documentation of 'mikera.matrixx.Matrix22' Java class
Matrix22
mikera.matrixx

Class Matrix22

    • Field Detail

      • m00

        public double m00
      • m01

        public double m01
      • m10

        public double m10
      • m11

        public double m11
    • Constructor Detail

      • Matrix22

        public Matrix22()
      • Matrix22

        public Matrix22(Matrix22 source)
      • Matrix22

        public Matrix22(double m00,
                        double m01,
                        double m10,
                        double m11)
      • Matrix22

        public Matrix22(AMatrix m)
    • Method Detail

      • set

        public void set(AMatrix m)
        Description copied from class: AMatrix
        Sets this matrix with the element values from another matrix. Source matrix must have the same shape.
        Overrides:
        set in class AMatrix
      • unsafeSet

        public void unsafeSet(AMatrix m)
      • create

        public static Matrix22 create(double a,
                                      double b,
                                      double c,
                                      double d)
      • createRotationMatrix

        public static Matrix22 createRotationMatrix(double angle)
      • createScaleMatrix

        public static Matrix22 createScaleMatrix(double d)
      • createIdentity

        public static Matrix22 createIdentity()
        Creates a new mutable 2D identity matrix
        Returns:
      • createReflectionMatrix

        public static Matrix22 createReflectionMatrix(AVector normal)
      • createReflectionMatrix

        public static Matrix22 createReflectionMatrix(Vector2 normal)
      • multiply

        public void multiply(double factor)
        Description copied from interface: INDArray
        Multiplies all elements of the array in place by a given double value
        Specified by:
        multiply in interface INDArray
        Overrides:
        multiply in class AMatrix
      • determinant

        public double determinant()
        Description copied from class: AMatrix
        Calculates the determinant of the matrix.
        Overrides:
        determinant in class AMatrix
      • elementCount

        public long elementCount()
        Description copied from interface: INDArray
        Returns the total number of elements in this array. Equivalent to the product of all dimension sizes.
        Specified by:
        elementCount in interface INDArray
        Overrides:
        elementCount in class AMatrix
      • elementSum

        public double elementSum()
        Description copied from class: AMatrix
        Returns the sum of all elements in this matrix
        Specified by:
        elementSum in interface INDArray
        Overrides:
        elementSum in class AMatrix
      • elementMin

        public double elementMin()
        Description copied from interface: INDArray
        Returns the maximum element value in this array. Throws an error if there are no elements.
        Specified by:
        elementMin in interface INDArray
        Overrides:
        elementMin in class AbstractArray<AVector>
      • elementMax

        public double elementMax()
        Description copied from interface: INDArray
        Returns the maximum element value in this array. Throws an error if there are no elements.
        Specified by:
        elementMax in interface INDArray
        Overrides:
        elementMax in class AbstractArray<AVector>
      • trace

        public double trace()
        Description copied from interface: IMatrix
        Computes the trace of a matrix, i.e. the sum of all elements on the leading diagonal
        Specified by:
        trace in interface IMatrix
        Overrides:
        trace in class AMatrix
        Returns:
      • inverse

        public Matrix22 inverse()
        Description copied from class: AMatrix
        Computes the inverse of a matrix. Returns null if the matrix is singular. Throws an Exception is the matrix is not square
        Specified by:
        inverse in interface IMatrix
        Overrides:
        inverse in class AMatrix
        Returns:
        A matrix which is the inverse of this matrix, or null if the inverse does not exist.
      • rowCount

        public int rowCount()
        Description copied from interface: IMatrix
        Gets the number of rows in this matrix (dimension 0)
        Specified by:
        rowCount in interface IMatrix
        Returns:
      • columnCount

        public int columnCount()
        Description copied from interface: IMatrix
        Gets the number of columns in this matrix (dimension 1)
        Specified by:
        columnCount in interface IMatrix
        Returns:
      • checkSquare

        public int checkSquare()
        Description copied from class: AMatrix
        Checks if a matrix is square. Returns the size if true, throws an exception otherwise;
        Specified by:
        checkSquare in class APrimitiveMatrix
        Returns:
      • add

        public void add(AMatrix a)
        Description copied from class: AMatrix
        Adds another matrix to this matrix. Matrices must be the same size.
        Overrides:
        add in class AMatrix
      • applyOp

        public void applyOp(Op op)
        Description copied from interface: INDArray
        Applies a unary operator to all elements of the array (in-place)
        Specified by:
        applyOp in interface INDArray
        Overrides:
        applyOp in class AMatrix
      • getRowClone

        public Vector2 getRowClone(int row)
        Description copied from interface: IMatrix
        Returns a row of the matrix as a new cloned, mutable vector. The cloned row may be modified without affecting the original matrix.
        Specified by:
        getRowClone in interface IMatrix
        Overrides:
        getRowClone in class AMatrix
      • getColumnClone

        public Vector2 getColumnClone(int column)
        Description copied from interface: IMatrix
        Returns a column of the matrix as a new cloned, mutable vector The cloned column may be modified without affecting the original matrix.
        Specified by:
        getColumnClone in interface IMatrix
        Overrides:
        getColumnClone in class AMatrix
      • copyRowTo

        public void copyRowTo(int row,
                              double[] dest,
                              int destOffset)
        Description copied from class: AMatrix
        Copies the elements in a selected row of this matrix to a double array
        Overrides:
        copyRowTo in class AMatrix
        Parameters:
        row - The index of the selected row
        dest - Destination double[] array
        destOffset - Offset into destination array
      • get

        public double get(int row,
                          int column)
        Description copied from interface: INDArray
        Returns the double value at the specified position in a 2D matrix
        Specified by:
        get in interface INDArray
        Specified by:
        get in interface IMatrix
        Specified by:
        get in class AMatrix
      • set

        public void set(int row,
                        int column,
                        double value)
        Description copied from interface: INDArray
        Sets a value at a given position in a mutable 2D array
        Specified by:
        set in interface INDArray
        Specified by:
        set in interface IMatrix
        Specified by:
        set in class AMatrix
      • innerProduct

        public AMatrix innerProduct(AMatrix a)
        Description copied from interface: IMatrix
        Computes the inner product of this matrix with another. Equivalent to matrix x matrix multiplication
        Specified by:
        innerProduct in interface IMatrix
        Overrides:
        innerProduct in class AMatrix
        Returns:
      • transform

        public void transform(AVector source,
                              AVector dest)
        Description copied from interface: IMatrix
        Transforms a source vector into a destination vector, using matrix multiplication (inner product). The destination vector is overwritten.
        Specified by:
        transform in interface IMatrix
        Overrides:
        transform in class AMatrix
      • transformInPlace

        public void transformInPlace(Vector2 dest)
      • isSymmetric

        public boolean isSymmetric()
        Description copied from class: AMatrix
        Returns true if a matrix is symmetric
        Specified by:
        isSymmetric in interface IMatrix
        Overrides:
        isSymmetric in class AMatrix
        Returns:
      • toVector

        public Vector toVector()
        Description copied from interface: INDArray
        Coerces the array into a flattened dense Vector, in row-major order. May return the same array if it is already a Vector instance.
        Specified by:
        toVector in interface INDArray
        Overrides:
        toVector in class AMatrix
      • getTranspose

        public Matrix22 getTranspose()
        Description copied from interface: INDArray
        Returns the transpose of this array. A transpose of an array is equivalent to reversing the order of dimensions. May or may not return a view depending on the array type.
        Specified by:
        getTranspose in interface INDArray
        Specified by:
        getTranspose in interface IMatrix
        Overrides:
        getTranspose in class AMatrix
        Returns:
        the transpose of this matrix
      • getElements

        public void getElements(double[] data,
                                int offset)
        Description copied from interface: INDArray
        Copies all elements of this array a double array at the specified offset
        Specified by:
        getElements in interface INDArray
        Overrides:
        getElements in class AMatrix
      • equals

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

        public boolean equals(Matrix22 m)
      • clone

        public Matrix22 clone()
        Description copied from interface: INDArray
        Returns a clone of the array data, as a new array which will be fully mutable and may be of a different class to the original. Clone should attempt to return the most efficient possible array type. Clone should preserve sparsity property where possible, but this is not guaranteed.
        Specified by:
        clone in interface INDArray
        Overrides:
        clone in class AMatrix
      • exactClone

        public Matrix22 exactClone()
        Description copied from interface: INDArray
        Creates a deep clone of an array, using the same class implementation as the original array
        Specified by:
        exactClone in interface INDArray
        Specified by:
        exactClone in class AMatrix
        Returns:
        A clone of the original array
      • toDoubleArray

        public double[] toDoubleArray()
        Description copied from interface: INDArray
        Copies the elements of this array to a new double[] array.
        Specified by:
        toDoubleArray in interface INDArray
        Overrides:
        toDoubleArray in class AMatrix
      • isZero

        public boolean isZero()
        Description copied from class: AMatrix
        Returns true if the matrix is the zero matrix (all components zero)
        Specified by:
        isZero in interface INDArray
        Overrides:
        isZero in class AMatrix

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.