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 1662 by tim, Thu Oct 28 03:14:11 2004 UTC vs.
Revision 1663 by tim, Thu Oct 28 03:27:03 2004 UTC

# Line 42 | Line 42 | std::vector<std::vector<int> > adjoint( const std::vec
42   const int WildCard = -1;
43  
44   std::vector<std::vector<int> > ReplaceWildCard(int beginIndex, int endIndex, int nWildCard);
45 < std::vector<std::vector<int> > adjoint( const std::vector<int>& firstPart, const std::vector<std::vector<int> >& secondPart);
45 > std::vector<std::vector<int> > join( const std::vector<int>& firstPart, const std::vector<std::vector<int> >& secondPart);
46  
47   /**
48   * Driver function for replacing
# Line 95 | Line 95 | std::vector<std::vector<int> > ReplaceWildCard(int beg
95          exit(1);
96      } else if (len == nWildCard) {
97          //if the lengths are the same, we only have one choice
98 <        //replace all of the index with WildCard
98 >        //replace all of the indices with WildCard
99          std::vector<int> singleResult(nWildCard, WildCard);
100          results.push_back(singleResult);
101          return results;
102      } else {
103 <        //we need to recursive calling ReplaceWildCard
103 >        //we need to recursively calling ReplaceWildCard
104          std::vector<int> firstPart;
105          std::vector<std::vector<int> > secondPart;
106          std::vector<std::vector<int> > sequences;
107  
108          for (int i = 0; i <=nRecursive; i ++) {
109 <          firstPart.clear();
110 <          for(int j = 0; j < i; ++j) {
111 <              firstPart.push_back(beginIndex + j);
112 <            }      
113 <            firstPart.push_back(WildCard);
109 >            
110 >            firstPart.clear();
111 >            for(int j = 0; j < i; ++j) {
112 >                firstPart.push_back(beginIndex + j);
113 >            }      
114 >            firstPart.push_back(WildCard);
115 >            
116              secondPart = ReplaceWildCard(beginIndex + i + 1, endIndex, nWildCard - 1);
117 <            sequences = adjoint(firstPart, secondPart);
118 <            results.insert(results.end(), sequences.begin(), sequences.end());                      
117 >            sequences = join(firstPart, secondPart);
118 >            results.insert(results.end(), sequences.begin(), sequences.end());              
119          }
120  
121          return results;
122      }
123   }
124  
125 < std::vector<std::vector<int> > adjoint( const std::vector<int>& firstPart, const std::vector<std::vector<int> >& secondPart){
125 > std::vector<std::vector<int> > join( const std::vector<int>& firstPart, const std::vector<std::vector<int> >& secondPart){
126      std::vector<std::vector<int> > results(secondPart.size());
127  
128      for (int i = 0; i < secondPart.size(); i++) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines