Chalkboard - v3.0.4
    Preparing search index...

    Function toMatrix

    • Converts a set or algebraic structure to a matrix.

      Parameters

      • struc: ChalkboardStructure<number> | ChalkboardSet<number>

        The set or structure

      • rows: number

        The number of rows of the matrix

      • Optionalcols: number = rows

        The number of columns of the matrix (optional, defaults to the number of rows to make a square matrix)

      Returns ChalkboardMatrix

      const set = Chalkboard.abal.set([1, 2, 3, 4]);
      const matrix = Chalkboard.abal.toMatrix(set, 2); // Returns [[1, 2], [3, 4]]