jessicapriebe commented on code in PR #2406:
URL: https://github.com/apache/systemds/pull/2406#discussion_r2728175068
##########
src/main/java/org/apache/sysds/runtime/data/SparseBlockCSC.java:
##########
@@ -581,11 +579,13 @@ public boolean checkValidity(int rlen, int clen, long
nnz, boolean strict) {
throw new RuntimeException(
"The values array should not contain
zeros." + " The " + i + "th value is " + _values[i]);
}
+ if(_indexes[i] < 0)
+ throw new RuntimeException("Invalid index at
pos=" + i);
}
//6. a capacity that is no larger than nnz times resize factor.
int capacity = _values.length;
- if(capacity > nnz * RESIZE_FACTOR1) {
+ if(capacity > INIT_CAPACITY && capacity > nnz * RESIZE_FACTOR1)
{
Review Comment:
I added the extra check to keep INIT_CAPACITY valid for very small nnz.
Without it, capacity = INIT_CAPACITY with nnz = 0 or 1 would throw the
exception.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]