File: getlocal.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 (43 lines) | stat: -rw-r--r-- 1,019 bytes parent folder | download | duplicates (4)
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
function [out,nwrk,txt]=getlocal(nwrk,nam,typ,m,n)
//Cette macro alloue une variable locale de taille m*n de type fortran typ
//et de nom scilab nam dans le
//    tableau de travail correspondant (modifie en consequence nwrk)
//    et retourne
//      -dans out une chaine de la forme 'work(iwnam)' ou 'iwork(iiwnam)'
//        le n etant defini automatiquement.
//      -dans txt les lignes fortran permettant de definir iwnam ou iiwnam
//
//!
// Copyright INRIA
txt=[]
mn=mulf(m,n)
if typ=='1' then
  i=nwrk(1)
  nw=nwrk(11);[m,n]=size(nw)
  free=find(nw(2,:)=='0')
  k=find(nw(1,free)==mn)
  if k==[] then
    nwrk(10)=[nwrk(10);nam]
    nwrk(11)=[nwrk(11) [mn;'1']]
  else
    i=free(k(1))
    nw(2,i)='1';nwrk(11)=nw
  end
  out='work(iw'+nam+')'
else
  i=nwrk(12)
  nw=nwrk(13);[m,n]=size(nw)
  free=find(nw(2,:)=='0')
  k=find(nw(1,free)==mn)
  if k==[] then
    nwrk(12)=[nwrk(12);nam]
    nwrk(13)=[nwrk(13),[mn;'1']];
  else
    i=free(k(1))
    nw(2,i)='1';nwrk(13)=nw
  end
  out='iwork(iiw'+nam+')'
end