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 ⛓
24+0.00000000,
+5.00000000,
-4.00000000,
-3.00000000,
+6.00000000,
-2.00000000
260.x^
0 + 5.x^
1 - 4.x^
2 - 3.x^
3 + 6.x^
4 - 2.x^
5
33+0.00000000,
+5.00000000,
-4.00000000,
-3.00000000,
+6.00000000,
-2.00000000
350.x^
0 + 5.x^
1 - 4.x^
2 - 3.x^
3 + 6.x^
4 - 2.x^
5
60-5.00000000,
-6.00000000,
+2.00000000,
-3.00000000,
-6.00000000
62-5.x^
0 - 6.x^
1 + 2.x^
2 - 3.x^
3 - 6.x^
4
69-5.00000000,
-6.00000000,
+2.00000000,
-3.00000000,
-6.00000000
71-5.x^
0 - 6.x^
1 + 2.x^
2 - 3.x^
3 - 6.x^
4
78+7.00000000,
-8.00000000,
-3.00000000,
-4.00000000,
-9.00000000,
+4.00000000
807.x^
0 - 8.x^
1 - 3.x^
2 - 4.x^
3 - 9.x^
4 + 4.x^
5
87-36.0000000,
+20.0000000
96+8.00000000,
+6.00000000,
+8.00000000,
-6.00000000,
+5.00000000,
-9.00000000,
+5.00000000
988.x^
0 + 6.x^
1 + 8.x^
2 - 6.x^
3 + 5.x^
4 - 9.x^
5 + 5.x^
6
105-45.0000000,
+30.0000000
114-4.00000000,
+7.00000000,
-1.00000000,
+0.00000000
116-4.x^
0 + 7.x^
1 - 1.x^
2 + 0.x^
3
123-4.00000000,
+7.00000000,
-1.00000000,
+0.00000000
125-4.x^
0 + 7.x^
1 - 1.x^
2 + 0.x^
3
132-6.00000000,
+4.00000000
141-6.00000000,
+4.00000000
150+2.00000000,
-4.00000000,
-3.00000000,
+2.00000000,
-8.00000000,
+9.00000000,
+8.00000000,
+4.00000000
1522.x^
0 - 4.x^
1 - 3.x^
2 + 2.x^
3 - 8.x^
4 + 9.x^
5 + 8.x^
6 + 4.x^
7
159-6.00000000,
+6.00000000,
-32.0000000,
+45.0000000,
+48.0000000,
+28.0000000
161-6.x^
0 + 6.x^
1 - 32.x^
2 + 45.x^
3 + 48.x^
4 + 28.x^
5
168+8.00000000,
-1.00000000,
-8.00000000
186-2.00000000,
+7.00000000,
-8.00000000,
+2.00000000,
+3.00000000,
+0.00000000,
+2.00000000,
+7.00000000
188-2.x^
0 + 7.x^
1 - 8.x^
2 + 2.x^
3 + 3.x^
4 + 0.x^
5 + 2.x^
6 + 7.x^
7
195+7.00000000,
-16.0000000,
+6.00000000,
+12.0000000,
+0.00000000,
+12.0000000,
+49.0000000
1977.x^
0 - 16.x^
1 + 6.x^
2 + 12.x^
3 + 0.x^
4 + 12.x^
5 + 49.x^
6
204-7.00000000,
+1.00000000,
+8.00000000,
+5.00000000,
-6.00000000,
-2.00000000,
-9.00000000,
+0.00000000,
+1.00000000
206-7.x^
0 + 1.x^
1 + 8.x^
2 + 5.x^
3 - 6.x^
4 - 2.x^
5 - 9.x^
6 + 0.x^
7 + 1.x^
8
213+16.0000000,
+15.0000000,
-24.0000000,
-10.0000000,
-54.0000000,
+0.00000000,
+8.00000000
21516.x^
0 + 15.x^
1 - 24.x^
2 - 10.x^
3 - 54.x^
4 + 0.x^
5 + 8.x^
6
222+2.00000000,
-5.00000000,
+6.00000000
231-5.00000000,
+12.0000000
258+1.00000000,
-7.00000000,
-5.00000000,
+0.00000000,
-4.00000000,
+4.00000000
2601.x^
0 - 7.x^
1 - 5.x^
2 + 0.x^
3 - 4.x^
4 + 4.x^
5
267+0.00000000,
-16.0000000,
+20.0000000
2690.x^
0 - 16.x^
1 + 20.x^
2
276+4.00000000,
-3.00000000,
-2.00000000,
+9.00000000,
+2.00000000,
+3.00000000,
-6.00000000,
+4.00000000,
-3.00000000
2784.x^
0 - 3.x^
1 - 2.x^
2 + 9.x^
3 + 2.x^
4 + 3.x^
5 - 6.x^
6 + 4.x^
7 - 3.x^
8
312-3.00000000,
+6.00000000,
-7.00000000,
+6.00000000
314-3.x^
0 + 6.x^
1 - 7.x^
2 + 6.x^
3
321+6.00000000,
-14.0000000,
+18.0000000
3236.x^
0 - 14.x^
1 + 18.x^
2
330+7.00000000,
+3.00000000,
-7.00000000,
-1.00000000,
+5.00000000,
+2.00000000,
+8.00000000
3327.x^
0 + 3.x^
1 - 7.x^
2 - 1.x^
3 + 5.x^
4 + 2.x^
5 + 8.x^
6
339+7.00000000,
+3.00000000,
-7.00000000,
-1.00000000,
+5.00000000,
+2.00000000,
+8.00000000
3417.x^
0 + 3.x^
1 - 7.x^
2 - 1.x^
3 + 5.x^
4 + 2.x^
5 + 8.x^
6
348+5.00000000,
+8.00000000,
-7.00000000,
-3.00000000,
-1.00000000,
+5.00000000
3505.x^
0 + 8.x^
1 - 7.x^
2 - 3.x^
3 - 1.x^
4 + 5.x^
5
357+5.00000000,
+8.00000000,
-7.00000000,
-3.00000000,
-1.00000000,
+5.00000000
3595.x^
0 + 8.x^
1 - 7.x^
2 - 3.x^
3 - 1.x^
4 + 5.x^
5
366(
+4.00000000,
+8.00000000), (
-6.00000000,
+8.00000000), (
+1.00000000,
-8.00000000), (
-5.00000000,
+3.00000000), (
+3.00000000,
+2.00000000), (
+5.00000000,
-8.00000000), (
+9.00000000,
+2.00000000), (
-7.00000000,
+2.00000000)
368(
4.,
8.)x^
0 + (
-6.,
8.)x^
1 + (
1.,
-8.)x^
2 + (
-5.,
3.)x^
3 + (
3.,
2.)x^
4 + (
5.,
-8.)x^
5 + (
9.,
2.)x^
6 + (
-7.,
2.)x^
7
375(
-6.00000000,
+8.00000000), (
+2.00000000,
-16.0000000), (
-15.0000000,
+9.00000000), (
+12.0000000,
+8.00000000), (
+25.0000000,
-40.0000000), (
+54.0000000,
+12.0000000), (
-49.0000000,
+14.0000000)
377(
-6.,
8.)x^
0 + (
2.,
-16.)x^
1 + (
-15.,
9.)x^
2 + (
12.,
8.)x^
3 + (
25.,
-40.)x^
4 + (
54.,
12.)x^
5 + (
-49.,
14.)x^
6
384(
+3.00000000,
+0.00000000), (
-8.00000000,
-5.00000000), (
-1.00000000,
-5.00000000), (
+4.00000000,
-4.00000000), (
-4.00000000,
-3.00000000), (
+9.00000000,
+9.00000000), (
+7.00000000,
-2.00000000), (
+7.00000000,
-7.00000000)
386(
3.,
0.)x^
0 + (
-8.,
-5.)x^
1 + (
-1.,
-5.)x^
2 + (
4.,
-4.)x^
3 + (
-4.,
-3.)x^
4 + (
9.,
9.)x^
5 + (
7.,
-2.)x^
6 + (
7.,
-7.)x^
7
393(
+42.0000000,
-12.0000000), (
+49.0000000,
-49.0000000)
395(
42.,
-12.)x^
0 + (
49.,
-49.)x^
1
420(
+0.00000000,
-4.00000000), (
+4.00000000,
+6.00000000), (
+4.00000000,
-5.00000000), (
-8.00000000,
+2.00000000), (
-3.00000000,
+5.00000000), (
-5.00000000,
+5.00000000), (
-2.00000000,
-3.00000000), (
-3.00000000,
-4.00000000), (
-3.00000000,
+7.00000000)
422(
0.,
-4.)x^
0 + (
4.,
6.)x^
1 + (
4.,
-5.)x^
2 + (
-8.,
2.)x^
3 + (
-3.,
5.)x^
4 + (
-5.,
5.)x^
5 + (
-2.,
-3.)x^
6 + (
-3.,
-4.)x^
7 + (
-3.,
7.)x^
8
429(
-21.0000000,
-28.0000000), (
-24.0000000,
+56.0000000)
431(
-21.,
-28.)x^
0 + (
-24.,
56.)x^
1
456(
-7.00000000,
+0.00000000), (
-7.00000000,
-8.00000000), (
+5.00000000,
+2.00000000), (
-2.00000000,
+3.00000000)
458(
-7.,
0.)x^
0 + (
-7.,
-8.)x^
1 + (
5.,
2.)x^
2 + (
-2.,
3.)x^
3
465(
-6.00000000,
+9.00000000)
474(
+0.00000000,
+2.00000000), (
-8.00000000,
+1.00000000), (
-9.00000000,
+2.00000000), (
-3.00000000,
-7.00000000), (
+9.00000000,
-3.00000000), (
+3.00000000,
-8.00000000), (
+5.00000000,
+9.00000000), (
-1.00000000,
+1.00000000), (
-9.00000000,
+5.00000000)
476(
0.,
2.)x^
0 + (
-8.,
1.)x^
1 + (
-9.,
2.)x^
2 + (
-3.,
-7.)x^
3 + (
9.,
-3.)x^
4 + (
3.,
-8.)x^
5 + (
5.,
9.)x^
6 + (
-1.,
1.)x^
7 + (
-9.,
5.)x^
8
492(
-3.00000000,
-6.00000000), (
+1.00000000,
+3.00000000), (
+3.00000000,
+4.00000000), (
+1.00000000,
+9.00000000), (
-5.00000000,
-1.00000000), (
-4.00000000,
-5.00000000), (
-6.00000000,
+0.00000000), (
-7.00000000,
-1.00000000), (
-7.00000000,
-3.00000000)
494(
-3.,
-6.)x^
0 + (
1.,
3.)x^
1 + (
3.,
4.)x^
2 + (
1.,
9.)x^
3 + (
-5.,
-1.)x^
4 + (
-4.,
-5.)x^
5 + (
-6.,
0.)x^
6 + (
-7.,
-1.)x^
7 + (
-7.,
-3.)x^
8
501(
+6.00000000,
+8.00000000), (
+3.00000000,
+27.0000000), (
-20.0000000,
-4.00000000), (
-20.0000000,
-25.0000000), (
-36.0000000,
+0.00000000), (
-49.0000000,
-7.00000000), (
-56.0000000,
-24.0000000)
503(
6.,
8.)x^
0 + (
3.,
27.)x^
1 + (
-20.,
-4.)x^
2 + (
-20.,
-25.)x^
3 + (
-36.,
0.)x^
4 + (
-49.,
-7.)x^
5 + (
-56.,
-24.)x^
6
510(
-5.00000000,
+0.00000000), (
-1.00000000,
-8.00000000)
512(
-5.,
0.)x^
0 + (
-1.,
-8.)x^
1
528(
+5.00000000,
-8.00000000), (
-1.00000000,
-7.00000000), (
+5.00000000,
+9.00000000), (
-9.00000000,
-8.00000000)
530(
5.,
-8.)x^
0 + (
-1.,
-7.)x^
1 + (
5.,
9.)x^
2 + (
-9.,
-8.)x^
3
537(
-1.00000000,
-7.00000000), (
+10.0000000,
+18.0000000), (
-27.0000000,
-24.0000000)
539(
-1.,
-7.)x^
0 + (
10.,
18.)x^
1 + (
-27.,
-24.)x^
2
546(
+4.00000000,
+0.00000000), (
+6.00000000,
+8.00000000)
548(
4.,
0.)x^
0 + (
6.,
8.)x^
1
582(
-8.00000000,
-5.00000000)
600(
-6.00000000,
+6.00000000)
618(
+8.00000000,
-6.00000000), (
+0.00000000,
+0.00000000), (
-8.00000000,
-8.00000000), (
-7.00000000,
-3.00000000), (
+2.00000000,
-9.00000000)
620(
8.,
-6.)x^
0 + (
0.,
0.)x^
1 + (
-8.,
-8.)x^
2 + (
-7.,
-3.)x^
3 + (
2.,
-9.)x^
4
690(
+3.00000000,
-3.00000000), (
-4.00000000,
+5.00000000), (
-4.00000000,
+7.00000000), (
+6.00000000,
-4.00000000), (
+4.00000000,
+8.00000000)
692(
3.,
-3.)x^
0 + (
-4.,
5.)x^
1 + (
-4.,
7.)x^
2 + (
6.,
-4.)x^
3 + (
4.,
8.)x^
4
699(
+16.0000000,
+32.0000000)
708(
-6.00000000,
-2.00000000), (
+1.00000000,
+5.00000000), (
-8.00000000,
-5.00000000), (
-9.00000000,
-1.00000000)
710(
-6.,
-2.)x^
0 + (
1.,
5.)x^
1 + (
-8.,
-5.)x^
2 + (
-9.,
-1.)x^
3
717(
+1.00000000,
+5.00000000), (
-16.0000000,
-10.0000000), (
-27.0000000,
-3.00000000)
719(
1.,
5.)x^
0 + (
-16.,
-10.)x^
1 + (
-27.,
-3.)x^
2
- 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.