On Jun 24, 11:25*am, pinkfloydfan <lloyd.greens...@googlemail.com>
wrote:
> I see your point about it not being very jagged. *The program creates
> a set of 240 doubles and repeats it 250,000 times. I stored them in a
> jagged array in order to easily reference any single set but as it
> happens I also need to go across sets at the same point.
>
> I have all the data manipulation I need already written and working
> fine its just that I have never used Linq queries so I thought that I
> might teach myself by trying to re-write this code with Linq instead.
>
> So, I have seen how to run a query on a single array, you say it can
> be done on a jagged array (and I guess also on a multi-dimensional
> array), so can you show me an example of how to do this please?
A jagged array is just an array of arrays. So, to get an
IEnumerable<double> from a jagged array declared as:
double[][] samples = new double[250000][240];
where you want the 100th element of each top level array, you'd just
do:
samples.Select(innerArray => innerArray[100]);
Jon
|