J
Juicer_X
Hello,
I have some code that I'm working on, the problem isn't that it doesn't
work it's that it's too slow. I have a class that holds my homemade class
within an std::map, within an std::map. here is the declaration.
std::map<char, std::map<char, CWordFrequency> > baseMap;
Now I can assign a pointer to the inner map, but I cannot assign a
pointer to my class without actually copying the second map into memory. I'm
not sure but I think the operators I need to use are ".*" or "->*".
Can somebody point me in the right direction?
Here is the slow but working code fragment.
sequenceFrequencyMap = baseMap[base];
tempFrequency = sequenceFrequencyMap[sequence];
if (wordPosition > 0 && (wordPosition + 1) < (word.length() -
1)) {tempFrequency.incrementCountWithin();}
else if (wordPosition == 0)
{tempFrequency.incrementCountBeginning();}
else if ((wordPosition + 1) == word.length() - 1)
{tempFrequency.incrementCountEnd();}
sequenceFrequencyMap[sequence] = tempFrequency;
baseMap[base] = sequenceFrequencyMap;
I have some code that I'm working on, the problem isn't that it doesn't
work it's that it's too slow. I have a class that holds my homemade class
within an std::map, within an std::map. here is the declaration.
std::map<char, std::map<char, CWordFrequency> > baseMap;
Now I can assign a pointer to the inner map, but I cannot assign a
pointer to my class without actually copying the second map into memory. I'm
not sure but I think the operators I need to use are ".*" or "->*".
Can somebody point me in the right direction?
Here is the slow but working code fragment.
sequenceFrequencyMap = baseMap[base];
tempFrequency = sequenceFrequencyMap[sequence];
if (wordPosition > 0 && (wordPosition + 1) < (word.length() -
1)) {tempFrequency.incrementCountWithin();}
else if (wordPosition == 0)
{tempFrequency.incrementCountBeginning();}
else if ((wordPosition + 1) == word.length() - 1)
{tempFrequency.incrementCountEnd();}
sequenceFrequencyMap[sequence] = tempFrequency;
baseMap[base] = sequenceFrequencyMap;