mirror of
https://github.com/HongjianFang/DSurfTomo.git
synced 2025-12-20 02:21:06 +08:00
Initial commit
change 1e-2 to 'ftol' in CalSurfG.f90, which may cause problem with small study region (~2 km)
This commit is contained in:
47
srcsparsity/forwardtrans.f90
Normal file
47
srcsparsity/forwardtrans.f90
Normal file
@@ -0,0 +1,47 @@
|
||||
subroutine forwardtrans(vec,n,mxl,tp)
|
||||
implicit none
|
||||
integer n,mxl,tp
|
||||
real vec(n)
|
||||
integer i,j
|
||||
integer forward
|
||||
i=n
|
||||
if (tp == 1) then
|
||||
forward=0
|
||||
do while(i.ge.n/(2**mxl))
|
||||
call split(vec,i)
|
||||
call predict(vec,i,forward)
|
||||
call update(vec,i,forward)
|
||||
call normalizationf(vec,i)
|
||||
i=i/2
|
||||
enddo
|
||||
endif
|
||||
|
||||
if (tp == 2) then
|
||||
do while(i.ge.n/(2**mxl))
|
||||
call split(vec,i)
|
||||
call forwardstep(vec,i)
|
||||
i=i/2
|
||||
enddo
|
||||
endif
|
||||
|
||||
if (tp == 3) then
|
||||
do while(i.ge.n/(2**mxl))
|
||||
call transformD8(vec,i)
|
||||
i=i/2
|
||||
enddo
|
||||
endif
|
||||
end subroutine
|
||||
|
||||
subroutine normalizationf(x,n)
|
||||
implicit none
|
||||
real x(*)
|
||||
integer n
|
||||
|
||||
integer k
|
||||
do k=1,n/2
|
||||
x(k)=x(k)*sqrt(2.0)
|
||||
enddo
|
||||
do k=n/2+1,n
|
||||
x(k)=x(k)*sqrt(2.0)/2
|
||||
enddo
|
||||
end
|
||||
Reference in New Issue
Block a user