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

Generate and return .true. if and only if the input matrix is of the specified input class.
More...

Detailed Description

Generate and return .true. if and only if the input matrix is of the specified input class.

See pm_matrixClass for the mathematical definitions of different matrix classes.

Parameters
[in]mat: The input matrix of arbitrary shape (:,:) of,
  1. type character of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU) of arbitrary length type parameter, or
  2. type integer of kind any supported by the processor (e.g., IK, IK8, IK16, IK32, or IK64), or
  3. type logical of kind any supported by the processor (e.g., LK), or
  4. type complex of kind any supported by the processor (e.g., CK, CK32, CK64, or CK128), or
  5. type real of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128),
containing the matrix whose class membership is to be tested.
[in]class: The input scalar constant that can be one of the following:
  1. The scalar constant symmetric implying the matrix is square Symmetric.
  2. The scalar constant hermitian implying the matrix is square Hermitian.
  3. The scalar constant posdefmat implying the matrix is square Hermitian Positive Definite.
[in]subset: The input scalar constant that can be one of the following:
  1. The scalar constant uppDia implying the upper-diagonal subset of the input matrix must be used for testing.
  2. The scalar constant lowDia implying the lower-diagonal subset of the input matrix must be used for testing.
Specifying this argument leads to faster runtimes.
If missing, the full input matrix will be considered for positive-definiteness testing.
(optional. It can be present only if the input argument class is set to posdefmat.)
[in]pack: The input scalar constant that can be one of the following:
  1. The scalar constant rdpack implying the Rectangular Default Packing format of the input matrix.
  2. The scalar constant rfpack implying the Rectangular Full Packing format of the input matrix.
(optional. It must be present if and only if the input arguments class = posdefmat and the input argument subset is present.)
Returns
itis : The output scalar logical of default kind LK that is .true. if and only if the input matrix belongs to the specified matrix type class.


Possible calling interfaces

itis = isMatClass(mat(:,:), class)
itis = isMatClass(mat(:,:), class, subset, pack) ! class = posdefmat; subset = uppDia, lowDia; pack = rdpack, rfpack
!
Generate and return .true. if and only if the input matrix is of the specified input class.
This module contains abstract and concrete derived types that are required for compile-time resolutio...
Warning
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
pm_matrixChol
pm_matrixPack
pm_matrixSubset


Example usage

1program example
2
3 use pm_kind, only: SK, IK, RKG => RK
4 use pm_io, only: display_type
6 use pm_distUnif, only: getUnifRand
8 use pm_matrixInit, only: getMatInit, uppLowDia
9 use pm_distCov, only: getCovRand
10 use pm_err, only: setAsserted
11 use pm_val2str, only: getStr
12
13 implicit none
14
15 integer(IK) :: i, shape(2)
16 type(display_type) :: disp
17 disp = display_type(file = "main.out.F90")
18
19 call disp%skip()
20 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
21 call disp%show("! Check for Symmetric/Hermitian matrix.")
22 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
23 call disp%skip()
24
25 block
26 character(2), allocatable :: choice(:), mat(:,:)
27 do i = 1, 10
28 call disp%skip
29 call disp%show("choice = ['AA', 'BB'] ! example matrix element values.")
30 choice = ['AA', 'BB'] ! example matrix element values.
31 call disp%show("mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))")
32 mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
33 call disp%show("mat")
34 call disp%show( mat , deliml = """" )
35 call disp%show("isMatClass(mat, class = symmetric)")
36 call disp%show( isMatClass(mat, class = symmetric) )
37 call disp%show("isMatClass(mat, class = hermitian)")
38 call disp%show( isMatClass(mat, class = hermitian) )
39 end do
40 end block
41
42 block
43 integer, allocatable :: choice(:), mat(:,:)
44 do i = 1, 10
45 call disp%skip
46 call disp%show("choice = [1, 2] ! example matrix element values.")
47 choice = [1, 2] ! example matrix element values.
48 call disp%show("mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))")
49 mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
50 call disp%show("mat")
51 call disp%show( mat )
52 call disp%show("isMatClass(mat, class = symmetric)")
53 call disp%show( isMatClass(mat, class = symmetric) )
54 call disp%show("isMatClass(mat, class = hermitian)")
55 call disp%show( isMatClass(mat, class = hermitian) )
56 end do
57 end block
58
59 block
60 logical, allocatable :: choice(:), mat(:,:)
61 do i = 1, 10
62 call disp%skip
63 call disp%show("choice = [.false., .true.] ! example matrix element values.")
64 choice = [.false., .true.] ! example matrix element values.
65 call disp%show("mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))")
66 mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
67 call disp%show("mat")
68 call disp%show( mat )
69 call disp%show("isMatClass(mat, class = symmetric)")
70 call disp%show( isMatClass(mat, class = symmetric) )
71 call disp%show("isMatClass(mat, class = hermitian)")
72 call disp%show( isMatClass(mat, class = hermitian) )
73 end do
74 end block
75
76 block
77 complex, allocatable :: choice(:), mat(:,:)
78 do i = 1, 10
79 call disp%skip
80 call disp%show("choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.")
81 choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
82 call disp%show("mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))")
83 mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
84 call disp%show("mat")
85 call disp%show( mat )
86 call disp%show("isMatClass(mat, class = symmetric)")
87 call disp%show( isMatClass(mat, class = symmetric) )
88 call disp%show("isMatClass(mat, class = hermitian)")
89 call disp%show( isMatClass(mat, class = hermitian) )
90 end do
91 end block
92
93 block
94 real, allocatable :: choice(:), mat(:,:)
95 do i = 1, 10
96 call disp%skip
97 call disp%show("choice = [1., 2., 3.] ! example matrix element values.")
98 choice = [1., 2., 3.] ! example matrix element values.
99 call disp%show("mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getUnifRand(choice(1), choice(2)), vlow = getUnifRand(choice(1), choice(2)), vdia = getUnifRand(choice(1), choice(2)))")
100 mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getUnifRand(choice(1), choice(2)), vlow = getUnifRand(choice(1), choice(2)), vdia = getUnifRand(choice(1), choice(2)))
101 call disp%show("mat")
102 call disp%show( mat )
103 call disp%show("isMatClass(mat, class = symmetric)")
104 call disp%show( isMatClass(mat, class = symmetric) )
105 call disp%show("isMatClass(mat, class = hermitian)")
106 call disp%show( isMatClass(mat, class = hermitian) )
107 end do
108 end block
109
110 call disp%skip()
111 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
112 call disp%show("! Check for positive-definite matrix.")
113 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
114 call disp%skip()
115
116 block
117 complex, allocatable :: choice(:), mat(:,:)
118 do i = 1, 10
119 call disp%skip
120 call disp%show("choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.")
121 choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
122 call disp%show("mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))")
123 mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
124 call disp%show("mat")
125 call disp%show( mat )
126 call disp%show("isMatClass(mat, class = hermitian)")
127 call disp%show( isMatClass(mat, class = hermitian) )
128 call disp%show("isMatClass(mat, class = posdefmat)")
129 call disp%show( isMatClass(mat, class = posdefmat) )
130 end do
131 end block
132
133 block
134 use pm_kind, only: TKG => RKD
135 real(TKG), allocatable :: choice(:), mat(:,:)
136 do i = 1, 10
137 call disp%skip
138 call disp%show("mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))")
139 mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
140 call disp%show("mat")
141 call disp%show( mat )
142 call disp%show("isMatClass(mat, class = symmetric)")
143 call disp%show( isMatClass(mat, class = symmetric) )
144 call disp%show("isMatClass(mat, class = hermitian)")
145 call disp%show( isMatClass(mat, class = hermitian) )
146 call disp%show("isMatClass(mat, class = posdefmat)")
147 call disp%show( isMatClass(mat, class = posdefmat) )
148 call disp%show(.not."if ( isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'")
149 if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
150 end do
151 end block
152
153end program example
Select a single (or multiple) element(s) from the input array of intrinsic type of arbitrary kind ran...
Generate and return a random positive-definite (correlation or covariance) matrix using the Gram meth...
Definition: pm_distCov.F90:394
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 a matrix of shape (shape(1), shape(2)) with the upper/lower triangle and the diag...
Generate and return the conversion of the input value to an output Fortran string,...
Definition: pm_val2str.F90:167
This module contains procedures and generic interfaces for selecting uniformly-distributed or arbitra...
This module contains classes and procedures for generating random matrices distributed on the space o...
Definition: pm_distCov.F90:72
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 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 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 RKD
The double precision real kind in Fortran mode. On most platforms, this is an 64-bit real kind.
Definition: pm_kind.F90:568
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(symmetric_type), parameter symmetric
This is a scalar parameter object of type symmetric_type that is exclusively used to signify the Symm...
type(posdefmat_type), parameter posdefmat
This is a scalar parameter object of type hermitian_type that is exclusively used to signify the Herm...
type(hermitian_type), parameter hermitian
This is a scalar parameter object of type hermitian_type that is exclusively used to signify the Herm...
This module contains procedures and generic interfaces relevant to generating and initializing matric...
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
2!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3! Check for Symmetric/Hermitian matrix.
4!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5
6
7choice = ['AA', 'BB'] ! example matrix element values.
8mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
9mat
10"AB", "BB"
11"BB", "AB"
12"BB", "BB"
13"BB", "BB"
14isMatClass(mat, class = symmetric)
15F
16isMatClass(mat, class = hermitian)
17F
18
19choice = ['AA', 'BB'] ! example matrix element values.
20mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
21mat
22"BB", "BB", "BB", "BB"
23"BB", "BB", "BB", "BB"
24"BB", "BB", "BB", "BB"
25"BB", "BB", "BB", "BB"
26isMatClass(mat, class = symmetric)
27T
28isMatClass(mat, class = hermitian)
29T
30
31choice = ['AA', 'BB'] ! example matrix element values.
32mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
33mat
34"BA", "AA", "AA", "AA"
35"AA", "BA", "AA", "AA"
36"AA", "AA", "BA", "AA"
37isMatClass(mat, class = symmetric)
38F
39isMatClass(mat, class = hermitian)
40F
41
42choice = ['AA', 'BB'] ! example matrix element values.
43mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
44mat
45"AB", "BB", "BB"
46"BB", "AB", "BB"
47"BB", "BB", "AB"
48isMatClass(mat, class = symmetric)
49T
50isMatClass(mat, class = hermitian)
51T
52
53choice = ['AA', 'BB'] ! example matrix element values.
54mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
55mat
56"AA", "AA", "AA"
57"AA", "AA", "AA"
58"AA", "AA", "AA"
59isMatClass(mat, class = symmetric)
60T
61isMatClass(mat, class = hermitian)
62T
63
64choice = ['AA', 'BB'] ! example matrix element values.
65mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
66mat
67"BB", "BB", "BB"
68"BB", "BB", "BB"
69"BB", "BB", "BB"
70isMatClass(mat, class = symmetric)
71T
72isMatClass(mat, class = hermitian)
73T
74
75choice = ['AA', 'BB'] ! example matrix element values.
76mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
77mat
78"BA", "AA", "AA", "AA"
79"BB", "BA", "AA", "AA"
80"BB", "BB", "BA", "AA"
81isMatClass(mat, class = symmetric)
82F
83isMatClass(mat, class = hermitian)
84F
85
86choice = ['AA', 'BB'] ! example matrix element values.
87mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
88mat
89"BB", "BB", "BB", "BB"
90"AA", "BB", "BB", "BB"
91isMatClass(mat, class = symmetric)
92F
93isMatClass(mat, class = hermitian)
94F
95
96choice = ['AA', 'BB'] ! example matrix element values.
97mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
98mat
99"AB", "AA", "AA"
100"BB", "AB", "AA"
101"BB", "BB", "AB"
102isMatClass(mat, class = symmetric)
103F
104isMatClass(mat, class = hermitian)
105F
106
107choice = ['AA', 'BB'] ! example matrix element values.
108mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
109mat
110"BB", "BB"
111"AA", "BB"
112"AA", "AA"
113"AA", "AA"
114isMatClass(mat, class = symmetric)
115F
116isMatClass(mat, class = hermitian)
117F
118
119choice = [1, 2] ! example matrix element values.
120mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
121mat
122+2, +2, +2
123+2, +2, +2
124isMatClass(mat, class = symmetric)
125F
126isMatClass(mat, class = hermitian)
127F
128
129choice = [1, 2] ! example matrix element values.
130mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
131mat
132+2, +1, +1
133+1, +2, +1
134+1, +1, +2
135isMatClass(mat, class = symmetric)
136T
137isMatClass(mat, class = hermitian)
138T
139
140choice = [1, 2] ! example matrix element values.
141mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
142mat
143+2, +2
144+1, +2
145+1, +1
146isMatClass(mat, class = symmetric)
147F
148isMatClass(mat, class = hermitian)
149F
150
151choice = [1, 2] ! example matrix element values.
152mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
153mat
154+2, +1, +1, +1
155+2, +2, +1, +1
156+2, +2, +2, +1
157+2, +2, +2, +2
158isMatClass(mat, class = symmetric)
159F
160isMatClass(mat, class = hermitian)
161F
162
163choice = [1, 2] ! example matrix element values.
164mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
165mat
166+2, +1, +1
167+2, +2, +1
168+2, +2, +2
169isMatClass(mat, class = symmetric)
170F
171isMatClass(mat, class = hermitian)
172F
173
174choice = [1, 2] ! example matrix element values.
175mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
176mat
177+2, +2, +2, +2
178+2, +2, +2, +2
179+2, +2, +2, +2
180isMatClass(mat, class = symmetric)
181F
182isMatClass(mat, class = hermitian)
183F
184
185choice = [1, 2] ! example matrix element values.
186mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
187mat
188+1, +1, +1
189+2, +1, +1
190+2, +2, +1
191isMatClass(mat, class = symmetric)
192F
193isMatClass(mat, class = hermitian)
194F
195
196choice = [1, 2] ! example matrix element values.
197mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
198mat
199+1, +2, +2
200+1, +1, +2
201isMatClass(mat, class = symmetric)
202F
203isMatClass(mat, class = hermitian)
204F
205
206choice = [1, 2] ! example matrix element values.
207mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
208mat
209+1, +2, +2, +2
210+2, +1, +2, +2
211+2, +2, +1, +2
212isMatClass(mat, class = symmetric)
213F
214isMatClass(mat, class = hermitian)
215F
216
217choice = [1, 2] ! example matrix element values.
218mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
219mat
220+2, +2, +2, +2
221+1, +2, +2, +2
222isMatClass(mat, class = symmetric)
223F
224isMatClass(mat, class = hermitian)
225F
226
227choice = [.false., .true.] ! example matrix element values.
228mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
229mat
230T, F
231T, T
232T, T
233T, T
234isMatClass(mat, class = symmetric)
235F
236isMatClass(mat, class = hermitian)
237F
238
239choice = [.false., .true.] ! example matrix element values.
240mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
241mat
242T, F
243T, T
244T, T
245T, T
246isMatClass(mat, class = symmetric)
247F
248isMatClass(mat, class = hermitian)
249F
250
251choice = [.false., .true.] ! example matrix element values.
252mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
253mat
254T, F, F, F
255F, T, F, F
256isMatClass(mat, class = symmetric)
257F
258isMatClass(mat, class = hermitian)
259F
260
261choice = [.false., .true.] ! example matrix element values.
262mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
263mat
264T, F
265F, T
266F, F
267isMatClass(mat, class = symmetric)
268F
269isMatClass(mat, class = hermitian)
270F
271
272choice = [.false., .true.] ! example matrix element values.
273mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
274mat
275F, T, T, T
276T, F, T, T
277T, T, F, T
278isMatClass(mat, class = symmetric)
279F
280isMatClass(mat, class = hermitian)
281F
282
283choice = [.false., .true.] ! example matrix element values.
284mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
285mat
286T, F, F, F
287T, T, F, F
288isMatClass(mat, class = symmetric)
289F
290isMatClass(mat, class = hermitian)
291F
292
293choice = [.false., .true.] ! example matrix element values.
294mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
295mat
296T, T, T, T
297F, T, T, T
298isMatClass(mat, class = symmetric)
299F
300isMatClass(mat, class = hermitian)
301F
302
303choice = [.false., .true.] ! example matrix element values.
304mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
305mat
306T, T, T, T
307T, T, T, T
308T, T, T, T
309T, T, T, T
310isMatClass(mat, class = symmetric)
311T
312isMatClass(mat, class = hermitian)
313T
314
315choice = [.false., .true.] ! example matrix element values.
316mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
317mat
318T, T, T, T
319F, T, T, T
320F, F, T, T
321isMatClass(mat, class = symmetric)
322F
323isMatClass(mat, class = hermitian)
324F
325
326choice = [.false., .true.] ! example matrix element values.
327mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
328mat
329T, F, F
330T, T, F
331T, T, T
332isMatClass(mat, class = symmetric)
333F
334isMatClass(mat, class = hermitian)
335F
336
337choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
338mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
339mat
340(+1.00000000, +1.00000000), (+1.00000000, +1.00000000)
341(+1.00000000, +1.00000000), (+1.00000000, +1.00000000)
342isMatClass(mat, class = symmetric)
343T
344isMatClass(mat, class = hermitian)
345F
346
347choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
348mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
349mat
350(+1.00000000, +1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
351(+1.00000000, +0.00000000), (+1.00000000, +1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
352(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +1.00000000), (+1.00000000, -1.00000000)
353(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +1.00000000)
354isMatClass(mat, class = symmetric)
355F
356isMatClass(mat, class = hermitian)
357F
358
359choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
360mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
361mat
362(+1.00000000, +0.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
363(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, -1.00000000)
364(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
365isMatClass(mat, class = symmetric)
366F
367isMatClass(mat, class = hermitian)
368F
369
370choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
371mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
372mat
373(+1.00000000, +1.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000)
374(+1.00000000, -1.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000)
375(+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, +1.00000000)
376isMatClass(mat, class = symmetric)
377F
378isMatClass(mat, class = hermitian)
379F
380
381choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
382mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
383mat
384(+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
385(+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
386(+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
387(+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
388isMatClass(mat, class = symmetric)
389T
390isMatClass(mat, class = hermitian)
391F
392
393choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
394mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
395mat
396(+1.00000000, +1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
397(+1.00000000, +1.00000000), (+1.00000000, +1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
398(+1.00000000, +1.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000), (+1.00000000, -1.00000000)
399(+1.00000000, +1.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000)
400isMatClass(mat, class = symmetric)
401F
402isMatClass(mat, class = hermitian)
403F
404
405choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
406mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
407mat
408(+1.00000000, +0.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
409(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, -1.00000000)
410(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
411isMatClass(mat, class = symmetric)
412F
413isMatClass(mat, class = hermitian)
414F
415
416choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
417mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
418mat
419(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
420(+1.00000000, +1.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
421(+1.00000000, +1.00000000), (+1.00000000, +1.00000000), (+1.00000000, +0.00000000)
422isMatClass(mat, class = symmetric)
423F
424isMatClass(mat, class = hermitian)
425F
426
427choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
428mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
429mat
430(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
431(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
432(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
433isMatClass(mat, class = symmetric)
434T
435isMatClass(mat, class = hermitian)
436T
437
438choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
439mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
440mat
441(+1.00000000, +1.00000000), (+1.00000000, -1.00000000)
442(+1.00000000, +1.00000000), (+1.00000000, +1.00000000)
443isMatClass(mat, class = symmetric)
444F
445isMatClass(mat, class = hermitian)
446F
447
448choice = [1., 2., 3.] ! example matrix element values.
449mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getUnifRand(choice(1), choice(2)), vlow = getUnifRand(choice(1), choice(2)), vdia = getUnifRand(choice(1), choice(2)))
450mat
451+1.38591480, +1.00488329
452+1.07084823, +1.38591480
453isMatClass(mat, class = symmetric)
454F
455isMatClass(mat, class = hermitian)
456F
457
458choice = [1., 2., 3.] ! example matrix element values.
459mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getUnifRand(choice(1), choice(2)), vlow = getUnifRand(choice(1), choice(2)), vdia = getUnifRand(choice(1), choice(2)))
460mat
461+1.03038633, +1.72255921
462+1.24019408, +1.03038633
463isMatClass(mat, class = symmetric)
464F
465isMatClass(mat, class = hermitian)
466F
467
468choice = [1., 2., 3.] ! example matrix element values.
469mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getUnifRand(choice(1), choice(2)), vlow = getUnifRand(choice(1), choice(2)), vdia = getUnifRand(choice(1), choice(2)))
470mat
471+1.28212190, +1.16034222, +1.16034222, +1.16034222
472+1.53475690, +1.28212190, +1.16034222, +1.16034222
473+1.53475690, +1.53475690, +1.28212190, +1.16034222
474+1.53475690, +1.53475690, +1.53475690, +1.28212190
475isMatClass(mat, class = symmetric)
476F
477isMatClass(mat, class = hermitian)
478F
479
480choice = [1., 2., 3.] ! example matrix element values.
481mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getUnifRand(choice(1), choice(2)), vlow = getUnifRand(choice(1), choice(2)), vdia = getUnifRand(choice(1), choice(2)))
482mat
483+1.08622289, +1.99702072
484+1.53482282, +1.08622289
485isMatClass(mat, class = symmetric)
486F
487isMatClass(mat, class = hermitian)
488F
489
490choice = [1., 2., 3.] ! example matrix element values.
491mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getUnifRand(choice(1), choice(2)), vlow = getUnifRand(choice(1), choice(2)), vdia = getUnifRand(choice(1), choice(2)))
492mat
493+1.68734360, +1.65898383, +1.65898383
494+1.68906057, +1.68734360, +1.65898383
495+1.68906057, +1.68906057, +1.68734360
496isMatClass(mat, class = symmetric)
497F
498isMatClass(mat, class = hermitian)
499F
500
501choice = [1., 2., 3.] ! example matrix element values.
502mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getUnifRand(choice(1), choice(2)), vlow = getUnifRand(choice(1), choice(2)), vdia = getUnifRand(choice(1), choice(2)))
503mat
504+1.03430676, +1.75754380, +1.75754380, +1.75754380
505+1.43025708, +1.03430676, +1.75754380, +1.75754380
506+1.43025708, +1.43025708, +1.03430676, +1.75754380
507+1.43025708, +1.43025708, +1.43025708, +1.03430676
508isMatClass(mat, class = symmetric)
509F
510isMatClass(mat, class = hermitian)
511F
512
513choice = [1., 2., 3.] ! example matrix element values.
514mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getUnifRand(choice(1), choice(2)), vlow = getUnifRand(choice(1), choice(2)), vdia = getUnifRand(choice(1), choice(2)))
515mat
516+1.63208580, +1.29120433
517+1.76638889, +1.63208580
518isMatClass(mat, class = symmetric)
519F
520isMatClass(mat, class = hermitian)
521F
522
523choice = [1., 2., 3.] ! example matrix element values.
524mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getUnifRand(choice(1), choice(2)), vlow = getUnifRand(choice(1), choice(2)), vdia = getUnifRand(choice(1), choice(2)))
525mat
526+1.92633224, +1.58054388, +1.58054388
527+1.26536107, +1.92633224, +1.58054388
528+1.26536107, +1.26536107, +1.92633224
529isMatClass(mat, class = symmetric)
530F
531isMatClass(mat, class = hermitian)
532F
533
534choice = [1., 2., 3.] ! example matrix element values.
535mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getUnifRand(choice(1), choice(2)), vlow = getUnifRand(choice(1), choice(2)), vdia = getUnifRand(choice(1), choice(2)))
536mat
537+1.57529998, +1.19651246, +1.19651246, +1.19651246
538+1.70954275, +1.57529998, +1.19651246, +1.19651246
539+1.70954275, +1.70954275, +1.57529998, +1.19651246
540+1.70954275, +1.70954275, +1.70954275, +1.57529998
541isMatClass(mat, class = symmetric)
542F
543isMatClass(mat, class = hermitian)
544F
545
546choice = [1., 2., 3.] ! example matrix element values.
547mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getUnifRand(choice(1), choice(2)), vlow = getUnifRand(choice(1), choice(2)), vdia = getUnifRand(choice(1), choice(2)))
548mat
549+1.68054473, +1.04381955, +1.04381955
550+1.04233968, +1.68054473, +1.04381955
551+1.04233968, +1.04233968, +1.68054473
552isMatClass(mat, class = symmetric)
553F
554isMatClass(mat, class = hermitian)
555F
556
557!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
558! Check for positive-definite matrix.
559!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
560
561
562choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
563mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
564mat
565(+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
566(+1.00000000, +0.00000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
567(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
568(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+0.500000000, -0.500000000)
569isMatClass(mat, class = hermitian)
570F
571isMatClass(mat, class = posdefmat)
572F
573
574choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
575mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
576mat
577(+0.500000000, +0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
578(+1.00000000, +0.00000000), (+0.500000000, +0.500000000), (+0.500000000, -0.500000000)
579(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+0.500000000, +0.500000000)
580isMatClass(mat, class = hermitian)
581F
582isMatClass(mat, class = posdefmat)
583F
584
585choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
586mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
587mat
588(+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
589(+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
590(+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
591isMatClass(mat, class = hermitian)
592F
593isMatClass(mat, class = posdefmat)
594F
595
596choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
597mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
598mat
599(+0.500000000, +0.500000000), (+0.500000000, -0.500000000)
600(+0.500000000, +0.500000000), (+0.500000000, +0.500000000)
601isMatClass(mat, class = hermitian)
602F
603isMatClass(mat, class = posdefmat)
604F
605
606choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
607mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
608mat
609(+0.500000000, +0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
610(+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+0.500000000, -0.500000000)
611(+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000)
612isMatClass(mat, class = hermitian)
613F
614isMatClass(mat, class = posdefmat)
615F
616
617choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
618mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
619mat
620(+1.00000000, +0.00000000), (+0.500000000, +0.500000000)
621(+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
622isMatClass(mat, class = hermitian)
623F
624isMatClass(mat, class = posdefmat)
625F
626
627choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
628mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
629mat
630(+1.00000000, +0.00000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
631(+0.500000000, -0.500000000), (+1.00000000, +0.00000000), (+0.500000000, -0.500000000)
632(+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+1.00000000, +0.00000000)
633isMatClass(mat, class = hermitian)
634F
635isMatClass(mat, class = posdefmat)
636F
637
638choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
639mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
640mat
641(+0.500000000, +0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
642(+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+0.500000000, -0.500000000)
643(+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000)
644isMatClass(mat, class = hermitian)
645F
646isMatClass(mat, class = posdefmat)
647F
648
649choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
650mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
651mat
652(+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
653(+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
654(+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
655(+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
656isMatClass(mat, class = hermitian)
657F
658isMatClass(mat, class = posdefmat)
659F
660
661choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
662mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
663mat
664(+1.00000000, +0.00000000), (+0.500000000, -0.500000000)
665(+0.500000000, +0.500000000), (+1.00000000, +0.00000000)
666isMatClass(mat, class = hermitian)
667T
668isMatClass(mat, class = posdefmat)
669T
670
671mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
672mat
673+1.0000000000000000, +0.26111173080490091, -0.38890865145155679, +0.43071800422681372, -0.55142862425280392, -0.23227322958822924, +0.34791131739651038, +0.20829952297259594
674+0.26111173080490091, +1.0000000000000000, -0.69025864176571405, -0.31884974870300348, -0.40908537387411459, -0.55906680853977242, +0.39135558772782064, -0.28209034307025949
675-0.38890865145155679, -0.69025864176571405, +1.0000000000000000, -0.27120922698876598, +0.47547452257340933, +0.84809005246237401, -0.42640789471423413, +0.18780131338326622
676+0.43071800422681372, -0.31884974870300348, -0.27120922698876598, +1.0000000000000000, -0.32766540560484403, -0.37772092915178024, -0.71626071765188953E-1, +0.37338434207438381
677-0.55142862425280392, -0.40908537387411459, +0.47547452257340933, -0.32766540560484403, +1.0000000000000000, +0.29980937326461576, -0.56456162897761475, -0.39446463228874817
678-0.23227322958822924, -0.55906680853977242, +0.84809005246237401, -0.37772092915178024, +0.29980937326461576, +1.0000000000000000, +0.42711623597670972E-1, +0.38858614558564419
679+0.34791131739651038, +0.39135558772782064, -0.42640789471423413, -0.71626071765188953E-1, -0.56456162897761475, +0.42711623597670972E-1, +1.0000000000000000, +0.21150079047399170
680+0.20829952297259594, -0.28209034307025949, +0.18780131338326622, +0.37338434207438381, -0.39446463228874817, +0.38858614558564419, +0.21150079047399170, +1.0000000000000000
681isMatClass(mat, class = symmetric)
682T
683isMatClass(mat, class = hermitian)
684T
685isMatClass(mat, class = posdefmat)
686T
687if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
688
689mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
690mat
691+1.0000000000000000, -0.84250633783710516, -0.53159676607824613, +0.67163937492950965
692-0.84250633783710516, +1.0000000000000000, +0.65213862272894108, -0.47787666291088021
693-0.53159676607824613, +0.65213862272894108, +1.0000000000000000, +0.88344676929912991E-1
694+0.67163937492950965, -0.47787666291088021, +0.88344676929912991E-1, +1.0000000000000000
695isMatClass(mat, class = symmetric)
696T
697isMatClass(mat, class = hermitian)
698T
699isMatClass(mat, class = posdefmat)
700T
701if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
702
703mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
704mat
705+1.0000000000000000, -0.86953105102349826, +0.98113310372059259, +0.41728630675548611
706-0.86953105102349826, +1.0000000000000000, -0.94830855325742780, -0.78931228638514317
707+0.98113310372059259, -0.94830855325742780, +1.0000000000000000, +0.57456768579538686
708+0.41728630675548611, -0.78931228638514317, +0.57456768579538686, +1.0000000000000000
709isMatClass(mat, class = symmetric)
710T
711isMatClass(mat, class = hermitian)
712T
713isMatClass(mat, class = posdefmat)
714T
715if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
716
717mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
718mat
719+1.0000000000000000, -0.12887702713990709, +0.86170105422631360
720-0.12887702713990709, +1.0000000000000000, -0.53162989608420985
721+0.86170105422631360, -0.53162989608420985, +1.0000000000000000
722isMatClass(mat, class = symmetric)
723T
724isMatClass(mat, class = hermitian)
725T
726isMatClass(mat, class = posdefmat)
727T
728if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
729
730mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
731mat
732+1.0000000000000000, -0.68621679568493954
733-0.68621679568493954, +1.0000000000000000
734isMatClass(mat, class = symmetric)
735T
736isMatClass(mat, class = hermitian)
737T
738isMatClass(mat, class = posdefmat)
739T
740if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
741
742mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
743mat
744+1.0000000000000000, +0.59140585919207656, -0.16435597660574991, +0.50762523208650667, -0.24889445653428799, -0.82113419695611964E-1, +0.39572086143279089, +0.23060652679645657
745+0.59140585919207656, +1.0000000000000000, -0.64378855775235166, -0.19978043781972876, -0.71610989061078911, +0.37101441383338638E-2, +0.60696989385222466, +0.39595311263858368
746-0.16435597660574991, -0.64378855775235166, +1.0000000000000000, +0.37398972130386865, +0.69567371052386917, -0.39101160509188604, -0.55228214672130405E-1, -0.57180693921305825
747+0.50762523208650667, -0.19978043781972876, +0.37398972130386865, +1.0000000000000000, +0.20363387207454620E-1, +0.39876726182449529E-2, +0.19841829383178766, -0.21688534367568885
748-0.24889445653428799, -0.71610989061078911, +0.69567371052386917, +0.20363387207454620E-1, +1.0000000000000000, -0.42451836400383658, -0.40197939952150807, -0.48496000484009699
749-0.82113419695611964E-1, +0.37101441383338638E-2, -0.39101160509188604, +0.39876726182449529E-2, -0.42451836400383658, +1.0000000000000000, -0.43657262598686170, +0.74620796347637675
750+0.39572086143279089, +0.60696989385222466, -0.55228214672130405E-1, +0.19841829383178766, -0.40197939952150807, -0.43657262598686170, +1.0000000000000000, -0.35755488466598045
751+0.23060652679645657, +0.39595311263858368, -0.57180693921305825, -0.21688534367568885, -0.48496000484009699, +0.74620796347637675, -0.35755488466598045, +1.0000000000000000
752isMatClass(mat, class = symmetric)
753T
754isMatClass(mat, class = hermitian)
755T
756isMatClass(mat, class = posdefmat)
757T
758if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
759
760mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
761mat
762+1.0000000000000000, -0.90100436004741069, -0.17250297693569897E-1
763-0.90100436004741069, +1.0000000000000000, +0.44714478076728370
764-0.17250297693569897E-1, +0.44714478076728370, +1.0000000000000000
765isMatClass(mat, class = symmetric)
766T
767isMatClass(mat, class = hermitian)
768T
769isMatClass(mat, class = posdefmat)
770T
771if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
772
773mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
774mat
775+1.0000000000000000, +0.76185621295191097, +0.50440601965961773, +0.85686496633639631, +0.65311875173347322, -0.24920137862216968
776+0.76185621295191097, +1.0000000000000000, +0.10153042046446514E-1, +0.82718558964835032, +0.76276012197612020, -0.22320003960060569
777+0.50440601965961773, +0.10153042046446514E-1, +1.0000000000000000, +0.25101238079459459, +0.37673421760240894, +0.27521379058266282
778+0.85686496633639631, +0.82718558964835032, +0.25101238079459459, +1.0000000000000000, +0.54434116038392544, -0.14994122992071385
779+0.65311875173347322, +0.76276012197612020, +0.37673421760240894, +0.54434116038392544, +1.0000000000000000, +0.14707939833253236
780-0.24920137862216968, -0.22320003960060569, +0.27521379058266282, -0.14994122992071385, +0.14707939833253236, +1.0000000000000000
781isMatClass(mat, class = symmetric)
782T
783isMatClass(mat, class = hermitian)
784T
785isMatClass(mat, class = posdefmat)
786T
787if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
788
789mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
790mat
791+1.0000000000000000, +0.99561795180731405, +0.77441364853248629, -0.56220011456574140E-1, -0.58814903500539850, -0.60157978056402261, -0.60695488547899201
792+0.99561795180731405, +1.0000000000000000, +0.71907490637649496, -0.33877477401188807E-1, -0.59910147482738263, -0.63130740613668657, -0.56577907033804009
793+0.77441364853248629, +0.71907490637649496, +1.0000000000000000, -0.37637940992950586, -0.40803972862587146, -0.32093235411858434, -0.65917174206962437
794-0.56220011456574140E-1, -0.33877477401188807E-1, -0.37637940992950586, +1.0000000000000000, -0.13646339902652338, +0.17989714437971027, +0.32718150080294672
795-0.58814903500539850, -0.59910147482738263, -0.40803972862587146, -0.13646339902652338, +1.0000000000000000, +0.78236652098737891, -0.13588173829175068
796-0.60157978056402261, -0.63130740613668657, -0.32093235411858434, +0.17989714437971027, +0.78236652098737891, +1.0000000000000000, +0.15804882428758785
797-0.60695488547899201, -0.56577907033804009, -0.65917174206962437, +0.32718150080294672, -0.13588173829175068, +0.15804882428758785, +1.0000000000000000
798isMatClass(mat, class = symmetric)
799T
800isMatClass(mat, class = hermitian)
801T
802isMatClass(mat, class = posdefmat)
803T
804if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
805
806mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
807mat
808+1.0000000000000000, -0.82415568432988306, -0.30197955233730961, -0.61515482813300637
809-0.82415568432988306, +1.0000000000000000, -0.11761858976573392, +0.24952658751498652
810-0.30197955233730961, -0.11761858976573392, +1.0000000000000000, +0.14903407908731736
811-0.61515482813300637, +0.24952658751498652, +0.14903407908731736, +1.0000000000000000
812isMatClass(mat, class = symmetric)
813T
814isMatClass(mat, class = hermitian)
815T
816isMatClass(mat, class = posdefmat)
817T
818if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
819
Test:
test_pm_matrixClass
Todo:
High Priority: This generic interface must be extended to all matrix classes documented in this module.
Todo:
High Priority: The implementation for rfpack can be improved once the corresponding improvements to the auxiliary routines used are implemented.
For example, the current implementation for positive-definiteness check makes a copy of the input array which can be avoided if the corresponding setMatChol interface is implemented.


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 2115 of file pm_matrixClass.F90.


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