作者ric2k1 (Ric)
看板EE_DSnP
标题[公告] bdd/test/testBdd.{cpp,out}
时间Sat Jun 20 22:29:33 2009
之前修 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