PolyBoRi
CDDOperations.h
Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //*****************************************************************************
00013 //*****************************************************************************
00014 
00015 #ifndef polybori_diagram_CDDOperations_h_
00016 #define polybori_diagram_CDDOperations_h_
00017 
00018 // include basic definitions
00019 #include <polybori/pbori_defs.h>
00020 
00021 // Get Cudd definitions
00022 #include <polybori/cudd/cudd.h>
00023 
00024 #include <polybori/routines/pbori_routines.h>
00025 #include <polybori/cache/CCacheManagement.h>
00026 #include <polybori/BoolePolyRing.h>
00027 
00028 BEGIN_NAMESPACE_PBORI
00029 
00032 template <class DDType, class MonomType>
00033 class CDDOperations {
00034 public:
00035 
00036   // This is only a work-around, since a monomial should not be generated from
00037   // a dd.
00038   MonomType getMonomial(const DDType& dd) const {
00039     return MonomType(dd);
00040   }
00041   
00042   MonomType usedVariables(const DDType& dd){
00043 
00044   // get type definitions from DDType
00045   typedef typename DDType::idx_type idx_type;
00046   typedef typename DDType::navigator navigator;
00047   typedef MonomType monom_type;
00048 
00049   CCacheManagement<BoolePolyRing, CCacheTypes::used_variables> cache_mgr((BoolePolyRing)dd.ring());
00050   return cached_used_vars(cache_mgr, dd.navigation(),  
00051                           MonomType(cache_mgr.one()));
00052 }
00053 
00054 };
00055 
00056 
00057 
00058 END_NAMESPACE_PBORI
00059 
00060 #endif