Class AbstractMatrixAbstract

Abstract base class for matrix implementations.

This class provides a common interface and basic functionality for all matrix types in the system. It implements the IMatrix interface and serves as the foundation for concrete matrix classes like Matrix44, Matrix33, etc.

Hierarchy (view full)

Implements

Constructors

Properties

_v: Float32Array = ...

Internal Float32Array storage for matrix elements

Accessors

  • get isIdentityMatrixClass(): boolean
  • Indicates whether this matrix is an identity matrix class.

    This property should be overridden in derived classes that represent identity matrices to return true.

    Returns boolean

    False for the base AbstractMatrix class

Methods

  • Gets the matrix element at the specified row and column.

    Parameters

    • row_i: number

      The zero-based row index

    • column_i: number

      The zero-based column index

    Returns number

    The matrix element value at the specified position

    Error when not implemented in derived classes

  • Flattens the matrix into a one-dimensional array.

    Returns number[]

    A flat array containing all matrix elements in row-major order

    Error when not implemented in derived classes

  • Checks if this matrix is a dummy (uninitialized) matrix.

    A matrix is considered dummy if its internal storage has zero length, indicating it hasn't been properly initialized with matrix data.

    Returns boolean

    True if the matrix is dummy/uninitialized, false otherwise

  • Checks if the matrix's internal storage shares the same ArrayBuffer as the provided one.

    This method is useful for determining if two matrices share the same underlying memory, which can be important for performance optimizations and avoiding unnecessary data copying.

    Parameters

    • arrayBuffer: ArrayBuffer

      The ArrayBuffer to compare against

    Returns boolean

    True if the internal storage uses the same ArrayBuffer, false otherwise

  • Converts the matrix to an approximate string representation.

    This method is useful for displaying matrices with rounded values for better readability in debugging or logging scenarios.

    Returns string

    An approximate string representation of the matrix

    Error when not implemented in derived classes

  • Gets the matrix element at the specified flat index.

    This provides direct access to the underlying Float32Array storage using a single index rather than row/column coordinates.

    Parameters

    • i: number

      The zero-based flat index into the matrix storage

    Returns number

    The matrix element value at the specified index