FST  openfst-1.7.2
OpenFst Library
minimize.h
Go to the documentation of this file.
1 // See www.openfst.org for extensive documentation on this weighted
2 // finite-state transducer library.
3 
4 #ifndef FST_SCRIPT_MINIMIZE_H_
5 #define FST_SCRIPT_MINIMIZE_H_
6 
7 #include <tuple>
8 
9 #include <fst/minimize.h>
10 #include <fst/script/fst-class.h>
11 
12 namespace fst {
13 namespace script {
14 
15 using MinimizeArgs = std::tuple<MutableFstClass *, MutableFstClass *, float,
16  bool>;
17 
18 template <class Arc>
19 void Minimize(MinimizeArgs *args) {
20  MutableFst<Arc> *ofst1 = std::get<0>(*args)->GetMutableFst<Arc>();
21  MutableFst<Arc> *ofst2 = (std::get<1>(*args) ?
22  std::get<1>(*args)->GetMutableFst<Arc>() :
23  nullptr);
24  Minimize(ofst1, ofst2, std::get<2>(*args), std::get<3>(*args));
25 }
26 
27 void Minimize(MutableFstClass *ofst1, MutableFstClass *ofst2 = nullptr,
28  float delta = kShortestDelta, bool allow_nondet = false);
29 
30 } // namespace script
31 } // namespace fst
32 
33 #endif // FST_SCRIPT_MINIMIZE_H_
void Minimize(MinimizeArgs *args)
Definition: minimize.h:19
std::tuple< MutableFstClass *, MutableFstClass *, float, bool > MinimizeArgs
Definition: minimize.h:16
constexpr float kShortestDelta