~srba/verifytapn/trunk

« back to all changes in this revision

Viewing changes to src/Core/SymbolicMarking/DBMMarking.cpp

  • Committer: Morten Jacobsen
  • Date: 2011-07-15 18:00:28 UTC
  • Revision ID: morten.jacobsen.2k@gmail.com-20110715180028-nngo342wg5ponnxz
- Fixed bug #809860
- Changed version number to 1.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
        // These tokens represent tokens that are moving to BOTTOM.
61
61
        // The DBM library requires arrays of bitvectors indicating which tokens are in
62
62
        // the original dbm (bitSrc) and which are in the resulting DBM (bitDst).
63
 
        void DBMMarking::RemoveTokens(const std::vector<int>& tokenIndices)
 
63
        void DBMMarking::RemoveTokens(const std::set<int>& tokenIndices)
64
64
        {
65
65
                std::vector<int> dbmTokensToRemove;
66
 
                for(unsigned int i = 0; i < tokenIndices.size(); ++i)
 
66
                for(std::set<int>::const_iterator it = tokenIndices.begin(); it != tokenIndices.end(); it++)
67
67
                {
68
 
                        dbmTokensToRemove.push_back(mapping.GetMapping(tokenIndices[i]));
 
68
                        dbmTokensToRemove.push_back(mapping.GetMapping(*it));
69
69
                }
70
70
 
71
71
                unsigned int oldDimension = dbm.getDimension();
125
125
                }
126
126
 
127
127
                // remove tokens from mapping and placement
128
 
                for(int i = tokenIndices.size()-1; i >= 0; --i)
 
128
                for(std::set<int>::const_reverse_iterator it = tokenIndices.rbegin(); it != tokenIndices.rend(); it++)
129
129
                {
130
 
                        mapping.RemoveToken(tokenIndices[i]);
131
 
                        dp.RemoveToken(tokenIndices[i]);
 
130
                        mapping.RemoveToken(*it);
 
131
                        dp.RemoveToken(*it);
132
132
                }
133
133
 
134
134
                assert(IsConsistent());