Commit f989add 1 parent b7b6a7e commit f989add Copy full SHA for f989add
File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,12 @@ struct Fsa {
112
112
return !arc_indexes.empty () ? (static_cast <int32_t >(arc_indexes.size ()) - 1 )
113
113
: 0 ;
114
114
}
115
+
116
+ int32_t FinalState () const {
117
+ // It's not valid to call this if the FSA is empty.
118
+ CHECK (!arc_indexes.empty ());
119
+ return arc_indexes.size () - 2 ;
120
+ }
115
121
};
116
122
117
123
/*
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ struct PairHash {
34
34
};
35
35
36
36
static const double kMinLogDiffDouble = log(DBL_EPSILON); // negative!
37
- static const float kMinLogDiffFloat = log (FLT_EPSILON); // negative!
37
+ static const float kMinLogDiffFloat = logf (FLT_EPSILON); // negative!
38
38
39
39
// returns log(exp(x) + exp(y)).
40
40
inline double LogAdd (double x, double y) {
@@ -71,7 +71,7 @@ inline float LogAdd(float x, float y) {
71
71
72
72
if (diff >= kMinLogDiffFloat ) {
73
73
float res;
74
- res = x + log1p ( exp (diff));
74
+ res = x + log1pf ( expf (diff));
75
75
return res;
76
76
} else {
77
77
return x; // return the larger one.
You can’t perform that action at this time.
0 commit comments