matrix: cleanup is_magic method types
This commit is contained in:
parent
99bf1af4b2
commit
676c5270b7
@ -243,12 +243,18 @@ matrix::is_magic (void) const {
|
|||||||
unsigned int sum1 = 0, sum2 = 0;
|
unsigned int sum1 = 0, sum2 = 0;
|
||||||
|
|
||||||
for (unsigned int j = 0; j < m_columns; ++j) {
|
for (unsigned int j = 0; j < m_columns; ++j) {
|
||||||
if (!numbers.contains ((*this)[i][j]) ||
|
double a = (*this)[i][j],
|
||||||
!numbers.contains ((*this)[j][i]))
|
b = (*this)[j][i];
|
||||||
|
|
||||||
|
if (!exactly_zero (a) || !exactly_zero (b))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
sum1 += (*this)[i][j];
|
if (!numbers.contains (a) ||
|
||||||
sum2 += (*this)[j][i];
|
!numbers.contains (b))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
sum1 += static_cast<unsigned> (a);
|
||||||
|
sum2 += static_cast<unsigned> (b);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sum1 != expected || sum2 != expected)
|
if (sum1 != expected || sum2 != expected)
|
||||||
|
Loading…
Reference in New Issue
Block a user