55 |
|
|
56 |
void ContainerMinimalVector::addSolution(Solution* sol) |
void ContainerMinimalVector::addSolution(Solution* sol) |
57 |
{ |
{ |
58 |
std::auto_ptr<Solution> tmp( sol->copy() ); |
std::auto_ptr<Solution> norm1( sol->copy() ); |
59 |
|
std::auto_ptr<Solution> norm2( sol->copy() ); |
60 |
|
std::auto_ptr<Solution> norm3( sol->copy() ); |
61 |
|
|
62 |
|
std::auto_ptr<Solution> mirror1( sol->copy() ); |
63 |
|
std::auto_ptr<Solution> mirror2( sol->copy() ); |
64 |
|
std::auto_ptr<Solution> mirror3( sol->copy() ); |
65 |
|
std::auto_ptr<Solution> mirror4( sol->copy() ); |
66 |
bool found = false; |
bool found = false; |
67 |
|
|
68 |
for (VIt it = m_solutions.begin(); it != m_solutions.end(); it++) |
norm1->rotate90(); |
69 |
|
norm2->rotate90(); |
70 |
|
norm2->rotate90(); |
71 |
|
norm3->rotate90(); |
72 |
|
norm3->rotate90(); |
73 |
|
norm3->rotate90(); |
74 |
|
|
75 |
|
mirror1->mirror(); |
76 |
|
mirror2->mirror(); |
77 |
|
mirror2->rotate90(); |
78 |
|
mirror3->mirror(); |
79 |
|
mirror3->rotate90(); |
80 |
|
mirror3->rotate90(); |
81 |
|
mirror4->mirror(); |
82 |
|
mirror4->rotate90(); |
83 |
|
mirror4->rotate90(); |
84 |
|
mirror4->rotate90(); |
85 |
|
|
86 |
|
for (VIt it = m_solutions.begin(); it != m_solutions.end() && found == false; it++) |
87 |
{ |
{ |
88 |
tmp->rotate90(); |
if ( *norm1 == *(*it) || *norm2 == *(*it) || *norm3 == *(*it) || |
89 |
if ( *tmp == *(*it)) |
*mirror1 == *(*it) || *mirror2 == *(*it) || *mirror3 == *(*it) || *mirror4 == *(*it)) |
|
{ |
|
|
found = true; |
|
|
break; |
|
|
} |
|
|
|
|
|
|
|
|
tmp->rotate90(); |
|
|
if ( *tmp == *(*it)) |
|
|
{ |
|
|
found = true; |
|
|
break; |
|
|
} |
|
|
|
|
|
tmp->rotate90(); |
|
|
if ( *tmp == *(*it)) |
|
|
{ |
|
|
found = true; |
|
|
break; |
|
|
} |
|
|
tmp->rotate90(); |
|
|
if ( *tmp == *(*it)) |
|
|
{ |
|
|
found = true; |
|
|
break; |
|
|
} |
|
|
tmp->mirror(); |
|
|
if ( *tmp == *(*it)) |
|
|
{ |
|
|
found = true; |
|
|
break; |
|
|
} |
|
|
|
|
|
tmp->rotate90(); |
|
|
if ( *tmp == *(*it)) |
|
|
{ |
|
|
found = true; |
|
|
break; |
|
|
} |
|
|
tmp->rotate90(); |
|
|
if ( *tmp == *(*it)) |
|
|
{ |
|
|
found = true; |
|
|
break; |
|
|
} |
|
|
tmp->rotate90(); |
|
|
if ( *tmp == *(*it)) |
|
90 |
{ |
{ |
91 |
found = true; |
found = true; |
92 |
break; |
break; |