File: %25imp2for.sci

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (54 lines) | stat: -rw-r--r-- 1,038 bytes parent folder | download
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
function [stk,nwrk,txt,top]=%imp2for(nwrk)
//fortran code for 1:n
//
// Voir s'il est possible d'ameliorer dans le cas ou ces vecteurs implicite
// servent dans la designation d'une sous matrice
//!
// Copyright INRIA
if forexp==1 then
  s1=stk(top-1);s2=stk(top)
  if op(3)=='2' then
    stk=list(s1(1)+','+s2(1),'2')
    top=top-1
  else
    s0=stk(top-2)
    stk=list(s0(1)+','+s2(1)+','+s1(1),'2')
    top=top-2
  end
  return
end
rhs=abs(evstr(op(3)))
if rhs==2 then
  fin=stk(top);
  deb=stk(top-1);
  pas=['1','0','0']
  top=top-1
else
  fin=stk(top);
  deb=stk(top-2);
  pas=stk(top-1);
  top=top-2
end
 
if pas(1)=='1' then
  ln=addf(subf(fin(1),deb(1)),'1')
else
  ln=addf('('+subf(fin(1),deb(1))+')/'+pas(1),'1')
end
//
if deb(3)=='1'|fin(3)=='1'|pas(3)=='1' then
  typ='1'
else
  typ='0'
end
//
  [out,nwrk,txt]=outname(nwrk,typ,'1',ln)
  if typ=='1' then
    txt=[txt;gencall(['dvimp',deb(1),fin(1),pas(1),out])]
  else
    txt=[txt;gencall(['ivimp',deb(1),fin(1),pas(1),out])]
  end
 
  stk=list(out,'-1',typ,'1',ln)
//end