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