diff options
author | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-13 08:20:47 +0000 |
---|---|---|
committer | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-13 08:20:47 +0000 |
commit | 5fd3e970bf9ef0ce243a9c66c791c6b420b2a86a (patch) | |
tree | 33a7995d86e3ba10631c2aa68a3b53dfd9390248 /decoder/exp_semiring.h | |
parent | e60301e1be0a0d5bb44f1efd40ff43316121d4d3 (diff) |
(NEEDS TESTING) cfg index rules->nts, sort by prob, remove duplicates keeping highest prob, topo sort (and after binarize topo sort). beginning to apply_fsa_models (PrefixTrieNode)
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@539 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/exp_semiring.h')
-rw-r--r-- | decoder/exp_semiring.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/decoder/exp_semiring.h b/decoder/exp_semiring.h index f91beee4..111eaaf1 100644 --- a/decoder/exp_semiring.h +++ b/decoder/exp_semiring.h @@ -14,7 +14,7 @@ // PType scalar, RType vector // BAD examples: // PType vector, RType scalar -template <typename PType, typename RType> +template <class PType, class RType> struct PRPair { PRPair() : p(), r() {} // Inside algorithm requires that T(0) and T(1) @@ -35,26 +35,26 @@ struct PRPair { RType r; }; -template <typename P, typename R> +template <class P, class R> std::ostream& operator<<(std::ostream& o, const PRPair<P,R>& x) { return o << '<' << x.p << ", " << x.r << '>'; } -template <typename P, typename R> +template <class P, class R> const PRPair<P,R> operator+(const PRPair<P,R>& a, const PRPair<P,R>& b) { PRPair<P,R> result = a; result += b; return result; } -template <typename P, typename R> +template <class P, class R> const PRPair<P,R> operator*(const PRPair<P,R>& a, const PRPair<P,R>& b) { PRPair<P,R> result = a; result *= b; return result; } -template <typename P, typename PWeightFunction, typename R, typename RWeightFunction> +template <class P, class PWeightFunction, class R, class RWeightFunction> struct PRWeightFunction { explicit PRWeightFunction(const PWeightFunction& pwf = PWeightFunction(), const RWeightFunction& rwf = RWeightFunction()) : |