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

Diff of /queensgui/src/containermnvector.cpp

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

queensgui/src/solutionmnvector.cpp revision 1 by torben, Thu Jul 19 21:34:15 2007 UTC queensgui/src/containermnvector.cpp revision 6 by torben, Fri Jul 20 09:54:09 2007 UTC
# Line 17  Line 17 
17   *   Free Software Foundation, Inc.,                                       *   *   Free Software Foundation, Inc.,                                       *
18   *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *   *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19   ***************************************************************************/   ***************************************************************************/
20  #include "solutionmnvector.h"  #include "containermnvector.h"
21    
22  SolutionMNVector::SolutionMNVector(GUIUpdate* update)  #include <memory>
23   : SolutionVector(update)  
24    ContainerMNVector::ContainerMNVector(GUIUpdate* update)
25     : ContainerVector(update)
26  {  {
27  }  }
28    
29    
30  SolutionMNVector::~SolutionMNVector()  ContainerMNVector::~ContainerMNVector()
31  {  {
32  }  }
33    
34  void SolutionMNVector::uniqueSolutions()  void ContainerMNVector::uniqueSolutions()
35  {  {
36          std::vector<Solution> buf;          std::vector< boost::shared_ptr<Solution> > buf;
37          buf.reserve(solutions.size() / 10);          buf.reserve(solutions.size() / 10);
38          for (unsigned int i=0; i<solutions.size(); i++) {          for (unsigned int i=0; i<solutions.size(); i++) {
39                  if (m_halt)                  if (m_halt)
# Line 41  void SolutionMNVector::uniqueSolutions() Line 43  void SolutionMNVector::uniqueSolutions()
43                  for (j=0; j<buf.size(); j++) {                  for (j=0; j<buf.size(); j++) {
44                          if (m_halt)                          if (m_halt)
45                                  break;                                  break;
46                          Solution tmp ( solutions[i] );                          std::auto_ptr<Solution> tmp ( solutions[i]->copy() ) ;
47    
48                          if (tmp == buf[j])                          if (*tmp == *buf[j])
49                                  break;                                  break;
50                          tmp.rotate90();                          tmp->rotate90();
51                                                    
52                          if (tmp == buf[j])                          if ( *tmp == *buf[j])
53                                  break;                                  break;
54                                                    
55                          tmp.rotate90();                          tmp->rotate90();
56                          if (tmp == buf[j])                          if (*tmp == *buf[j])
57                                  break;                                  break;
58                                                                    
59                          tmp.rotate90();                          tmp->rotate90();
60                          if (tmp == buf[j])                          if (*tmp == *buf[j])
61                                  break;                                  break;
62                                                    
63                          tmp.mirror();                          tmp->mirror();
64                          if (tmp == buf[j])                          if (*tmp == *buf[j])
65                                  break;                                  break;
66                                                    
67                          tmp.rotate90();                          tmp->rotate90();
68                          if (tmp == buf[j])                          if (*tmp == *buf[j])
69                                  break;                                  break;
70                                                                    
71                          tmp.rotate90();                          tmp->rotate90();
72                          if (tmp == buf[j])                          if (*tmp == *buf[j])
73                                  break;                                  break;
74                                                                    
75                          tmp.rotate90();                          tmp->rotate90();
76                          if (tmp == buf[j])                          if (*tmp == *buf[j])
77                                  break;                                  break;
78                  }                  }
79                  if ( j == buf.size() )                  if ( j == buf.size() )
# Line 82  void SolutionMNVector::uniqueSolutions() Line 84  void SolutionMNVector::uniqueSolutions()
84                  }                  }
85          }          }
86          solutions = buf;          solutions = buf;
87            
88  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.20