00001
00002 #line 6220 "MIN_CYCLE_BASIS.lw"
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
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #line 764 "MIN_CYCLE_BASIS.lw"
00039
00043 #ifndef EDGE_NUM_H
00044 #define EDGE_NUM_H
00045
00046 #ifdef LEDA_GE_V5
00047 #include <LEDA/graph/graph.h>
00048 #include <LEDA/graph/edge_array.h>
00049 #include <LEDA/graph/node_set.h>
00050 #include <LEDA/core/b_queue.h>
00051 #else
00052 #include <LEDA/graph.h>
00053 #include <LEDA/edge_array.h>
00054 #include <LEDA/node_set.h>
00055 #include <LEDA/b_queue.h>
00056 #endif
00057
00058 namespace mcb {
00059
00060
00061 #line 823 "MIN_CYCLE_BASIS.lw"
00062
00081 class edge_num
00082 {
00083
00084 private:
00085
00086 int m,n,k;
00087 leda::edge *index;
00088 leda::edge_array<int> rindex;
00089
00090 void create_numbering( const leda::graph& G );
00091 int construct_tree( const leda::graph& g, leda::edge_array<bool>& tree );
00092
00093
00094 edge_num& operator=( const edge_num& );
00095
00096 public:
00098
00101 edge_num ( const leda::graph& G );
00102
00104 edge_num ( const edge_num& enumb );
00105
00107 ~edge_num (void);
00109
00110
00111 #line 875 "MIN_CYCLE_BASIS.lw"
00112
00113
00117 inline int operator()(leda::edge e) const {
00118 return rindex[e];
00119 }
00120
00125 inline leda::edge operator()(int i) const {
00126 #if ! defined(LEDA_CHECKING_OFF)
00127 if ( i < 0 || i > m )
00128 leda::error_handler(999,"edge_num: illegal number requested");
00129 #endif
00130 return index[ i ];
00131 }
00133
00134
00135
00136 #line 905 "MIN_CYCLE_BASIS.lw"
00137
00138
00142 bool tree( leda::edge e ) const {
00143 return ( rindex[e] >= m - n + k );
00144 }
00145
00151 int dim_cycle_space() const {
00152 return m - n + k;
00153 }
00154
00158 int num_weak_connected_comp() const {
00159 return k;
00160 }
00162
00163 };
00164
00165
00166 #line 787 "MIN_CYCLE_BASIS.lw"
00167 }
00168
00169 #endif
00170
00171 #line 6217 "MIN_CYCLE_BASIS.lw"
00172
00173
00174