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

Generate and return .true. if and only if a desired matrix with the specified input shape is of the specified input packing pack.
More...

Detailed Description

Generate and return .true. if and only if a desired matrix with the specified input shape is of the specified input packing pack.

See pm_matrixPack for the mathematical definitions of different matrix packings.
Note that a matrix in RFP format can be either in normal (long) or transpose (wide) format.
This generic interface checks for both conditions to hold.

Parameters
[in]pack: The input scalar constant that can be one of the following:
  1. The scalar constant lfpack implying the matrix has the Rectangular Full Packing (RFP) format.
  2. The scalar constant rfpack implying the matrix has the Rectangular Full Packing (RFP) format.
[in]shape: The input vector of length 2 of type integer of default kind IK, representing the shape of the desired matrix whose specific packing is to be confirmed.
This input argument can be et to the direct output of the intrinsic Fortran function shape().
Returns
itis : The output scalar logical of default kind LK that is .true. if and only if the desired matrix with the specified input shape has the specified input packing pack.


Possible calling interfaces

itis = isMatPack(pack, shape)
Generate and return .true. if and only if a desired matrix with the specified input shape is of the s...
This module contains abstract and concrete derived types that are required for compile-time resolutio...
Remarks
The procedures under discussion are pure.


Example usage

1program example
2
3 use pm_kind, only: SK, IK
4 use pm_io, only: display_type
5 use pm_distUnif, only: getUnifRand
7 use pm_err, only: setAsserted
8 use pm_val2str, only: getStr
9
10 implicit none
11
12 integer(IK) :: i, shape(2)
13 type(display_type) :: disp
14 disp = display_type(file = "main.out.F90")
15
16 do i = 1, 30
17 call disp%skip
18 call disp%show("shape = getUnifRand(1_IK, 7_IK, 2_IK)")
19 shape = getUnifRand(1_IK, 7_IK, 2_IK)
20 call disp%show("shape")
21 call disp%show( shape )
22 call disp%show("isMatPack(rfpack, shape)")
23 call disp%show( isMatPack(rfpack, shape) )
24 end do
25
26end program example
Generate and return a scalar or a contiguous array of rank 1 of length s1 of randomly uniformly distr...
Verify the input assertion holds and if it does not, print the (optional) input message on stdout and...
Definition: pm_err.F90:735
Generate and return an object of type stop_type with the user-specified input attributes.
Definition: pm_err.F90:1618
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11508
Generate and return the conversion of the input value to an output Fortran string,...
Definition: pm_val2str.F90:167
This module contains classes and procedures for computing various statistical quantities related to t...
This module contains classes and procedures for reporting and handling errors.
Definition: pm_err.F90:52
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 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
type(rfpack_type), parameter rfpack
This is an object instance of class rfpack_type that is exclusively used to signify Rectangular Full ...
This module contains the generic procedures for converting values of different types and kinds to For...
Definition: pm_val2str.F90:58
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
2shape = getUnifRand(1_IK, 7_IK, 2_IK)
3shape
4+6, +7
5isMatPack(rfpack, shape)
6F
7
8shape = getUnifRand(1_IK, 7_IK, 2_IK)
9shape
10+1, +3
11isMatPack(rfpack, shape)
12T
13
14shape = getUnifRand(1_IK, 7_IK, 2_IK)
15shape
16+7, +6
17isMatPack(rfpack, shape)
18F
19
20shape = getUnifRand(1_IK, 7_IK, 2_IK)
21shape
22+4, +4
23isMatPack(rfpack, shape)
24F
25
26shape = getUnifRand(1_IK, 7_IK, 2_IK)
27shape
28+6, +2
29isMatPack(rfpack, shape)
30F
31
32shape = getUnifRand(1_IK, 7_IK, 2_IK)
33shape
34+3, +4
35isMatPack(rfpack, shape)
36F
37
38shape = getUnifRand(1_IK, 7_IK, 2_IK)
39shape
40+2, +4
41isMatPack(rfpack, shape)
42F
43
44shape = getUnifRand(1_IK, 7_IK, 2_IK)
45shape
46+4, +4
47isMatPack(rfpack, shape)
48F
49
50shape = getUnifRand(1_IK, 7_IK, 2_IK)
51shape
52+2, +3
53isMatPack(rfpack, shape)
54T
55
56shape = getUnifRand(1_IK, 7_IK, 2_IK)
57shape
58+1, +6
59isMatPack(rfpack, shape)
60F
61
62shape = getUnifRand(1_IK, 7_IK, 2_IK)
63shape
64+3, +3
65isMatPack(rfpack, shape)
66F
67
68shape = getUnifRand(1_IK, 7_IK, 2_IK)
69shape
70+6, +2
71isMatPack(rfpack, shape)
72F
73
74shape = getUnifRand(1_IK, 7_IK, 2_IK)
75shape
76+6, +5
77isMatPack(rfpack, shape)
78F
79
80shape = getUnifRand(1_IK, 7_IK, 2_IK)
81shape
82+7, +7
83isMatPack(rfpack, shape)
84F
85
86shape = getUnifRand(1_IK, 7_IK, 2_IK)
87shape
88+4, +1
89isMatPack(rfpack, shape)
90F
91
92shape = getUnifRand(1_IK, 7_IK, 2_IK)
93shape
94+1, +1
95isMatPack(rfpack, shape)
96T
97
98shape = getUnifRand(1_IK, 7_IK, 2_IK)
99shape
100+3, +5
101isMatPack(rfpack, shape)
102T
103
104shape = getUnifRand(1_IK, 7_IK, 2_IK)
105shape
106+4, +3
107isMatPack(rfpack, shape)
108F
109
110shape = getUnifRand(1_IK, 7_IK, 2_IK)
111shape
112+6, +6
113isMatPack(rfpack, shape)
114F
115
116shape = getUnifRand(1_IK, 7_IK, 2_IK)
117shape
118+1, +3
119isMatPack(rfpack, shape)
120T
121
122shape = getUnifRand(1_IK, 7_IK, 2_IK)
123shape
124+1, +4
125isMatPack(rfpack, shape)
126F
127
128shape = getUnifRand(1_IK, 7_IK, 2_IK)
129shape
130+5, +3
131isMatPack(rfpack, shape)
132T
133
134shape = getUnifRand(1_IK, 7_IK, 2_IK)
135shape
136+5, +2
137isMatPack(rfpack, shape)
138T
139
140shape = getUnifRand(1_IK, 7_IK, 2_IK)
141shape
142+7, +7
143isMatPack(rfpack, shape)
144F
145
146shape = getUnifRand(1_IK, 7_IK, 2_IK)
147shape
148+4, +5
149isMatPack(rfpack, shape)
150F
151
152shape = getUnifRand(1_IK, 7_IK, 2_IK)
153shape
154+1, +1
155isMatPack(rfpack, shape)
156T
157
158shape = getUnifRand(1_IK, 7_IK, 2_IK)
159shape
160+4, +2
161isMatPack(rfpack, shape)
162F
163
164shape = getUnifRand(1_IK, 7_IK, 2_IK)
165shape
166+1, +1
167isMatPack(rfpack, shape)
168T
169
170shape = getUnifRand(1_IK, 7_IK, 2_IK)
171shape
172+1, +3
173isMatPack(rfpack, shape)
174T
175
176shape = getUnifRand(1_IK, 7_IK, 2_IK)
177shape
178+2, +6
179isMatPack(rfpack, shape)
180F
181
Test:
test_pm_matrixPack

Critical Priority: This generic interface must be extended to lfpack format.


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, Monday March 6, 2017, 3:22 pm, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin.

Definition at line 525 of file pm_matrixPack.F90.


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