/[projects]/queensgui/src/solutionvector.cpp
ViewVC logotype

Diff of /queensgui/src/solutionvector.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1 by torben, Thu Jul 19 21:34:15 2007 UTC revision 2 by torben, Thu Jul 19 22:26:42 2007 UTC
# Line 59  void SolutionVector::uniqueSolutionsWork Line 59  void SolutionVector::uniqueSolutionsWork
59          if (total == -1)          if (total == -1)
60                  total = solutions.size();                  total = solutions.size();
61                    
62          std::vector<Solution> buf;          std::vector<Solution*> buf;
63          for (unsigned int i=0; i<solutions.size(); i++) {          for (unsigned int i=0; i<solutions.size(); i++) {
64                  if (m_halt)                  if (m_halt)
65                          return;                          return;
66                  match_count = 0;                  match_count = 0;
67                  Solution tmp(solutions[i]);                  Solution* tmp = solutions[i]->copy();
68                  if (mirror)                  if (mirror)
69                          tmp.mirror();                          tmp->mirror();
70                  for (int k=0;k<rot;k++)                  for (int k=0;k<rot;k++)
71                          tmp.rotate90();                          tmp->rotate90();
72    
73                  //unders�g kun resten af m�ngden, start ved i                  //unders�g kun resten af m�ngden, start ved i
74                  for (unsigned int j=i+1; j<solutions.size();j++) {                  for (unsigned int j=i+1; j<solutions.size();j++) {
75                          if ( tmp == solutions[j] ) {                          if ( *tmp == *solutions[j] ) {
76                                  match_count++;                                  match_count++;
77                                  break;                                  break;
78                          }                          }
# Line 89  void SolutionVector::uniqueSolutionsWork Line 89  void SolutionVector::uniqueSolutionsWork
89    
90    
91    
92  void SolutionVector::addSolution(Solution sol)  void SolutionVector::addSolution(Solution* sol)
93  {  {
94      solutions.push_back(sol);        solutions.push_back(sol);  
95  }  }
96    
97  Solution SolutionVector::solution(int index)  Solution* SolutionVector::solution(int index)
98  {  {
99      return solutions[index] ;      return solutions[index] ;
100  }  }

Legend:
Removed from v.1  
changed lines
  Added in v.2

  ViewVC Help
Powered by ViewVC 1.1.20