Function padMatrix

  • Fix a 2-D matrix to have full rows (pad with zeros).

    Type Parameters

    • T extends number | bigint

    Parameters

    • M: T[][]

      Input matrix.

    Returns {
        M: T[][];
        height: number;
        one: number | bigint;
        width: number;
        zero: T;
    }

    Height, width, the padded matrix and the corresponding 0 or 0n and 1 or 1n.

    • M: T[][]
    • height: number
    • one: number | bigint
    • width: number
    • zero: T