17 #ifndef AWALI_ALGOS_TRANSPOSE_HH 
   18 # define AWALI_ALGOS_TRANSPOSE_HH 
   26 namespace awali { 
namespace sttc {
 
   35     template <
typename Aut>
 
   47           src(aut->src_of(t)), 
dst(aut->dst_of(t)), 
label(aut->label_of(t)), 
weight(aut->weight_of(t)) {}
 
   52     template <
typename Aut>
 
   56           std::vector<transition_t> oldtr;
 
   57           std::vector<internal::trans_tuple<Aut>> trs;
 
   60           for(
auto t : aut->all_transitions())
 
   63                 oldtr.emplace_back(t);
 
   67                 aut->del_transition(t);
 
   71                 if(t.dst==aut->post())
 
   73                 aut->add_transition(t.dst, t.src, aut->labelset()->transpose(t.label), aut->weightset()->transpose(t.weight));
 
   77     template <
typename Aut,
 
   78                 typename AutOut = 
typename Aut::element_type::automaton_nocv_t>
 
   79     AutOut 
transpose(Aut& aut, 
bool keep_history=
true) {
 
   80       AutOut out = 
copy(aut, keep_history);
 
   82        if(aut->get_name().empty()) {
 
   83          out->set_name(
"transpose");
 
   84          out->set_desc(
"Automaton obtained by a transposition");
 
   87          out->set_name(
"transpose-"+aut->get_name());
 
   88          out->set_desc(
"Transposition of "+aut->get_name());
 
typename internal::label_t_of_impl< internal::base_t< ValueSet > >::type label_t_of
Helper to retrieve the type of the labels of a value set.
Definition: traits.hh:71
 
typename internal::weight_t_of_impl< internal::base_t< ValueSet > >::type weight_t_of
Helper to retrieve the type of the weights of a value set.
Definition: traits.hh:81
 
AutOut transpose(Aut &aut, bool keep_history=true)
Definition: transpose.hh:79
 
AutOut copy(const AutIn &input, Pred keep_state, bool keep_history=true, bool transpose=false)
A copy of input keeping only its states that are accepted by keep_state.
Definition: copy.hh:189
 
void transpose_here(Aut &aut)
Definition: transpose.hh:53
 
Main namespace of Awali.
Definition: ato.hh:22
 
unsigned state_t
Definition: types.hh:21
 
unsigned transition_t
Definition: types.hh:22
 
Definition: transpose.hh:36
 
label_t label
Definition: transpose.hh:43
 
Aut automaton_t
Definition: transpose.hh:37
 
state_t dst
Definition: transpose.hh:42
 
weight_t weight
Definition: transpose.hh:44
 
weight_t_of< automaton_t > weight_t
Definition: transpose.hh:39
 
label_t_of< automaton_t > label_t
Definition: transpose.hh:38
 
trans_tuple(const Aut &aut, transition_t &t)
Definition: transpose.hh:46
 
state_t src
Definition: transpose.hh:41