nape-js API
    Preparing search index...

    Class MatMN

    Variable-sized M×N matrix.

    Converted from nape-compiled.js lines 17261–17395.

    Index

    Constructors

    Accessors

    Methods

    Constructors

    • Create a zero-filled M×N matrix. Both dimensions must be ≥ 1.

      Parameters

      • rows: number

        Number of rows (must be ≥ 1).

      • cols: number

        Number of columns (must be ≥ 1).

      Returns MatMN

    Accessors

    Methods

    • Check whether this MatMN is element-wise equal to another, within an optional epsilon tolerance. Matrices must have the same dimensions.

      Parameters

      • other: MatMN

        The MatMN to compare against.

      • epsilon: number = 0

        Maximum allowed difference per element (default 0).

      Returns boolean

      true if dimensions match and all elements differ by at most epsilon.

    • Return the matrix product this × matrix. Column count of this must equal row count of matrix.

      Parameters

      • matrix: MatMN

        The right-hand matrix to multiply by.

      Returns MatMN

      A new MatMN representing the product.

    • Write value to the element at (row, col). Returns the written value.

      Parameters

      • row: number

        Zero-based row index.

      • col: number

        Zero-based column index.

      • value: number

        The value to write.

      Returns number

      The written value.

    • String representation with rows separated by semicolons.

      Returns string

      A human-readable string of the matrix elements.

    • Read the element at (row, col). Zero-based indices.

      Parameters

      • row: number

        Zero-based row index.

      • col: number

        Zero-based column index.

      Returns number

      The element value at the given position.