keep entries in matrix

This commit is contained in:
Carl William Pearson
2021-06-11 14:42:46 -06:00
parent fb88da915d
commit 2f82c65bbe

View File

@@ -475,7 +475,7 @@ CsrMat<Where::host> random_band_matrix(const int64_t n, const int64_t bw, const
int lb = r - bw;
int ub = r + bw + 1;
int64_t c = rand() % (ub - lb) + lb;
if (c < 0 || c > n) {
if (c < 0 || c >= n) {
continue; // don't over-weight first or last column
}