26 false, false, Aut, Auts...>
37 template <
size_t... I>
38 using seq =
typename super_t::template
seq<I...>;
48 using label_t =
typename labelset_t::value_t;
49 using weight_t =
typename weightset_t::value_t;
74 while (!
aut_->todo_.empty())
76 const auto& p =
aut_->todo_.front();
78 aut_->todo_.pop_front();
81 catch (
const std::runtime_error& e)
83 raise(e,
" while tupling automata");
99 template <std::size_t... I>
104 if (!
all((std::get<I>(psrc) == std::get<I>(
aut_->auts_)->post())...))
106 const auto& ls = *
aut_->labelset();
107 const auto& ws = *
aut_->weightset();
112 auto label = ls.special();
115 add_tape_transitions_<0>(src, psrc, dst,
label,
weight);
127 template <std::
size_t I>
132 const auto& ls = *
aut_->labelset();
133 const auto& ws = *
aut_->weightset();
134 const auto& aut = std::get<I>(
aut_->auts_);
139 ([
this](
auto src,
const auto&,
const auto& dstn,
140 const auto& label,
const auto& weight)
145 aut_->set_final(src, weight);
147 aut_->new_transition(src,
state(dstn), label, weight);
149 [
this](
auto src,
const auto& srcn,
const auto& dstn,
152 add_tape_transitions_<I + 1>(src, srcn, dstn,
label,
weight);
155 if (std::get<I>(srcn) == aut->post())
158 add(src, srcn, dstn, label, weight);
161 for (
auto t: aut->all_out(std::get<I>(srcn)))
164 = aut->dst_of(t) == aut->post()
167 std::get<I>(dstn) = aut->dst_of(t);
168 add(src, srcn, dstn, label, ws.mul(weight, aut->weight_of(t)));
198 template <
typename Auts,
size_t... I>
207 template <
typename Auts>
209 tuple(
const std::vector<automaton>& as)
213 return tuple_<Auts>(as, indices);
base_t< tuple_element_t< I, automata_t > > input_automaton_t
The type of the Ith input automaton, unqualified.
typename detail::weightset_t_of_impl< base_t< ValueSet > >::type weightset_t_of
tuple_automata_impl self_t
auto label_one(const LabelSet &ls) -> typename LabelSet::value_t
Enjoy type inference.
void add_tape_transitions_(const state_t src, const state_name_t &srcn, state_name_t dstn, label_t label, const weight_t &weight)
Add outgoing transitions from src computed by looking at tape I and beyond.
automaton tuple(const std::vector< automaton > &as)
Bridge.
typename tuple_automaton_impl::state_name_t state_name_t
tuple_automata_impl(Aut aut, const Auts &... auts)
Build a tuple automaton.
Decorator implementing the laziness for an algorithm.
typename super_t::state_t state_t
void add_tuple_transitions(const state_t src, const state_name_t &psrc)
Add transitions to the result automaton, starting from the given result input state, which must correspond to the given pair of input state automata.
auto tuple_context(Ctx &&... ctx) -> context< tupleset< labelset_t_of< Ctx >... >, join_t< weightset_t_of< Ctx >... >>
void add_tuple_transitions_(const state_t src, const state_name_t &psrc, seq< I... >)
state_t state(Args &&... args)
Conversion from state name to state number.
automaton_t aut_
The wrapped automaton, possibly const.
auto tuple(const Auts &... as)
Build the (accessible part of the) tuple.
typename detail::context_t_of_impl< base_t< ValueSet > >::type context_t_of
typename std::tuple_element< I, T >::type tuple_element_t
C++14.
typename weightset_t::value_t weight_t
typename labelset_t::value_t label_t
typename super_t::state_name_t state_name_t
typename detail::labelset_t_of_impl< base_t< ValueSet > >::type labelset_t_of
Build the static sequence of size_t [0, N[.
std::remove_cv_t< std::remove_reference_t< T > > base_t
T without reference or const/volatile qualifiers.
automaton tuple_(const std::vector< automaton > &as, vcsn::detail::index_sequence< I... >)
Bridge helper.
Aut automaton_t
The type of the resulting automaton.
context_t_of< Aut > context_t
The context of the result.
void tuple()
Compute the (accessible part of the) tuple.
typename tuple_automaton_impl::state_t state_t
std::tuple< typename transition_map_t< Auts >::map_t &... > out_(const state_name_t &ss)
The outgoing tuple of transitions from state tuple ss.
typename super_t::template seq< I... > seq
std::tuple< Auts... > automata_t
The type of input automata.
value_impl< detail::label_tag > label
std::tuple< transition_map_t< Auts >... > transition_maps_
Transition caches.
auto static_if(Then &&then, Else &&else_)
Execute the then- or the else-clause depending on cond.
mutable_automaton< Context > make_mutable_automaton(const Context &ctx)
Build the (accessible part of the) Cartesian product of automata.
weightset_t_of< context_t > weightset_t
labelset_t_of< context_t > labelset_t
const weightset_t & ws_
The resulting weightset.
value_impl< detail::weight_tag > weight
bool all(Bool &&... values)
Whether all the values evaluate as true.