ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-2.0/src/utils/Utility.cpp
Revision: 1854
Committed: Sun Dec 5 22:02:42 2004 UTC (19 years, 6 months ago) by tim
File size: 877 byte(s)
Log Message:
fix a bug in filling MolMembership

File Contents

# Content
1
2 #include "utils/Utility.hpp"
3
4 namespace oopse {
5
6 bool replaceWithWildCard(std::vector<std::vector<std::string>::iterator>& cont,
7 std::vector<std::string>& sequence, std::vector<std::string>& result, const std::string& wildCard) {
8 if (cont.size() > sequence.size()) {
9 std::cerr << "the size of iterator container is greater than the size of sequence";
10 }
11
12 bool hasMoreCombination = next_combination(cont, sequence.begin(), sequence.end());
13 if (hasMoreCombination) {
14 result.clear();
15 result.insert(result.begin(), sequence.size(), wildCard);
16 std::vector<std::vector<std::string>::iterator>::iterator i;
17 for ( i = cont.begin(); i != cont.end(); i++){
18 result[*i - sequence.begin()] = **i;
19 }
20 }
21
22 return hasMoreCombination;
23
24 }//end replaceWildCard
25
26 }

Properties

Name Value
svn:executable *