spvecgf2.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 1073 "MIN_CYCLE_BASIS.lw"
00039 
00043 #ifndef SPVECGF2_H
00044 #define SPVECGF2_H
00045 
00046 #include <iostream>
00047 
00048 #ifdef LEDA_GE_V5
00049 #include <LEDA/system/basic.h>
00050 #include <LEDA/core/list.h>
00051 #include <LEDA/core/d_int_set.h>
00052 #include <LEDA/system/error.h>
00053 #include <LEDA/system/assert.h>
00054 #else
00055 #include <LEDA/basic.h>
00056 #include <LEDA/list.h>
00057 #include <LEDA/d_int_set.h>
00058 #include <LEDA/error.h>
00059 #include <LEDA/assert.h>
00060 #endif
00061 #include <LEP/mcb/edge_num.h>
00062 #include <LEP/mcb/arithm.h>
00063 
00064 namespace mcb
00065 {
00066 
00067 #if defined(LEDA_NAMESPACE)
00068     using leda::list;
00069     using leda::list_item;
00070     using leda::error_handler;
00071     using leda::d_int_set;
00072 #endif
00073 
00074 
00075 #line 1137 "MIN_CYCLE_BASIS.lw"
00076 
00114     class spvecgf2
00115     {
00116       public:
00118 
00119         spvecgf2();
00120         
00122         spvecgf2( const spvecgf2 & a );
00123 
00125          ~spvecgf2(  );
00127 
00128 
00130 
00134         spvecgf2& operator=( const spvecgf2& i );
00135 
00137         spvecgf2& operator=( const int& i );
00138 
00143 #if (__LEDA__ >= 500)
00144         spvecgf2& operator=( const d_int_set& i );
00145 #else
00146         spvecgf2& operator=( d_int_set& i );
00147 #endif
00148 
00152         spvecgf2 operator-(  ) const;
00153 
00158         int operator*( const spvecgf2& a ) const;
00159 
00164         spvecgf2 operator+( const spvecgf2& a ) const;
00165 
00169         void add( const spvecgf2& a ); 
00170 
00176         spvecgf2 operator%( const spvecgf2& a ) const;
00177         
00183         d_int_set operator%( const d_int_set& a ) const;
00184         
00189         spvecgf2 intersect( const spvecgf2& a ) const;
00190 
00195         spvecgf2& operator+=( const spvecgf2& a );
00196 
00202         spvecgf2& operator-=( const spvecgf2& a );
00203 
00209         spvecgf2& operator%=( const spvecgf2& a );
00210 
00215         void spvecgf2::swap( spvecgf2& a );
00217 
00219 
00222         d_int_set to_d_int_set() const;
00223 
00227         list<int> to_list() const { return l; }
00229 
00231 
00232         void clear( ) { l.clear(); }
00233 
00237         void print( std::ostream & o ) const;
00238 
00246         void append( int index );
00247 
00255         void insert( int index );
00256 
00261         int pop() { return l.pop(); }
00262 
00267         void sort() { l.sort(); }
00268 
00269 
00270 #line 1337 "MIN_CYCLE_BASIS.lw"
00271         // define access stuff, like leda lists
00272 
00276         bool empty() const { return l.empty(); }
00277         
00281         int size(  ) const { return l.size(); }
00283 
00285 
00291         list_item first(  ) const { return l.first(); }
00292 
00299         list_item last(  ) const { return l.last(); }
00300 
00306         list_item succ( list_item it ) const { return l.succ(it); }
00307         
00313         list_item pred( list_item it ) const { return l.pred(it); }
00314         
00320         int index( list_item it ) const { return l.contents(it); }
00321 
00327         int inf( list_item it ) const { return l.contents(it); }
00328 
00329         // allow the LEDA forall() macro to work
00330         typedef list_item item;
00331 
00332         item first_item()       const { return l.first(); }
00333         item last_item()        const { return l.last(); }
00334         item next_item(item it) const { return it ? l.succ(it) : 0; }
00336 
00337       private:
00338 
00339         list < int > l;
00340     };
00341 
00347     std::ostream & operator<<( std::ostream & o, const spvecgf2& v );
00348     
00354     std::istream & operator>>( std::istream & o, spvecgf2& v );
00355     
00356     // swap
00357     void swap( spvecgf2&, spvecgf2& );
00358 
00359 
00360 
00361 #line 1110 "MIN_CYCLE_BASIS.lw"
00362 }
00363 
00364 #endif
00365 
00366 #line 6217 "MIN_CYCLE_BASIS.lw"
00367 /* ex: set ts=8 sw=4 sts=4 noet: */
00368 
00369 

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