/[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 2 by torben, Thu Jul 19 22:26:42 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]->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.2  
changed lines
  Added in v.6

  ViewVC Help
Powered by ViewVC 1.1.20