Generate and return the component-wise minimum value of (both real and imaginary parts of) the input complex
.
More...
Generate and return the component-wise minimum value of (both real and imaginary parts of) the input complex
.
This generic interfaces extends the behavior of the intrinsic Fortran minval(a, dim = dim)
for arguments of real
type to arguments of type complex
.
- Parameters
-
[in] | array | : The input array of rank (1..2) of type complex of kind any supported by the processor (e.g., CK, CK32, CK64, or CK128). |
[in] | dim | : The input scalar of type integer of default kind IK of value 1 <= dim .and. dim <= rank(array) , representing the dimension along which the minimum must be computed.
(optional. If missing, the output value is a scalar containing the minimum of the entire input array .) |
- Returns
val
: The output object of the same type and kind as the input array
of rank rank(array) - 1
whose real and imaginary parts are the minimum values of the corresponding real and imaginary parts of the input array
.
The returned values are +huge(real(0, kind(array))
if the input array
has zero size along the dimension of interest.
Possible calling interfaces ⛓
val = minval(array)
val = minval(array, dim) ! = cmplx(minval(array%re, dim), minval(array%im, dim), kind(array))
Generate and return the component-wise minimum value of (both real and imaginary parts of) the input ...
This module contains procedures and generic interfaces for computing element-wise minimum/maximum val...
- Warning
- The condition
1 <= dim .and. dim <= rank(sample)
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
- min
max
minval
maxval
minloc
maxloc
pm_complexCompareAll
pm_complexCompareAny
pm_complexCompareLex
pm_arrayMinMax
pm_mathMinMax
Example usage ⛓
10 integer(IK) :: ndim, nsam
11 type(display_type) :: disp
16 complex(CKG),
allocatable :: array(:,:)
20 call disp%show(
"array = getUnifRand((-9._CKG, -9._CKG), (+9._CKG, +9._CKG), ndim, nsam)")
21 array
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), ndim, nsam)
26 call disp%show(
"minval(array, dim = 1_IK)")
27 call disp%show(
minval(array,
dim = 1_IK) )
28 call disp%show(
"minval(array, dim = 2_IK)")
29 call disp%show(
minval(array,
dim = 2_IK) )
30 call disp%show(
"minval([complex(CKG)::])")
31 call disp%show(
minval([
complex(CKG)::]) )
32 call disp%show(
"minval([complex(CKG)::], dim = 1_IK)")
33 call disp%show(
minval([
complex(CKG)::],
dim = 1_IK) )
34 call disp%show(
"minval([complex(CKG)::], dim = 2_IK)")
35 call disp%show(
minval([
complex(CKG)::],
dim = 2_IK) )
41 complex(CKG),
allocatable :: array(:,:)
45 call disp%show(
"array = getUnifRand((-9._CKG, -9._CKG), (+9._CKG, +9._CKG), ndim, nsam)")
46 array
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), ndim, nsam)
51 call disp%show(
"minval(array, dim = 1_IK)")
52 call disp%show(
minval(array,
dim = 1_IK) )
53 call disp%show(
"minval(array, dim = 2_IK)")
54 call disp%show(
minval(array,
dim = 2_IK) )
55 call disp%show(
"minval([complex(CKG)::])")
56 call disp%show(
minval([
complex(CKG)::]) )
57 call disp%show(
"minval([complex(CKG)::], dim = 1_IK)")
58 call disp%show(
minval([
complex(CKG)::],
dim = 1_IK) )
59 call disp%show(
"minval([complex(CKG)::], dim = 2_IK)")
60 call disp%show(
minval([
complex(CKG)::],
dim = 2_IK) )
66 complex(CKG),
allocatable :: array(:,:)
70 call disp%show(
"array = getUnifRand((-9._CKG, -9._CKG), (+9._CKG, +9._CKG), ndim, nsam)")
71 array
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), ndim, nsam)
76 call disp%show(
"minval(array, dim = 1_IK)")
77 call disp%show(
minval(array,
dim = 1_IK) )
78 call disp%show(
"minval(array, dim = 2_IK)")
79 call disp%show(
minval(array,
dim = 2_IK) )
80 call disp%show(
"minval([complex(CKG)::])")
81 call disp%show(
minval([
complex(CKG)::]) )
82 call disp%show(
"minval([complex(CKG)::], dim = 1_IK)")
83 call disp%show(
minval([
complex(CKG)::],
dim = 1_IK) )
84 call disp%show(
"minval([complex(CKG)::], dim = 2_IK)")
85 call disp%show(
minval([
complex(CKG)::],
dim = 2_IK) )
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 ⛓
3array
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), ndim, nsam)
5(
+2.60732365,
+8.46351242), (
-7.24947166,
+7.24568129), (
+2.95055771,
-4.55852127), (
-8.30581665,
-5.06211853), (
-4.45735359,
-4.05682182)
6(
+5.09797859,
+8.82484436), (
-1.35777950,
-3.40248609), (
-5.04421520,
-0.549399376), (
-6.70114517,
-1.83418465), (
-6.83773041,
-3.30593109)
7(
+2.49844646,
-6.37499237), (
+4.43418789,
-7.70254087), (
+0.585691452,
-4.08227062), (
-6.61038685,
+4.13049984), (
-0.700310707,
+1.39616299)
9(
-8.30581665,
-7.70254087)
10minval(array,
dim = 1_IK)
11(
+2.49844646,
-6.37499237), (
-7.24947166,
-7.70254087), (
-5.04421520,
-4.55852127), (
-8.30581665,
-5.06211853), (
-6.83773041,
-4.05682182)
12minval(array,
dim = 2_IK)
13(
-8.30581665,
-5.06211853), (
-6.83773041,
-3.40248609), (
-6.61038685,
-7.70254087)
14minval([
complex(CKG)::])
15(
+0.340282347E+39,
+0.340282347E+39)
16minval([
complex(CKG)::],
dim = 1_IK)
17(
+0.340282347E+39,
+0.340282347E+39)
18minval([
complex(CKG)::],
dim = 2_IK)
19(
+0.340282347E+39,
+0.340282347E+39)
23array
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), ndim, nsam)
25(
-5.2652129631498283,
+2.5435661395466873), (
+1.3695223640334806,
+5.7825303305994904), (
-1.2109087693005325,
-2.2514731717533141), (
-8.5256482836320089,
-4.6475873938824108), (
-7.5457345680619845,
-0.88619220735508009)
26(
+4.4462746733738019,
+6.2137713682114466), (
-8.5364604284919032,
-2.0640264680796943), (
+6.0947132041052843,
-5.1191996370363491), (
+3.7267147470096429,
+7.7258176125129827), (
+1.9496842289634380,
+7.2246617437184009)
27(
+7.1945292064536446,
-5.2921336488600321), (
+8.3068270508758033,
+8.7068411579139990), (
-6.3872828273163549,
-6.0737010877838244), (
+8.9327803126362930,
-4.1379928576125025), (
+4.4523488581050898,
-6.4612519771316705)
29(
-8.5364604284919032,
-6.4612519771316705)
30minval(array,
dim = 1_IK)
31(
-5.2652129631498283,
-5.2921336488600321), (
-8.5364604284919032,
-2.0640264680796943), (
-6.3872828273163549,
-6.0737010877838244), (
-8.5256482836320089,
-4.6475873938824108), (
-7.5457345680619845,
-6.4612519771316705)
32minval(array,
dim = 2_IK)
33(
-8.5256482836320089,
-4.6475873938824108), (
-8.5364604284919032,
-5.1191996370363491), (
-6.3872828273163549,
-6.4612519771316705)
34minval([
complex(CKG)::])
35(
+0.17976931348623157E+309,
+0.17976931348623157E+309)
36minval([
complex(CKG)::],
dim = 1_IK)
37(
+0.17976931348623157E+309,
+0.17976931348623157E+309)
38minval([
complex(CKG)::],
dim = 2_IK)
39(
+0.17976931348623157E+309,
+0.17976931348623157E+309)
43array
= getUnifRand((
-9._CKG,
-9._CKG), (
+9._CKG,
+9._CKG), ndim, nsam)
45(
+6.50251655168950951014069416939962664,
+2.36250408627912362243953024143753578), (
-6.98935034287366867160988620537447419,
-2.37825299299188041993904025595271000), (
-5.34246689356414825546907732463461884,
-8.99608728119260563927331293207604186), (
+5.22499442122172633806926484788904092,
-1.94532584465520006108269761424929210), (
+6.78408727971443371397364266037928922,
-8.46774032782875835034963311967522334)
46(
+2.75574635823474339152323345711195596,
-4.89232663244001612405180768599086820), (
-2.17532454774046691736241592432604783,
-3.68306079079469781507618650528044393), (
-1.20199361492165130006138722259024205,
+5.94422332867628954366078350581458471), (
+5.37131252620968244395555788030146115,
-7.48885518775416614417577761726435266), (
-1.38536431199889970039496609304865241,
+0.546090413232214585948333390365277059)
47(
-7.15116023504499209765835778103026345,
+1.19076292407455000875200491099415243), (
+1.80382251882339237461254007305022285,
-0.775266311154606460021592748980481969), (
-5.49592881457738898997041995838101328,
+3.85221193522037194912507938938925736), (
+0.525735943776231658214098478312576735,
-4.80348673942705736791888902571548531), (
+4.08038210398215447122768745278950548,
+4.17402746805352836159183981999805715)
49(
-7.15116023504499209765835778103026345,
-8.99608728119260563927331293207604186)
50minval(array,
dim = 1_IK)
51(
-7.15116023504499209765835778103026345,
-4.89232663244001612405180768599086820), (
-6.98935034287366867160988620537447419,
-3.68306079079469781507618650528044393), (
-5.49592881457738898997041995838101328,
-8.99608728119260563927331293207604186), (
+0.525735943776231658214098478312576735,
-7.48885518775416614417577761726435266), (
-1.38536431199889970039496609304865241,
-8.46774032782875835034963311967522334)
52minval(array,
dim = 2_IK)
53(
-6.98935034287366867160988620537447419,
-8.99608728119260563927331293207604186), (
-2.17532454774046691736241592432604783,
-7.48885518775416614417577761726435266), (
-7.15116023504499209765835778103026345,
-4.80348673942705736791888902571548531)
54minval([
complex(CKG)::])
55(
+0.118973149535723176508575932662800702E+4933,
+0.118973149535723176508575932662800702E+4933)
56minval([
complex(CKG)::],
dim = 1_IK)
57(
+0.118973149535723176508575932662800702E+4933,
+0.118973149535723176508575932662800702E+4933)
58minval([
complex(CKG)::],
dim = 2_IK)
59(
+0.118973149535723176508575932662800702E+4933,
+0.118973149535723176508575932662800702E+4933)
- 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 341 of file pm_complexMinMax.F90.