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+1.00000000,
+8.00000000,
-8.00000000,
-5.00000000,
-9.00000000,
+6.00000000,
+8.00000000
81.x^
0 + 8.x^
1 - 8.x^
2 - 5.x^
3 - 9.x^
4 + 6.x^
5 + 8.x^
6
24-1.00000000,
+7.00000000,
+8.00000000,
+2.00000000,
-3.00000000,
+8.00000000,
+0.00000000
26-1.x^
0 + 7.x^
1 + 8.x^
2 + 2.x^
3 - 3.x^
4 + 8.x^
5 + 0.x^
6
33+7.00000000,
+16.0000000,
+6.00000000,
-12.0000000,
+40.0000000,
+0.00000000
357.x^
0 + 16.x^
1 + 6.x^
2 - 12.x^
3 + 40.x^
4 + 0.x^
5
60-6.00000000,
+3.00000000,
-7.00000000,
+2.00000000,
+9.00000000
62-6.x^
0 + 3.x^
1 - 7.x^
2 + 2.x^
3 + 9.x^
4
69-14.0000000,
+6.00000000,
+36.0000000
71-14.x^
0 + 6.x^
1 + 36.x^
2
78+3.00000000,
+7.00000000,
+9.00000000,
+6.00000000,
-4.00000000,
+4.00000000,
+9.00000000,
+5.00000000
803.x^
0 + 7.x^
1 + 9.x^
2 + 6.x^
3 - 4.x^
4 + 4.x^
5 + 9.x^
6 + 5.x^
7
87+18.0000000,
+18.0000000,
-16.0000000,
+20.0000000,
+54.0000000,
+35.0000000
8918.x^
0 + 18.x^
1 - 16.x^
2 + 20.x^
3 + 54.x^
4 + 35.x^
5
96+7.00000000,
+3.00000000,
+0.00000000
105+7.00000000,
+3.00000000,
+0.00000000
114+4.00000000,
+0.00000000,
-4.00000000,
-6.00000000,
+4.00000000,
-8.00000000,
-7.00000000,
+8.00000000
1164.x^
0 + 0.x^
1 - 4.x^
2 - 6.x^
3 + 4.x^
4 - 8.x^
5 - 7.x^
6 + 8.x^
7
132-8.00000000,
+3.00000000,
+5.00000000
134-8.x^
0 + 3.x^
1 + 5.x^
2
141-8.00000000,
+3.00000000,
+5.00000000
143-8.x^
0 + 3.x^
1 + 5.x^
2
150-6.00000000,
-4.00000000
159-6.00000000,
-4.00000000
168-1.00000000,
-6.00000000
186+0.00000000,
+0.00000000,
+2.00000000,
-8.00000000
1880.x^
0 + 0.x^
1 + 2.x^
2 - 8.x^
3
222-4.00000000,
-9.00000000,
-7.00000000,
-1.00000000,
-2.00000000,
-9.00000000,
-9.00000000,
-4.00000000
224-4.x^
0 - 9.x^
1 - 7.x^
2 - 1.x^
3 - 2.x^
4 - 9.x^
5 - 9.x^
6 - 4.x^
7
231-4.00000000,
-9.00000000,
-7.00000000,
-1.00000000,
-2.00000000,
-9.00000000,
-9.00000000,
-4.00000000
233-4.x^
0 - 9.x^
1 - 7.x^
2 - 1.x^
3 - 2.x^
4 - 9.x^
5 - 9.x^
6 - 4.x^
7
240-5.00000000,
-3.00000000
249-5.00000000,
-3.00000000
258+1.00000000,
+6.00000000,
-8.00000000,
+6.00000000,
-3.00000000,
+2.00000000
2601.x^
0 + 6.x^
1 - 8.x^
2 + 6.x^
3 - 3.x^
4 + 2.x^
5
267-12.0000000,
+10.0000000
294-8.00000000,
-8.00000000,
+9.00000000,
-5.00000000,
-2.00000000
296-8.x^
0 - 8.x^
1 + 9.x^
2 - 5.x^
3 - 2.x^
4
348+0.00000000,
+4.00000000,
+3.00000000,
-4.00000000,
+4.00000000,
-2.00000000
3500.x^
0 + 4.x^
1 + 3.x^
2 - 4.x^
3 + 4.x^
4 - 2.x^
5
357+6.00000000,
-12.0000000,
+16.0000000,
-10.0000000
3596.x^
0 - 12.x^
1 + 16.x^
2 - 10.x^
3
366(
+8.00000000,
+8.00000000), (
+7.00000000,
+4.00000000), (
-1.00000000,
+2.00000000)
368(
8.,
8.)x^
0 + (
7.,
4.)x^
1 + (
-1.,
2.)x^
2
375(
+7.00000000,
+4.00000000), (
-2.00000000,
+4.00000000)
377(
7.,
4.)x^
0 + (
-2.,
4.)x^
1
384(
-8.00000000,
+1.00000000), (
+7.00000000,
+6.00000000), (
+2.00000000,
+0.00000000), (
+8.00000000,
-4.00000000), (
-4.00000000,
-1.00000000)
386(
-8.,
1.)x^
0 + (
7.,
6.)x^
1 + (
2.,
0.)x^
2 + (
8.,
-4.)x^
3 + (
-4.,
-1.)x^
4
402(
-2.00000000,
-9.00000000), (
+5.00000000,
-2.00000000), (
+6.00000000,
+1.00000000), (
+0.00000000,
-7.00000000)
404(
-2.,
-9.)x^
0 + (
5.,
-2.)x^
1 + (
6.,
1.)x^
2 + (
0.,
-7.)x^
3
411(
+5.00000000,
-2.00000000), (
+12.0000000,
+2.00000000), (
+0.00000000,
-21.0000000)
413(
5.,
-2.)x^
0 + (
12.,
2.)x^
1 + (
0.,
-21.)x^
2
420(
-2.00000000,
-7.00000000), (
+0.00000000,
-7.00000000), (
+8.00000000,
-5.00000000), (
+4.00000000,
+8.00000000)
422(
-2.,
-7.)x^
0 + (
0.,
-7.)x^
1 + (
8.,
-5.)x^
2 + (
4.,
8.)x^
3
429(
+0.00000000,
-7.00000000), (
+16.0000000,
-10.0000000), (
+12.0000000,
+24.0000000)
431(
0.,
-7.)x^
0 + (
16.,
-10.)x^
1 + (
12.,
24.)x^
2
438(
-9.00000000,
+2.00000000), (
-5.00000000,
-1.00000000), (
-2.00000000,
-1.00000000)
440(
-9.,
2.)x^
0 + (
-5.,
-1.)x^
1 + (
-2.,
-1.)x^
2
447(
-4.00000000,
-2.00000000)
474(
+3.00000000,
+7.00000000), (
-4.00000000,
+4.00000000), (
+4.00000000,
+5.00000000), (
-5.00000000,
+7.00000000), (
-8.00000000,
-2.00000000)
476(
3.,
7.)x^
0 + (
-4.,
4.)x^
1 + (
4.,
5.)x^
2 + (
-5.,
7.)x^
3 + (
-8.,
-2.)x^
4
483(
+3.00000000,
+7.00000000), (
-4.00000000,
+4.00000000), (
+4.00000000,
+5.00000000), (
-5.00000000,
+7.00000000), (
-8.00000000,
-2.00000000)
485(
3.,
7.)x^
0 + (
-4.,
4.)x^
1 + (
4.,
5.)x^
2 + (
-5.,
7.)x^
3 + (
-8.,
-2.)x^
4
492(
-4.00000000,
+8.00000000), (
-5.00000000,
-1.00000000), (
-5.00000000,
-8.00000000), (
-4.00000000,
-1.00000000), (
-8.00000000,
-8.00000000), (
+3.00000000,
+6.00000000)
494(
-4.,
8.)x^
0 + (
-5.,
-1.)x^
1 + (
-5.,
-8.)x^
2 + (
-4.,
-1.)x^
3 + (
-8.,
-8.)x^
4 + (
3.,
6.)x^
5
501(
-32.0000000,
-32.0000000), (
+15.0000000,
+30.0000000)
503(
-32.,
-32.)x^
0 + (
15.,
30.)x^
1
528(
-7.00000000,
-3.00000000), (
+2.00000000,
-5.00000000), (
+8.00000000,
-5.00000000), (
+0.00000000,
-9.00000000), (
-3.00000000,
+8.00000000), (
-3.00000000,
+6.00000000), (
-8.00000000,
-8.00000000)
530(
-7.,
-3.)x^
0 + (
2.,
-5.)x^
1 + (
8.,
-5.)x^
2 + (
0.,
-9.)x^
3 + (
-3.,
8.)x^
4 + (
-3.,
6.)x^
5 + (
-8.,
-8.)x^
6
546(
+0.00000000,
+6.00000000), (
-9.00000000,
-2.00000000), (
+3.00000000,
+8.00000000), (
-6.00000000,
+5.00000000), (
-4.00000000,
+3.00000000)
548(
0.,
6.)x^
0 + (
-9.,
-2.)x^
1 + (
3.,
8.)x^
2 + (
-6.,
5.)x^
3 + (
-4.,
3.)x^
4
555(
-18.0000000,
+15.0000000), (
-16.0000000,
+12.0000000)
557(
-18.,
15.)x^
0 + (
-16.,
12.)x^
1
564(
+5.00000000,
-8.00000000)
582(
+9.00000000,
-7.00000000), (
+4.00000000,
+2.00000000), (
+7.00000000,
+1.00000000), (
+2.00000000,
+1.00000000), (
+2.00000000,
-1.00000000), (
+0.00000000,
-4.00000000), (
+3.00000000,
-8.00000000), (
-4.00000000,
-1.00000000)
584(
9.,
-7.)x^
0 + (
4.,
2.)x^
1 + (
7.,
1.)x^
2 + (
2.,
1.)x^
3 + (
2.,
-1.)x^
4 + (
0.,
-4.)x^
5 + (
3.,
-8.)x^
6 + (
-4.,
-1.)x^
7
591(
+9.00000000,
-7.00000000), (
+4.00000000,
+2.00000000), (
+7.00000000,
+1.00000000), (
+2.00000000,
+1.00000000), (
+2.00000000,
-1.00000000), (
+0.00000000,
-4.00000000), (
+3.00000000,
-8.00000000), (
-4.00000000,
-1.00000000)
593(
9.,
-7.)x^
0 + (
4.,
2.)x^
1 + (
7.,
1.)x^
2 + (
2.,
1.)x^
3 + (
2.,
-1.)x^
4 + (
0.,
-4.)x^
5 + (
3.,
-8.)x^
6 + (
-4.,
-1.)x^
7
600(
+1.00000000,
-5.00000000), (
+0.00000000,
-5.00000000), (
-8.00000000,
+8.00000000), (
-7.00000000,
+8.00000000), (
+2.00000000,
-2.00000000)
602(
1.,
-5.)x^
0 + (
0.,
-5.)x^
1 + (
-8.,
8.)x^
2 + (
-7.,
8.)x^
3 + (
2.,
-2.)x^
4
609(
+1.00000000,
-5.00000000), (
+0.00000000,
-5.00000000), (
-8.00000000,
+8.00000000), (
-7.00000000,
+8.00000000), (
+2.00000000,
-2.00000000)
611(
1.,
-5.)x^
0 + (
0.,
-5.)x^
1 + (
-8.,
8.)x^
2 + (
-7.,
8.)x^
3 + (
2.,
-2.)x^
4
618(
-7.00000000,
+3.00000000), (
+7.00000000,
+0.00000000)
620(
-7.,
3.)x^
0 + (
7.,
0.)x^
1
654(
-9.00000000,
+4.00000000), (
+7.00000000,
-1.00000000)
656(
-9.,
4.)x^
0 + (
7.,
-1.)x^
1
672(
+6.00000000,
-7.00000000), (
+9.00000000,
+9.00000000), (
+6.00000000,
+9.00000000)
674(
6.,
-7.)x^
0 + (
9.,
9.)x^
1 + (
6.,
9.)x^
2
690(
+2.00000000,
+8.00000000), (
-1.00000000,
+8.00000000), (
+9.00000000,
+3.00000000), (
-4.00000000,
-8.00000000), (
-2.00000000,
+5.00000000)
692(
2.,
8.)x^
0 + (
-1.,
8.)x^
1 + (
9.,
3.)x^
2 + (
-4.,
-8.)x^
3 + (
-2.,
5.)x^
4
699(
+18.0000000,
+6.00000000), (
-12.0000000,
-24.0000000), (
-8.00000000,
+20.0000000)
701(
18.,
6.)x^
0 + (
-12.,
-24.)x^
1 + (
-8.,
20.)x^
2
708(
-7.00000000,
+3.00000000), (
+2.00000000,
-2.00000000), (
-4.00000000,
-4.00000000), (
+0.00000000,
-3.00000000), (
-9.00000000,
-5.00000000), (
-1.00000000,
+6.00000000), (
+6.00000000,
+1.00000000), (
+4.00000000,
-3.00000000), (
-6.00000000,
+3.00000000)
710(
-7.,
3.)x^
0 + (
2.,
-2.)x^
1 + (
-4.,
-4.)x^
2 + (
0.,
-3.)x^
3 + (
-9.,
-5.)x^
4 + (
-1.,
6.)x^
5 + (
6.,
1.)x^
6 + (
4.,
-3.)x^
7 + (
-6.,
3.)x^
8
717(
-5.00000000,
+30.0000000), (
+36.0000000,
+6.00000000), (
+28.0000000,
-21.0000000), (
-48.0000000,
+24.0000000)
719(
-5.,
30.)x^
0 + (
36.,
6.)x^
1 + (
28.,
-21.)x^
2 + (
-48.,
24.)x^
3
- 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 2416 of file pm_polynomial.F90.