SquareMatrix

public protocol SquareMatrix : ConstantSizeMatrix

A matrix whose dimensions are determined at compile time and whose rows equal its columns.

  • The number of rows and columns of the matrix. Self.dimensions and self.dimensions must equal size for both components. Must be greater than 0.

    Declaration

    Swift

    static var size: Int { get }
  • identity Default implementation

    The identity matrix for this size of matrices. The product of a matrix and the identity matrix is the original matrix.

    Default Implementation

    Declaration

    Swift

    static var identity: Self { get }
  • Calculates the matrix product of two matrices.

    Declaration

    Swift

    static func * (lhs: Self, rhs: Self) -> Self

    Parameters

    lhs

    The matrix on the left of the multiplication.

    rhs

    The matrix on the right of the multiplication.

    Return Value

    The product of lhs and rhs.

  • Calculates the matrix product of two matrices.

    Declaration

    Swift

    static func *= (lhs: inout Self, rhs: Self)

    Parameters

    lhs

    The matrix on the left of the multiplication.

    rhs

    The matrix on the right of the multiplication.

    Return Value

    The product of lhs and rhs.