Generate and return the vector of coefficients of the polynomial resulting from the \(k\)th-order differentiation of a univariate polynomial of arbitrary degree.
More...
Generate and return the vector of coefficients of the polynomial resulting from the \(k\)th-order differentiation of a univariate polynomial of arbitrary degree.
See the documentation of pm_polynomial for details of the implementation.
- Parameters
-
[in] | coef | : The input contiguous vector of non-zero size of,
-
type
complex of kind any supported by the processor (e.g., CK, CK32, CK64, or CK128), or
-
type
real of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128),
containing the coefficients (in the order of increasing power) of the univariate polynomial whose \(k\)th-order derivative must be returned.
By definition, the degree of the coef polynomial is size(coef) - 1 .
This means that the condition coef(size(coef)) /= 0. is expected to hold (although not enforced).
|
[in] | order | : The input scalar nonnegative integer of default kind IK containing the order of the derivative to compute.
(optional, default = 1 ) |
- Returns
diff
: The output contiguous
vector of the same type and kind as the input coef
, of size size(coef) - order
, containing the coefficients (in the order of increasing power) of the resulting polynomial from the \(k\)th-order differentiation of the input polynomial with coefficients coef
of arbitrary degree.
By definition, the degree of the diff
polynomial is size(diff) - order
.
Possible calling interfaces ⛓
diff(
1 :
size(coef)
- order)
= getPolyDiff(coef(:), order)
Generate and return the vector of coefficients of the polynomial resulting from the th-order differen...
This module contains procedures and generic interfaces for performing various mathematical operations...
- Warning
- The condition
0 <= order
must hold for the corresponding input arguments.
This condition is verified only if the library is built with the preprocessor macro CHECK_ENABLED=1
.
-
The
pure
procedure(s) documented herein become impure
when the ParaMonte library is compiled with preprocessor macro CHECK_ENABLED=1
.
By default, these procedures are pure
in release
build and impure
in debug
and testing
builds.
- See also
- getPolyDiff
setPolyDiff
Example usage ⛓
13 type(display_type) :: disp
14 integer(IK) :: itry, ntry
= 20
19 real(TKG),
allocatable :: coef(:), diff(:)
21 call disp%show(
"degree = getUnifRand(0, 9_IK)")
25 call disp%show(
"coef = getUnifRand(-9, 9, degree)")
31 call disp%show(
"order = getUnifRand(0, size(coef) + 1)")
36 call disp%show(
"diff = getPolyDiff(coef, order)")
38 call disp%show(
"diff ! derivative coefficients.")
48 complex(TKG),
allocatable :: coef(:), diff(:)
50 call disp%show(
"degree = getUnifRand(0, 9_IK)")
54 call disp%show(
"coef = cmplx(getUnifRand(-9, 9, degree), getUnifRand(-9, 9, degree), TKG)")
60 call disp%show(
"order = getUnifRand(0, size(coef) + 1)")
65 call disp%show(
"diff = getPolyDiff(coef, order)")
67 call disp%show(
"diff ! derivative coefficients.")
Generate and return a scalar or a contiguous array of rank 1 of length s1 of randomly uniformly distr...
This is a generic method of the derived type display_type with pass attribute.
This is a generic method of the derived type display_type with pass attribute.
Generate and return a string containing the polynomial expression corresponding to the input polynomi...
This module contains classes and procedures for computing various statistical quantities related to t...
This module contains classes and procedures for input/output (IO) or generic display operations on st...
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
integer, parameter RKS
The single-precision real kind in Fortran mode. On most platforms, this is an 32-bit real kind.
Generate and return an object of type display_type.
Example Unix compile command via Intel ifort
compiler ⛓
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example Windows Batch compile command via Intel ifort
compiler ⛓
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
Example Unix / MinGW compile command via GNU gfortran
compiler ⛓
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example output ⛓
6-9.00000000,
+1.00000000,
+2.00000000,
-1.00000000,
+0.00000000,
+3.00000000,
-2.00000000
8-9.x^
0 + 1.x^
1 + 2.x^
2 - 1.x^
3 + 0.x^
4 + 3.x^
5 - 2.x^
6
15+15.0000000,
-12.0000000
60-9.00000000,
-5.00000000
78-4.00000000,
-3.00000000,
+5.00000000,
-9.00000000,
-7.00000000,
+7.00000000,
-3.00000000
80-4.x^
0 - 3.x^
1 + 5.x^
2 - 9.x^
3 - 7.x^
4 + 7.x^
5 - 3.x^
6
96-1.00000000,
-6.00000000,
+8.00000000,
+6.00000000,
+6.00000000
98-1.x^
0 - 6.x^
1 + 8.x^
2 + 6.x^
3 + 6.x^
4
114+1.00000000,
+4.00000000,
-3.00000000,
+9.00000000
1161.x^
0 + 4.x^
1 - 3.x^
2 + 9.x^
3
132+4.00000000,
-2.00000000,
+1.00000000,
+4.00000000,
+3.00000000,
-5.00000000,
+6.00000000,
+0.00000000
1344.x^
0 - 2.x^
1 + 1.x^
2 + 4.x^
3 + 3.x^
4 - 5.x^
5 + 6.x^
6 + 0.x^
7
141+36.0000000,
+0.00000000
150-2.00000000,
-4.00000000,
-9.00000000,
+5.00000000
152-2.x^
0 - 4.x^
1 - 9.x^
2 + 5.x^
3
159-4.00000000,
-18.0000000,
+15.0000000
161-4.x^
0 - 18.x^
1 + 15.x^
2
186-1.00000000,
+3.00000000,
-6.00000000,
-1.00000000,
-6.00000000,
-8.00000000,
+0.00000000,
-7.00000000,
-3.00000000
188-1.x^
0 + 3.x^
1 - 6.x^
2 - 1.x^
3 - 6.x^
4 - 8.x^
5 + 0.x^
6 - 7.x^
7 - 3.x^
8
195-24.0000000,
-40.0000000,
+0.00000000,
-49.0000000,
-24.0000000
197-24.x^
0 - 40.x^
1 + 0.x^
2 - 49.x^
3 - 24.x^
4
222-8.00000000,
-7.00000000,
-9.00000000,
+4.00000000,
+9.00000000
224-8.x^
0 - 7.x^
1 - 9.x^
2 + 4.x^
3 + 9.x^
4
240-8.00000000,
-9.00000000,
-4.00000000
242-8.x^
0 - 9.x^
1 - 4.x^
2
258+8.00000000,
+6.00000000,
+2.00000000,
+7.00000000,
+4.00000000
2608.x^
0 + 6.x^
1 + 2.x^
2 + 7.x^
3 + 4.x^
4
267+8.00000000,
+6.00000000,
+2.00000000,
+7.00000000,
+4.00000000
2698.x^
0 + 6.x^
1 + 2.x^
2 + 7.x^
3 + 4.x^
4
294+7.00000000,
+0.00000000,
+0.00000000,
+5.00000000,
-8.00000000,
+7.00000000,
+2.00000000,
-9.00000000
2967.x^
0 + 0.x^
1 + 0.x^
2 + 5.x^
3 - 8.x^
4 + 7.x^
5 + 2.x^
6 - 9.x^
7
303+35.0000000,
+12.0000000,
-63.0000000
30535.x^
0 + 12.x^
1 - 63.x^
2
312+2.00000000,
-7.00000000,
+8.00000000,
-3.00000000,
-3.00000000,
+3.00000000,
+4.00000000,
+6.00000000
3142.x^
0 - 7.x^
1 + 8.x^
2 - 3.x^
3 - 3.x^
4 + 3.x^
5 + 4.x^
6 + 6.x^
7
321+2.00000000,
-7.00000000,
+8.00000000,
-3.00000000,
-3.00000000,
+3.00000000,
+4.00000000,
+6.00000000
3232.x^
0 - 7.x^
1 + 8.x^
2 - 3.x^
3 - 3.x^
4 + 3.x^
5 + 4.x^
6 + 6.x^
7
330+5.00000000,
+1.00000000,
-7.00000000,
+3.00000000,
-6.00000000,
-7.00000000
3325.x^
0 + 1.x^
1 - 7.x^
2 + 3.x^
3 - 6.x^
4 - 7.x^
5
339+1.00000000,
-14.0000000,
+9.00000000,
-24.0000000,
-35.0000000
3411.x^
0 - 14.x^
1 + 9.x^
2 - 24.x^
3 - 35.x^
4
366(
+7.00000000,
-9.00000000), (
+9.00000000,
+5.00000000), (
-2.00000000,
+9.00000000)
368(
7.,
-9.)x^
0 + (
9.,
5.)x^
1 + (
-2.,
9.)x^
2
384(
+3.00000000,
+7.00000000), (
+7.00000000,
+2.00000000), (
-7.00000000,
-3.00000000), (
-9.00000000,
-5.00000000), (
+1.00000000,
+0.00000000)
386(
3.,
7.)x^
0 + (
7.,
2.)x^
1 + (
-7.,
-3.)x^
2 + (
-9.,
-5.)x^
3 + (
1.,
0.)x^
4
393(
+7.00000000,
+2.00000000), (
-14.0000000,
-6.00000000), (
-27.0000000,
-15.0000000), (
+4.00000000,
+0.00000000)
395(
7.,
2.)x^
0 + (
-14.,
-6.)x^
1 + (
-27.,
-15.)x^
2 + (
4.,
0.)x^
3
402(
+0.00000000,
+4.00000000), (
+8.00000000,
-8.00000000), (
+3.00000000,
-2.00000000), (
-3.00000000,
-2.00000000), (
+7.00000000,
+7.00000000), (
+7.00000000,
-9.00000000), (
+9.00000000,
-7.00000000), (
+2.00000000,
-1.00000000), (
+7.00000000,
+9.00000000)
404(
0.,
4.)x^
0 + (
8.,
-8.)x^
1 + (
3.,
-2.)x^
2 + (
-3.,
-2.)x^
3 + (
7.,
7.)x^
4 + (
7.,
-9.)x^
5 + (
9.,
-7.)x^
6 + (
2.,
-1.)x^
7 + (
7.,
9.)x^
8
411(
-9.00000000,
-6.00000000), (
+28.0000000,
+28.0000000), (
+35.0000000,
-45.0000000), (
+54.0000000,
-42.0000000), (
+14.0000000,
-7.00000000), (
+56.0000000,
+72.0000000)
413(
-9.,
-6.)x^
0 + (
28.,
28.)x^
1 + (
35.,
-45.)x^
2 + (
54.,
-42.)x^
3 + (
14.,
-7.)x^
4 + (
56.,
72.)x^
5
420(
+3.00000000,
-1.00000000), (
+0.00000000,
+4.00000000), (
-3.00000000,
+2.00000000), (
-9.00000000,
+4.00000000)
422(
3.,
-1.)x^
0 + (
0.,
4.)x^
1 + (
-3.,
2.)x^
2 + (
-9.,
4.)x^
3
429(
-27.0000000,
+12.0000000)
438(
+6.00000000,
+7.00000000), (
+6.00000000,
+6.00000000), (
-2.00000000,
-5.00000000), (
-2.00000000,
+1.00000000), (
-4.00000000,
-5.00000000), (
+1.00000000,
+4.00000000), (
-3.00000000,
-6.00000000)
440(
6.,
7.)x^
0 + (
6.,
6.)x^
1 + (
-2.,
-5.)x^
2 + (
-2.,
1.)x^
3 + (
-4.,
-5.)x^
4 + (
1.,
4.)x^
5 + (
-3.,
-6.)x^
6
456(
+6.00000000,
+5.00000000), (
-2.00000000,
+5.00000000), (
+4.00000000,
-7.00000000), (
+7.00000000,
+8.00000000), (
+0.00000000,
-8.00000000), (
+6.00000000,
-2.00000000), (
-3.00000000,
-9.00000000), (
-9.00000000,
-4.00000000), (
-4.00000000,
-3.00000000)
458(
6.,
5.)x^
0 + (
-2.,
5.)x^
1 + (
4.,
-7.)x^
2 + (
7.,
8.)x^
3 + (
0.,
-8.)x^
4 + (
6.,
-2.)x^
5 + (
-3.,
-9.)x^
6 + (
-9.,
-4.)x^
7 + (
-4.,
-3.)x^
8
465(
-2.00000000,
+5.00000000), (
+8.00000000,
-14.0000000), (
+21.0000000,
+24.0000000), (
+0.00000000,
-32.0000000), (
+30.0000000,
-10.0000000), (
-18.0000000,
-54.0000000), (
-63.0000000,
-28.0000000), (
-32.0000000,
-24.0000000)
467(
-2.,
5.)x^
0 + (
8.,
-14.)x^
1 + (
21.,
24.)x^
2 + (
0.,
-32.)x^
3 + (
30.,
-10.)x^
4 + (
-18.,
-54.)x^
5 + (
-63.,
-28.)x^
6 + (
-32.,
-24.)x^
7
474(
+3.00000000,
-8.00000000), (
-2.00000000,
+1.00000000), (
-5.00000000,
+5.00000000), (
+1.00000000,
-1.00000000), (
+2.00000000,
-9.00000000), (
+6.00000000,
+0.00000000), (
-2.00000000,
-3.00000000), (
+6.00000000,
-7.00000000), (
+6.00000000,
+5.00000000)
476(
3.,
-8.)x^
0 + (
-2.,
1.)x^
1 + (
-5.,
5.)x^
2 + (
1.,
-1.)x^
3 + (
2.,
-9.)x^
4 + (
6.,
0.)x^
5 + (
-2.,
-3.)x^
6 + (
6.,
-7.)x^
7 + (
6.,
5.)x^
8
483(
-10.0000000,
+10.0000000), (
+3.00000000,
-3.00000000), (
+8.00000000,
-36.0000000), (
+30.0000000,
+0.00000000), (
-12.0000000,
-18.0000000), (
+42.0000000,
-49.0000000), (
+48.0000000,
+40.0000000)
485(
-10.,
10.)x^
0 + (
3.,
-3.)x^
1 + (
8.,
-36.)x^
2 + (
30.,
0.)x^
3 + (
-12.,
-18.)x^
4 + (
42.,
-49.)x^
5 + (
48.,
40.)x^
6
492(
+3.00000000,
+1.00000000), (
-7.00000000,
+4.00000000), (
-1.00000000,
+2.00000000), (
+3.00000000,
-1.00000000), (
+2.00000000,
+8.00000000)
494(
3.,
1.)x^
0 + (
-7.,
4.)x^
1 + (
-1.,
2.)x^
2 + (
3.,
-1.)x^
3 + (
2.,
8.)x^
4
501(
-2.00000000,
+4.00000000), (
+9.00000000,
-3.00000000), (
+8.00000000,
+32.0000000)
503(
-2.,
4.)x^
0 + (
9.,
-3.)x^
1 + (
8.,
32.)x^
2
510(
+7.00000000,
+4.00000000), (
+2.00000000,
-8.00000000), (
+0.00000000,
+5.00000000), (
+6.00000000,
+2.00000000), (
-4.00000000,
-6.00000000)
512(
7.,
4.)x^
0 + (
2.,
-8.)x^
1 + (
0.,
5.)x^
2 + (
6.,
2.)x^
3 + (
-4.,
-6.)x^
4
519(
+2.00000000,
-8.00000000), (
+0.00000000,
+10.0000000), (
+18.0000000,
+6.00000000), (
-16.0000000,
-24.0000000)
521(
2.,
-8.)x^
0 + (
0.,
10.)x^
1 + (
18.,
6.)x^
2 + (
-16.,
-24.)x^
3
528(
-6.00000000,
+8.00000000), (
-9.00000000,
+5.00000000), (
+6.00000000,
+4.00000000), (
+5.00000000,
-1.00000000)
530(
-6.,
8.)x^
0 + (
-9.,
5.)x^
1 + (
6.,
4.)x^
2 + (
5.,
-1.)x^
3
537(
+12.0000000,
+8.00000000), (
+15.0000000,
-3.00000000)
539(
12.,
8.)x^
0 + (
15.,
-3.)x^
1
546(
-3.00000000,
+1.00000000), (
+5.00000000,
+8.00000000)
548(
-3.,
1.)x^
0 + (
5.,
8.)x^
1
555(
-3.00000000,
+1.00000000), (
+5.00000000,
+8.00000000)
557(
-3.,
1.)x^
0 + (
5.,
8.)x^
1
564(
+0.00000000,
+8.00000000), (
-4.00000000,
-8.00000000), (
+0.00000000,
-8.00000000), (
-3.00000000,
+4.00000000), (
-2.00000000,
-2.00000000), (
+1.00000000,
+9.00000000), (
-8.00000000,
+5.00000000), (
+5.00000000,
+1.00000000)
566(
0.,
8.)x^
0 + (
-4.,
-8.)x^
1 + (
0.,
-8.)x^
2 + (
-3.,
4.)x^
3 + (
-2.,
-2.)x^
4 + (
1.,
9.)x^
5 + (
-8.,
5.)x^
6 + (
5.,
1.)x^
7
573(
+0.00000000,
+8.00000000), (
-4.00000000,
-8.00000000), (
+0.00000000,
-8.00000000), (
-3.00000000,
+4.00000000), (
-2.00000000,
-2.00000000), (
+1.00000000,
+9.00000000), (
-8.00000000,
+5.00000000), (
+5.00000000,
+1.00000000)
575(
0.,
8.)x^
0 + (
-4.,
-8.)x^
1 + (
0.,
-8.)x^
2 + (
-3.,
4.)x^
3 + (
-2.,
-2.)x^
4 + (
1.,
9.)x^
5 + (
-8.,
5.)x^
6 + (
5.,
1.)x^
7
582(
-8.00000000,
+5.00000000), (
-2.00000000,
-7.00000000), (
-4.00000000,
+0.00000000)
584(
-8.,
5.)x^
0 + (
-2.,
-7.)x^
1 + (
-4.,
0.)x^
2
600(
-9.00000000,
-7.00000000), (
+0.00000000,
+6.00000000)
602(
-9.,
-7.)x^
0 + (
0.,
6.)x^
1
609(
-9.00000000,
-7.00000000), (
+0.00000000,
+6.00000000)
611(
-9.,
-7.)x^
0 + (
0.,
6.)x^
1
636(
+9.00000000,
+1.00000000), (
+7.00000000,
+3.00000000), (
+1.00000000,
-8.00000000), (
+7.00000000,
-1.00000000), (
+6.00000000,
-7.00000000), (
+7.00000000,
-6.00000000), (
-5.00000000,
-4.00000000), (
-3.00000000,
+5.00000000), (
-1.00000000,
+0.00000000)
638(
9.,
1.)x^
0 + (
7.,
3.)x^
1 + (
1.,
-8.)x^
2 + (
7.,
-1.)x^
3 + (
6.,
-7.)x^
4 + (
7.,
-6.)x^
5 + (
-5.,
-4.)x^
6 + (
-3.,
5.)x^
7 + (
-1.,
0.)x^
8
645(
+21.0000000,
-3.00000000), (
+24.0000000,
-28.0000000), (
+35.0000000,
-30.0000000), (
-30.0000000,
-24.0000000), (
-21.0000000,
+35.0000000), (
-8.00000000,
+0.00000000)
647(
21.,
-3.)x^
0 + (
24.,
-28.)x^
1 + (
35.,
-30.)x^
2 + (
-30.,
-24.)x^
3 + (
-21.,
35.)x^
4 + (
-8.,
0.)x^
5
654(
+1.00000000,
-2.00000000), (
-8.00000000,
+5.00000000), (
-3.00000000,
+1.00000000), (
-7.00000000,
-3.00000000)
656(
1.,
-2.)x^
0 + (
-8.,
5.)x^
1 + (
-3.,
1.)x^
2 + (
-7.,
-3.)x^
3
663(
+1.00000000,
-2.00000000), (
-8.00000000,
+5.00000000), (
-3.00000000,
+1.00000000), (
-7.00000000,
-3.00000000)
665(
1.,
-2.)x^
0 + (
-8.,
5.)x^
1 + (
-3.,
1.)x^
2 + (
-7.,
-3.)x^
3
672(
+6.00000000,
+5.00000000), (
+6.00000000,
-8.00000000), (
-2.00000000,
-1.00000000), (
-8.00000000,
-7.00000000)
674(
6.,
5.)x^
0 + (
6.,
-8.)x^
1 + (
-2.,
-1.)x^
2 + (
-8.,
-7.)x^
3
690(
-6.00000000,
+1.00000000), (
+7.00000000,
-2.00000000), (
+4.00000000,
+9.00000000), (
-8.00000000,
-6.00000000), (
+4.00000000,
-4.00000000), (
+5.00000000,
-9.00000000)
692(
-6.,
1.)x^
0 + (
7.,
-2.)x^
1 + (
4.,
9.)x^
2 + (
-8.,
-6.)x^
3 + (
4.,
-4.)x^
4 + (
5.,
-9.)x^
5
708(
+9.00000000,
-5.00000000), (
-5.00000000,
-2.00000000), (
+3.00000000,
+5.00000000)
710(
9.,
-5.)x^
0 + (
-5.,
-2.)x^
1 + (
3.,
5.)x^
2
717(
-5.00000000,
-2.00000000), (
+6.00000000,
+10.0000000)
719(
-5.,
-2.)x^
0 + (
6.,
10.)x^
1
- Test:
- test_pm_polynomial
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
-
If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
-
If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
- Copyright
- Computational Data Science Lab
- Author:
- Fatemeh Bagheri, Tuesday 11:34 PM, August 10, 2021, Dallas, TX
Definition at line 2415 of file pm_polynomial.F90.