Vcsn  2.0
Be Rational
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
vcsn::detail::enumerater< Aut > Class Template Reference

#include <enumerate.hh>

Collaboration diagram for vcsn::detail::enumerater< Aut >:

Public Types

using automaton_t = Aut
 
using context_t = context_t_of< Aut >
 
using labelset_t = labelset_t_of< automaton_t >
 
using weightset_t = weightset_t_of< automaton_t >
 
using wordset_context_t = word_context_t< context_t >
 
using polynomialset_t = polynomialset< wordset_context_t >
 
using polynomial_t = typename polynomialset_t::value_t
 
using label_t = label_t_of< automaton_t >
 
using weight_t = weight_t_of< automaton_t >
 
using state_t = state_t_of< automaton_t >
 
using word_t = typename labelset_t::word_t
 
using monomial_t = std::pair< word_t, weight_t >
 Same as polynomial_t::value_type. More...
 
using queue_t = std::queue< std::pair< state_t, monomial_t >>
 

Public Member Functions

 enumerater (const automaton_t &aut)
 
polynomial_t enumerate (unsigned max)
 The weighted accepted word with length at most max. More...
 
polynomial_t shortest (unsigned num)
 The shortest accepted weighted words, or throw an exception. More...
 

Private Member Functions

void propagate_ (queue_t &q1)
 Process once all the states of q1. More...
 

Private Attributes

const automaton_taut_
 
const weightset_tws_ = *aut_->weightset()
 
const polynomialset_t ps_ = make_word_polynomialset(aut_->context())
 
const labelset_t_of
< polynomialset_t > & 
ls_ = *ps_.labelset()
 
std::map< state_t, polynomial_tpast_
 For each state, the first orders of its past. More...
 

Detailed Description

template<typename Aut>
class vcsn::detail::enumerater< Aut >

Definition at line 26 of file enumerate.hh.

Member Typedef Documentation

template<typename Aut>
using vcsn::detail::enumerater< Aut >::automaton_t = Aut

Definition at line 29 of file enumerate.hh.

template<typename Aut>
using vcsn::detail::enumerater< Aut >::context_t = context_t_of<Aut>

Definition at line 30 of file enumerate.hh.

template<typename Aut>
using vcsn::detail::enumerater< Aut >::label_t = label_t_of<automaton_t>

Definition at line 39 of file enumerate.hh.

template<typename Aut>
using vcsn::detail::enumerater< Aut >::labelset_t = labelset_t_of<automaton_t>

Definition at line 34 of file enumerate.hh.

template<typename Aut>
using vcsn::detail::enumerater< Aut >::monomial_t = std::pair<word_t, weight_t>

Same as polynomial_t::value_type.

Definition at line 45 of file enumerate.hh.

template<typename Aut>
using vcsn::detail::enumerater< Aut >::polynomial_t = typename polynomialset_t::value_t

Definition at line 38 of file enumerate.hh.

Definition at line 37 of file enumerate.hh.

template<typename Aut>
using vcsn::detail::enumerater< Aut >::queue_t = std::queue<std::pair<state_t, monomial_t>>

Definition at line 46 of file enumerate.hh.

template<typename Aut>
using vcsn::detail::enumerater< Aut >::state_t = state_t_of<automaton_t>

Definition at line 41 of file enumerate.hh.

template<typename Aut>
using vcsn::detail::enumerater< Aut >::weight_t = weight_t_of<automaton_t>

Definition at line 40 of file enumerate.hh.

template<typename Aut>
using vcsn::detail::enumerater< Aut >::weightset_t = weightset_t_of<automaton_t>

Definition at line 35 of file enumerate.hh.

template<typename Aut>
using vcsn::detail::enumerater< Aut >::word_t = typename labelset_t::word_t

Definition at line 42 of file enumerate.hh.

template<typename Aut>
using vcsn::detail::enumerater< Aut >::wordset_context_t = word_context_t<context_t>

Definition at line 36 of file enumerate.hh.

Constructor & Destructor Documentation

template<typename Aut>
vcsn::detail::enumerater< Aut >::enumerater ( const automaton_t aut)
inline

Definition at line 48 of file enumerate.hh.

References vcsn::detail::enumerater< Aut >::aut_, vcsn::polynomialset< Context >::one(), vcsn::detail::enumerater< Aut >::past_, and vcsn::detail::enumerater< Aut >::ps_.

Here is the call graph for this function:

Member Function Documentation

template<typename Aut>
polynomial_t vcsn::detail::enumerater< Aut >::enumerate ( unsigned  max)
inline

The weighted accepted word with length at most max.

Definition at line 55 of file enumerate.hh.

References vcsn::polynomialset< Context >::add_here(), vcsn::detail::enumerater< Aut >::aut_, vcsn::detail::enumerater< Aut >::ls_, vcsn::polynomialset< Context >::monomial_one(), vcsn::detail::enumerater< Aut >::past_, vcsn::detail::enumerater< Aut >::propagate_(), and vcsn::detail::enumerater< Aut >::ps_.

Referenced by vcsn::enumerate().

Here is the call graph for this function:

template<typename Aut>
void vcsn::detail::enumerater< Aut >::propagate_ ( queue_t q1)
inlineprivate

Process once all the states of q1.

Save into q1 the new states to visit.

Definition at line 99 of file enumerate.hh.

References vcsn::polynomialset< Context >::add_here(), vcsn::detail::enumerater< Aut >::aut_, vcsn::detail::enumerater< Aut >::ls_, vcsn::detail::enumerater< Aut >::past_, vcsn::detail::enumerater< Aut >::ps_, and vcsn::detail::enumerater< Aut >::ws_.

Referenced by vcsn::detail::enumerater< Aut >::enumerate(), and vcsn::detail::enumerater< Aut >::shortest().

Here is the call graph for this function:

template<typename Aut>
polynomial_t vcsn::detail::enumerater< Aut >::shortest ( unsigned  num)
inline

The shortest accepted weighted words, or throw an exception.

Definition at line 76 of file enumerate.hh.

References vcsn::polynomialset< Context >::add_here(), vcsn::detail::enumerater< Aut >::aut_, vcsn::detail::enumerater< Aut >::ls_, vcsn::polynomialset< Context >::monomial_one(), vcsn::detail::enumerater< Aut >::past_, vcsn::detail::enumerater< Aut >::propagate_(), and vcsn::detail::enumerater< Aut >::ps_.

Referenced by vcsn::shortest().

Here is the call graph for this function:

Member Data Documentation

template<typename Aut>
std::map<state_t, polynomial_t> vcsn::detail::enumerater< Aut >::past_
private
template<typename Aut>
const weightset_t& vcsn::detail::enumerater< Aut >::ws_ = *aut_->weightset()
private

Definition at line 121 of file enumerate.hh.

Referenced by vcsn::detail::enumerater< Aut >::propagate_().


The documentation for this class was generated from the following file: