00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_RANDOM_VISITOR_HH
00018 # define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_RANDOM_VISITOR_HH
00019
00020 # include <algorithm>
00021 # include <vaucanson/algebra/implementation/series/rat/nodes.hh>
00022
00023 namespace vcsn {
00024
00025 namespace rat {
00026
00027 template<typename M_, typename W_>
00028 class RandomVisitor : public ConstNodeVisitor<M_, W_>
00029 {
00030 public:
00031 enum { nb_star_max_default = 5 };
00032
00033 RandomVisitor(unsigned nb_star_max);
00034 RandomVisitor();
00035
00036 virtual void
00037 product(const Node<M_, W_>* left_, const Node<M_, W_>* right_);
00038 virtual void
00039 sum(const Node<M_, W_>* left_, const Node<M_, W_>* right_);
00040
00041 virtual void
00042 star(const Node<M_, W_>* node);
00043
00044 virtual void left_weight(const W_&, const Node<M_, W_>*);
00045 virtual void right_weight(const W_&, const Node<M_, W_>*);
00046
00047 virtual void
00048 constant(const M_& m);
00049 virtual void zero();
00050 virtual void one();
00051
00052 M_ get() const;
00053
00054 protected:
00055 M_ w_;
00056 bool not_empty;
00057 unsigned nb_star_max_;
00058 };
00059
00060 }
00061
00062 }
00063
00064
00065 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00066 # include <vaucanson/algebra/implementation/series/rat/random_visitor.hxx>
00067 #endif // VCSN_USE_INTERFACE_ONLY
00068
00069
00070 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_RANDOM_VISITOR_HH