diff options
Diffstat (limited to 'sourcecodes/bnt-master/SLP/examples/test_cpdag.m')
| -rw-r--r-- | sourcecodes/bnt-master/SLP/examples/test_cpdag.m | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sourcecodes/bnt-master/SLP/examples/test_cpdag.m b/sourcecodes/bnt-master/SLP/examples/test_cpdag.m new file mode 100644 index 00000000..983a0399 --- /dev/null +++ b/sourcecodes/bnt-master/SLP/examples/test_cpdag.m @@ -0,0 +1,22 @@ +% Test Dag2Cpdag and Cpdag2Dag functions ... + +close all; +clear all; + +bnet=mk_asia_bnet ; + +n=8; +names={ 'A' , 'S' , 'T' , 'L' , 'B' , 'O' , 'X' , 'D' }; +carre=ones(1,n); + +[xx yy] = make_layout(bnet.dag); +yy=(yy-0.2)*.8/.6+.1; +xx=(xx-0.2833)*.8/.517+.1; + +cpdag=dag_to_cpdag(bnet.dag) ; +dag1 = cpdag_to_dag(cpdag) ; + +figure; +subplot(1,3,1), draw_graph(bnet.dag,names,carre,xx,yy); title('original ASIA'); +subplot(1,3,2), draw_graph(cpdag,names,carre,xx,yy); title('cpasia=DAGtoCPDAG(asia)'); +subplot(1,3,3), draw_graph(dag1,names,carre,xx,yy); title('CPDAGtoDAG(cpasia)'); \ No newline at end of file |
