We need to resample vectors of doubles, either shrinking or expanding them by a factor which is also a double. Think of the samples as the integrals in the ranges [0..1[, [1, 2[... of an unknown function defined on a segment with a certain length; then change the unit of measure of this length by factor and recompute the ceil(newlength) new samples, again as integrals over [0..1[, [1, 2[... . This operation must conserve exactly the sum of the samples, and qualitatively the shape of the underlying function, although there is information loss when the samples are shrunk; it is sometime called conservative rebinning (just google "idl frebin").
In the attached C++ source you'll find a proposed interface; there are just 2 member functions to implement: vector::shrink and vector::expand.
In the spirit if TDD, in the attached source there is also a suite of 5 tests that do not pass at the moment. We'll add more tests, and generate new ones by tweaking the constants (factor, ifactor, 0.5 ...) in the existing tests. The focus should be covering all borderline cases which may cause truncation and numerical errors.
Dear sir,
I am strong in C++ and STL programming especially in algorithm design and implementation. I am familiar with the internal mechanism of vector and I have sound solution for it and I can finish the project with high quality.
Wait for your response
Thank you BR
I m a developer by profession currently working on java, C++ and web development. I have a good understanding of this project. Deliverable would be ready on time with 95-99% accuracy.