PolyBoRi
BooleEnv.h
Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //*****************************************************************************
00014 //*****************************************************************************
00015 
00016 
00017 // load PolyBoRi settings
00018 # include "pbori_defs.h"
00019 
00020 #include "BoolePolyRing.h"
00021 #include <vector>
00022 
00023 #ifndef BooleEnv_h_
00024 #define BooleEnv_h_
00025 
00026 // Obey stricter dependence of Sun Studio compiler
00027 // todo: resolve dependency 
00028 #if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
00029 # define PBORI_ENV_RING_NOTINLINED
00030 #endif
00031 
00032 
00033 BEGIN_NAMESPACE_PBORI
00034 
00035 
00036 class BoolePolyRing;
00037 //extern BoolePolyRing active_ring;
00038 class COrderingBase;
00039 
00047 class BooleEnv: 
00048   public CTypes::orderenums_type, public CTypes::compenums_type, 
00049   public CTypes::auxtypes_type {
00050 
00051  public:
00052   //-------------------------------------------------------------------------
00053   // types definitions
00054   //-------------------------------------------------------------------------
00055 
00057   typedef BooleEnv self;
00058 
00060   typedef CTypes::orderenums_type base;
00061 
00063 
00064   typedef CTypes::ordercode_type ordercode_type;
00065   typedef BoolePolyRing::dd_type dd_type;
00066   typedef CTypes::vartext_type vartext_type;
00068 
00070   typedef std::vector<idx_type> block_idx_type;
00071 
00073   typedef block_idx_type::const_iterator block_iterator;
00074 
00075   //-------------------------------------------------------------------------
00076   // constructors and destructor
00077   //-------------------------------------------------------------------------
00078 
00080   using base::ordercodes;
00081 
00083   static dd_type variable(idx_type idx);
00084 
00086   static ordercode_type getOrderCode();
00087 
00090   static ordercode_type getBaseOrderCode();
00091 
00093   static dd_type zero();
00094 
00096   static dd_type one();
00097 
00099   static size_type nVariables();
00100 
00101   typedef BoolePolyRing ring_type;
00102 
00103   typedef COrderingBase order_type;
00104 
00105 #ifdef PBORI_ENV_RING_NOTINLINED
00106   static ring_type& ring();
00107 #else
00108   static ring_type& ring() {
00109     static BooleEnv::ring_type active_ring(1000, CTypes::lp, false);
00110 
00111     return active_ring;
00112   }
00113 #endif
00114   //  static manager_type& manager();
00115   static order_type& ordering();
00117   static void setVariableName(idx_type idx, vartext_type varname);
00118 
00120   static vartext_type getVariableName(idx_type idx);
00121 
00123 
00124 
00125 
00126   static block_iterator blockBegin();
00127 
00129   static block_iterator blockEnd();
00130 
00132   static void appendBlock(idx_type idx);
00133 
00135   static void clearBlocks();
00136 
00138   static idx_type lastBlockStart();
00140 
00142   static void changeOrdering(ordercode_type code);
00143 
00145   static ostream_type& print(ostream_type&);
00146 
00148   static void set(ring_type& theRing);
00149 };
00150 
00152 
00153 END_NAMESPACE_PBORI
00154 
00155 #endif // of #ifndef BooleEnv_h_