Identification Division.
Program-Id. fourier.
author. Robert Sedgewick.
* Simplex Verfahren, lineare Programmierung
* aus Algorithmen p669
Data Division.
Working-Storage Section.
77 w pic 9(4)V9(2).
77 i pic 9(4).
Linkage Section.
77 p pic 9(4)V9(2) occurs 1000.
77 n pic 9(4)V9(2).
77 k pic 9(4).
77 r pic 9(4)V9(2).
77 p1 pic 9(4)V9(2).
77 p2 pic 9(4)V9(2).
77 p3 pic 9(4)V9(2).
77 r1 pic 9(4)V9(2).
77 r2 pic 9(4)V9(2).
77 r3 pic 9(4)V9(2).
Procedure Division using p n k r.
if n=1 then
move t to p(k)
move p(k+1) to p1
compute p(k)=t+p1
compute p(k+1)=t-p1
else
perform varying i from 0 by 2 until i=n / 2
compute j=k+2*i
move p(j) to t(i)
compute te=i+1+n/2
move p(j+1) to t(te)
end-perform
perform varying i from 0 by 2 until i=n
move t(i) to p(k+i)
end-perform
compute te=n/2
call fourier using p te k
compute te=n/2
compute te2=k+1+n/2
call fourier using p te te2
compute j=(outN+1)/(n+1)
perform varying i from 0 until i=n/2
compute te=i*j
compute te2=k+(n/2)+1+i
compute t=w(te)*p(te2)
compute t(i)=p(k+1)+t
compute te=i+n/2+1
compute t(te)=p(k+i)-t
end-perform
perform varying i from 0 until i=n/2
move t(i) to p(k+i)
end-perform
End-Program fourier.
¤ Dauer der Verarbeitung: 0.18 Sekunden
(vorverarbeitet)
¤
|
Haftungshinweis
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.
|