GetChebyshev1RecurrenceCoeff
Recurrence coefficients are for monic and nonmonic Chebyshev1 polynomials.
Interface 1
Monic polynomials
INTERFACE
MODULE PURE SUBROUTINE GetChebyshev1RecurrenceCoeff(n, alphaCoeff, betaCoeff)
INTEGER(I4B), INTENT(IN) :: n
!! order of Chebyshev1 polynomial, it should be greater than 1
REAL(DFP), INTENT(OUT) :: alphaCoeff(0:n - 1)
REAL(DFP), INTENT(OUT) :: betaCoeff(0:n - 1)
END SUBROUTINE GetChebyshev1RecurrenceCoeff
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 GetChebyshev1RecurrenceCoeff(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
INTERFACE
MODULE PURE SUBROUTINE GetChebyshev1RecurrenceCoeff2(n, A, B, C)
INTEGER(I4B), INTENT(IN) :: n
!! order of Chebyshev1 polynomial, it should be greater than 1
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 GetChebyshev1RecurrenceCoeff2
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