ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/test/utils/ReplaceWildCard.hpp
(Generate patch)

Comparing trunk/OOPSE-3.0/test/utils/ReplaceWildCard.hpp (file contents):
Revision 1661 by tim, Thu Oct 28 02:28:03 2004 UTC vs.
Revision 1662 by tim, Thu Oct 28 03:14:11 2004 UTC

# Line 38 | Line 38 | namespace oopse{
38  
39   namespace oopse{
40  
41 < //use -1 to represent the wild card, it is easy and cheap to operate one integer (or index) instead of string
41 > //use -1 to represent the wild card, it is easy and cheap to handle integer
42   const int WildCard = -1;
43  
44   std::vector<std::vector<int> > ReplaceWildCard(int beginIndex, int endIndex, int nWildCard);
# Line 55 | Line 55 | std::vector<std::vector<int> > adjoint( const std::vec
55   * //0, -1, 2
56   * //0, 1, -1
57   * //-1, -1, 2
58 + * //-1, 1, -1
59   * //0, -1, -1
60   * //-1, -1, -1
61   * @endcode
# Line 105 | Line 106 | std::vector<std::vector<int> > ReplaceWildCard(int beg
106          std::vector<std::vector<int> > sequences;
107  
108          for (int i = 0; i <=nRecursive; i ++) {
109 <            firstPart.push_back( beginIndex + i);
109 >          firstPart.clear();
110 >          for(int j = 0; j < i; ++j) {
111 >              firstPart.push_back(beginIndex + j);
112 >            }      
113 >            firstPart.push_back(WildCard);
114              secondPart = ReplaceWildCard(beginIndex + i + 1, endIndex, nWildCard - 1);
115              sequences = adjoint(firstPart, secondPart);
116              results.insert(results.end(), sequences.begin(), sequences.end());                      

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines