question: public boolean [ ] [ ] moralize ( BayesNet bayesNet ) { int nNodes = bayesNet . getNrOfNodes ( ) ; boolean [ ] [ ] bAdjacencyMatrix = new boolean [ nNodes ] [ nNodes ] ; for ( int iNode = 0 ; iNode < nNodes ; iNode ++ ) { ParentSet parents = bayesNet . getParentSets ( ) [ iNode ] ; moralizeNode ( parents , iNode , bAdjacencyMatrix ) ; } return bAdjacencyMatrix ; }
target:  moralize DAG and calculate adjacency matrix representation for a Bayes Network, effecively converting the directed acyclic graph to an undirected graph.