ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_arrayReverse::setReversed Interface Reference

Reverse the order of the elements of the input array, such that
  array = array(lenArray:1:-1),
  where lenArray = len(array) if array is a scalar character, or lenArray = size(array) is an array of rank 1. More...

Detailed Description

Reverse the order of the elements of the input array, such that
  array = array(lenArray:1:-1),
  where lenArray = len(array) if array is a scalar character, or lenArray = size(array) is an array of rank 1.

Parameters
[in,out]array: The input or input/output contiguous array of shape (:) of either
  • type css_pdt or,
  • type character of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU), or
  • type integer of kind any supported by the processor (e.g., IK, IK8, IK16, IK32, or IK64), or
  • type logical of kind any supported by the processor (e.g., LK), or
  • 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),
or,
  • a scalar character of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU) of arbitrary length type parameter,
whose elements will be reversed in order, such that the first element becomes the last and the last becomes the first in array.
  • If the input argument ArrayReversed is specified, then array has intent(in) and will not change.
  • If the input argument ArrayReversed is missing, then array will be reversed on output.
[out]ArrayReversed: The output contiguous array of the same type, kind, shape, and size as the input array that will contain the reversed array.
(optional, if missing, the reversed array will stored and output in the input contiguous array in-place)


Possible calling interfaces

call setReversed(array)
call setReversed(array, ArrayReversed)
Reverse the order of the elements of the input array, such that   array = array(lenArray:1:-1),...
This module contains procedures and generic interfaces for reversing the order of elements in arrays ...
Warning
If ArrayReversed is present, its size must equal that of array.
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.
Remarks
The primary purpose of the procedures under this generic interface is to provide a more efficient faster method of reversing an, array of any intrinsic type and kind, in place, without an extra copy that is implicitly done by current compilers with the regular Fortran syntax.
This generic interface also provides a comfortable generic way to reverse arrays of any intrinsic type and kind. This is particularly useful in case of scalar character.
With further compiler and language template enhancements in the future, the need for the procedures under this generic interface might be resolved in the future.
See pm_arrayReverse for the relevant benchmarks.
Note
Upon return, if array is allocatable, intent(inout) :: array argument, then it is guaranteed to have the same lower and upper bounds as before. This condition happens when ArrayReversed is missing in the arguments list.
See also
getReversed
setShuffled
getRemapped
setRemapped


Example usage

1program example
2
3 use pm_kind, only: LK
4 use pm_kind, only: SK ! All kinds are supported.
5 use pm_kind, only: IK ! All kinds are supported.
6 use pm_kind, only: CK ! All kinds are supported.
7 use pm_kind, only: RK ! All kinds are supported.
8 use pm_io, only: display_type
10
11 implicit none
12
13 character(:, SK), allocatable :: string1_SK , string2_SK
14 character(9, SK), allocatable :: Array1_SK(:) , Array2_SK(:) ! Can be any processor-supported kind.
15 integer(IK) , allocatable :: Array1_IK(:) , Array2_IK(:) ! Can be any processor-supported kind.
16 complex(CK) , allocatable :: Array1_CK(:) , Array2_CK(:) ! Can be any processor-supported kind.
17 real(RK) , allocatable :: Array1_RK(:) , Array2_RK(:) ! Can be any processor-supported kind.
18 logical(LK) , allocatable :: Array1_LK(:) , Array2_LK(:)
19
20 type(display_type) :: disp
21
22 disp = display_type(file = "main.out.F90")
23
24 call disp%skip()
25 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%")
26 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%")
27 call disp%show("! Reverse an array IN-PLACE.")
28 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%")
29 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%")
30 call disp%skip()
31
32 string1_SK = "ABCDEF"
33 Array1_SK = ["AA", "BB", "CC", "DD", "EE", "FF"]
34 Array1_IK = [1_IK, 2_IK, 3_IK, 4_IK, 5_IK, 6_IK]
35 Array1_RK = [1._RK, 2._RK, 3._RK, 4._RK, 5._RK, 6._RK]
36 Array1_CK = [(1._CK, -1._CK), (2._CK, -2._CK), (3._CK, -3._CK), (4._CK, -4._CK), (5._CK, -5._CK), (6._CK, -6._CK)]
37 Array1_LK = [.false._LK, .true._LK, .false._LK, .true._LK, .false._LK, .true._LK]
38
39 string2_SK = string1_SK
40 Array2_SK = Array1_SK
41 Array2_IK = Array1_IK
42 Array2_RK = Array1_RK
43 Array2_CK = Array1_CK
44 Array2_LK = Array1_LK
45
46 call disp%skip()
47 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
48 call disp%show("! Reverse character scalar in-place.")
49 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
50 call disp%skip()
51
52 call disp%show("string2_SK")
53 call disp%show( string2_SK, deliml = SK_"""" )
54 call disp%show("call setReversed(string2_SK)")
55 call setReversed(string2_SK)
56 call disp%show("string2_SK")
57 call disp%show( string2_SK, deliml = SK_"""" )
58
59 call disp%skip()
60 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
61 call disp%show("! Reverse character array in-place.")
62 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
63 call disp%skip()
64
65 call disp%show("Array2_SK")
66 call disp%show( Array2_SK, deliml = SK_"""" )
67 call disp%show("call setReversed(Array2_SK)")
68 call setReversed(Array2_SK)
69 call disp%show( Array2_SK, deliml = SK_"""" )
70
71 call disp%skip()
72 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
73 call disp%show("! Reverse logical array in-place.")
74 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
75 call disp%skip()
76
77 call disp%show("Array2_LK")
78 call disp%show( Array2_LK )
79 call disp%show("call setReversed(Array2_LK)")
80 call setReversed(Array2_LK)
81 call disp%show("Array2_LK")
82 call disp%show( Array2_LK )
83
84 call disp%skip()
85 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
86 call disp%show("! Reverse integer array in-place.")
87 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
88 call disp%skip()
89
90 call disp%show("Array2_IK")
91 call disp%show( Array2_IK )
92 call disp%show("call setReversed(Array2_IK)")
93 call setReversed(Array2_IK)
94 call disp%show("Array2_IK")
95 call disp%show( Array2_IK )
96
97 call disp%skip()
98 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
99 call disp%show("! Reverse complex array in-place.")
100 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
101 call disp%skip()
102
103 call disp%show("Array2_CK")
104 call disp%show( Array2_CK )
105 call disp%show("call setReversed(Array2_CK)")
106 call setReversed(Array2_CK)
107 call disp%show("Array2_CK")
108 call disp%show( Array2_CK )
109
110 call disp%skip()
111 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
112 call disp%show("! Reverse real array in-place.")
113 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
114 call disp%skip()
115
116 call disp%show("Array2_RK")
117 call disp%show( Array2_RK )
118 call disp%show("call setReversed(Array2_RK)")
119 call setReversed(Array2_RK)
120 call disp%show("Array2_RK")
121 call disp%show( Array2_RK )
122
123
124 call disp%skip()
125 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
126 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
127 call disp%show("! Reverse an array and output it in a separate array.")
128 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
129 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
130 call disp%skip()
131
132
133 call disp%skip()
134 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
135 call disp%show("! Reverse character scalar in-place.")
136 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
137 call disp%skip()
138
139 call disp%show("string1_SK")
140 call disp%show( string1_SK, deliml = SK_"""" )
141 call disp%show("call setReversed(string1_SK, string2_SK)")
142 call setReversed(string1_SK, string2_SK)
143 call disp%show("string2_SK")
144 call disp%show( string2_SK, deliml = SK_"""" )
145
146 call disp%skip()
147 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
148 call disp%show("! Reverse character array in-place.")
149 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
150 call disp%skip()
151
152 call disp%show("Array1_SK")
153 call disp%show( Array1_SK, deliml = SK_"""" )
154 call disp%show("call setReversed(Array1_SK, Array2_SK)")
155 call setReversed(Array1_SK, Array2_SK)
156 call disp%show("Array2_SK")
157 call disp%show( Array2_SK, deliml = SK_"""" )
158
159 call disp%skip()
160 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
161 call disp%show("! Reverse logical array in-place.")
162 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
163 call disp%skip()
164
165 call disp%show("Array1_LK")
166 call disp%show( Array1_LK )
167 call disp%show("call setReversed(Array1_LK, Array2_LK)")
168 call setReversed(Array1_LK, Array2_LK)
169 call disp%show("Array2_LK")
170 call disp%show( Array2_LK )
171
172 call disp%skip()
173 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
174 call disp%show("! Reverse integer array in-place.")
175 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
176 call disp%skip()
177
178 call disp%show("Array1_IK")
179 call disp%show( Array1_IK )
180 call disp%show("call setReversed(Array1_IK, Array2_IK)")
181 call setReversed(Array1_IK, Array2_IK)
182 call disp%show("Array2_IK")
183 call disp%show( Array2_IK )
184
185 call disp%skip()
186 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
187 call disp%show("! Reverse complex array in-place.")
188 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
189 call disp%skip()
190
191 call disp%show("Array1_CK")
192 call disp%show( Array1_CK )
193 call disp%show("call setReversed(Array1_CK, Array2_CK)")
194 call setReversed(Array1_CK, Array2_CK)
195 call disp%show("Array2_CK")
196 call disp%show( Array2_CK )
197
198 call disp%skip()
199 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
200 call disp%show("! Reverse real array in-place.")
201 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
202 call disp%skip()
203
204 call disp%show("Array1_RK")
205 call disp%show( Array1_RK )
206 call disp%show("call setReversed(Array1_RK, Array2_RK)")
207 call setReversed(Array1_RK, Array2_RK)
208 call disp%show("Array2_RK")
209 call disp%show( Array2_RK )
210
211
212 call disp%skip()
213 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
214 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
215 call disp%show("! Call to setReversed() preserves the allocatable array lower/upper bounds.")
216 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
217 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
218 call disp%skip()
219
220 deallocate(Array1_IK)
221 allocate(Array1_IK(-6:-1), source = [1_IK, 2_IK, 3_IK, 4_IK, 5_IK, 6_IK])
222 call disp%show("[lbound(Array1_IK,1), ubound(Array1_IK,1)]")
223 call disp%show( [lbound(Array1_IK,1), ubound(Array1_IK,1)] )
224 call disp%show("Array1_IK")
225 call disp%show( Array1_IK )
226 call disp%show("call setReversed(Array1_IK)")
227 call setReversed(Array1_IK)
228 call disp%show("Array1_IK")
229 call disp%show( Array1_IK )
230 call disp%show("[lbound(Array1_IK,1), ubound(Array1_IK,1)]")
231 call disp%show( [lbound(Array1_IK,1), ubound(Array1_IK,1)] )
232
233end program example
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11726
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11508
This module contains classes and procedures for input/output (IO) or generic display operations on st...
Definition: pm_io.F90:252
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
Definition: pm_io.F90:11393
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter RK
The default real kind in the ParaMonte library: real64 in Fortran, c_double in C-Fortran Interoperati...
Definition: pm_kind.F90:543
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
Definition: pm_kind.F90:541
integer, parameter CK
The default complex kind in the ParaMonte library: real64 in Fortran, c_double_complex in C-Fortran I...
Definition: pm_kind.F90:542
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
Definition: pm_kind.F90:540
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Definition: pm_kind.F90:539
Generate and return an object of type display_type.
Definition: pm_io.F90:10282

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
2!%%%%%%%%%%%%%%%%%%%%%%%%%%%
3!%%%%%%%%%%%%%%%%%%%%%%%%%%%
4! Reverse an array IN-PLACE.
5!%%%%%%%%%%%%%%%%%%%%%%%%%%%
6!%%%%%%%%%%%%%%%%%%%%%%%%%%%
7
8
9!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10! Reverse character scalar in-place.
11!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12
13string2_SK
14"ABCDEF"
15call setReversed(string2_SK)
16string2_SK
17"FEDCBA"
18
19!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20! Reverse character array in-place.
21!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
22
23Array2_SK
24"AA ", "BB ", "CC ", "DD ", "EE ", "FF "
25call setReversed(Array2_SK)
26"FF ", "EE ", "DD ", "CC ", "BB ", "AA "
27
28!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
29! Reverse logical array in-place.
30!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31
32Array2_LK
33F, T, F, T, F, T
34call setReversed(Array2_LK)
35Array2_LK
36T, F, T, F, T, F
37
38!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39! Reverse integer array in-place.
40!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
41
42Array2_IK
43+1, +2, +3, +4, +5, +6
44call setReversed(Array2_IK)
45Array2_IK
46+6, +5, +4, +3, +2, +1
47
48!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49! Reverse complex array in-place.
50!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
51
52Array2_CK
53(+1.0000000000000000, -1.0000000000000000), (+2.0000000000000000, -2.0000000000000000), (+3.0000000000000000, -3.0000000000000000), (+4.0000000000000000, -4.0000000000000000), (+5.0000000000000000, -5.0000000000000000), (+6.0000000000000000, -6.0000000000000000)
54call setReversed(Array2_CK)
55Array2_CK
56(+6.0000000000000000, -6.0000000000000000), (+5.0000000000000000, -5.0000000000000000), (+4.0000000000000000, -4.0000000000000000), (+3.0000000000000000, -3.0000000000000000), (+2.0000000000000000, -2.0000000000000000), (+1.0000000000000000, -1.0000000000000000)
57
58!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59! Reverse real array in-place.
60!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
61
62Array2_RK
63+1.0000000000000000, +2.0000000000000000, +3.0000000000000000, +4.0000000000000000, +5.0000000000000000, +6.0000000000000000
64call setReversed(Array2_RK)
65Array2_RK
66+6.0000000000000000, +5.0000000000000000, +4.0000000000000000, +3.0000000000000000, +2.0000000000000000, +1.0000000000000000
67
68!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
69!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
70! Reverse an array and output it in a separate array.
71!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
72!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73
74
75!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
76! Reverse character scalar in-place.
77!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
78
79string1_SK
80"ABCDEF"
81call setReversed(string1_SK, string2_SK)
82string2_SK
83"FEDCBA"
84
85!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
86! Reverse character array in-place.
87!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
88
89Array1_SK
90"AA ", "BB ", "CC ", "DD ", "EE ", "FF "
91call setReversed(Array1_SK, Array2_SK)
92Array2_SK
93"FF ", "EE ", "DD ", "CC ", "BB ", "AA "
94
95!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
96! Reverse logical array in-place.
97!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
98
99Array1_LK
100F, T, F, T, F, T
101call setReversed(Array1_LK, Array2_LK)
102Array2_LK
103T, F, T, F, T, F
104
105!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
106! Reverse integer array in-place.
107!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
108
109Array1_IK
110+1, +2, +3, +4, +5, +6
111call setReversed(Array1_IK, Array2_IK)
112Array2_IK
113+6, +5, +4, +3, +2, +1
114
115!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
116! Reverse complex array in-place.
117!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
118
119Array1_CK
120(+1.0000000000000000, -1.0000000000000000), (+2.0000000000000000, -2.0000000000000000), (+3.0000000000000000, -3.0000000000000000), (+4.0000000000000000, -4.0000000000000000), (+5.0000000000000000, -5.0000000000000000), (+6.0000000000000000, -6.0000000000000000)
121call setReversed(Array1_CK, Array2_CK)
122Array2_CK
123(+6.0000000000000000, -6.0000000000000000), (+5.0000000000000000, -5.0000000000000000), (+4.0000000000000000, -4.0000000000000000), (+3.0000000000000000, -3.0000000000000000), (+2.0000000000000000, -2.0000000000000000), (+1.0000000000000000, -1.0000000000000000)
124
125!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
126! Reverse real array in-place.
127!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
128
129Array1_RK
130+1.0000000000000000, +2.0000000000000000, +3.0000000000000000, +4.0000000000000000, +5.0000000000000000, +6.0000000000000000
131call setReversed(Array1_RK, Array2_RK)
132Array2_RK
133+6.0000000000000000, +5.0000000000000000, +4.0000000000000000, +3.0000000000000000, +2.0000000000000000, +1.0000000000000000
134
135!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
136!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
137! Call to setReversed() preserves the allocatable array lower/upper bounds.
138!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
139!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
140
141[lbound(Array1_IK,1), ubound(Array1_IK,1)]
142-6, -1
143Array1_IK
144+1, +2, +3, +4, +5, +6
145call setReversed(Array1_IK)
146Array1_IK
147+6, +5, +4, +3, +2, +1
148[lbound(Array1_IK,1), ubound(Array1_IK,1)]
149-6, -1
150
Test:
test_pm_arrayReverse
Todo:
Low Priority: This generic interface can be extended to 2D input objects.


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.

  1. 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.
  2. 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.

Author:
Amir Shahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas Austin

Definition at line 616 of file pm_arrayReverse.F90.


The documentation for this interface was generated from the following file: