~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to macros/m2sci/sci_ifft.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
function [stk,txt,top]=sci_ifft()
2
 
// Copyright INRIA
3
 
txt=[]
4
 
if rhs==1 then
5
 
  [m,n]=checkdims(stk(top))
6
 
  x=stk(top)(1)
7
 
  if m==-1&n==-1 then
8
 
    set_infos(['mtlb_ifft('+x+') may be replaced by '
9
 
               '     fft('+x+',1)'+' if '+x+'is a vector'],1)
10
 
    stk=list('mtlb_ifft('+x+')','0',stk(top)(3),stk(top)(4),'1')
11
 
  elseif m==1|n==1 then
12
 
    stk=list('fft('+x+',1)','0',stk(top)(3),stk(top)(4),'1')
13
 
  else
14
 
    stk=list('mtlb_ifft('+x+')','0',stk(top)(3),stk(top)(4),'1')
15
 
  end
16
 
elseif rhs==2 then
17
 
  stk=list('mtlb_ifft('+stk(top-1)(1)+','+stk(top)(1)+')','0','?','?','1')
18
 
elseif rhs==3 then
19
 
  job=stk(top)(1)
20
 
  if stk(top-1)(1)=='[]' then
21
 
    if job=='1' then
22
 
      y=lhsvarsnames()
23
 
      if y==[] then y=gettempvar();typ='0';else typ='-2',end
24
 
      if isname(stk(top-2)(1)) then 
25
 
        r=stk(top-2)(1),
26
 
        else 
27
 
        r=gettempvar(1),
28
 
        txt=[txt;r+'='+stk(stk(top-2)(1))+';']
29
 
      end
30
 
      txt=[txt;
31
 
          y+'=[];for %xk='+r+','+y+'=['+y+',fft(%xk,1)];end']
32
 
      stk=list(y,typ,stk(top)(3),stk(top)(4),'1')
33
 
    elseif job=='2' then
34
 
      y=lhsvarsnames()
35
 
      if y==[] then y=gettempvar(1);typ='0';else typ='-2',end
36
 
      if isname(stk(top-2)(1)) then 
37
 
        r=stk(top-2)(1),
38
 
        else 
39
 
        r=gettempvar(),
40
 
        txt=[txt;r+'='+stk(stk(top-2)(1))+';']
41
 
      end
42
 
      txt=[txt;
43
 
          y+'=[];for %j=1:size('+r+',1),'+y+'=['+y+';fft('+r+'(%j,:),1)];end']
44
 
      stk=list(y,typ,stk(top)(3),stk(top)(4),'1')
45
 
    else
46
 
      args=[];for k=1:3,args=[stk(top)(1),args];top=top-1,end;top=top+1
47
 
      stk=list('mtlb_ifft'+rhsargs(args),'0',stk(top)(3),stk(top)(4),'1')
48
 
    end
49
 
  else
50
 
    args=[];for k=1:3,args=[stk(top)(1),args];top=top-1,end;top=top+1
51
 
    stk=list('mtlb_ifft'+rhsargs(args),'0','?','?','1')
52
 
  end
53
 
end
54