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) |
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(); |