I have a real-time application that needs to "grow" a data series in a Vector (i.e. some double is allocated > initial size and Count is adjusted as the vector grows).
Basically data arrives on some high sampling frequency, is added to a vector or vectors. The vector may start with 0 elements and grow in single units from one event to the next. Calculations are done using those vectors after appending a new
sample to the vector.
Hence, I started by implemented a subclass of Vector<T> that implements an expandable vector. I ran into the following problems:
- the Count property setter is declared private rather than protected
- the ctor checks for Count > 0
Could the distribution be modified to relax Count privs and the ctor check? Is there any direct usage of Vector<T>.Data.Length in algorithms as opposed to Vector<T>.Count? If Data.length is used where Count < Length would be
p.s. The cost of creating a new precisely sized vector on each invocation would be prohibitively costly.