GetJacobiRecurrenceCoeff
Recurrence coefficients are for monic and nonmonic jacobi polynomials.
Interface 1
Monic polynomials
INTERFACE
MODULE PURE SUBROUTINE GetJacobiRecurrenceCoeff(n, alpha, beta, &
& alphaCoeff, betaCoeff)
INTEGER(I4B), INTENT(IN) :: n
!! order of jacobi polynomial, it should be greater than 1
REAL(DFP), INTENT(IN) :: alpha
REAL(DFP), INTENT(IN) :: beta
REAL(DFP), INTENT(OUT) :: alphaCoeff(0:n - 1)
REAL(DFP), INTENT(OUT) :: betaCoeff(0:n - 1)
END SUBROUTINE GetJacobiRecurrenceCoeff
END INTERFACE
- ️܀ See example
- ↢
program main
use easifembase
implicit none
real(dfp), allocatable :: alphacoeff(:)
real(dfp), allocatable :: betacoeff(:)
integer(i4b) :: n
n = 5; call reallocate(alphacoeff, n, betacoeff, n)
call GetJacobiRecurrenceCoeff(n=n, &
& alpha=0.0_DFP, beta=0.0_DFP, &
& alphacoeff=alphacoeff, betacoeff=betacoeff)
call display( alphacoeff .colconcat. betacoeff, "ans = ")
end program main
See results
results
ans =
----------------
0.00000 2.00000
0.00000 0.33333
0.00000 0.26667
0.00000 0.25714
0.00000 0.25397
Interface 2
These recurrence coefficients are for non-monic jacobi polynomials.
INTERFACE
MODULE PURE SUBROUTINE GetJacobiRecurrenceCoeff2(n, alpha, beta, &
& A, B, C)
INTEGER(I4B), INTENT(IN) :: n
!! order of jacobi polynomial, it should be greater than 1
REAL(DFP), INTENT(IN) :: alpha
REAL(DFP), INTENT(IN) :: beta
REAL(DFP), INTENT(OUT) :: A(0:n - 1)
REAL(DFP), INTENT(OUT) :: B(0:n - 1)
REAL(DFP), INTENT(OUT) :: C(0:n - 1)
END SUBROUTINE GetJacobiRecurrenceCoeff2
END INTERFACE
- ️܀ See example
- ↢
program main
use easifembase
implicit none
real(dfp), allocatable :: A(:)
real(dfp), allocatable :: B(:)
real(dfp), allocatable :: C(:)
integer(i4b) :: n
n = 5; call reallocate(A, n, B, n, C, n)
call GetJacobiRecurrenceCoeff2(n=n, &
& alpha=0.0_DFP, beta=0.0_DFP, &
& A=A, B=B, C=C)
call display( A .colconcat. B .colconcat. C, "ans = ")
end program main
See results
results
ans =
-------------------------
1.00000 -.00000 1.41421
1.50000 0.00000 0.50000
1.66667 0.00000 0.66667
1.75000 0.00000 0.75000
1.80000 0.00000 0.80000