Safe Haskell | None |
---|---|
Language | Haskell2010 |
Fast hash functions for Primary
sequences. This function maps
primary sequences to a continuous set of Ints [0 ..]
where the maximum
is dependent on the input length. This allows us to map short sequences
into contiguous memory locations. Useful for, say, energy lookup tables.
- newtype HashedPrimary t = HashedPrimary {}
- mkHashedPrimary :: forall t. (Unbox (Letter t), Bounded (Letter t), Enum (Letter t)) => Primary t -> HashedPrimary t
- hash2primary :: forall t. (Unbox (Letter t), Bounded (Letter t), Enum (Letter t)) => HashedPrimary t -> Primary t
Documentation
newtype HashedPrimary t Source
The hash of a primary sequence.
Vector Vector (HashedPrimary a) | |
MVector MVector (HashedPrimary a) | |
Bounded (HashedPrimary t) | |
Enum (HashedPrimary t) | |
Eq (HashedPrimary t) | |
Ord (HashedPrimary t) | |
Read (HashedPrimary t) | |
Show (HashedPrimary t) | |
Ix (HashedPrimary t) | |
Unbox (HashedPrimary a) | |
data MVector s0 (HashedPrimary a0) = MV_HashedPrimary (MVector s Int) | |
data Vector (HashedPrimary a0) = V_HashedPrimary (Vector Int) |
mkHashedPrimary :: forall t. (Unbox (Letter t), Bounded (Letter t), Enum (Letter t)) => Primary t -> HashedPrimary t Source
Given a piece of primary sequence information, reduce it to an index. The empty input produces an index of 0.
hash2primary :: forall t. (Unbox (Letter t), Bounded (Letter t), Enum (Letter t)) => HashedPrimary t -> Primary t Source
Turn a hash back into a sequence. Will fail if the resulting sequence has more than 100 elements.