精華區beta EE_DSnP 關於我們 聯絡資訊
※ 引述《phloke ()》之銘言: : 標題: Re: 求救 : 時間: Wed Jan 18 23:19:25 2006 : : ※ 引述《phloke ()》之銘言: : 1. return ite(…,…,…) : 不建議這樣寫,可能會有recursive call : 我是直接改變f、g、h的值,參考看看吧。 : : 2. &f &g &h : 應該改成f()、g()、h(),因為f、g、h是BddNode,不同的BddNode : 可以指到相同的BddNodeInt,做standardize的時候也要視為相同。 : : -- : ※ 發信站: 批踢踢實業坊(ptt.cc) : ◆ From: 140.112.5.65 : 推 ric2k1:不懂 2... what's the problem for standardize(BddNode& f 01/18 23:00 : → ric2k1:, BddNode& g, BddNode& h)? 01/18 23:01 : 比方說有兩個BddNodeInt在同一個level,分別有兩個BddNode a, b指到他們, : 而且a的address大於b的address,那麼做ite(a,1,b)會改成ite(b,1,a)(如果是 : 檢查BddNode的address的話)。 : 那麼現在同樣是那兩個BddNodeInt,分別由BddNode c, d指到他們,但是c的address小於 : d的address,那麼做ite(c,1,d)就不會改變c,d的順序,這樣就和ite(a,1,b)的情況不同 : 。 : What do you mean by comparing the addresses of two BddNodes? They are object variables... What I mean is: bool BddNode::operator < (const BddNode& n) const { return (_nodeV < n._nodeV); } So as you said --- : 比方說有兩個BddNodeInt在同一個level Let's call them "f_int" and "g_int", so a() = size_t(f_int), and b() = size_t(g_int). : 而且a的address大於b的address I guess it means "a() > b()"... Then we will do --- BddNode tmp = a; a = b; b = tmp; At the end, a() = g_int and b() = f_int. Is this the same as what you said? Sorry if I misunderstand what you meant... : -- : ※ 發信站: 批踢踢實業坊(ptt.cc) : ◆ From: 140.112.5.65 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.121.130.124
phloke:嗯嗯,意思一樣 01/19 01:20
ric2k1:好的 謝謝 01/19 01:30