b0VIM 8.0 Ϛ�Z<
��R masaki nt172 ~masaki/solutions/research/bio-seq-algos/src/utils.rs utf-8
3210 #"! U tp 6 ad M A 6 � � � � h g S 9 � � � { E �
�
^
-
� � � � d ; � � � { R ' % �
�
�
�
�
�
�
?
'
� � � � � � � _ C A 1 } } } } } } x.log2() * INVERSE_LOG2_E pub fn fast_ln(x: PartitionFunc) -> LogPf { #[inline] } } fast_ln(xs.iter().fold(0., |acc, &x| acc + (x - max).exp())) + max } else { fast_ln(xs.iter().fold(0., |acc, &x| acc + x.exp())) if !max.is_finite() { pub fn logsumexp(xs: SliceOfEpsOfTerms4LogPf, max: ExpPartOfTerm4LogPf) -> LogPf { #[inline] const INVERSE_LOG2_E: LogPf = 1. / LOG2_E; pub type PosPair = (Pos, Pos); pub type Pos = usize; pub type ProbSeqPair = (Probs, Probs); } pub base_extending_gap_penalty: SaScore, pub base_opening_gap_penalty: SaScore, pub ca_sm: CaScoreMat, pub struct SaScoringParams { pub type CaScoreMat = HashMap<CharPair, SaScore, Hasher>; pub type SaScore = LogProb; pub type SsPair<'a> = (SeqSlice<'a>, SeqSlice<'a>); pub type LogPpfMat = Vec<LogPartialPfs>; pub type LogPartialPfs = Vec<LogPf>; pub type LogProbMat = Vec<LogProbs>; pub type LogProbs = Vec<LogProb>; pub type ProbMat = Vec<Probs>; pub type Probs = Vec<Prob>; pub type CharPair = (Char, Char); pub type Hasher = BuildHasherDefault<FnvHasher>; pub type SliceOfEpsOfTerms4LogProb<'a> = &'a[ExpPartOfTerm4LogProb]; pub type EpsOfTerms4LogProb = Vec<ExpPartOfTerm4LogProb>; pub type ExpPartOfTerm4LogProb = Prob; pub type SliceOfEpsOfTerms4LogPf<'a> = &'a[ExpPartOfTerm4LogPf]; pub type EpsOfTerms4LogPf = Vec<ExpPartOfTerm4LogPf>; pub type ExpPartOfTerm4LogPf = PartitionFunc; pub type LogPf = PartitionFunc; pub type PartitionFunc = Prob; pub type LogProb = Prob; pub type Prob = f64; pub type SeqSlice<'a> = &'a[Char]; pub type Seq = Vec<Char>; pub type Char = u8; pub use std::f64::NEG_INFINITY; use std::hash::BuildHasherDefault; use fnv::FnvHasher; pub use std::collections::HashMap; use std::f64::consts::LOG2_E;