看板 EE_DSnP 關於我們 聯絡資訊
之前修 bug 時不小心將 testBdd.cpp 更改了, 而我的 release script 又只有 update testBdd.out, 沒有 update testBdd.cpp... 現在你們看到的 testBdd.out 應該是以下程式產生出來的結果 --- (黃色的 code 與之前不同, 紅色的是新加的) (我會再看完上一篇的問題後一併更新 bdd.tgz, 大家可以自行更新即可) /**************************************************************************** FileName [ testBdd.cpp ] PackageName [ ] Synopsis [ Define main() ] Author [ Chung-Yang (Ric) Huang ] Copyright [ Copyleft(c) 2005-2009 LaDs(III), GIEE, NTU, Taiwan ] ****************************************************************************/ #include <iostream> #include <fstream> #include "bddNode.h" #include "bddMgr.h" using namespace std; /**************************************************************************/ /* Define Global BDD Manager */ /**************************************************************************/ BddMgr bm; /**************************************************************************/ /* Define Static Function Prototypes */ /**************************************************************************/ static void initBdd(size_t nSupports, size_t hashSize, size_t cacheSize); /**************************************************************************/ /* Define main() */ /**************************************************************************/ int main() { initBdd(5, 127, 61); /*-------- THIS IS JUST A TEST CODE ---------*/ BddNode a(bm.getSupport(1)); BddNode b(bm.getSupport(2)); BddNode c(bm.getSupport(3)); BddNode d(bm.getSupport(4)); BddNode e(bm.getSupport(5)); BddNode f = ~(a & b); cout << f << endl; BddNode g = c | d; cout << g << endl; BddNode h = ~e; cout << h << endl; BddNode i = f ^ (c | d); // f ^ g; cout << i << endl; BddNode j = ~a | ~b; cout << j << endl; ofstream ofile("i.dot"); i.drawBdd("i", ofile); system("dot -o i.png -Tpng i.dot"); /*----------- END OF TEST CODE ------------*/ } /**************************************************************************/ /* Define Static Functions */ /**************************************************************************/ static void initBdd(size_t nin, size_t h, size_t c) { BddNode::_debugBddAddr = true; BddNode::_debugRefCount = true; bm.reset(); bm.init(nin, h, c); } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.224.46.108