看板 EE_DSnP 關於我們 聯絡資訊
※ 引述《toshiba011 ()》之銘言: : 標題: Re: [問題] cirGateV : 時間: Sun Jan 15 12:31:29 2012 : : : 推 ric2k1:CirGateV = CirGate* + invPhase + floatPhase 01/15 02:34 : : 抱歉再問一個問題 : : 在replace(CirGAte*, bool inv)的時候 : : 裡面只有(size_t)g + (inv^isInv()) : : 那floatPhase在哪裡呢??? : : 謝謝 : : -- : ※ 發信站: 批踢踢實業坊(ptt.cc) : ◆ From: 140.112.4.192 : 推 anfranion:GateV裏頭不也有個isFloat(?) 01/15 12:49 : 老師的意思應該是 設定的時候會順便把float phase傳進去 : : 但是replace並沒有處理到 嗯,我是把 float 另外再設的,可能是因為我懶得傳那麼多的參數給 replace, 也可能是常常不需要設定 float. 所以,我的 code 是像這樣: _in1.replace(n, inv); if (n->isUndef()) _in1.setFloat(); 當然,如果你覺得應該把 float flag 一起傳進去,please go ahead to modify it. : : 還有一個問題 : : 如果有一個cirGate* aig, fanin0本來是一個aig : : 現在有一個CirGate* g 他是const 0 : : 以下步驟後: : : aig->getIn0().replace(g, inv); : : 那麼現在aig->getIn0Gate()->isConst()會自動改成true嗎? : 會啊! 因為 g 的本身是一個 CirConstGate, 所以 isConst() 當然會 return true. : aig->getIn0Gate()->getGid() == g->getGid()嗎 : 這個應該也會成立吧! : 我試過好像步行欸... 用 debugger 來 "p* aig" 以及 "p* aig->getIn0Gate()" 看看, 是不是有正確的接好呢? : ※ 編輯: toshiba011 來自: 140.112.4.192 (01/15 13:35) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.36.61.155
toshiba011:OK 謝謝RIC! 01/15 16:12