18 #ifndef VCSN_ALGEBRA_IMPLEMENTATION_SEMIRING_NUMERICAL_SEMIRING_HH
19 # define VCSN_ALGEBRA_IMPLEMENTATION_SEMIRING_NUMERICAL_SEMIRING_HH
21 # include <vaucanson/algebra/concept/numerical_semiring.hh>
29 bool op_contains(
const algebra::NumericalSemiring& s, T c);
31 template<
typename T,
typename U>
32 void op_in_mul(
const algebra::NumericalSemiring& s1, T& dst, U arg);
34 template<
typename T,
typename U>
35 void op_in_add(
const algebra::NumericalSemiring& s1, T& dst, U arg);
37 template<
typename T,
typename U>
38 T op_mul(
const algebra::NumericalSemiring& s, T a, U b);
40 template<
typename T,
typename U>
41 T op_add(
const algebra::NumericalSemiring& s, T a, U b);
53 Element<algebra::NumericalSemiring, T>
54 op_choose(
const algebra::NumericalSemiring& s,
SELECTOR(T));
64 Element<algebra::NumericalSemiring, int>
67 Element<algebra::NumericalSemiring, int>
75 void op_in_mul(
const algebra::NumericalSemiring& s1,
78 inline bool op_mul(
const algebra::NumericalSemiring& s,
bool a,
bool b);
80 inline void op_in_add(
const algebra::NumericalSemiring& s1,
83 inline bool op_add(
const algebra::NumericalSemiring& s,
bool a,
bool b);
85 inline bool identity_value(
SELECTOR(algebra::NumericalSemiring),
88 inline bool zero_value(
SELECTOR(algebra::NumericalSemiring),
91 inline bool op_starable(
const algebra::NumericalSemiring& s,
bool b);
93 inline void op_in_star(
const algebra::NumericalSemiring& s,
bool& b);
95 Element<algebra::NumericalSemiring, bool>
98 Element<algebra::NumericalSemiring, bool>
107 inline float op_sub(
const algebra::NumericalSemiring&,
const float& a,
const float& b);
109 inline double op_sub(
const algebra::NumericalSemiring&,
const double& a,
const double& b);
111 inline float op_div(
const algebra::NumericalSemiring&,
const float& a,
const float& b);
113 inline double op_div(
const algebra::NumericalSemiring&,
const double& a,
const double& b);
116 inline bool op_eq(
const algebra::NumericalSemiring&,
float& a,
float& b);
118 inline bool op_eq(
const algebra::NumericalSemiring&,
double& a,
double& b);
121 bool op_starable(
const algebra::NumericalSemiring& s, T v);
123 inline bool op_starable(
const algebra::NumericalSemiring& s,
126 inline bool op_starable(
const algebra::NumericalSemiring& s,
129 inline void op_in_star(
const algebra::NumericalSemiring& s,
float& f);
131 inline void op_in_star(
const algebra::NumericalSemiring& s,
double& f);
137 Element<algebra::NumericalSemiring, float>
141 Element<algebra::NumericalSemiring, float>
149 Element<algebra::NumericalSemiring, double>
153 Element<algebra::NumericalSemiring, double>
162 inline RationalNumber
163 op_sub(
const algebra::NumericalSemiring&,
const RationalNumber&,
const RationalNumber&);
165 inline RationalNumber
166 op_div(
const algebra::NumericalSemiring&,
const RationalNumber&,
const RationalNumber&);
169 inline algebra::RationalNumber
170 identity_value(
SELECTOR(algebra::NumericalSemiring),
174 inline algebra::RationalNumber
175 zero_value(
SELECTOR(algebra::NumericalSemiring),
179 bool op_starable(
const algebra::NumericalSemiring& s, RationalNumber& v);
181 inline bool op_starable(
const algebra::NumericalSemiring& s,
182 const algebra::RationalNumber& r);
184 inline void op_in_star(
const algebra::NumericalSemiring& s,
185 algebra::RationalNumber& r);
193 Element<algebra::NumericalSemiring, algebra::RationalNumber>
198 Element<algebra::NumericalSemiring, algebra::RationalNumber>
204 template <
typename T>
205 struct semiring_traits<algebra::NumericalSemiring, T>
207 enum { is_positive = 0 };
211 struct semiring_traits<algebra::NumericalSemiring, bool>
213 enum { is_positive = 1 };
219 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
220 # include <vaucanson/algebra/implementation/semiring/numerical_semiring.hxx>
221 #endif // VCSN_USE_INTERFACE_ONLY
224 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SEMIRING_NUMERICAL_SEMIRING_HH