Q: 在ite()裡面 bddNode要檢查complement parameter
是不是該用BddNode::isNegEdge()呢? 但是它是private 可以把它改成public嗎??
A: 嗯 是應該改成 public
不過不建議將 BddNode 宣告成 BddNodeInt 或是 BddManager 的 friend class
Q: BddManager::ite(...)
{
...
// check unique table
BddNodeInt* ni = uniquify(t(), e(), v);
ret = size_t(ni); <== what does this mean?
...
}
A: The type of "ret" is BddNode.
However, the line "ret = size_t(ni)" is NOT clear, and will make the later
line "ret = ~ret" ambiguous...
PLEASE CHANGE IT TO ---
ret = BddNode(size_t(ni));
This will make it easier to read.
Q: void forceInsert(size_t b, const BddHashNode& n) {
_buckets[b].push_back(n); }
void forceInsert(const BddHashKey& k, BddNodeInt* const n) {
_buckets[bucketNum(k)].push_back(BddHashNode(k, n)); }
我想問一下這兩個有差嗎?
既然知道 BddHashKey& k 就一定可以由 bucketNum(k) 得到 size_t b吧
還是有些地方會只知道size_t b 而不知道 BddHashKey& k??
如果不用紀錄b的話_uniqueTable.check(k, b, n)似乎可以少傳一個變數?
A: 我想原因有二:
(1) forceInsert(b, n) is called after check(), in which the bucket index
is computed. I just don't want to call the hash function again.
(2) Actually I don't want to expose "bucketNumber()" as a public function
because it seems to be some detailed information about the hash
implementation. Somehow it was left as a public one...
Anyway, I didn't update/improve "bddHash.cpp" this year --- it is the old
code from last semester. I think there's definitely room for improve.
You are welcome to modify it as the way you like.
※ 編輯: ric2k1 來自: 59.121.129.244 (01/08 00:01)
※ 編輯: ric2k1 來自: 59.121.129.244 (01/08 00:02)