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

Copy the strided elements of an input scalar string or vector of arbitrary intrinsic type, kind, and size to the strided elements of another scalar string or vector of the same type, kind, and compatible size.
More...

Detailed Description

Copy the strided elements of an input scalar string or vector of arbitrary intrinsic type, kind, and size to the strided elements of another scalar string or vector of the same type, kind, and compatible size.

The functionality of this interface is readily available from the standard Fortran array syntax for all Fortran intrinsic type arrays.
However, it is impossible to perform elemental copy action for scalar strings.
This interface provides a universal generic approach to performing copy all vectors of intrinsic type and and kind as well as scalar strings, allowing seamless generic programming.

Parameters
[in]From: The input
  1. scalar of type character of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU) of arbitrary length type parameter,
or contiguous array of rank 1 of either,
  1. type character of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU) of arbitrary length type parameter,
  2. type integer of kind any supported by the processor (e.g., IK, IK8, IK16, IK32, or IK64),
  3. type logical of kind any supported by the processor (e.g., LK),
  4. type complex of kind any supported by the processor (e.g., CK, CK32, CK64, or CK128),
  5. type real of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128),
whose specified elements will be copied to the array to.
[in,out]To: The input/output scalar or contiguous array of the same type, kind, rank, and compatible size as the input From. On output, the specific requested elements of To will be replaced by the requested corresponding values from From. The remaining elements of To are returned as is.
[in]incf: The input scalar of type integer of default kind IK, containing the stride of the input vector From.
  1. A negative value implies the copy action to be performed from the end of From to its beginning every other incf elements.
  2. A zero value will lead to copying values only from the first element of From to any specified element of To.
[in]inct: The input scalar of type integer of default kind IK, containing the stride of the input/output vector To.
The copy action will occur at every other incf elements in To.
  1. A negative value implies the copy action to be performed from the end of To to its beginning.
  2. A zero value will lead to copying values to the first element of To from any specified element of From.


Possible calling interfaces

call setCopyStrided(From, To, incf, inct)
Copy the strided elements of an input scalar string or vector of arbitrary intrinsic type,...
This module contains procedures and generic interfaces for copying strided or indexed elements of one...
Warning
The condition incf /= 0_IK .or. inct /= 0_IK must hold for the corresponding input arguments.
The condition (size(From) - 1_IK) / abs(incf) == (size(To) - 1_IK) / abs(inct) must hold for the corresponding input arguments (when both incf and inct are non-zero).
These conditions are 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.
BLAS/LAPACK equivalent:
The procedures under discussion combine, modernize, and extend the interface and functionalities of Version 3.11 of BLAS/LAPACK routine(s): SCOPY, DCOPY, CCOPY, and ZCOPY.
In particular copying of subsets of scalar strings are also implemented as part of this module.
See also
pm_matrixCopy
pm_matrixInit
pm_arrayCopy
pm_arrayCopy
netlib::LAPACK
The IBM Engineering and Scientific Subroutine Library.
Developer Reference for Intel® oneAPI Math Kernel Library - Fortran.
Lawson, C. L.; Hanson, R. J.; Kincaid, D. R.; Krough, F. T. Sept. 1979. “Basic Linear Algebra Subprograms for Fortran Usage.” ACM Transactions on Mathematical Software 5(3):308–323.


Example usage

1#define SET_COPY \
2call disp%show("From"); \
3call disp%show( From ); \
4call disp%show("To"); \
5call disp%show( To ); \
6call disp%show("call setCopyStrided(From, To, incf, inct)"); \
7 call setCopyStrided(From, To, incf, inct); \
8call disp%show("From"); \
9call disp%show( From ); \
10call disp%show("To"); \
11call disp%show( To );
12
13program example
14
15 use pm_kind, only: SK, IK, LK
16 use pm_io, only: display_type
18 use pm_distUnif, only: getUnifRand
19
20 implicit none
21
22 integer(IK) :: incf, inct
23
24 type(display_type) :: disp
25 disp = display_type(file = "main.out.F90")
26
27 call disp%skip()
28 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
29 call disp%show("!Copy a string of characters of arbitrary kind in arbitrary stride.")
30 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
31 call disp%skip()
32
33 block
34
35 use pm_strASCII, only: ALPHA_STR_SK
38
39 character(:, SK), allocatable :: From, To
40
41 call disp%skip()
42 call disp%show("From = ALPHA_UPPER_STR_SK")
44 call disp%show("To = ALPHA_LOWER_STR_SK")
46 call disp%show("incf = 0; inct = 2")
47 incf = 0; inct = 2
48 SET_COPY ! fpp
49 call disp%skip()
50
51 call disp%skip()
52 call disp%show("From = ALPHA_UPPER_STR_SK")
54 call disp%show("To = ALPHA_LOWER_STR_SK")
56 call disp%show("incf = 2; inct = -2")
57 incf = 2; inct = -2
58 SET_COPY ! fpp
59 call disp%skip()
60
61 call disp%skip()
62 call disp%show("From = ALPHA_UPPER_STR_SK")
64 call disp%show("To = ALPHA_LOWER_STR_SK")
66 call disp%show("incf = 2; inct = -2")
67 incf = 2; inct = -2
68 SET_COPY ! fpp
69 call disp%skip()
70
71 call disp%skip()
72 call disp%show("From = ALPHA_STR_SK")
73 From = ALPHA_STR_SK
74 call disp%show("To = ALPHA_LOWER_STR_SK")
76 call disp%show("incf = 4; inct = 2")
77 incf = 4; inct = 2
78 SET_COPY ! fpp
79 call disp%skip()
80
81 end block
82
83 call disp%skip()
84 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
85 call disp%show("!Copy array of strings of the same length of arbitrary kind in arbitrary order.")
86 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
87 call disp%skip()
88
89 block
90
91 use pm_strASCII, only: ALPHA_VEC_SK
94
95 character(1, SK), allocatable :: From(:), To(:)
96
97 call disp%skip()
98 call disp%show("From = ALPHA_UPPER_VEC_SK")
100 call disp%show("To = ALPHA_LOWER_VEC_SK")
102 call disp%show("incf = 2; inct = -2")
103 incf = 2; inct = -2
104 SET_COPY ! fpp
105 call disp%skip()
106
107 call disp%skip()
108 call disp%show("From = ALPHA_LOWER_VEC_SK")
109 From = ALPHA_LOWER_VEC_SK
110 call disp%show("To = ALPHA_LOWER_VEC_SK")
112 call disp%show("incf = 2; inct = -2")
113 incf = 2; inct = -2
114 SET_COPY ! fpp
115 call disp%skip()
116
117 call disp%skip()
118 call disp%show("From = ALPHA_VEC_SK")
119 From = ALPHA_VEC_SK
120 call disp%show("To = ALPHA_LOWER_VEC_SK")
122 call disp%show("incf = 4; inct = 2")
123 incf = 4; inct = 2
124 SET_COPY ! fpp
125 call disp%skip()
126
127 end block
128
129 call disp%skip()
130 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
131 call disp%show("!Copy array of integer values of arbitrary kind in arbitrary orders.")
132 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
133 call disp%skip()
134
135 block
136
137 integer, allocatable :: From(:), To(:)
138
139 call disp%skip()
140 call disp%show("From = [13]")
141 From = [13]
142 call disp%show("To = [(huge(0), incf = 1, 5)]")
143 To = [(huge(0), incf = 1, 5)]
144 call disp%show("incf = 0; inct = 1")
145 incf = 0; inct = 1
146 SET_COPY ! fpp
147 call disp%skip()
148
149 call disp%skip()
150 call disp%show("From = [1, 2, 3, 4, 5]")
151 From = [1, 2, 3, 4, 5]
152 call disp%show("To = [(huge(0), incf = 1, 9)]")
153 To = [(huge(0), incf = 1, 9)]
154 call disp%show("incf = 1; inct = 2")
155 incf = 1; inct = 2
156 SET_COPY ! fpp
157 call disp%skip()
158
159 call disp%skip()
160 call disp%show("From = [1, 2, 3, 4, 5]")
161 From = [1, 2, 3, 4, 5]
162 call disp%show("To = [(huge(0), incf = 1, 9)]")
163 To = [(huge(0), incf = 1, 9)]
164 call disp%show("incf = 1; inct = -2")
165 incf = 1; inct = -2
166 SET_COPY ! fpp
167 call disp%skip()
168
169 end block
170
171 call disp%skip()
172 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
173 call disp%show("!Copy array of logical values of arbitrary kind in arbitrary orders.")
174 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
175 call disp%skip()
176
177 block
178
179 logical, allocatable :: From(:), To(:)
180
181 call disp%skip()
182 call disp%show("From = [.true.]")
183 From = [.true.]
184 call disp%show("To = [(.false., incf = 1, 5)]")
185 To = [(.false., incf = 1, 5)]
186 call disp%show("incf = 0; inct = 1")
187 incf = 0; inct = 1
188 SET_COPY ! fpp
189 call disp%skip()
190
191 call disp%skip()
192 call disp%show("From = [.true., .true., .true., .true., .true.]")
193 From = [.true., .true., .true., .true., .true.]
194 call disp%show("To = [(.false., incf = 1, 9)]")
195 To = [(.false., incf = 1, 9)]
196 call disp%show("incf = 1; inct = 2")
197 incf = 1; inct = 2
198 SET_COPY ! fpp
199 call disp%skip()
200
201 end block
202
203 call disp%skip()
204 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
205 call disp%show("!Copy array of complex values of arbitrary kind in arbitrary orders.")
206 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
207 call disp%skip()
208
209 block
210
211 real, allocatable :: From(:), To(:)
212
213 call disp%skip()
214 call disp%show("From = cmplx([13], -[13])")
215 From = cmplx([13], -[13])
216 call disp%show("To = cmplx([(huge(0), incf = 1, 5)], -[(huge(0), incf = 1, 5)])")
217 To = cmplx([(huge(0), incf = 1, 5)], -[(huge(0), incf = 1, 5)])
218 call disp%show("incf = 0; inct = 1")
219 incf = 0; inct = 1
220 SET_COPY ! fpp
221 call disp%skip()
222
223 call disp%skip()
224 call disp%show("From = cmplx([1, 2, 3, 4, 5], -[1, 2, 3, 4, 5])")
225 From = cmplx([1, 2, 3, 4, 5], -[1, 2, 3, 4, 5])
226 call disp%show("To = cmplx([(huge(0), incf = 1, 9)], -[(huge(0), incf = 1, 9)])")
227 To = cmplx([(huge(0), incf = 1, 9)], -[(huge(0), incf = 1, 9)])
228 call disp%show("incf = 1; inct = 2")
229 incf = 1; inct = 2
230 SET_COPY ! fpp
231 call disp%skip()
232
233 call disp%skip()
234 call disp%show("From = cmplx([1, 2, 3, 4, 5], -[1, 2, 3, 4, 5])")
235 From = cmplx([1, 2, 3, 4, 5], -[1, 2, 3, 4, 5])
236 call disp%show("To = cmplx([(huge(0), incf = 1, 9)], -[(huge(0), incf = 1, 9)])")
237 To = cmplx([(huge(0), incf = 1, 9)], -[(huge(0), incf = 1, 9)])
238 call disp%show("incf = 1; inct = -2")
239 incf = 1; inct = -2
240 SET_COPY ! fpp
241 call disp%skip()
242
243 end block
244
245 call disp%skip()
246 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
247 call disp%show("!Copy array of real values of arbitrary kind in arbitrary orders.")
248 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
249 call disp%skip()
250
251 block
252
253 real, allocatable :: From(:), To(:)
254
255 call disp%skip()
256 call disp%show("From = [13]")
257 From = [13]
258 call disp%show("To = [(huge(0), incf = 1, 5)]")
259 To = [(huge(0), incf = 1, 5)]
260 call disp%show("incf = 0; inct = 1")
261 incf = 0; inct = 1
262 SET_COPY ! fpp
263 call disp%skip()
264
265 call disp%skip()
266 call disp%show("From = [1, 2, 3, 4, 5]")
267 From = [1, 2, 3, 4, 5]
268 call disp%show("To = [(huge(0), incf = 1, 9)]")
269 To = [(huge(0), incf = 1, 9)]
270 call disp%show("incf = 1; inct = 2")
271 incf = 1; inct = 2
272 SET_COPY ! fpp
273 call disp%skip()
274
275 call disp%skip()
276 call disp%show("From = [1, 2, 3, 4, 5]")
277 From = [1, 2, 3, 4, 5]
278 call disp%show("To = [(huge(0), incf = 1, 9)]")
279 To = [(huge(0), incf = 1, 9)]
280 call disp%show("incf = 1; inct = -2")
281 incf = 1; inct = -2
282 SET_COPY ! fpp
283 call disp%skip()
284
285 end block
286
287end program example
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.
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 computing various statistical quantities related to t...
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 LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
Definition: pm_kind.F90:541
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
This module contains the uncommon and hardly representable ASCII characters as well as procedures for...
Definition: pm_strASCII.F90:61
character(*, SK), parameter ALPHA_UPPER_STR_SK
The constant scalar of type character of default kind SK containing the ASCII uppercase English lette...
character(*, SK), parameter ALPHA_STR_SK
The constant scalar of type character of default kind SK containing the ASCII uppercase and lowercase...
character(1, SK), dimension(*), parameter ALPHA_UPPER_VEC_SK
The constant array of type character of default kind SK containing the uppercase English letters.
character(1, SK), dimension(*), parameter ALPHA_LOWER_VEC_SK
The constant array of type character of default kind SK containing the lowercase English letters.
character(*, SK), parameter ALPHA_LOWER_STR_SK
The constant scalar of type character of default kind SK containing the ASCII lowercase English lette...
character(1, SK), dimension(*), parameter ALPHA_VEC_SK
The constant array of type character of default kind SK containing the ASCII uppercase and lowercase ...
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!Copy a string of characters of arbitrary kind in arbitrary stride.
4!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5
6
9incf = 0; inct = 2
10From
11ABCDEFGHIJKLMNOPQRSTUVWXYZ
12To
13abcdefghijklmnopqrstuvwxyz
14call setCopyStrided(From, To, incf, inct)
15From
16ABCDEFGHIJKLMNOPQRSTUVWXYZ
17To
18AbAdAfAhAjAlAnApArAtAvAxAz
19
20
23incf = 2; inct = -2
24From
25ABCDEFGHIJKLMNOPQRSTUVWXYZ
26To
27abcdefghijklmnopqrstuvwxyz
28call setCopyStrided(From, To, incf, inct)
29From
30ABCDEFGHIJKLMNOPQRSTUVWXYZ
31To
32aYcWeUgSiQkOmMoKqIsGuEwCyA
33
34
37incf = 2; inct = -2
38From
39ABCDEFGHIJKLMNOPQRSTUVWXYZ
40To
41abcdefghijklmnopqrstuvwxyz
42call setCopyStrided(From, To, incf, inct)
43From
44ABCDEFGHIJKLMNOPQRSTUVWXYZ
45To
46aYcWeUgSiQkOmMoKqIsGuEwCyA
47
48
49From = ALPHA_STR_SK
51incf = 4; inct = 2
52From
53ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
54To
55abcdefghijklmnopqrstuvwxyz
56call setCopyStrided(From, To, incf, inct)
57From
58ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
59To
60AbEdIfMhQjUlYncpgrktovsxwz
61
62
63!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
64!Copy array of strings of the same length of arbitrary kind in arbitrary order.
65!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66
67
70incf = 2; inct = -2
71From
72A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z
73To
74a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z
75call setCopyStrided(From, To, incf, inct)
76From
77A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z
78To
79a, Y, c, W, e, U, g, S, i, Q, k, O, m, M, o, K, q, I, s, G, u, E, w, C, y, A
80
81
84incf = 2; inct = -2
85From
86a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z
87To
88a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z
89call setCopyStrided(From, To, incf, inct)
90From
91a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z
92To
93a, y, c, w, e, u, g, s, i, q, k, o, m, m, o, k, q, i, s, g, u, e, w, c, y, a
94
95
96From = ALPHA_VEC_SK
98incf = 4; inct = 2
99From
100A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z
101To
102a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z
103call setCopyStrided(From, To, incf, inct)
104From
105A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z
106To
107A, b, E, d, I, f, M, h, Q, j, U, l, Y, n, c, p, g, r, k, t, o, v, s, x, w, z
108
109
110!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
111!Copy array of integer values of arbitrary kind in arbitrary orders.
112!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
113
114
115From = [13]
116To = [(huge(0), incf = 1, 5)]
117incf = 0; inct = 1
118From
119+13
120To
121+2147483647, +2147483647, +2147483647, +2147483647, +2147483647
122call setCopyStrided(From, To, incf, inct)
123From
124+13
125To
126+13, +13, +13, +13, +13
127
128
129From = [1, 2, 3, 4, 5]
130To = [(huge(0), incf = 1, 9)]
131incf = 1; inct = 2
132From
133+1, +2, +3, +4, +5
134To
135+2147483647, +2147483647, +2147483647, +2147483647, +2147483647, +2147483647, +2147483647, +2147483647, +2147483647
136call setCopyStrided(From, To, incf, inct)
137From
138+1, +2, +3, +4, +5
139To
140+1, +2147483647, +2, +2147483647, +3, +2147483647, +4, +2147483647, +5
141
142
143From = [1, 2, 3, 4, 5]
144To = [(huge(0), incf = 1, 9)]
145incf = 1; inct = -2
146From
147+1, +2, +3, +4, +5
148To
149+2147483647, +2147483647, +2147483647, +2147483647, +2147483647, +2147483647, +2147483647, +2147483647, +2147483647
150call setCopyStrided(From, To, incf, inct)
151From
152+1, +2, +3, +4, +5
153To
154+5, +2147483647, +4, +2147483647, +3, +2147483647, +2, +2147483647, +1
155
156
157!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
158!Copy array of logical values of arbitrary kind in arbitrary orders.
159!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
160
161
162From = [.true.]
163To = [(.false., incf = 1, 5)]
164incf = 0; inct = 1
165From
166T
167To
168F, F, F, F, F
169call setCopyStrided(From, To, incf, inct)
170From
171T
172To
173T, T, T, T, T
174
175
176From = [.true., .true., .true., .true., .true.]
177To = [(.false., incf = 1, 9)]
178incf = 1; inct = 2
179From
180T, T, T, T, T
181To
182F, F, F, F, F, F, F, F, F
183call setCopyStrided(From, To, incf, inct)
184From
185T, T, T, T, T
186To
187T, F, T, F, T, F, T, F, T
188
189
190!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
191!Copy array of complex values of arbitrary kind in arbitrary orders.
192!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
193
194
195From = cmplx([13], -[13])
196To = cmplx([(huge(0), incf = 1, 5)], -[(huge(0), incf = 1, 5)])
197incf = 0; inct = 1
198From
199+13.0000000
200To
201+0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10
202call setCopyStrided(From, To, incf, inct)
203From
204+13.0000000
205To
206+13.0000000, +13.0000000, +13.0000000, +13.0000000, +13.0000000
207
208
209From = cmplx([1, 2, 3, 4, 5], -[1, 2, 3, 4, 5])
210To = cmplx([(huge(0), incf = 1, 9)], -[(huge(0), incf = 1, 9)])
211incf = 1; inct = 2
212From
213+1.00000000, +2.00000000, +3.00000000, +4.00000000, +5.00000000
214To
215+0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10
216call setCopyStrided(From, To, incf, inct)
217From
218+1.00000000, +2.00000000, +3.00000000, +4.00000000, +5.00000000
219To
220+1.00000000, +0.214748365E+10, +2.00000000, +0.214748365E+10, +3.00000000, +0.214748365E+10, +4.00000000, +0.214748365E+10, +5.00000000
221
222
223From = cmplx([1, 2, 3, 4, 5], -[1, 2, 3, 4, 5])
224To = cmplx([(huge(0), incf = 1, 9)], -[(huge(0), incf = 1, 9)])
225incf = 1; inct = -2
226From
227+1.00000000, +2.00000000, +3.00000000, +4.00000000, +5.00000000
228To
229+0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10
230call setCopyStrided(From, To, incf, inct)
231From
232+1.00000000, +2.00000000, +3.00000000, +4.00000000, +5.00000000
233To
234+5.00000000, +0.214748365E+10, +4.00000000, +0.214748365E+10, +3.00000000, +0.214748365E+10, +2.00000000, +0.214748365E+10, +1.00000000
235
236
237!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
238!Copy array of real values of arbitrary kind in arbitrary orders.
239!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
240
241
242From = [13]
243To = [(huge(0), incf = 1, 5)]
244incf = 0; inct = 1
245From
246+13.0000000
247To
248+0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10
249call setCopyStrided(From, To, incf, inct)
250From
251+13.0000000
252To
253+13.0000000, +13.0000000, +13.0000000, +13.0000000, +13.0000000
254
255
256From = [1, 2, 3, 4, 5]
257To = [(huge(0), incf = 1, 9)]
258incf = 1; inct = 2
259From
260+1.00000000, +2.00000000, +3.00000000, +4.00000000, +5.00000000
261To
262+0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10
263call setCopyStrided(From, To, incf, inct)
264From
265+1.00000000, +2.00000000, +3.00000000, +4.00000000, +5.00000000
266To
267+1.00000000, +0.214748365E+10, +2.00000000, +0.214748365E+10, +3.00000000, +0.214748365E+10, +4.00000000, +0.214748365E+10, +5.00000000
268
269
270From = [1, 2, 3, 4, 5]
271To = [(huge(0), incf = 1, 9)]
272incf = 1; inct = -2
273From
274+1.00000000, +2.00000000, +3.00000000, +4.00000000, +5.00000000
275To
276+0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10, +0.214748365E+10
277call setCopyStrided(From, To, incf, inct)
278From
279+1.00000000, +2.00000000, +3.00000000, +4.00000000, +5.00000000
280To
281+5.00000000, +0.214748365E+10, +4.00000000, +0.214748365E+10, +3.00000000, +0.214748365E+10, +2.00000000, +0.214748365E+10, +1.00000000
282
283
Test:
test_pm_arrayCopy
Todo:
Normal Priority: Benchmarks comparing this interface with LAPACK routines and conventional approach should be added to the documentation.


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, April 21, 2017, 1:54 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas Austin

Definition at line 592 of file pm_arrayCopy.F90.


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