00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef OLENA_TOPO_TARJAN_TARJAN_HH
00029 # define OLENA_TOPO_TARJAN_TARJAN_HH
00030 # include <oln/basics.hh>
00031
00032
00033 # define oln_tarjan_input_type(T) typename oln::topo::tarjan::tarjan_traits<T >::input_type
00034 # define oln_tarjan_output_type(T) typename oln::topo::tarjan::tarjan_traits<T >::output_type
00035 # define oln_tarjan_attr_type(T) typename oln::topo::tarjan::tarjan_traits<T >::attr_type
00036
00037
00038
00039
00040
00041
00042
00043 namespace oln {
00044
00045 namespace topo {
00047 namespace tarjan {
00048
00050 template <typename Exact>
00051 struct tarjan_traits;
00052
00054 namespace abstract {
00062 template <typename Exact>
00063 struct tarjan: public mlc_hierarchy::any<Exact>
00064 {
00065 typedef oln_tarjan_input_type(Exact) input_type;
00066 typedef oln_tarjan_output_type(Exact) image_out_type;
00067 typedef oln_value_type(image_out_type) comp_type;
00068 typedef oln_point_type(input_type) point_type;
00069
00077 template<class N>
00078 image_out_type
00079 get_compute(const oln::abstract::neighborhood<N> &Ng)
00080 {
00081 mlc_dispatch(get_compute)(Ng);
00082 }
00083
00090 comp_type ncomps() const
00091 {
00092 mlc_dispatch(ncomps)();
00093 }
00094
00095 protected:
00102 std::vector<point_type>
00103 get_processing_order()
00104 {
00105 mlc_dispatch(get_processing_order)();
00106 }
00107
00114 void
00115 mark_set(const point_type &x)
00116 {
00117 mlc_dispatch(mark_set)(x);
00118 }
00119
00126 void
00127 uni(const point_type& n, const point_type& p)
00128 {
00129 mlc_dispatch(uni)(n, p);
00130 }
00131
00139 bool is_proc(const point_type &p) const
00140 {
00141 mlc_dispatch(is_proc)(p);
00142 };
00143
00147 tarjan() {}
00148 };
00149 }
00150 }
00151 }
00152 }
00153
00154 #endif // ! OLENA_TOPO_TARJAN_TARJAN_HH