ShortestPathSemiring.hpp

Go to the documentation of this file.
00001 #ifndef WALI_SHORTEST_PATH_SEMIRING_HPP
00002 #define WALI_SHORTEST_PATH_SEMIRING_HPP
00003 
00004 #include "wali/SemElem.hpp"
00005 #include "wali/MergeFn.hpp"
00006 #include "wali/ref_ptr.hpp"
00007 #include "wali/Key.hpp"
00008 #include <set>
00009 
00010 
00011 namespace wali {
00012 
00013   
00014   class ShortestPathSemiring : public wali::SemElem
00015   {
00016   public:
00017 
00018     //-----------------------------
00019     // semiring one and zero
00020     //-----------------------------
00021     sem_elem_t one() const;
00022 
00023     sem_elem_t zero() const;
00024 
00025     //---------------------------------
00026     // semiring operations
00027     //---------------------------------
00028     sem_elem_t extend( SemElem* rhs );
00029 
00030     sem_elem_t combine( SemElem* rhs );
00031 
00032     bool equal(SemElem *rhs) const;
00033 
00034     //------------------------------------
00035     // output
00036     //------------------------------------
00037     std::ostream & print(std::ostream &out) const;
00038 
00039     unsigned int getNum() const;
00040 
00041   private:
00042     
00043     unsigned int v;
00044 
00045   public:
00046     //---------------------
00047     // Constructors 
00048     //---------------------
00049     ShortestPathSemiring() : v(0) { }
00050     ShortestPathSemiring(unsigned int _v) : v(_v) {}
00051   };
00052 
00053 
00054 
00055 }
00056 
00057 #endif // REACH_SEMIRING