📄 factorgraphmodel.java
字号:
package rmn;import java.util.*;/** * A set of (not necessarily connected) factor graphs * * @author Razvan Bunescu */public class FactorGraphModel { Vector m_vecFGraphs; public FactorGraphModel() { m_vecFGraphs = new Vector(); } public int size() { return m_vecFGraphs.size(); } public FactorGraph getFactorGraph(int i) { return (FactorGraph) m_vecFGraphs.get(i); } public void addFactorGraph(FactorGraph fg) { m_vecFGraphs.add(fg); } public void allocateMessages() { for (int i = 0; i < m_vecFGraphs.size(); i++) { FactorGraph fg = (FactorGraph) m_vecFGraphs.get(i); fg.allocateMessages(); } } public void deallocateMessages() { for (int i = 0; i < m_vecFGraphs.size(); i++) { FactorGraph fg = (FactorGraph) m_vecFGraphs.get(i); fg.deallocateMessages(); } } public boolean beliefPropagation(boolean bMaximize) { for (int i = 0; i < m_vecFGraphs.size(); i++) { FactorGraph fg = (FactorGraph) m_vecFGraphs.get(i); fg.beliefPropagation(bMaximize); } return true; } public boolean setMPE() { for (int i = 0; i < m_vecFGraphs.size(); i++) { FactorGraph fg = (FactorGraph) m_vecFGraphs.get(i); fg.setMPE(); } return true; } public void cleanup() { for (int i = 0; i < m_vecFGraphs.size(); i++) { FactorGraph fg = (FactorGraph) m_vecFGraphs.get(i); fg.cleanup(); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -