"apm" <Co*********@AdsorptionProcessModeling.com> wrote in message
news:Be47f.6062$vS1.3991@dukeread03...
I have a similar problem but with a huge array of double. Is there a way to create an array that is
a subset of a larger array without copying the elements?
Sort of.
Once again the question is ...WHY?
Memory considerations?
Duplication of data?
You can COPY a segment of your Array to a new Array, but you specified no copying.
You could create a class that ACTS like an Array and only looks at a subset of the data in the
master Array.
You would implement the IEnumerable and IEnumerator interfaces and set up an indexer on your class.
You pass in the Array and bounds to the constructor and it looks and feels like a SUB-Array.
All access to the underlying data would be through access methods, so this could cause performance
issues if the array is accessed frequently and if the JITer can't speed things up. (You would need
to test it out)
If you don't use 'foreach' of the SUB-Array you can even lose the IEnumerable and IEnumerator
interfaces and just do the indexer.
Hope this helps
Bill