Return number of iterations after decoding
This commit is contained in:
@@ -31,7 +31,7 @@ public:
|
||||
Eigen::setNbThreads(8);
|
||||
}
|
||||
|
||||
const std::optional<Eigen::RowVectorXi>
|
||||
std::pair<std::optional<Eigen::RowVectorXi>, int>
|
||||
decode(const Eigen::Ref<const Eigen::VectorXd>& y) {
|
||||
Eigen::RowVectorXd s = Eigen::RowVectorXd::Zero(mH.cols());
|
||||
Eigen::RowVectorXi x_hat;
|
||||
@@ -49,11 +49,11 @@ public:
|
||||
}).cast<int>();
|
||||
|
||||
if (check_parity(x_hat)) {
|
||||
return x_hat;
|
||||
return {x_hat, i + 1};
|
||||
}
|
||||
}
|
||||
|
||||
return std::nullopt;
|
||||
return {std::nullopt, mK};
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user