everything working
This commit is contained in:
@ -81,6 +81,9 @@ bool SQMTableModel::setData(const QModelIndex &index, const QVariant &value, int
|
|||||||
int row = index.row();
|
int row = index.row();
|
||||||
int col = index.column();
|
int col = index.column();
|
||||||
|
|
||||||
|
if (col == 0 && value.toInt() != 0 && value.toInt() != 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// call calculateSqmMatrix
|
// call calculateSqmMatrix
|
||||||
sqmMatrix.at(col).at(row) = value.toInt();
|
sqmMatrix.at(col).at(row) = value.toInt();
|
||||||
@ -174,10 +177,14 @@ void SQMTableModel::UpdateSqmMatrix(QModelIndex startIndex) {
|
|||||||
|
|
||||||
// Update sqmMatrix
|
// Update sqmMatrix
|
||||||
for (int i = start_row; i < binLen; i++) {
|
for (int i = start_row; i < binLen; i++) {
|
||||||
if (start_col != 1) {
|
if (start_row == 0 && start_col == 0) {
|
||||||
sqmMatrix.at(1).at(i) = (sqmMatrix.at(2).at(i - 1) * sqmMatrix.at(2).at(i - 1)) % mod;
|
sqmMatrix.at(1).at(i) = 1;
|
||||||
|
start_row = 1;
|
||||||
}
|
}
|
||||||
|
else if (start_col != 1) {
|
||||||
|
sqmMatrix.at(1).at(i) = (sqmMatrix.at(2).at(i - 1) * sqmMatrix.at(2).at(i - 1)) % mod;
|
||||||
|
}
|
||||||
|
|
||||||
start_col = 0;
|
start_col = 0;
|
||||||
if (sqmMatrix.at(0).at(i) == 0) {
|
if (sqmMatrix.at(0).at(i) == 0) {
|
||||||
sqmMatrix.at(2).at(i) = sqmMatrix.at(1).at(i);
|
sqmMatrix.at(2).at(i) = sqmMatrix.at(1).at(i);
|
||||||
|
Reference in New Issue
Block a user