Skip to content

Commit edc8d42

Browse files
committed
Fix GetEnteringArcs declaration...
1 parent 51ba03c commit edc8d42

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

k2/csrc/fsa.h

-11
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,6 @@ struct DenseFsa {
112112
DenseFsa(Weight *data, int32_t T, int32_t num_symbols, int32_t stride);
113113
};
114114

115-
/*
116-
this general-purpose structure conceptually the same as
117-
std::vector<std::vector>; elements of `ranges` are (begin, end) indexes into
118-
`values`.
119-
120-
121-
*/
122-
struct VecOfVec {
123-
std::vector<std::pair<int32, int32> > elems;
124-
};
125-
126115
struct Fst {
127116
Fsa core;
128117
std::vector<int32_t> aux_label;

k2/csrc/fsa_util.h

+16-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,23 @@ namespace k2 {
1515
Computes lists of arcs entering each state (needed for algorithms that
1616
traverse the Fsa in reverse order).
1717
18-
Requires that `fsa` be valid and top-sorted, i.e.
19-
CheckProperties(fsa, KTopSorted) == true.
18+
Requires that `fsa` be valid and top-sorted, i.e. CheckProperties(fsa,
19+
KTopSorted) == true.
20+
21+
@param [out] arc_index A list of arc indexes.
22+
For states 0 < s < fsa.NumStates(),
23+
the elements arc_index[i] for end_index[s-1] <= i < end_index[s]
24+
contain the arc-indexes in fsa.arcs for arcs that
25+
enter state s.
26+
@param [out] end_index For each state, the `end` index in `arc_index`
27+
where we can find arcs entering this state, i.e.
28+
one past the index of the last element in `arc_index`
29+
that points to an arc entering this state.
2030
*/
21-
void GetEnteringArcs(const Fsa &fsa, VecOfVec *entering_arcs);
31+
void GetEnteringArcs(const Fsa &fsa,
32+
std::vector<int32_t> *arc_index,
33+
std::vector<int32_t> *end_index);
34+
2235

2336
} // namespace k2
2437

0 commit comments

Comments
 (0)