comparison core/magnatagatune/ClipComparedGraph.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 % ---
2 % class ClipComparedGraph
3 % Directed graph representing comparative clip similarities.
4 %
5 % each node represents a clip
6 % an edge a -> b is present if clipas a and b cooccur
7 % in a comparison triplet
8 %
9 % ---
10
11 classdef ClipComparedGraph < Graph
12
13 % ---
14 % the methods
15 % ---
16 methods
17
18
19 % constructor of the graph
20 function G = ClipComparedGraph(comparison, comparison_ids)
21
22 if nargin == 2
23 % ---
24 % handle automatic or manual input
25 % ---
26 for i = 1:size(comparison,1)
27
28 % get clips and votes
29 clips = comparison_ids(comparison(i,1:3));
30
31 % edges
32 G.add_edge(clips(1), clips(2), 1);
33 G.add_edge(clips(1), clips(3), 1);
34 G.add_edge(clips(2), clips(3), 1);
35 %
36 % % symmectric edges
37 % G.add_edge(clips(2), clips(1), 1);
38 % G.add_edge(clips(3), clips(1), 1);
39 % G.add_edge(clips(3), clips(2), 1);
40 end
41
42 elseif nargin == 1
43
44 % ---
45 % Add the input graph to the empty one
46 % ---
47 G.add_graph(comparison);
48
49 end
50
51 % end constructor function
52 end
53
54 end
55 end
56
57