Generate and return the component-wise maximum value of (both real and imaginary parts of) the input complex
.
More...
Generate and return the component-wise maximum value of (both real and imaginary parts of) the input complex
.
- Parameters
-
[in] | a1 | : The input scalar or array of arbitrary rank of type complex of kind any supported by the processor (e.g., CK, CK32, CK64, or CK128). |
[in] | a2 | : The input scalar or array of arbitrary rank of the same type and kind as a1 . |
- Returns
val
: The output scalar or array of the same rank and shape as a1
whose real and imaginary parts are set to the maximum values of the corresponding real and imaginary parts of the input a1
and a2
.
Possible calling interfaces ⛓
val = max(a1, a2) ! = cmplx(max(a1%re, a2%re), max(a1%im, a2%im), kind(a1))
Generate and return the component-wise maximum value of (both real and imaginary parts of) the input ...
This module contains procedures and generic interfaces for computing element-wise minimum/maximum val...
- See also
- min
max
minval
maxval
minloc
maxloc
pm_complexCompareAll
pm_complexCompareAny
pm_complexCompareLex
pm_arrayMinMax
pm_mathMinMax
Example usage ⛓
10 integer(IK) :: lb, ub, lenarr
11 integer(IK) :: itry, ntry
= 5
12 type(display_type) :: disp
17 complex(CKG) :: a1, a2
18 complex(CKG),
allocatable :: array1(:)
23 call disp%show(
"a1 = cmplx(getUnifRand(lb, ub), getUnifRand(lb, ub), CKG)")
25 call disp%show(
"a2 = cmplx(getUnifRand(lb, ub), getUnifRand(lb, ub), CKG)")
31 call disp%show(
"lenarr = getUnifRand(2, 5)")
33 call disp%show(
"array1 = getUnifRand((-9._CKG, -9._CKG), (+9._CKG, +9._CKG), lenarr)")
34 array1
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), lenarr)
47 complex(CKG),
allocatable :: array1(:)
48 complex(CKG) :: a1, a2
53 call disp%show(
"a1 = cmplx(getUnifRand(lb, ub), getUnifRand(lb, ub), CKG)")
55 call disp%show(
"a2 = cmplx(getUnifRand(lb, ub), getUnifRand(lb, ub), CKG)")
61 call disp%show(
"lenarr = getUnifRand(2, 5)")
63 call disp%show(
"array1 = getUnifRand((-9._CKG, -9._CKG), (+9._CKG, +9._CKG), lenarr)")
64 array1
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), lenarr)
75 complex(CKG) :: a1, a2
76 complex(CKG),
allocatable :: array1(:)
81 call disp%show(
"a1 = cmplx(getUnifRand(lb, ub), getUnifRand(lb, ub), CKG)")
83 call disp%show(
"a2 = cmplx(getUnifRand(lb, ub), getUnifRand(lb, ub), CKG)")
89 call disp%show(
"lenarr = getUnifRand(2, 5)")
91 call disp%show(
"array1 = getUnifRand((-9._CKG, -9._CKG), (+9._CKG, +9._CKG), lenarr)")
92 array1
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), lenarr)
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.
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 CKH
The scalar integer constant of intrinsic default kind, representing the highest-precision complex kin...
integer, parameter CKS
The single-precision complex kind in Fortran mode. On most platforms, this is a 32-bit real kind.
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
integer, parameter CKD
The double precision complex kind in Fortran mode. On most platforms, this is a 64-bit real kind.
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
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(
-6.00000000,
-5.00000000), (
-7.00000000,
+1.00000000)
8(
-6.00000000,
+1.00000000)
10array1
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), lenarr)
12(
+5.77509403,
+7.26830864), (
-0.546312332E-1,
-3.71372890), (
-0.274978638,
-8.11486626)
14(
+5.77509403,
+7.26830864), (
-0.546312332E-1,
+1.00000000), (
-0.274978638,
+1.00000000)
16(
+5.77509403,
+7.26830864), (
-0.546312332E-1,
+1.00000000), (
-0.274978638,
+1.00000000)
22(
+7.00000000,
+5.00000000), (
+1.00000000,
-8.00000000)
24(
+7.00000000,
+5.00000000)
26array1
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), lenarr)
28(
-2.84169650,
-2.77973294), (
+7.65304947,
+0.989590645), (
+4.06895924,
+5.72152615), (
+0.515568733,
-3.84267020), (
-2.50154090,
-3.08302021)
30(
+1.00000000,
-2.77973294), (
+7.65304947,
+0.989590645), (
+4.06895924,
+5.72152615), (
+1.00000000,
-3.84267020), (
+1.00000000,
-3.08302021)
32(
+1.00000000,
-2.77973294), (
+7.65304947,
+0.989590645), (
+4.06895924,
+5.72152615), (
+1.00000000,
-3.84267020), (
+1.00000000,
-3.08302021)
38(
+5.00000000,
+8.00000000), (
+9.00000000,
-2.00000000)
40(
+9.00000000,
+8.00000000)
42array1
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), lenarr)
44(
+8.98181343,
+7.48204851), (
+6.27610588,
+6.77355289), (
+8.11279297,
+4.16598034), (
+6.92352676,
+8.41947937)
46(
+9.00000000,
+7.48204851), (
+9.00000000,
+6.77355289), (
+9.00000000,
+4.16598034), (
+9.00000000,
+8.41947937)
48(
+9.00000000,
+7.48204851), (
+9.00000000,
+6.77355289), (
+9.00000000,
+4.16598034), (
+9.00000000,
+8.41947937)
54(
+4.00000000,
-6.00000000), (
-5.00000000,
+2.00000000)
56(
+4.00000000,
+2.00000000)
58array1
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), lenarr)
60(
-0.886293411,
-4.97562885), (
+2.30322671,
-6.66812515), (
-1.71968102,
+6.62104797)
62(
-0.886293411,
+2.00000000), (
+2.30322671,
+2.00000000), (
-1.71968102,
+6.62104797)
64(
-0.886293411,
+2.00000000), (
+2.30322671,
+2.00000000), (
-1.71968102,
+6.62104797)
70(
+5.00000000,
-3.00000000), (
-2.00000000,
-8.00000000)
72(
+5.00000000,
-3.00000000)
74array1
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), lenarr)
76(
-2.03373551,
-4.97903538), (
+5.51100731,
-0.860132217), (
-7.03594780,
+3.74754262), (
+6.53022194,
+7.44160080), (
+5.77462006,
-8.33890915)
78(
-2.00000000,
-4.97903538), (
+5.51100731,
-0.860132217), (
-2.00000000,
+3.74754262), (
+6.53022194,
+7.44160080), (
+5.77462006,
-8.00000000)
80(
-2.00000000,
-4.97903538), (
+5.51100731,
-0.860132217), (
-2.00000000,
+3.74754262), (
+6.53022194,
+7.44160080), (
+5.77462006,
-8.00000000)
87(
+5.0000000000000000,
-5.0000000000000000), (
+3.0000000000000000,
+6.0000000000000000)
89(
+5.0000000000000000,
+6.0000000000000000)
91array1
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), lenarr)
93(
+3.0000000000000000,
+6.0000000000000000), (
+3.0000000000000000,
+6.0000000000000000)
95(
+3.0000000000000000,
+6.0000000000000000), (
+3.0000000000000000,
+6.0000000000000000)
101(
+2.0000000000000000,
+5.0000000000000000), (
-6.0000000000000000,
+6.0000000000000000)
103(
+2.0000000000000000,
+6.0000000000000000)
105array1
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), lenarr)
107(
+4.1142715999303530,
+6.0000000000000000), (
-6.0000000000000000,
+6.0000000000000000), (
-1.3836837224962575,
+6.0000000000000000), (
-5.8378321417809627,
+6.0000000000000000)
109(
+4.1142715999303530,
+6.0000000000000000), (
-6.0000000000000000,
+6.0000000000000000), (
-1.3836837224962575,
+6.0000000000000000), (
-5.8378321417809627,
+6.0000000000000000)
115(
+6.0000000000000000,
+9.0000000000000000), (
-3.0000000000000000,
+9.0000000000000000)
117(
+6.0000000000000000,
+9.0000000000000000)
119array1
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), lenarr)
121(
-3.0000000000000000,
+9.0000000000000000), (
-1.5870464932110999,
+9.0000000000000000), (
+2.8465317856279331,
+9.0000000000000000), (
+1.0762488245502446,
+9.0000000000000000)
123(
-3.0000000000000000,
+9.0000000000000000), (
-1.5870464932110999,
+9.0000000000000000), (
+2.8465317856279331,
+9.0000000000000000), (
+1.0762488245502446,
+9.0000000000000000)
129(
+0.0000000000000000,
-4.0000000000000000), (
+7.0000000000000000,
+1.0000000000000000)
131(
+7.0000000000000000,
+1.0000000000000000)
133array1
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), lenarr)
135(
+7.0000000000000000,
+8.9050943921657755), (
+7.0000000000000000,
+7.7130477722431854), (
+7.0000000000000000,
+1.0000000000000000), (
+7.0000000000000000,
+1.0000000000000000)
137(
+7.0000000000000000,
+8.9050943921657755), (
+7.0000000000000000,
+7.7130477722431854), (
+7.0000000000000000,
+1.0000000000000000), (
+7.0000000000000000,
+1.0000000000000000)
143(
+4.0000000000000000,
+8.0000000000000000), (
-4.0000000000000000,
+3.0000000000000000)
145(
+4.0000000000000000,
+8.0000000000000000)
147array1
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), lenarr)
149(
-2.7904548345816487,
+5.9141288714934834), (
+7.5703993523353255,
+3.0000000000000000), (
+8.2374918339026948,
+3.0000000000000000), (
+3.2906239196974578,
+3.0000000000000000)
151(
-2.7904548345816487,
+5.9141288714934834), (
+7.5703993523353255,
+3.0000000000000000), (
+8.2374918339026948,
+3.0000000000000000), (
+3.2906239196974578,
+3.0000000000000000)
158(
+2.00000000000000000000000000000000000,
-5.00000000000000000000000000000000000), (
+9.00000000000000000000000000000000000,
+9.00000000000000000000000000000000000)
160(
+9.00000000000000000000000000000000000,
+9.00000000000000000000000000000000000)
162array1
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), lenarr)
164(
+9.00000000000000000000000000000000000,
+9.00000000000000000000000000000000000), (
+9.00000000000000000000000000000000000,
+9.00000000000000000000000000000000000)
166(
+9.00000000000000000000000000000000000,
+9.00000000000000000000000000000000000), (
+9.00000000000000000000000000000000000,
+9.00000000000000000000000000000000000)
172(
-6.00000000000000000000000000000000000,
+1.00000000000000000000000000000000000), (
-2.00000000000000000000000000000000000,
+8.00000000000000000000000000000000000)
174(
-2.00000000000000000000000000000000000,
+8.00000000000000000000000000000000000)
176array1
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), lenarr)
178(
+2.59307140137809800106765209852877734,
+8.00000000000000000000000000000000000), (
+0.672342878322346966542953084203422161E-1,
+8.00000000000000000000000000000000000), (
-2.00000000000000000000000000000000000,
+8.00000000000000000000000000000000000), (
-2.00000000000000000000000000000000000,
+8.00000000000000000000000000000000000), (
+5.99556646461495744268321641113209053,
+8.00000000000000000000000000000000000)
180(
+2.59307140137809800106765209852877734,
+8.00000000000000000000000000000000000), (
+0.672342878322346966542953084203422161E-1,
+8.00000000000000000000000000000000000), (
-2.00000000000000000000000000000000000,
+8.00000000000000000000000000000000000), (
-2.00000000000000000000000000000000000,
+8.00000000000000000000000000000000000), (
+5.99556646461495744268321641113209053,
+8.00000000000000000000000000000000000)
186(
+5.00000000000000000000000000000000000,
-1.00000000000000000000000000000000000), (
+2.00000000000000000000000000000000000,
+1.00000000000000000000000000000000000)
188(
+5.00000000000000000000000000000000000,
+1.00000000000000000000000000000000000)
190array1
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), lenarr)
192(
+2.00000000000000000000000000000000000,
+1.00000000000000000000000000000000000), (
+2.94365135871718712327784505298041508,
+2.06319202586801465212614905863358466), (
+2.00000000000000000000000000000000000,
+7.88503553418600145297395632364055115), (
+4.59874362862378145695645893605426450,
+1.00000000000000000000000000000000000), (
+2.00000000000000000000000000000000000,
+1.00000000000000000000000000000000000)
194(
+2.00000000000000000000000000000000000,
+1.00000000000000000000000000000000000), (
+2.94365135871718712327784505298041508,
+2.06319202586801465212614905863358466), (
+2.00000000000000000000000000000000000,
+7.88503553418600145297395632364055115), (
+4.59874362862378145695645893605426450,
+1.00000000000000000000000000000000000), (
+2.00000000000000000000000000000000000,
+1.00000000000000000000000000000000000)
200(
+8.00000000000000000000000000000000000,
-8.00000000000000000000000000000000000), (
-3.00000000000000000000000000000000000,
+5.00000000000000000000000000000000000)
202(
+8.00000000000000000000000000000000000,
+5.00000000000000000000000000000000000)
204array1
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), lenarr)
206(
+5.67609409966728769172692044859682598,
+5.00000000000000000000000000000000000), (
+1.46845414278488335536910314854546788,
+5.00000000000000000000000000000000000), (
+7.01219878291718461114508390552343669,
+5.00000000000000000000000000000000000)
208(
+5.67609409966728769172692044859682598,
+5.00000000000000000000000000000000000), (
+1.46845414278488335536910314854546788,
+5.00000000000000000000000000000000000), (
+7.01219878291718461114508390552343669,
+5.00000000000000000000000000000000000)
214(
-9.00000000000000000000000000000000000,
-8.00000000000000000000000000000000000), (
+0.00000000000000000000000000000000000,
-4.00000000000000000000000000000000000)
216(
+0.00000000000000000000000000000000000,
-4.00000000000000000000000000000000000)
218array1
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), lenarr)
220(
+5.57741463443902716235600295196314535,
+2.28367598518912478880437789388874356), (
+2.17093724885975204354499061264026200,
-1.44529216738097550799987225347516084), (
+0.00000000000000000000000000000000000,
+1.74324602711675209998059020229147214), (
+0.00000000000000000000000000000000000,
+8.48460590811234953193378918013611785), (
+5.63855286213168113896990790642814955,
-4.00000000000000000000000000000000000)
222(
+5.57741463443902716235600295196314535,
+2.28367598518912478880437789388874356), (
+2.17093724885975204354499061264026200,
-1.44529216738097550799987225347516084), (
+0.00000000000000000000000000000000000,
+1.74324602711675209998059020229147214), (
+0.00000000000000000000000000000000000,
+8.48460590811234953193378918013611785), (
+5.63855286213168113896990790642814955,
-4.00000000000000000000000000000000000)
- Test:
- test_pm_complexMinMax
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:
- Amir Shahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas Austin
Definition at line 217 of file pm_complexMinMax.F90.