Mercurial > hg > silvet
changeset 89:a6e136aaa202 timing
Initialise new vectors with epsilon instead of copying and then overwriting
author | Chris Cannam |
---|---|
date | Tue, 06 May 2014 12:56:18 +0100 |
parents | 97b77e7cb94c |
children | f1116eb464f9 91bb029a847a |
files | src/EM.cpp testdata/timing/results.txt |
diffstat | 2 files changed, 11 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/EM.cpp Tue May 06 12:49:49 2014 +0100 +++ b/src/EM.cpp Tue May 06 12:56:18 2014 +0100 @@ -160,27 +160,23 @@ void EM::maximisation(const V &column) { - V newPitches = m_pitches; - Grid newShifts = m_shifts; - Grid newSources = m_sources; + V newPitches(m_noteCount, epsilon); + Grid newShifts(m_shiftCount, V(m_noteCount, epsilon)); + Grid newSources(m_instrumentCount, V(m_noteCount, epsilon)); for (int n = 0; n < m_noteCount; ++n) { const double pitch = m_pitches[n]; - newPitches[n] = epsilon; for (int f = 0; f < m_shiftCount; ++f) { const double shift = m_shifts[f][n]; - newShifts[f][n] = epsilon; for (int i = 0; i < m_instrumentCount; ++i) { const double source = m_sources[i][n]; - newSources[i][n] = epsilon; - + const double factor = pitch * source * shift; const double *w = templateFor(i, n, f); - const double factor = pitch * source * shift; if (n >= m_lowestPitch && n <= m_highestPitch) {
--- a/testdata/timing/results.txt Tue May 06 12:49:49 2014 +0100 +++ b/testdata/timing/results.txt Tue May 06 12:56:18 2014 +0100 @@ -117,3 +117,10 @@ user 1m44.490s sys 0m0.190s +commit:97b77e7cb94c, as commit:6075e92d63ab but with templates stored +as doubles instead of floats (doubling the size of the plugin binary) + +real 1m40.135s +user 1m39.820s +sys 0m0.230s +