Vcsn  2.0
Be Rational
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
labelset.hh
Go to the documentation of this file.
1 #ifndef VCSN_LABELSET_LABELSET_HH
2 # define VCSN_LABELSET_LABELSET_HH
3 
5 
6 namespace vcsn
7 {
8  namespace detail
9  {
10  /*--------------------.
11  | make_nullableset. |
12  `--------------------*/
13 
20  template <typename LabelSet,
21  typename Enable = void>
23  {};
24 
26  template <typename LabelSet>
28 
30  template <typename LabelSet>
33  {
35  };
36 
37  /*-------------------------.
38  | make_nullable_context. |
39  `-------------------------*/
40 
41  template <typename Ctx>
44 
46  template <typename LabelSet, typename WeightSet>
49  {
50  return {make_nullableset(*ctx.labelset()), *ctx.weightset()};
51  }
52 
53 
54  /*---------------.
55  | make_wordset. |
56  `---------------*/
57 
61  template <typename ValueSet>
62  struct law_traits
63  {};
64 
66  template <typename LabelSet>
68 
70  template <typename LabelSet>
71  inline law_t<LabelSet>
73  {
74  return law_traits<LabelSet>::value(ls);
75  };
76 
77  /*--------------------.
78  | make_word_context. |
79  `--------------------*/
80 
81  template <typename Ctx>
82  using word_context_t
84 
86  template <typename LabelSet, typename WeightSet>
89  {
90  return {make_wordset(*ctx.labelset()), *ctx.weightset()};
91  }
92 
93  /*--------------------------.
94  | make_word_polynomialset. |
95  `--------------------------*/
96 
97  template <typename Ctx>
99 
102  template <typename Ctx>
103  inline auto
104  make_word_polynomialset(const Ctx& ctx)
106  {
107  return make_word_context(ctx);
108  }
109  }
110 }
111 
112 #endif // !VCSN_LABELSET_LABELSET_HH
Linear combination of labels: map labels to weights.
Definition: fwd.hh:32
nullableset_t< LabelSet > make_nullableset(const LabelSet &ls)
The nullableset of a labelset.
Definition: labelset.hh:32
const weightset_ptr & weightset() const
Definition: context.hh:129
context< nullableset_t< labelset_t_of< Ctx >>, weightset_t_of< Ctx >> nullableset_context_t
Definition: labelset.hh:43
The LAW from a LAL.
Definition: labelset.hh:62
word_context_t< context< LabelSet, WeightSet > > make_word_context(const context< LabelSet, WeightSet > &ctx)
The wordset context of a context.
Definition: labelset.hh:88
nullableset_context_t< context< LabelSet, WeightSet > > make_nullableset_context(const context< LabelSet, WeightSet > &ctx)
The nullableset context of a context.
Definition: labelset.hh:48
context< law_t< labelset_t_of< Ctx >>, weightset_t_of< Ctx >> word_context_t
Definition: labelset.hh:83
typename law_traits< LabelSet >::type law_t
The smallest wordset that includes LabelSet.
Definition: labelset.hh:67
auto make_word_polynomialset(const Ctx &ctx) -> word_polynomialset_t< Ctx >
The polynomialset of words of a labelset (not necessarily on words itself).
Definition: labelset.hh:104
typename detail::weightset_t_of_impl< base_t< ValueSet >>::type weightset_t_of
Definition: traits.hh:38
law_t< LabelSet > make_wordset(const LabelSet &ls)
The wordset of a labelset.
Definition: labelset.hh:72
const labelset_ptr & labelset() const
Definition: context.hh:124
typename nullableset_traits< LabelSet >::type nullableset_t
The smallest nullableset that includes LabelSet.
Definition: labelset.hh:27
The smallest nullableset which includes LabelSet.
Definition: labelset.hh:22