chtrfm1.f
来自「简单的fortran程序实现chebyshev变换」· F 代码 · 共 28 行
F
28 行
subroutine chtrfm1(n,x,cosn,iflag)***************************************************** 1-D Chebyshev transform !! MUST call costi(n+1,cosn) to initialize !!*** iflag=1: Spectral to Physical*** iflag=0: Physical to Spectral *** x: input and output************************************************* implicit double precision (a-h,o-z) dimension x(0:n),cosn(1) if (iflag.eq.1) then val=.5d0 do i=1,n-1 x(i)=val*x(i) enddo call cost(n+1,x,cosn) else call cost(n+1,x,cosn) val=1.d0/n do i=1,n-1 x(i)=x(i)*val enddo x(0)=x(0)*val*.5d0 x(n)=x(n)*val*.5d0 endif return end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?