CodePlexProject Hosting for Open Source Software

int[,] data = new int[,] { ... }; int sum = data.AsEnumerable().Sum();

double[,] A = ...; double c = ...; double[,] product = A.Map(e => c * e);

double[,] A = ..., B = ...; double[,] sum = A.Combine(B, (x, y) => x + y);

double[,] A = ..., B = ...; double[,] product = A.CrossJoin(B, (x, y) => x * y, r => r.Sum());

int[,] pixels = ...; int[,] scaledTo50 = pixels.Split(2, 2).Map(e => (int)e.AsEnumerable().Average());

int[,] puzzle = ...; bool isSolution = // rows puzzle.AsRows() // columns .Union(puzzle.AsColumns()) // regions .Union(puzzle.Split(3, 3).AsEnumerable().Select(e => e.To1DArray())) // check all .All(g => Enumerable.Range(1, 9).All(e => g.Contains(e))) ;

Last edited Nov 17, 2012 at 5:17 PM by BlueCode, version 5