jessicapriebe commented on code in PR #2406:
URL: https://github.com/apache/systemds/pull/2406#discussion_r2729102508
##########
src/main/java/org/apache/sysds/runtime/data/SparseBlockCOO.java:
##########
@@ -221,12 +235,12 @@ public boolean checkValidity(int rlen, int clen, long
nnz, boolean strict) {
}
//2. correct array lengths
- if(_size != nnz && _cindexes.length < nnz && _rindexes.length <
nnz && _values.length < nnz) {
+ if(_size != nnz || _cindexes.length < nnz || _rindexes.length <
nnz || _values.length < nnz) {
Review Comment:
You're right they are very similar! I tried unifying them, but it ended up
making the code less readable. These checks differ slightly across sparse types
(different variables, boundaries, slightly different function calls and
exception messages). Keeping them separate feels cleaner and clearer, what do
you think?
--
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]