00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00017
00018 #if !defined(AFX_BFIGIMPLICANTHEAP_H__7CC40E22_8CA3_4DCD_ABE4_3E86F956A0FE__INCLUDED_)
00019 #define AFX_BFIGIMPLICANTHEAP_H__7CC40E22_8CA3_4DCD_ABE4_3E86F956A0FE__INCLUDED_
00020
00021 #if _MSC_VER > 1000
00022 #pragma once
00023 #endif // _MSC_VER > 1000
00024
00025 #include <Mers/Utils/Containers/DynamicHeap.h>
00026
00027 namespace Mers {
00028 namespace Generators {
00029 namespace BFIG {
00030
00031 class BFIGImplicant;
00032
00036 class BFIGImplicantHeap : public Mers::Utils::Containers::DynamicHeap
00037 {
00038 public:
00040 typedef BFIGImplicant HeapElement;
00041
00042
00043
00044
00045
00061 BFIGImplicantHeap(bool greatestOnTop, double maximumCost, bool owner);
00062
00075 BFIGImplicantHeap(bool greatestOnTop, bool owner);
00076
00077
00078
00079
00080
00084 virtual ~BFIGImplicantHeap();
00085
00086
00087
00088
00089
00097 int insert(HeapElement * element);
00098
00106 int peekFirst(HeapElement * &element);
00114 int getFirst(HeapElement * &element);
00115
00122 HeapElement * &operator[](int elementIndex)
00123 {
00124 return (HeapElement * &) DynamicHeap::operator[](elementIndex);
00125 }
00132 HeapElement * &operator[](unsigned int elementIndex)
00133 {
00134 return (HeapElement * &) DynamicHeap::operator[](elementIndex);
00135 }
00142 HeapElement const * &operator[](int elementIndex) const
00143 {
00144 return (HeapElement const * &) DynamicHeap::operator[](elementIndex);
00145 }
00152 HeapElement const * &operator[](unsigned int elementIndex) const
00153 {
00154 return (HeapElement const * &) DynamicHeap::operator[](elementIndex);
00155 }
00156
00157 protected:
00158
00159
00160
00161 #ifndef EMBEDDED
00162
00170 virtual void printElement(std::ostream &out, void const * element) const;
00171 #endif
00172
00178 virtual void deleteElement(void * element) const;
00185 virtual void * newElement(void const * element) const;
00186
00194 virtual bool greaterThan(void const * e1, void const * e2) const;
00202 virtual bool lessThan(void const * e1, void const * e2) const;
00203
00204
00205
00206
00207
00210 const bool mPruneByCost;
00211
00214 const double mMaximumCost;
00215 };
00216 }
00217 }
00218 }
00219
00220 #endif // !defined(AFX_BFIGIMPLICANTHEAP_H__7CC40E22_8CA3_4DCD_ABE4_3E86F956A0FE__INCLUDED_)