Sha256: 2b14bc148d637dff6a279ba6ce2607175b0fddc3b3bb9143d78733f34c017a16
Contents?: true
Size: 527 Bytes
Versions: 319
Compression:
Stored size: 527 Bytes
Contents
module Matrix type Matrix = { rows: int [][]; cols: int [][] } let fromString (str: string) = let parseRow (row: string) = row.Split(' ') |> Array.map (string >> int) let rows = str.Split('\n') |> Array.map parseRow let numberOfCols = Array.item 0 rows |> Array.length let cols = [| for col in 0..numberOfCols - 1 -> [| for row in rows -> Array.item col row |] |] { rows = rows; cols = cols } let rows matrix = matrix.rows let cols matrix = matrix.cols
Version data entries
319 entries across 319 versions & 1 rubygems