1 #ifndef VCSN_ALGOS_TRANSPOSE_HH
2 # define VCSN_ALGOS_TRANSPOSE_HH
4 # include <vcsn/algos/fwd.hh>
22 template <
typename Aut>
23 class transpose_automaton_impl :
public automaton_decorator<Aut>
34 automaton_t::element_type::automaton_nocv_t>;
45 using kind_t =
typename automaton_t::element_type::kind_t;
47 using super_t::super_t;
55 std::string
vname(
bool full =
true)
const
57 return "transpose_automaton<" +
aut_->vname(full) +
">";
78 # define DEFINE(Signature, Value) \
81 -> decltype(aut_->Value) \
87 template <
typename Pred>
90 template <
typename Pred>
135 # define DEFINE(Signature, Value) \
138 -> decltype(aut_->Value) \
140 return aut_->Value; \
163 aut_->labelset()->transpose(l),
164 aut_->weightset()->transpose(k)));
170 aut_->labelset()->transpose(l),
171 aut_->weightset()->transpose(k)));
174 aut_->labelset()->transpose(l)));
178 aut_->labelset()->transpose(l),
179 aut_->weightset()->transpose(k)));
189 template <
typename A>
192 typename A::element_type::transition_t t,
196 template <
typename A>
199 typename A::element_type::transition_t t,
211 # define DEFINE(Signature, Value) \
215 -> decltype(automaton_t::element_type::Value) \
217 return automaton_t::element_type::Value; \
227 template <
typename Aut>
232 return aut->naked_automaton();
235 template <
typename Aut>
237 transpose_automaton<Aut>
240 return make_shared_ptr<transpose_automaton<Aut>>(aut);
248 template <
typename Aut>
252 auto& a = aut->as<Aut>();
270 template <
typename RatExpSet>
274 const auto& e = exp->as<RatExpSet>();
294 template <
typename RatExpSet>
298 const auto& e = exp->as<RatExpSet>();
301 e.ratexpset().transposition(e.ratexp()));
311 #endif // !VCSN_ALGOS_TRANSPOSE_HH
ATTRIBUTE_PURE auto get_initial_weight(state_t s) const -> decltype(aut_-> weightset() ->transpose(aut_->get_ final _weight(s)))
ratexp make_ratexp(const RatExpSet &rs, const typename RatExpSet::value_t &ratexp)
auto num_initials() const -> decltype(aut_-> num_ final s())
auto del_transition(transition_t t) -> decltype(aut_-> del_transition(t))
weightset_t_of< automaton_t > weightset_t
auto set_final(state_t s) -> decltype(aut_-> set_initial(s))
auto final_transitions() const -> decltype(aut_-> initial_transitions())
auto is_initial(state_t s) const -> decltype(aut_-> is_ final(s))
context_t_of< automaton_t > context_t
auto label_of(transition_t t) const -> decltype(aut_-> labelset() ->transpose(aut_->label_of(t)))
REGISTER_DECLARE(accessible,(const automaton &) -> automaton)
std::shared_ptr< detail::automaton_base > automaton
auto labelset(Args &&...args) const -> decltype(aut_-> labelset(std::forward< Args >(args)...))
auto add_transition(state_t s, state_t d, label_t l, weight_t k) -> decltype(aut_-> add_transition(d, s, aut_->labelset() ->transpose(l), aut_->weightset() ->transpose(k)))
auto unset_initial(state_t s) -> decltype(aut_-> unset_ final(s))
Aut automaton_t
The type of automaton to wrap.
ATTRIBUTE_PURE auto weight_of(transition_t t) const -> decltype(aut_-> weightset() ->transpose(aut_->weight_of(t)))
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_t_of
auto aut_ weightset() -> transpose(k)))
auto has_transition(state_t s, state_t d, label_t l) const -> decltype(aut_-> has_transition(d, s, aut_->labelset() ->transpose(l)))
auto add_transition(state_t s, state_t d, label_t l) -> decltype(aut_-> add_transition(d, s, aut_->labelset() ->transpose(l)))
std::shared_ptr< detail::transpose_automaton_impl< Aut >> transpose_automaton
An automaton wrapper that presents the transposed automaton.
auto get_transition(state_t s, state_t d, label_t l) const -> decltype(aut_-> get_transition(d, s, aut_->labelset() ->transpose(l)))
ratexp transpose_ratexp(const ratexp &exp)
Bridge.
RatExpSet::value_t transpose(const RatExpSet &rs, const typename RatExpSet::value_t &v)
auto num_finals() const -> decltype(aut_-> num_initials())
automaton make_automaton(const Aut &aut)
Build a dyn::automaton.
auto lmul_weight(transition_t t, weight_t k) -> decltype(aut_-> lmul_weight(t, aut_->weightset() ->transpose(k)))
auto new_transition_copy(state_t src, state_t dst, const A &aut, typename A::element_type::transition_t t, bool transpose=false) -> decltype(aut_-> new_transition_copy(dst, src, aut, t,!transpose))
std::shared_ptr< detail::ratexp_base > ratexp
transpose_automaton< typename automaton_t::element_type::automaton_nocv_t > automaton_nocv_t
The type to use to build an automaton of the same type: remove the inner const-volatile qualifiers...
state_t_of< automaton_t > state_t
labelset_t_of< automaton_t > labelset_t
auto all_out(state_t s, Pred pred) const -> decltype(aut_-> all_in(s, pred))
typename detail::context_t_of_impl< base_t< ValueSet >>::type context_t_of
auto add_final(state_t s, weight_t k) -> decltype(aut_-> add_initial(s, aut_->weightset() ->transpose(k)))
auto all_in(state_t s) const -> decltype(aut_-> all_out(s))
auto unset_final(state_t s) -> decltype(aut_-> unset_initial(s))
auto is_final(state_t s) const -> decltype(aut_-> is_initial(s))
auto set_weight(transition_t t, weight_t k) -> decltype(aut_-> set_weight(t, aut_->weightset() ->transpose(k)))
auto add_weight(transition_t t, weight_t k) -> decltype(aut_-> add_weight(t, aut_->weightset() ->transpose(k)))
static constexpr auto post() -> decltype(automaton_t::element_type::pre())
typename automaton_t::element_type::kind_t kind_t
typename detail::label_t_of_impl< base_t< ValueSet >>::type label_t_of
typename detail::weightset_t_of_impl< base_t< ValueSet >>::type weightset_t_of
auto set_transition(state_t s, state_t d, label_t l, weight_t k) -> decltype(aut_-> set_transition(d, s, aut_->labelset() ->transpose(l), aut_->weightset() ->transpose(k)))
auto rmul_weight(transition_t t, weight_t k) -> decltype(aut_-> rmul_weight(t, aut_->weightset() ->transpose(k)))
auto new_transition(state_t s, state_t d, label_t l, weight_t k) -> decltype(aut_-> new_transition(d, s, aut_->labelset() ->transpose(l), aut_->weightset() ->transpose(k)))
static constexpr auto pre() -> decltype(automaton_t::element_type::post())
typename detail::transition_t_of_impl< base_t< ValueSet >>::type transition_t_of
automaton_t naked_automaton()
The automaton we are decorating (typically a mutable_automaton).
auto all_in(state_t s, Pred pred) const -> decltype(aut_-> all_out(s, pred))
auto add_initial(state_t s, weight_t k) -> decltype(aut_-> add_ final(s
ratexp transposition_ratexp(const ratexp &exp)
Bridge.
auto del_transition(state_t s, state_t d, label_t l) -> decltype(aut_-> del_transition(d, s, aut_->labelset() ->transpose(l)))
auto out(state_t s) const -> decltype(aut_-> in(s))
#define DEFINE(Signature, Value)
std::string vname(bool full=true) const
auto strip(const Aut &aut) -> decltype(detail::strip(aut, 0))
Remove (all) the decorations from a decorated automaton.
label_t_of< automaton_t > label_t
typename detail::weight_t_of_impl< base_t< ValueSet >>::type weight_t_of
auto dst_of(transition_t t) const -> decltype(aut_-> src_of(t))
auto set_initial(state_t s) -> decltype(aut_-> set_ final(s))
Aut transpose(const transpose_automaton< Aut > &aut)
auto in(state_t s) const -> decltype(aut_-> out(s))
auto src_of(transition_t t) const -> decltype(aut_-> dst_of(t))
weight_t_of< automaton_t > weight_t
auto initial_transitions() const -> decltype(aut_-> final _transitions())
ATTRIBUTE_PURE auto get_final_weight(state_t s) const -> decltype(aut_-> weightset() ->transpose(aut_->get_initial_weight(s)))
typename detail::state_t_of_impl< base_t< ValueSet >>::type state_t_of
auto outin(state_t s, state_t d) const -> decltype(aut_-> outin(d, s))
auto add_transition_copy(state_t src, state_t dst, const A &aut, typename A::element_type::transition_t t, bool transpose=false) -> decltype(aut_-> add_transition_copy(dst, src, aut, t,!transpose))
auto strip() -> decltype(transpose(vcsn::strip(this->naked_automaton())))
transition_t_of< automaton_t > transition_t
automaton transpose(automaton &aut)
Bridge.
auto all_out(state_t s) const -> decltype(aut_-> all_in(s))
automaton_t aut_
The wrapped automaton, possibly const.
static std::string sname()