[Clam-devel] [PATCH] segmentation in chord extractor as a seperate class
Roman Goj
roman.goj at gmail.com
Tue Jul 24 12:41:34 PDT 2007
David García Garzón wrote:
> 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.
Yes, I can see the advantage of IRC now, I just sent another e-mail
without noticing this one ;)
> About the content of the patch itself, well, please, do some const accessors
> to the vectors ;-)
>
> const std::vector<doubles> & timePositions() const { return _timePositions; }
I know, I know, it hurts to see code without accessors, they're coming!
:-) (have to finish dinner though...)
> 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]= ...
> }
Oh, point - didn't notice this (didn't start cleaning the code yet, just
copy/pasting from one place to another as safely as possible) will do,
of course :)
roman
More information about the clam-devel
mailing list