about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/SLP/examples/test_cpdag.m
diff options
context:
space:
mode:
authorziejd22018-03-14 23:23:33 -0500
committerGitHub2018-03-14 23:23:33 -0500
commit1ff6baa44e22b91eefb48aea6f3befa078c0489b (patch)
treee0fd79d2e32fd2aedda2eadaed0f19af3514c520 /sourcecodes/bnt-master/SLP/examples/test_cpdag.m
parent6882395afdadf4e982b25b5215071a0932730950 (diff)
parentc80226899f5cdd9f11c163817d59445213f5bef0 (diff)
downloadBNW-1ff6baa44e22b91eefb48aea6f3befa078c0489b.tar.gz
Merge pull request #1 from ziejd2/octave_php_separate
Octave php separate
Diffstat (limited to 'sourcecodes/bnt-master/SLP/examples/test_cpdag.m')
-rw-r--r--sourcecodes/bnt-master/SLP/examples/test_cpdag.m22
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