[Clam-devel] [PATCH] segmentation in chord extractor as a seperate class

David García Garzón dgarcia at iua.upf.edu
Tue Jul 24 12:24:51 PDT 2007


Ups, i commited the previous patch, hope not having so many conflicts. Do a 
backup of the file, revert, recover the backup and regenerate the patch, 
please. Sorry.

About the content of the patch itself, well, please, do some const accessors 
to the vectors ;-)

const std::vector<doubles> & timePositions() const { return _timePositions; }

In order to do that wiser, before the loop, Set the Number Of Contexts once to 
the number chords that you already know, and once the full buffer for all the 
chords is allocated you can also optimize a little the code and make it 
clearer by Getting the Write Pools outside the main loop and just indexing 
them inside.

pool.SetNumberOfContexts("ExtractedChord",segmentation.chordIndexes().size());

Simac::Enumerated * roots = 
_pool->GetWritePool<Simac::Enumerated>("ExtractedChord", "Root");

Simac::Enumerated * modes = ...

for (unsigned segment=....)
{
	roots[segment]=extractor.root(segmentation.chordIndexes()[segment])
	modes[segment]= ...
}


On Tuesday 24 July 2007 20:59:55 Roman Goj wrote:
> (patch contains patch step3and4)
>
> Took a bit long, because I tried a very strange/stupid approach at
> first, but finally this bullet got the patch-spotlight:
>
> On 7/19/07, David García Garzón <dgarcia at iua.upf.edu> wrote:
> (...)
>
> > Goal 1 remove reference to the pool (after each step compile test and
> > patch):
>
> (...)
>
> > * Move the old pool code to the destructor but now looping and
> > translating one to the other.
>
> (...)
>
> I hope I understood this point correctly... anyway I wrote the code
> how I imagine it should work (for the moment at least, the code simply
> begs and screams for some accessors ... on to the next bullet then :)
> ).
>
> cheers!
> roman






More information about the clam-devel mailing list