18 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
19 |
***************************************************************************/ |
***************************************************************************/ |
20 |
|
|
21 |
|
/* |
22 |
#include "solutionmatrix.h" |
#include "solutionmatrix.h" |
23 |
|
|
24 |
SolutionMatrix::SolutionMatrix(int size) |
SolutionMatrix::SolutionMatrix(int size) |
86 |
return true; |
return true; |
87 |
} |
} |
88 |
|
|
|
bool SolutionMatrix::operator!=(const Solution& s) |
|
|
{ |
|
|
const SolutionMatrix& sol = dynamic_cast<const SolutionMatrix&>(s); |
|
|
|
|
|
int matchcount = 0; |
|
|
for (int i=0; i<m_size; i++) |
|
|
for (int j=0; j<m_size; j++) |
|
|
if (m_matrix[i][j] == sol.m_matrix[i][j]) |
|
|
matchcount++; |
|
|
if (matchcount == (m_size*2) ) |
|
|
return false; |
|
|
else |
|
|
return true; |
|
|
} |
|
|
|
|
89 |
bool SolutionMatrix::getMatrix(int x, int y) { |
bool SolutionMatrix::getMatrix(int x, int y) { |
90 |
return m_matrix[x][y]; |
return m_matrix[x][y]; |
91 |
} |
} |
99 |
{ |
{ |
100 |
return new SolutionMatrix(*this); |
return new SolutionMatrix(*this); |
101 |
} |
} |
102 |
|
*/ |
103 |
|
|