resample vector in C++


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.

Skills: C++ Programming

See more: resample vector, shape resample vector, vectors programming, vectors in c programming, vector of ones, vector member functions, vector in c, vector cplusplus, vector add, tdd programming, programming vector, numerical programming, idl programming, functions in c# programming, functions in c programming, double in c programming, c programming find function, c programming double, cplusplus vector, resample, programming tests, function in c++ programming, TDD, shrunk, samples with a cause

Project ID: #4214824

10 freelancers are bidding on average $131 for this job


Hi, I am C++ expert and can surely help you here, Thank You

$250 USD in 2 days
(89 Reviews)

plz check your inbox. Thanks

$230 USD in 1 day
(26 Reviews)

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 More

$100 USD in 2 days
(13 Reviews)

I am senior and efficient c++ programmer, u can see my reviews, I can do this, please let me do it.

$150 USD in 4 days
(12 Reviews)

Let me help you. Please check your pmb.

$150 USD in 3 days
(15 Reviews)

I'd make something similar to the IDL code.

$100 USD in 5 days
(2 Reviews)

I can do this for you, please check PMB.

$100 USD in 4 days
(1 Review)

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.

$30 USD in 4 days
(0 Reviews)

Hello I can do this Please check PMB

$100 USD in 6 days
(0 Reviews)

>15 years of experience with numerics and scientific programming in C++; would be happy to do your project

$100 USD in 3 days
(0 Reviews)