@equinor/videx-linear-algebra
    Preparing search index...

    Function reshape

    • Reshapes an array of values to a collection of vectors with given dimensions.

      Parameters

      • array: number[]

        Single array with all values

      • dimensions: number

        Dimensions per vector

      Returns number[][]

      Array of vectors with given dimensions

      reshape([1, 2, 3, 4, 5, 6], 3); // Returns [ [1, 2, 3], [4, 5, 6] ]