GetUltrasphericalRecurrenceCoeff
Recurrence coefficients are for monic and nonmonic Ultraspherical polynomials.
Interface 1
Monic polynomials:
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE PURE SUBROUTINE GetUltrasphericalRecurrenceCoeff(n, &
& lambda, alphaCoeff, betaCoeff)
INTEGER(I4B), INTENT(IN) :: n
!! order of Ultraspherical polynomial, it should be greater than 1
REAL(DFP), INTENT(IN) :: lambda
!! lambda should be greater than -0.5
!! lambda should not be zero
REAL(DFP), INTENT(OUT) :: alphaCoeff(0:n - 1)
REAL(DFP), INTENT(OUT) :: betaCoeff(0:n - 1)
END SUBROUTINE GetUltrasphericalRecurrenceCoeff
END INTERFACE
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 GetUltrasphericalRecurrenceCoeff(n=n, &
& lambda=0.5_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
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE PURE SUBROUTINE GetUltrasphericalRecurrenceCoeff2(n, lambda, &
& A, B, C)
INTEGER(I4B), INTENT(IN) :: n
!! order of jacobi polynomial, it should be greater than 1
REAL(DFP), INTENT(IN) :: lambda
!! lambda should be greater than -0.5
!! lambda should not be 0.0
REAL(DFP), INTENT(OUT) :: A(0:n - 1)
!! size is n
REAL(DFP), INTENT(OUT) :: B(0:n - 1)
!! this coefficient is zero
REAL(DFP), INTENT(OUT) :: C(0:n - 1)
!! size is n
END SUBROUTINE GetUltrasphericalRecurrenceCoeff2
END INTERFACE
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 GetUltrasphericalRecurrenceCoeff2(n=n, &
& lambda=0.5_DFP, &
& A=A, B=B, C=C)
call display( mdencode(A .colconcat. B .colconcat. C), "ans = ")
end program main
See results
ans =
1 | 0 | 0 |
1.5 | 0 | 0.5 |
1.6667 | 0 | 0.66667 |
1.75 | 0 | 0.75 |
1.8 | 0 | 0.8 |