Opened 6 years ago
Closed 6 years ago
#17564 closed enhancement (fixed)
Boilerplate hash, comparison and pickling for biseq_t
Reported by:  SimonKing  Owned by:  

Priority:  major  Milestone:  sage6.5 
Component:  algebra  Keywords:  
Cc:  jdemeyer  Merged in:  
Authors:  Simon King  Reviewers:  Jeroen Demeyer 
Report Upstream:  N/A  Work issues:  
Branch:  fd3fd82 (Commits)  Commit:  fd3fd824ce08e1459ab2c140c59e713425a86e8f 
Dependencies:  Stopgaps: 
Description (last modified by )
At #16453, Jeroen asked me to implement some useful functions directly for biseq_t
, not just for BoundedIntegerSequence
. The hash function has changed, I hope the new one is better.
Change History (9)
comment:1 Changed 6 years ago by
 Branch set to u/SimonKing/boilerplate_hash__comparison_and_pickling_for_biseq_t
comment:2 Changed 6 years ago by
 Cc jdemeyer added
 Commit set to f2a69ab9a9d5d3e276e937ae013bb63046a7eabd
 Component changed from PLEASE CHANGE to algebra
 Description modified (diff)
 Status changed from new to needs_review
 Type changed from PLEASE CHANGE to enhancement
comment:3 Changed 6 years ago by
I would simply keep the hash function from bitsets, at least it's fast and easy to understand.
comment:4 followup: ↓ 5 Changed 6 years ago by
Sorry to say, but your hash is actually much worse: the limb sequence (0,0,0,0,1) has the same hash as (0,0,0,0,0)
comment:5 in reply to: ↑ 4 Changed 6 years ago by
Replying to jdemeyer:
Sorry to say, but your hash is actually much worse: the limb sequence (0,0,0,0,1) has the same hash as (0,0,0,0,0)
Ouch...
OK, I'll return to the bitset hash. And also I should document the new functions.
comment:6 Changed 6 years ago by
 Commit changed from f2a69ab9a9d5d3e276e937ae013bb63046a7eabd to fd3fd824ce08e1459ab2c140c59e713425a86e8f
Branch pushed to git repo; I updated commit sha1. New commits:
fd3fd82  Better hash function for biseq_t. Document the new functions.

comment:7 Changed 6 years ago by
Hope the new hash function is better...
New commits:
fd3fd82  Better hash function for biseq_t. Document the new functions.

comment:8 Changed 6 years ago by
 Reviewers set to Jeroen Demeyer
 Status changed from needs_review to positive_review
comment:9 Changed 6 years ago by
 Branch changed from u/SimonKing/boilerplate_hash__comparison_and_pickling_for_biseq_t to fd3fd824ce08e1459ab2c140c59e713425a86e8f
 Resolution set to fixed
 Status changed from positive_review to closed
New commits:
More useful functions for biseq_t