resample vector in C++

  • Status Closed
  • Budget $30 - $250 USD
  • Total Bids 10

Project Description

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.

Get free quotes for a project like this
Skills Required

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online