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

Diff of /queensgui/src/containermnvector.cpp

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

revision 5 by torben, Thu Jul 19 23:44:01 2007 UTC revision 6 by torben, Fri Jul 20 09:54:09 2007 UTC
# Line 19  Line 19 
19   ***************************************************************************/   ***************************************************************************/
20  #include "containermnvector.h"  #include "containermnvector.h"
21    
22    #include <memory>
23    
24  ContainerMNVector::ContainerMNVector(GUIUpdate* update)  ContainerMNVector::ContainerMNVector(GUIUpdate* update)
25   : ContainerVector(update)   : ContainerVector(update)
26  {  {
# Line 31  ContainerMNVector::~ContainerMNVector() Line 33  ContainerMNVector::~ContainerMNVector()
33    
34  void ContainerMNVector::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 ContainerMNVector::uniqueSolutions( Line 43  void ContainerMNVector::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]->copy() ;                          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();

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

  ViewVC Help
Powered by ViewVC 1.1.20