[Clam-devel] test changes after refactoring of InstantTunningEstimator

Roman Goj roman.goj at gmail.com
Tue Jul 10 02:39:39 PDT 2007


Hi!

After yesterday's chat learning session with David, I'm sending very
small patches now :)

The next few patches should make the tests in
InstantTunningEstimatorTest use the std::vector version of doIt in
InstantTunningEstimator and change the positions in all the test to
use the new conventions of numbering the bins in a semitone (was: each
semitone has bins 0,1,2 and is now: 0, 1/3, 2/3 or similar...). The
TODO's are in my GSoC space on the Devel/Chord Extraction TODOs page
if anyone's interested :)

This patch is:
Change assertFoundCenterIs to use the vector<pair> interface

Btw. there's a std::vector< std::pair<double,double> > and in this
patch I had to initialize it from two arrays of doubles and did this
in a loop:

unsigned nPeaks;
double * peakPositions;
double * peakValues;
(...)
std::vector< std::pair<double,double> > peaks;
for(int i=0; i<nPeaks; ++i)
{
     peaks.push_back( std::pair<double,double>(peakPositions[i],peakValues[i]));
}

Am I missing some other obvious way of making a vector of pairs out of
two arrays of doubles? Guess not, or...?

Also - David - I didn't ask about this yesterday, but:

Should I also modify the code in the tests themselves, so that the
assertFoundCenterIs changes from:
assertFoundCenterIs(double,double,unsigned,double *, double *)
to
assertFoundCenterIs(double,double,unsigned,std::vector<
std::pair<double,double> >
?

Then the code I asked about above could disappear from assertFoundCenterIs.
So - should I add this to the end of the nice long list of
InstantTunningEstimatorTODOs ? :)

cheers,
roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: InstantTunningEstimatorTest_step1_assert_with_stdvector.patch
Type: text/x-diff
Size: 799 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20070710/3072b975/attachment-0002.patch>


More information about the clam-devel mailing list