sebwrede commented on pull request #1237:
URL: https://github.com/apache/systemds/pull/1237#issuecomment-833301963


   > Why not allow the two federated ranges to be equal if the arrays are the 
same and they are both overlapping?
   > then you don't have to care about the hash of this element, making the 
implementation cleaner.
   > In general why does the ranges need to implement comparable, if it is just 
for sorting then allowing them to be equal is fine.
   
   The hashCode, equals, and compareTo are used when putting the range into a 
federation map. Depending on the data structure chosen for the federation map, 
which in most cases is a TreeMap, one or more of the methods will need to 
separate between the overlapping ranges. This is the point of adding some kind 
of uniqueness to the ranges. 
   If I change one of the three methods, then I should change all of them to 
include this unique value. Otherwise, it will be really confusing later on if 
there is a difference between putting into a HashMap vs a TreeMap. 
   Additionally, I add the uniqueness to the toString method so that we can see 
the difference in the print. 
   
   > it would be cool if you enabled some of the tests in the python API, since 
i added overlapping tests there sometime back and never got to use them
   
   Where do I find this? 
   
   


-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to