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

Generate a compacted version of the input array where all sequentially duplicate entries along the specified dimension of array are condensed to a single entry in the output compact. More...

Detailed Description

Generate a compacted version of the input array where all sequentially duplicate entries along the specified dimension of array are condensed to a single entry in the output compact.

Parameters
[in,out]array: The input contiguous array of shape (:) or (:,:) of either
  • 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 scalar character of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU).
On input, it contains the elements to be condensed.
On output, the first csize entries of array contain the condensed elements of the original input array, such that no two adjacent entries in array from entry 1 to entry csize are duplicates.
[out]weight: The output contiguous array of shape (:) of type integer of default kind IK of the same size as array.
On output, the first csize elements of weight contain the weights of the elements of the output condensed array such that getVerbose(array(1:csize), weight(1:csize), sum(weight)) returns the original array.
[out]csize: The output scalar of type integer of default kind IK such that,
  • weight(1:csize) contains the weight of the condensed elements of the input array, and
  • array(1:csize) or array(:,1:csize) or array(1:csize,:) contains the condensed elements of the input array.
[in]dim: The input scalar of type integer of default kind IK representing the axis of array(:,:) along which array must be compacted.
(optional, it must be present if and only if array is of shape (:,:).)


Possible calling interfaces

call setCompact(array, weight(:), csize) ! scalar character objects.
call setCompact(array(:), weight(:), csize) ! all intrinsic array objects.
call setCompact(array(:,:), weight(:), csize, dim) ! all intrinsic array objects.
!
Generate a compacted version of the input array where all sequentially duplicate entries along the sp...
This module contains procedures and generic interfaces for condensing (removing duplicate sequential ...
Warning
The condition dim == 1 .or. dim == 2 must hold.
The condition size(weight) == size(array) must hold when array is rank 1.
The condition size(weight) == size(array, dim) must hold when array is rank 2.
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.
See also
getCompact
getVerbose


Example usage

1program example
2
3 use pm_kind, only: SK, IK, LK, CK, RK ! all processor kinds are supported.
4 use pm_io, only: display_type
7
8 implicit none
9
10 integer(IK) , parameter :: ND = 2_IK, NP = 8_IK
11 integer(IK) :: Weight(NP)
12 integer(IK) :: newsize
13 type(display_type) :: disp
14
15 disp = display_type(file = "main.out.F90")
16
17 ! Condense 1D array.
18
19 block
20
21 character(:, SK), allocatable :: string
22 character(2, SK), allocatable :: Array_SK(:)
23 integer(IK) , allocatable :: Array_IK(:)
24 logical(LK) , allocatable :: Array_LK(:)
25 complex(CK) , allocatable :: Array_CK(:)
26 real(RK) , allocatable :: Array_RK(:)
27
28 string = "AABCCCDC"
29 Array_SK = [ "AA", "AA", "BB", "CC", "CC", "CC", "DD", "CC" ]
30 Array_LK = [ .false., .false., .true., .false., .false., .false., .true., .false. ]
31 Array_IK = [ 1, 1, 2, 3, 3, 3, 4, 3 ]
32 Array_CK = [ 1, 1, 2, 3, 3, 3, 4, 3 ]
33 Array_RK = [ 1, 1, 2, 3, 3, 3, 4, 3 ]
34
35 call disp%skip()
36 call disp%show("!%%%%%%%%%%%%%%%%%%%%")
37 call disp%show("!Condense a 1D array.")
38 call disp%show("!%%%%%%%%%%%%%%%%%%%%")
39 call disp%skip()
40
41 call disp%skip()
42 call disp%show("string")
43 call disp%show( string , deliml = SK_"""" )
44 call disp%show("size(Weight)")
45 call disp%show( size(Weight) )
46 call disp%show("call setCompact(string, Weight, newsize)")
47 call setCompact(string, Weight, newsize)
48 call disp%show("string(1:newsize)")
49 call disp%show( string(1:newsize) , deliml = SK_"""" )
50 call disp%show("Weight(1:newsize)")
51 call disp%show( Weight(1:newsize) )
52 call disp%show("getVerbose(string(1:newsize), Weight(1:newsize), sum(Weight(1:newsize)))")
53 call disp%show( getVerbose(string(1:newsize), Weight(1:newsize), sum(Weight(1:newsize))) , deliml = SK_"""" )
54
55 call disp%skip()
56 call disp%show("Array_SK")
57 call disp%show( Array_SK , deliml = SK_"""" )
58 call disp%show("size(Weight)")
59 call disp%show( size(Weight) )
60 call disp%show("call setCompact(Array_SK, Weight, newsize)")
61 call setCompact(Array_SK, Weight, newsize)
62 call disp%show("Array_SK(1:newsize)")
63 call disp%show( Array_SK(1:newsize) , deliml = SK_"""" )
64 call disp%show("Weight(1:newsize)")
65 call disp%show( Weight(1:newsize) )
66 call disp%show("getVerbose(Array_SK(1:newsize), Weight(1:newsize), sum(Weight(1:newsize)))")
67 call disp%show( getVerbose(Array_SK(1:newsize), Weight(1:newsize), sum(Weight(1:newsize))) , deliml = SK_"""" )
68
69 call disp%skip()
70 call disp%show("Array_IK")
71 call disp%show( Array_IK )
72 call disp%show("size(Weight)")
73 call disp%show( size(Weight) )
74 call disp%show("call setCompact(Array_IK, Weight, newsize)")
75 call setCompact(Array_IK, Weight, newsize)
76 call disp%show("Array_IK(1:newsize)")
77 call disp%show( Array_IK(1:newsize) )
78 call disp%show("Weight(1:newsize)")
79 call disp%show( Weight(1:newsize) )
80 call disp%show("getVerbose(Array_IK(1:newsize), Weight(1:newsize), sum(Weight(1:newsize)))")
81 call disp%show( getVerbose(Array_IK(1:newsize), Weight(1:newsize), sum(Weight(1:newsize))) )
82
83 call disp%skip()
84 call disp%show("Array_LK")
85 call disp%show( Array_LK )
86 call disp%show("size(Weight)")
87 call disp%show( size(Weight) )
88 call disp%show("call setCompact(Array_LK, Weight, newsize)")
89 call setCompact(Array_LK, Weight, newsize)
90 call disp%show("Array_LK(1:newsize)")
91 call disp%show( Array_LK(1:newsize) )
92 call disp%show("Weight(1:newsize)")
93 call disp%show( Weight(1:newsize) )
94 call disp%show("getVerbose(Array_LK(1:newsize), Weight(1:newsize), sum(Weight(1:newsize)))")
95 call disp%show( getVerbose(Array_LK(1:newsize), Weight(1:newsize), sum(Weight(1:newsize))) )
96
97 call disp%skip()
98 call disp%show("Array_CK")
99 call disp%show( Array_CK )
100 call disp%show("size(Weight)")
101 call disp%show( size(Weight) )
102 call disp%show("call setCompact(Array_CK, Weight, newsize)")
103 call setCompact(Array_CK, Weight, newsize)
104 call disp%show("Array_CK(1:newsize)")
105 call disp%show( Array_CK(1:newsize) )
106 call disp%show("Weight(1:newsize)")
107 call disp%show( Weight(1:newsize) )
108 call disp%show("getVerbose(Array_CK(1:newsize), Weight(1:newsize), sum(Weight(1:newsize)))")
109 call disp%show( getVerbose(Array_CK(1:newsize), Weight(1:newsize), sum(Weight(1:newsize))) )
110
111 call disp%skip()
112 call disp%show("Array_RK")
113 call disp%show( Array_RK )
114 call disp%show("size(Weight)")
115 call disp%show( size(Weight) )
116 call disp%show("call setCompact(Array_RK, Weight, newsize)")
117 call setCompact(Array_RK, Weight, newsize)
118 call disp%show("Array_RK(1:newsize)")
119 call disp%show( Array_RK(1:newsize) )
120 call disp%show("Weight(1:newsize)")
121 call disp%show( Weight(1:newsize) )
122 call disp%show("getVerbose(Array_RK(1:newsize), Weight(1:newsize), sum(Weight(1:newsize)))")
123 call disp%show( getVerbose(Array_RK(1:newsize), Weight(1:newsize), sum(Weight(1:newsize))) )
124
125 end block
126
127 ! Flatten 2D array.
128
129 block
130
131 character(2, SK), allocatable :: Array_SK(:,:)
132 integer(IK) , allocatable :: Array_IK(:,:)
133 logical(LK) , allocatable :: Array_LK(:,:)
134 complex(CK) , allocatable :: Array_CK(:,:)
135 real(RK) , allocatable :: Array_RK(:,:)
136
137 Array_SK = transpose(reshape([ "AA", "AA", "BB", "CC", "CC", "CC", "DD", "CC", "EE", "EE", "FF", "GG", "GG", "GG", "HH", "GG" ], shape = [NP, ND]))
138 Array_LK = transpose(reshape([ .false., .false., .true., .false., .false., .false., .true., .false., .true., .true., .false., .true., .true., .true., .false., .true. ], shape = [NP, ND]))
139 Array_IK = transpose(reshape([ 1, 1, 2, 3, 3, 3, 4, 3, 5, 5, 6, 7, 7, 7, 8, 7 ], shape = [NP, ND]))
140 Array_CK = transpose(reshape([ 1, 1, 2, 3, 3, 3, 4, 3, 5, 5, 6, 7, 7, 7, 8, 7 ], shape = [NP, ND]))
141 Array_RK = transpose(reshape([ 1, 1, 2, 3, 3, 3, 4, 3, 5, 5, 6, 7, 7, 7, 8, 7 ], shape = [NP, ND]))
142
143 call disp%skip()
144 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
145 call disp%show("!Condense a 2D array along the desired axis `dim`.")
146 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
147 call disp%skip()
148
149 call disp%skip()
150 call disp%show("Array_SK")
151 call disp%show( Array_SK , deliml = SK_"""" )
152 call disp%show("size(Weight)")
153 call disp%show( size(Weight) )
154 call disp%show("call setCompact(Array_SK, Weight, newsize, dim = 2_IK)")
155 call setCompact(Array_SK, Weight, newsize, dim = 2_IK)
156 call disp%show("Array_SK(:,1:newsize)")
157 call disp%show( Array_SK(:,1:newsize) , deliml = SK_"""" )
158 call disp%show("Weight(1:newsize)")
159 call disp%show( Weight(1:newsize) )
160 call disp%show("getVerbose(Array_SK(:,1:newsize), Weight(1:newsize), sum(Weight(1:newsize)), dim = 2_IK)")
161 call disp%show( getVerbose(Array_SK(:,1:newsize), Weight(1:newsize), sum(Weight(1:newsize)), dim = 2_IK) , deliml = SK_"""" )
162
163 call disp%skip()
164 call disp%show("Array_IK")
165 call disp%show( Array_IK )
166 call disp%show("size(Weight)")
167 call disp%show( size(Weight) )
168 call disp%show("call setCompact(Array_IK, Weight, newsize, dim = 2_IK)")
169 call setCompact(Array_IK, Weight, newsize, dim = 2_IK)
170 call disp%show("Array_IK(:,1:newsize)")
171 call disp%show( Array_IK(:,1:newsize) )
172 call disp%show("Weight(1:newsize)")
173 call disp%show( Weight(1:newsize) )
174 call disp%show("getVerbose(Array_IK(:,1:newsize), Weight(1:newsize), sum(Weight(1:newsize)), dim = 2_IK)")
175 call disp%show( getVerbose(Array_IK(:,1:newsize), Weight(1:newsize), sum(Weight(1:newsize)), dim = 2_IK) )
176
177 call disp%skip()
178 call disp%show("Array_LK")
179 call disp%show( Array_LK )
180 call disp%show("size(Weight)")
181 call disp%show( size(Weight) )
182 call disp%show("call setCompact(Array_LK, Weight, newsize, dim = 2_IK)")
183 call setCompact(Array_LK, Weight, newsize, dim = 2_IK)
184 call disp%show("Array_LK(:,1:newsize)")
185 call disp%show( Array_LK(:,1:newsize) )
186 call disp%show("Weight(1:newsize)")
187 call disp%show( Weight(1:newsize) )
188 call disp%show("getVerbose(Array_LK(:,1:newsize), Weight(1:newsize), sum(Weight(1:newsize)), dim = 2_IK)")
189 call disp%show( getVerbose(Array_LK(:,1:newsize), Weight(1:newsize), sum(Weight(1:newsize)), dim = 2_IK) )
190
191 call disp%skip()
192 call disp%show("Array_CK")
193 call disp%show( Array_CK )
194 call disp%show("size(Weight)")
195 call disp%show( size(Weight) )
196 call disp%show("call setCompact(Array_CK, Weight, newsize, dim = 2_IK)")
197 call setCompact(Array_CK, Weight, newsize, dim = 2_IK)
198 call disp%show("Array_CK(:,1:newsize)")
199 call disp%show( Array_CK(:,1:newsize) )
200 call disp%show("Weight(1:newsize)")
201 call disp%show( Weight(1:newsize) )
202 call disp%show("getVerbose(Array_CK(:,1:newsize), Weight(1:newsize), sum(Weight(1:newsize)), dim = 2_IK)")
203 call disp%show( getVerbose(Array_CK(:,1:newsize), Weight(1:newsize), sum(Weight(1:newsize)), dim = 2_IK) )
204
205 call disp%skip()
206 call disp%show("Array_RK")
207 call disp%show( Array_RK )
208 call disp%show("size(Weight)")
209 call disp%show( size(Weight) )
210 call disp%show("call setCompact(Array_RK, Weight, newsize, dim = 2_IK)")
211 call setCompact(Array_RK, Weight, newsize, dim = 2_IK)
212 call disp%show("Array_RK(:,1:newsize)")
213 call disp%show( Array_RK(:,1:newsize) )
214 call disp%show("Weight(1:newsize)")
215 call disp%show( Weight(1:newsize) )
216 call disp%show("getVerbose(Array_RK(:,1:newsize), Weight(1:newsize), sum(Weight(1:newsize)), dim = 2_IK)")
217 call disp%show( getVerbose(Array_RK(:,1:newsize), Weight(1:newsize), sum(Weight(1:newsize)), dim = 2_IK) )
218
219 end block
220
221end program example
Generate an equally-weighted (verbose or flattened) array of the input weighted array of rank 1 or 2.
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 procedures and generic interfaces for flattening (duplicating the elements of) a...
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!Condense a 1D array.
4!%%%%%%%%%%%%%%%%%%%%
5
6
7string
8"AABCCCDC"
9size(Weight)
10+8
11call setCompact(string, Weight, newsize)
12string(1:newsize)
13"ABCDC"
14Weight(1:newsize)
15+2, +1, +3, +1, +1
16getVerbose(string(1:newsize), Weight(1:newsize), sum(Weight(1:newsize)))
17"AABCCCDC"
18
19Array_SK
20"AA", "AA", "BB", "CC", "CC", "CC", "DD", "CC"
21size(Weight)
22+8
23call setCompact(Array_SK, Weight, newsize)
24Array_SK(1:newsize)
25"AA", "BB", "CC", "DD", "CC"
26Weight(1:newsize)
27+2, +1, +3, +1, +1
28getVerbose(Array_SK(1:newsize), Weight(1:newsize), sum(Weight(1:newsize)))
29"AA", "AA", "BB", "CC", "CC", "CC", "DD", "CC"
30
31Array_IK
32+1, +1, +2, +3, +3, +3, +4, +3
33size(Weight)
34+8
35call setCompact(Array_IK, Weight, newsize)
36Array_IK(1:newsize)
37+1, +2, +3, +4, +3
38Weight(1:newsize)
39+2, +1, +3, +1, +1
40getVerbose(Array_IK(1:newsize), Weight(1:newsize), sum(Weight(1:newsize)))
41+1, +1, +2, +3, +3, +3, +4, +3
42
43Array_LK
44F, F, T, F, F, F, T, F
45size(Weight)
46+8
47call setCompact(Array_LK, Weight, newsize)
48Array_LK(1:newsize)
49F, T, F, T, F
50Weight(1:newsize)
51+2, +1, +3, +1, +1
52getVerbose(Array_LK(1:newsize), Weight(1:newsize), sum(Weight(1:newsize)))
53F, F, T, F, F, F, T, F
54
55Array_CK
56(+1.0000000000000000, +0.0000000000000000), (+1.0000000000000000, +0.0000000000000000), (+2.0000000000000000, +0.0000000000000000), (+3.0000000000000000, +0.0000000000000000), (+3.0000000000000000, +0.0000000000000000), (+3.0000000000000000, +0.0000000000000000), (+4.0000000000000000, +0.0000000000000000), (+3.0000000000000000, +0.0000000000000000)
57size(Weight)
58+8
59call setCompact(Array_CK, Weight, newsize)
60Array_CK(1:newsize)
61(+1.0000000000000000, +0.0000000000000000), (+2.0000000000000000, +0.0000000000000000), (+3.0000000000000000, +0.0000000000000000), (+4.0000000000000000, +0.0000000000000000), (+3.0000000000000000, +0.0000000000000000)
62Weight(1:newsize)
63+2, +1, +3, +1, +1
64getVerbose(Array_CK(1:newsize), Weight(1:newsize), sum(Weight(1:newsize)))
65(+1.0000000000000000, +0.0000000000000000), (+1.0000000000000000, +0.0000000000000000), (+2.0000000000000000, +0.0000000000000000), (+3.0000000000000000, +0.0000000000000000), (+3.0000000000000000, +0.0000000000000000), (+3.0000000000000000, +0.0000000000000000), (+4.0000000000000000, +0.0000000000000000), (+3.0000000000000000, +0.0000000000000000)
66
67Array_RK
68+1.0000000000000000, +1.0000000000000000, +2.0000000000000000, +3.0000000000000000, +3.0000000000000000, +3.0000000000000000, +4.0000000000000000, +3.0000000000000000
69size(Weight)
70+8
71call setCompact(Array_RK, Weight, newsize)
72Array_RK(1:newsize)
73+1.0000000000000000, +2.0000000000000000, +3.0000000000000000, +4.0000000000000000, +3.0000000000000000
74Weight(1:newsize)
75+2, +1, +3, +1, +1
76getVerbose(Array_RK(1:newsize), Weight(1:newsize), sum(Weight(1:newsize)))
77+1.0000000000000000, +1.0000000000000000, +2.0000000000000000, +3.0000000000000000, +3.0000000000000000, +3.0000000000000000, +4.0000000000000000, +3.0000000000000000
78
79!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
80!Condense a 2D array along the desired axis `dim`.
81!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
82
83
84Array_SK
85"AA", "AA", "BB", "CC", "CC", "CC", "DD", "CC"
86"EE", "EE", "FF", "GG", "GG", "GG", "HH", "GG"
87size(Weight)
88+8
89call setCompact(Array_SK, Weight, newsize, dim = 2_IK)
90Array_SK(:,1:newsize)
91"AA", "BB", "CC", "DD", "CC"
92"EE", "FF", "GG", "HH", "GG"
93Weight(1:newsize)
94+2, +1, +3, +1, +1
95getVerbose(Array_SK(:,1:newsize), Weight(1:newsize), sum(Weight(1:newsize)), dim = 2_IK)
96"AA", "AA", "BB", "CC", "CC", "CC", "DD", "CC"
97"EE", "EE", "FF", "GG", "GG", "GG", "HH", "GG"
98
99Array_IK
100+1, +1, +2, +3, +3, +3, +4, +3
101+5, +5, +6, +7, +7, +7, +8, +7
102size(Weight)
103+8
104call setCompact(Array_IK, Weight, newsize, dim = 2_IK)
105Array_IK(:,1:newsize)
106+1, +2, +3, +4, +3
107+5, +6, +7, +8, +7
108Weight(1:newsize)
109+2, +1, +3, +1, +1
110getVerbose(Array_IK(:,1:newsize), Weight(1:newsize), sum(Weight(1:newsize)), dim = 2_IK)
111+1, +1, +2, +3, +3, +3, +4, +3
112+5, +5, +6, +7, +7, +7, +8, +7
113
114Array_LK
115F, F, T, F, F, F, T, F
116T, T, F, T, T, T, F, T
117size(Weight)
118+8
119call setCompact(Array_LK, Weight, newsize, dim = 2_IK)
120Array_LK(:,1:newsize)
121F, T, F, T, F
122T, F, T, F, T
123Weight(1:newsize)
124+2, +1, +3, +1, +1
125getVerbose(Array_LK(:,1:newsize), Weight(1:newsize), sum(Weight(1:newsize)), dim = 2_IK)
126F, F, T, F, F, F, T, F
127T, T, F, T, T, T, F, T
128
129Array_CK
130(+1.0000000000000000, +0.0000000000000000), (+1.0000000000000000, +0.0000000000000000), (+2.0000000000000000, +0.0000000000000000), (+3.0000000000000000, +0.0000000000000000), (+3.0000000000000000, +0.0000000000000000), (+3.0000000000000000, +0.0000000000000000), (+4.0000000000000000, +0.0000000000000000), (+3.0000000000000000, +0.0000000000000000)
131(+5.0000000000000000, +0.0000000000000000), (+5.0000000000000000, +0.0000000000000000), (+6.0000000000000000, +0.0000000000000000), (+7.0000000000000000, +0.0000000000000000), (+7.0000000000000000, +0.0000000000000000), (+7.0000000000000000, +0.0000000000000000), (+8.0000000000000000, +0.0000000000000000), (+7.0000000000000000, +0.0000000000000000)
132size(Weight)
133+8
134call setCompact(Array_CK, Weight, newsize, dim = 2_IK)
135Array_CK(:,1:newsize)
136(+1.0000000000000000, +0.0000000000000000), (+2.0000000000000000, +0.0000000000000000), (+3.0000000000000000, +0.0000000000000000), (+4.0000000000000000, +0.0000000000000000), (+3.0000000000000000, +0.0000000000000000)
137(+5.0000000000000000, +0.0000000000000000), (+6.0000000000000000, +0.0000000000000000), (+7.0000000000000000, +0.0000000000000000), (+8.0000000000000000, +0.0000000000000000), (+7.0000000000000000, +0.0000000000000000)
138Weight(1:newsize)
139+2, +1, +3, +1, +1
140getVerbose(Array_CK(:,1:newsize), Weight(1:newsize), sum(Weight(1:newsize)), dim = 2_IK)
141(+1.0000000000000000, +0.0000000000000000), (+1.0000000000000000, +0.0000000000000000), (+2.0000000000000000, +0.0000000000000000), (+3.0000000000000000, +0.0000000000000000), (+3.0000000000000000, +0.0000000000000000), (+3.0000000000000000, +0.0000000000000000), (+4.0000000000000000, +0.0000000000000000), (+3.0000000000000000, +0.0000000000000000)
142(+5.0000000000000000, +0.0000000000000000), (+5.0000000000000000, +0.0000000000000000), (+6.0000000000000000, +0.0000000000000000), (+7.0000000000000000, +0.0000000000000000), (+7.0000000000000000, +0.0000000000000000), (+7.0000000000000000, +0.0000000000000000), (+8.0000000000000000, +0.0000000000000000), (+7.0000000000000000, +0.0000000000000000)
143
144Array_RK
145+1.0000000000000000, +1.0000000000000000, +2.0000000000000000, +3.0000000000000000, +3.0000000000000000, +3.0000000000000000, +4.0000000000000000, +3.0000000000000000
146+5.0000000000000000, +5.0000000000000000, +6.0000000000000000, +7.0000000000000000, +7.0000000000000000, +7.0000000000000000, +8.0000000000000000, +7.0000000000000000
147size(Weight)
148+8
149call setCompact(Array_RK, Weight, newsize, dim = 2_IK)
150Array_RK(:,1:newsize)
151+1.0000000000000000, +2.0000000000000000, +3.0000000000000000, +4.0000000000000000, +3.0000000000000000
152+5.0000000000000000, +6.0000000000000000, +7.0000000000000000, +8.0000000000000000, +7.0000000000000000
153Weight(1:newsize)
154+2, +1, +3, +1, +1
155getVerbose(Array_RK(:,1:newsize), Weight(1:newsize), sum(Weight(1:newsize)), dim = 2_IK)
156+1.0000000000000000, +1.0000000000000000, +2.0000000000000000, +3.0000000000000000, +3.0000000000000000, +3.0000000000000000, +4.0000000000000000, +3.0000000000000000
157+5.0000000000000000, +5.0000000000000000, +6.0000000000000000, +7.0000000000000000, +7.0000000000000000, +7.0000000000000000, +8.0000000000000000, +7.0000000000000000
158
Test:
test_pm_arrayCompact


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, Saturday 1:48 AM, August 20, 2016, Institute for Computational Engineering and Sciences, UT Austin, TX

Definition at line 865 of file pm_arrayCompact.F90.


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