ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/utils/next_combination.hpp
(Generate patch)

Comparing:
trunk/OOPSE-3.0/src/utils/next_combination.hpp (file contents), Revision 1680 by tim, Thu Oct 28 21:42:30 2004 UTC vs.
branches/new_design/OOPSE-3.0/src/utils/next_combination.hpp (file contents), Revision 1720 by tim, Sat Nov 6 05:21:55 2004 UTC

# Line 133 | Line 133 | bool next_combination(IteratorContainer<RandomAccessIt
133   /**
134   * @brief iteratively replace the sequence with wild cards
135   * @return true if more combination sequence is avaliable, otherwise return true
136 < * @param cont iterator container, if expect whole series of combination, just pass an empty iterator
137 < * container. The user should not modify the iterator container
136 > * @param cont iterator container, if expect the whole series of combinations,  pass an empty iterator
137 > * container. The user should not modify this iterator container
138   * @param sequence the whole sequence used to generate combination
139   * @param result a possible combination sequence which is set on return
140 < * @wildCard the wild card string. Its value is "X" by default
140 > * @param wildCard the wild card string. Its value is "X" by default
141   * @note since next_combination never returns an empty sequence, replaceWildCard will not generate
142   * one special combination, which is n identical wild cards (n is equal to the size of the passing sequence)
143   *
# Line 149 | Line 149 | bool next_combination(IteratorContainer<RandomAccessIt
149   * sv.push_back("C");
150   * sv.push_back("N");
151  
152 < * while (replaceWildCard(sic, sv, resultString)) {  
152 > * while (replaceWithWildCard(sic, sv, resultString)) {  
153   *     for(std::vector<std::string>::iterator i = resultString.begin(); i != resultString.end(); ++i) {
154   *         std::cout << *i << "\t";
155   *     }
# Line 163 | Line 163 | bool next_combination(IteratorContainer<RandomAccessIt
163   * //H X N
164   * //X C N
165   * //H C N
166 < @endcode
166 > * @endcode
167   */
168 < bool replaceWildCard(std::vector<std::vector<std::string>::iterator>& cont,
168 > bool replaceWithWildCard(std::vector<std::vector<std::string>::iterator>& cont,
169                                               std::vector<std::string>& sequence, std::vector<std::string>& result,
170                                               const std::string& wildCard = "X") {
171      if (cont.size() > sequence.size()) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines