File: splitted_links.sci

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (56 lines) | stat: -rw-r--r-- 1,750 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
function prt=splitted_links(scs_m,keep,del)
// given a vectors of indexes of "kept" blocks and "deleted" blocks 
// forms at table prt. Each line of prt is relative to a link beetween 
// a kept and a deleted block as follow:
// [io,keep_block_# port_# link_type link_color del_block_# port_#]
// io = 1 : link goes to a kept block, 0:link comes from a kept block
// Copyright INRIA
prt=[]
for kkeep=1:size(keep,'*')
  kk=keep(kkeep)
  o=scs_m(kk)
  if o(1)=='Block' then
    connected=get_connected(scs_m,kk,'in')
    for kc=1:size(connected,'*') //loop on input links 
      lk=scs_m(connected(kc))
      ct=lk(7)
      from=lk(8)
      to=lk(9)
      if or(from(1)==del) then // link between keep and del
	prt=[prt;[1,to(1),to(2),ct(2),ct(1),from(1),from(2)]]
      end
    end
    connected=get_connected(scs_m,kk,'clkin')
    for kc=1:size(connected,'*') //loop on input links 
      lk=scs_m(connected(kc))
      ct=lk(7)
      from=lk(8)
      to=lk(9)
      if or(from(1)==del) then // link between keep and del
	prt=[prt;[1,to(1),to(2),ct(2),ct(1),from(1),from(2)]]
      end
    end    
    
    connected=get_connected(scs_m,kk,'out')
    for kc=1:size(connected,'*') //loop on output links 
      lk=scs_m(connected(kc))
      ct=lk(7)
      from=lk(8)
      to=lk(9)
      if or(to(1)==del) then // link between keep and del
	prt=[prt;[0,from(1),from(2),ct(2),ct(1),to(1),to(2)]]
      end
    end    
    connected=get_connected(scs_m,kk,'clkout')
    for kc=1:size(connected,'*') //loop on output links 
      lk=scs_m(connected(kc))
      ct=lk(7)
      from=lk(8)
      to=lk(9)
      if or(to(1)==del) then // link between keep and del
	prt=[prt;[0,from(1),from(2),ct(2),ct(1),to(1),to(2)]]
      end
    end        
  end
end