edge_num.h

Go to the documentation of this file.
00001 
00002 #line 6220 "MIN_CYCLE_BASIS.lw"
00003 //---------------------------------------------------------------------
00004 // File automatically generated using notangle from DMIN_CYCLE_BASIS.lw
00005 //
00006 // emails and bugs: Dimitris Michail <michail@mpi-inf.mpg.de>
00007 //---------------------------------------------------------------------
00008 //
00009 // This program can be freely used in an academic environment
00010 // ONLY for research purposes, subject to the following restrictions:
00011 //
00012 // 1. The origin of this software must not be misrepresented; you must not
00013 //    claim that you wrote the original software. If you use this software
00014 //    an acknowledgment in the product documentation is required.
00015 // 2. Altered source versions must be plainly marked as such, and must not be
00016 //    misrepresented as being the original software.
00017 // 3. This notice may not be removed or altered from any source distribution.
00018 //
00019 // Any other use is strictly prohibited by the author, without an explicit 
00020 // permission.
00021 //
00022 // Note that this program uses the LEDA library, which is NOT free. For more 
00023 // details visit Algorithmic Solutions at http://www.algorithmic-solutions.com/
00024 //
00025 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
00026 // ! Any commercial use of this software is strictly !
00027 // ! prohibited without explicit permission by the   !
00028 // ! author.                                         !
00029 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
00030 //
00031 // This software is distributed in the hope that it will be useful,
00032 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00033 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00034 //
00035 // Copyright (C) 2004-2005 - Dimitris Michail <michail@mpi-inf.mpg.de>
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 // variables:
00086     int m,n,k;
00087     leda::edge *index;
00088     leda::edge_array<int> rindex;
00089 // methods:
00090     void create_numbering( const leda::graph& G );
00091     int construct_tree( const leda::graph& g, leda::edge_array<bool>& tree );
00092 
00093 // disabled:
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 } // end namespace mcb
00168 
00169 #endif
00170 
00171 #line 6217 "MIN_CYCLE_BASIS.lw"
00172 /* ex: set ts=8 sw=4 sts=4 noet: */
00173 
00174 

Generated on Thu Mar 30 16:45:43 2006 for mcb LEDA Extension Package by  doxygen 1.4.6