27 #include <type_traits> 43 template <
class W,
class L ,
class S >
55 ArcTpl() noexcept(std::is_nothrow_default_constructible_v<
Weight>) = default;
61 weight(std::forward<T>(weight)),
62 nextstate(nextstate) {}
68 static const std::string &
Type() {
69 static const auto *
const type =
new std::string(
70 Weight::Type() ==
"tropical" ?
"standard" : Weight::Type());
86 template <StringType S = STRING_LEFT>
93 static const std::string &
Type() {
94 static const auto *
const type =
new std::string(
97 :
"restricted_standard_string"));
104 template <
class A, GallicType G = GALLIC_LEFT>
106 typename A::Label, typename A::StateId> {
108 typename A::Label,
typename A::StateId>;
117 static const std::string &
Type() {
118 static const auto *
const type =
new std::string(
124 ?
"restricted_gallic_" 125 : (G ==
GALLIC_MIN ?
"min_gallic_" :
"gallic_")))) +
134 typename A::Label, typename A::StateId> {
135 using Base =
ArcTpl<
typename A::Weight::ReverseWeight,
typename A::Label,
136 typename A::StateId>;
141 static const std::string &
Type() {
142 static const auto *
const type =
new std::string(
"reverse_" + Arc::Type());
148 template <
class Weight1,
class Weight2>
152 template <
class Weight1,
class Weight2>
158 template <
class A,
size_t n>
160 typename A::Label, typename A::StateId> {
162 typename A::StateId>;
167 static const std::string &
Type() {
168 static const auto *
const type =
169 new std::string(Arc::Type() +
"_^" + std::to_string(n));
176 template <
class A,
class K =
int>
178 typename A::Label, typename A::StateId> {
180 typename A::Label,
typename A::StateId>;
185 static const std::string &
Type() {
186 static const std::string *
const type = [] {
187 std::string type = Arc::Type() +
"_^n";
188 if (
sizeof(K) !=
sizeof(uint32_t)) {
189 type +=
"_" + std::to_string(CHAR_BIT *
sizeof(K));
191 return new std::string(type);
200 template <
class A,
class X2>
202 typename A::Label, typename A::StateId> {
204 typename A::Label,
typename A::StateId>;
206 using X1 =
typename Arc::Weight;
210 static const std::string &
Type() {
211 static const auto *
const type =
212 new std::string(
"expectation_" + Arc::Type() +
"_" + X2::Type());
static const std::string & Type()
ArcTpl(Label ilabel, Label olabel, StateId nextstate)
static const std::string & Type()
ArcTpl() noexcept(std::is_nothrow_default_constructible_v< Weight >)=default
static const std::string & Type()
static const std::string & Type()
static const std::string & Type()
static const std::string & Type()
static const std::string & Type()
GallicArc(const Arc &arc)