UltrasphericalGradientEvalAll
Evaluate gradient of Ultraspherical polynomials.
Interface 1
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE PURE FUNCTION UltrasphericalGradientEvalAll(n, lambda, x) &
& RESULT(ans)
INTEGER(I4B), INTENT(IN) :: n
!! order of polynomial
REAL(DFP), INTENT(IN) :: lambda
!! lambda should be greater than -0.5
REAL(DFP), INTENT(IN) :: x
REAL(DFP) :: ans(1:n + 1)
END FUNCTION UltrasphericalGradientEvalAll
END INTERFACE
This example shows the usage of UltrasphericalGradientEvalAll
method.
This routine evaluates the first derivative of Ultraspherical polynomial upto order n, for many points
program main
use easifembase
implicit none
integer( i4b ) :: n
real( dfp ), allocatable :: ans( :, : ), x( : )
real( dfp ), parameter :: lambda = 0.5_DFP
type(string) :: astr
x = [-1.0, 0.0, 1.0]
n = 3; call callme
contains
subroutine callme
ans= UltrasphericalGradientEvalAll( n=n, x=x, &
& lambda=lambda )
astr = MdEncode( ans )
call display( astr%chars(), "" )
end subroutine callme
end program main
See results
dP0 | dP1 | dP2 | dP3 |
---|---|---|---|
0 | 1 | -3 | 6 |
0 | 1 | 0 | -1.5 |
0 | 1 | 3 | 6 |
Interface 2
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE PURE FUNCTION UltrasphericalGradientEvalAll(n, lambda, x) &
& RESULT(ans)
INTEGER(I4B), INTENT(IN) :: n
!! order of polynomial
REAL(DFP), INTENT(IN) :: lambda
!! lambda should be greater than -0.5
REAL(DFP), INTENT(IN) :: x(:)
REAL(DFP) :: ans(1:SIZE(x), 1:n + 1)
END FUNCTION UltrasphericalGradientEvalAll
END INTERFACE
This example shows the usage of UltrasphericalGradientEvalAll
method.
This routine evaluates Ultraspherical polynomial upto order n, for many points.
program main
use easifembase
implicit none
integer( i4b ) :: n
real( dfp ), allocatable :: ans( : ), x
real( dfp ), parameter :: lambda=0.5_DFP
type(string) :: astr
x = -1.0_DFP
n = 3; call callme
contains
subroutine callme
ans= UltrasphericalGradientEvalAll( n=n, x=x, &
& lambda=lambda )
astr = MdEncode( ans )
call display( astr%chars(), "" )
end subroutine callme
end program main
See results
P0 | P1 | P2 | P3 |
---|---|---|---|
0 | 1 | -3 | 6 |