Array2D zu Array
Ich habe Array2D von 0 und 1:
let rnd = System.Random()
let a = Array2D.init n n (fun i j -> int(System.Math.Round(rnd.NextDouble() / index)) )
Ich muss die Anzahl der '1'-Elemente wie folgt berechnen:
a |> Array.filter (fun x -> x == 1)
Aber 'a' ist Array2D (nicht Array), also frage ich mich, ob es einen Standardweg gibt, Array2D in Array umzuwandeln?