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"BB", "BB"
11"AA", "BB"
12isMatClass(mat, class = symmetric)
13F
14isMatClass(mat, class = hermitian)
15F
16
17choice = ['AA', 'BB'] ! example matrix element values.
18mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
19mat
20"BA", "AA"
21"AA", "BA"
22isMatClass(mat, class = symmetric)
23T
24isMatClass(mat, class = hermitian)
25T
26
27choice = ['AA', 'BB'] ! example matrix element values.
28mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
29mat
30"BB", "BB"
31"BB", "BB"
32"BB", "BB"
33"BB", "BB"
34isMatClass(mat, class = symmetric)
35F
36isMatClass(mat, class = hermitian)
37F
38
39choice = ['AA', 'BB'] ! example matrix element values.
40mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
41mat
42"AB", "AA"
43"AA", "AB"
44"AA", "AA"
45isMatClass(mat, class = symmetric)
46F
47isMatClass(mat, class = hermitian)
48F
49
50choice = ['AA', 'BB'] ! example matrix element values.
51mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
52mat
53"AA", "AA", "AA"
54"AA", "AA", "AA"
55"AA", "AA", "AA"
56isMatClass(mat, class = symmetric)
57T
58isMatClass(mat, class = hermitian)
59T
60
61choice = ['AA', 'BB'] ! example matrix element values.
62mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
63mat
64"AB", "AA"
65"BB", "AB"
66"BB", "BB"
67isMatClass(mat, class = symmetric)
68F
69isMatClass(mat, class = hermitian)
70F
71
72choice = ['AA', 'BB'] ! example matrix element values.
73mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
74mat
75"BB", "BB"
76"BB", "BB"
77isMatClass(mat, class = symmetric)
78T
79isMatClass(mat, class = hermitian)
80T
81
82choice = ['AA', 'BB'] ! example matrix element values.
83mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
84mat
85"AA", "BB"
86"AA", "AA"
87"AA", "AA"
88"AA", "AA"
89isMatClass(mat, class = symmetric)
90F
91isMatClass(mat, class = hermitian)
92F
93
94choice = ['AA', 'BB'] ! example matrix element values.
95mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
96mat
97"BB", "AA"
98"BB", "BB"
99"BB", "BB"
100"BB", "BB"
101isMatClass(mat, class = symmetric)
102F
103isMatClass(mat, class = hermitian)
104F
105
106choice = ['AA', 'BB'] ! example matrix element values.
107mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
108mat
109"AA", "AA", "AA", "AA"
110"AA", "AA", "AA", "AA"
111"AA", "AA", "AA", "AA"
112isMatClass(mat, class = symmetric)
113F
114isMatClass(mat, class = hermitian)
115F
116
117choice = [1, 2] ! example matrix element values.
118mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
119mat
120+1, +1, +1, +1
121+1, +1, +1, +1
122+1, +1, +1, +1
123+1, +1, +1, +1
124isMatClass(mat, class = symmetric)
125T
126isMatClass(mat, class = hermitian)
127T
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
135+1, +1, +1
136isMatClass(mat, class = symmetric)
137F
138isMatClass(mat, class = hermitian)
139F
140
141choice = [1, 2] ! example matrix element values.
142mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
143mat
144+2, +1, +1
145+1, +2, +1
146+1, +1, +2
147+1, +1, +1
148isMatClass(mat, class = symmetric)
149F
150isMatClass(mat, class = hermitian)
151F
152
153choice = [1, 2] ! example matrix element values.
154mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
155mat
156+2, +1, +1
157+1, +2, +1
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, +1
167+2, +2, +1, +1
168+2, +2, +2, +1
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+1, +2, +2, +2
179+1, +1, +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+2, +2, +2, +2
189+2, +2, +2, +2
190isMatClass(mat, class = symmetric)
191F
192isMatClass(mat, class = hermitian)
193F
194
195choice = [1, 2] ! example matrix element values.
196mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
197mat
198+2, +2, +2
199+2, +2, +2
200+2, +2, +2
201isMatClass(mat, class = symmetric)
202T
203isMatClass(mat, class = hermitian)
204T
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+2, +1, +1
210+2, +2, +1
211+2, +2, +2
212+2, +2, +2
213isMatClass(mat, class = symmetric)
214F
215isMatClass(mat, class = hermitian)
216F
217
218choice = [1, 2] ! example matrix element values.
219mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
220mat
221+1, +2, +2, +2
222+2, +1, +2, +2
223+2, +2, +1, +2
224isMatClass(mat, class = symmetric)
225F
226isMatClass(mat, class = hermitian)
227F
228
229choice = [.false., .true.] ! example matrix element values.
230mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
231mat
232F, T, T, T
233T, F, T, 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
242F, F, F, F
243T, F, F, F
244T, T, F, F
245T, T, T, F
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, T, T
265F, T, T
266isMatClass(mat, class = symmetric)
267F
268isMatClass(mat, class = hermitian)
269F
270
271choice = [.false., .true.] ! example matrix element values.
272mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
273mat
274F, F, F
275T, F, F
276T, T, F
277isMatClass(mat, class = symmetric)
278F
279isMatClass(mat, class = hermitian)
280F
281
282choice = [.false., .true.] ! example matrix element values.
283mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
284mat
285T, T, T, T
286T, T, T, T
287T, T, T, T
288T, T, T, T
289isMatClass(mat, class = symmetric)
290T
291isMatClass(mat, class = hermitian)
292T
293
294choice = [.false., .true.] ! example matrix element values.
295mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
296mat
297F, T
298T, F
299T, T
300isMatClass(mat, class = symmetric)
301F
302isMatClass(mat, class = hermitian)
303F
304
305choice = [.false., .true.] ! example matrix element values.
306mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
307mat
308F, T
309T, F
310T, T
311T, T
312isMatClass(mat, class = symmetric)
313F
314isMatClass(mat, class = hermitian)
315F
316
317choice = [.false., .true.] ! example matrix element values.
318mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
319mat
320F, T
321F, F
322F, F
323F, F
324isMatClass(mat, class = symmetric)
325F
326isMatClass(mat, class = hermitian)
327F
328
329choice = [.false., .true.] ! example matrix element values.
330mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
331mat
332T, T
333T, T
334isMatClass(mat, class = symmetric)
335T
336isMatClass(mat, class = hermitian)
337T
338
339choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
340mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
341mat
342(+1.00000000, +1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
343(+1.00000000, -1.00000000), (+1.00000000, +1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
344(+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, +1.00000000), (+1.00000000, -1.00000000)
345(+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, +1.00000000)
346isMatClass(mat, class = symmetric)
347T
348isMatClass(mat, class = hermitian)
349F
350
351choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
352mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
353mat
354(+1.00000000, +1.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000)
355(+1.00000000, +0.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000)
356(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000)
357(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +1.00000000)
358isMatClass(mat, class = symmetric)
359F
360isMatClass(mat, class = hermitian)
361F
362
363choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
364mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
365mat
366(+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
367(+1.00000000, +1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
368(+1.00000000, +1.00000000), (+1.00000000, +1.00000000), (+1.00000000, -1.00000000)
369isMatClass(mat, class = symmetric)
370F
371isMatClass(mat, class = hermitian)
372F
373
374choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
375mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
376mat
377(+1.00000000, -1.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
378(+1.00000000, +0.00000000), (+1.00000000, -1.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
379(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, -1.00000000), (+1.00000000, +0.00000000)
380(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, -1.00000000)
381isMatClass(mat, class = symmetric)
382T
383isMatClass(mat, class = hermitian)
384F
385
386choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
387mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
388mat
389(+1.00000000, +0.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000)
390(+1.00000000, +1.00000000), (+1.00000000, +0.00000000), (+1.00000000, +1.00000000)
391(+1.00000000, +1.00000000), (+1.00000000, +1.00000000), (+1.00000000, +0.00000000)
392isMatClass(mat, class = symmetric)
393T
394isMatClass(mat, class = hermitian)
395F
396
397choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
398mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
399mat
400(+1.00000000, +1.00000000), (+1.00000000, +1.00000000)
401(+1.00000000, -1.00000000), (+1.00000000, +1.00000000)
402isMatClass(mat, class = symmetric)
403F
404isMatClass(mat, class = hermitian)
405F
406
407choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
408mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
409mat
410(+1.00000000, +1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
411(+1.00000000, -1.00000000), (+1.00000000, +1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
412(+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, +1.00000000), (+1.00000000, -1.00000000)
413(+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, +1.00000000)
414isMatClass(mat, class = symmetric)
415T
416isMatClass(mat, class = hermitian)
417F
418
419choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
420mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
421mat
422(+1.00000000, -1.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000)
423(+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000)
424(+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, +1.00000000)
425(+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
426isMatClass(mat, class = symmetric)
427F
428isMatClass(mat, class = hermitian)
429F
430
431choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
432mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
433mat
434(+1.00000000, +1.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000)
435(+1.00000000, +0.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000)
436(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000)
437(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +1.00000000)
438isMatClass(mat, class = symmetric)
439F
440isMatClass(mat, class = hermitian)
441F
442
443choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
444mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
445mat
446(+1.00000000, +0.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
447(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
448(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, -1.00000000)
449(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
450isMatClass(mat, class = symmetric)
451F
452isMatClass(mat, class = hermitian)
453F
454
455choice = [1., 2., 3.] ! example matrix element values.
456mat = 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)))
457mat
458+1.55586100, +1.40965474, +1.40965474
459+1.27280653, +1.55586100, +1.40965474
460+1.27280653, +1.27280653, +1.55586100
461isMatClass(mat, class = symmetric)
462F
463isMatClass(mat, class = hermitian)
464F
465
466choice = [1., 2., 3.] ! example matrix element values.
467mat = 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)))
468mat
469+1.93497837, +1.68250120, +1.68250120
470+1.96232677, +1.93497837, +1.68250120
471+1.96232677, +1.96232677, +1.93497837
472isMatClass(mat, class = symmetric)
473F
474isMatClass(mat, class = hermitian)
475F
476
477choice = [1., 2., 3.] ! example matrix element values.
478mat = 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)))
479mat
480+1.87384677, +1.67886353, +1.67886353, +1.67886353
481+1.57175064, +1.87384677, +1.67886353, +1.67886353
482+1.57175064, +1.57175064, +1.87384677, +1.67886353
483+1.57175064, +1.57175064, +1.57175064, +1.87384677
484isMatClass(mat, class = symmetric)
485F
486isMatClass(mat, class = hermitian)
487F
488
489choice = [1., 2., 3.] ! example matrix element values.
490mat = 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)))
491mat
492+1.98632193, +1.43915772
493+1.00081563, +1.98632193
494isMatClass(mat, class = symmetric)
495F
496isMatClass(mat, class = hermitian)
497F
498
499choice = [1., 2., 3.] ! example matrix element values.
500mat = 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)))
501mat
502+1.47831726, +1.99886155, +1.99886155
503+1.55248129, +1.47831726, +1.99886155
504+1.55248129, +1.55248129, +1.47831726
505isMatClass(mat, class = symmetric)
506F
507isMatClass(mat, class = hermitian)
508F
509
510choice = [1., 2., 3.] ! example matrix element values.
511mat = 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)))
512mat
513+1.43244636, +1.61565709, +1.61565709
514+1.37112164, +1.43244636, +1.61565709
515+1.37112164, +1.37112164, +1.43244636
516isMatClass(mat, class = symmetric)
517F
518isMatClass(mat, class = hermitian)
519F
520
521choice = [1., 2., 3.] ! example matrix element values.
522mat = 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)))
523mat
524+1.30009329, +1.31227648, +1.31227648, +1.31227648
525+1.64829826, +1.30009329, +1.31227648, +1.31227648
526+1.64829826, +1.64829826, +1.30009329, +1.31227648
527+1.64829826, +1.64829826, +1.64829826, +1.30009329
528isMatClass(mat, class = symmetric)
529F
530isMatClass(mat, class = hermitian)
531F
532
533choice = [1., 2., 3.] ! example matrix element values.
534mat = 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)))
535mat
536+1.87678504, +1.63589787, +1.63589787, +1.63589787
537+1.08569002, +1.87678504, +1.63589787, +1.63589787
538+1.08569002, +1.08569002, +1.87678504, +1.63589787
539+1.08569002, +1.08569002, +1.08569002, +1.87678504
540isMatClass(mat, class = symmetric)
541F
542isMatClass(mat, class = hermitian)
543F
544
545choice = [1., 2., 3.] ! example matrix element values.
546mat = 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)))
547mat
548+1.97254825, +1.88383210
549+1.85990310, +1.97254825
550isMatClass(mat, class = symmetric)
551F
552isMatClass(mat, class = hermitian)
553F
554
555choice = [1., 2., 3.] ! example matrix element values.
556mat = 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)))
557mat
558+1.12669778, +1.07764876
559+1.18785596, +1.12669778
560isMatClass(mat, class = symmetric)
561F
562isMatClass(mat, class = hermitian)
563F
564
565!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
566! Check for positive-definite matrix.
567!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
568
569
570choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
571mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
572mat
573(+0.500000000, +0.500000000), (+0.500000000, +0.500000000)
574(+1.00000000, +0.00000000), (+0.500000000, +0.500000000)
575isMatClass(mat, class = hermitian)
576F
577isMatClass(mat, class = posdefmat)
578F
579
580choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
581mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
582mat
583(+0.500000000, -0.500000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000)
584(+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000)
585(+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, +0.500000000)
586(+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
587isMatClass(mat, class = hermitian)
588F
589isMatClass(mat, class = posdefmat)
590F
591
592choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
593mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
594mat
595(+1.00000000, +0.00000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000)
596(+0.500000000, +0.500000000), (+1.00000000, +0.00000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000)
597(+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+1.00000000, +0.00000000), (+0.500000000, +0.500000000)
598(+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+1.00000000, +0.00000000)
599isMatClass(mat, class = hermitian)
600F
601isMatClass(mat, class = posdefmat)
602F
603
604choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
605mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
606mat
607(+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000)
608(+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000)
609(+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000)
610isMatClass(mat, class = hermitian)
611F
612isMatClass(mat, class = posdefmat)
613F
614
615choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
616mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
617mat
618(+0.500000000, +0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
619(+1.00000000, +0.00000000), (+0.500000000, +0.500000000), (+0.500000000, -0.500000000)
620(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+0.500000000, +0.500000000)
621isMatClass(mat, class = hermitian)
622F
623isMatClass(mat, class = posdefmat)
624F
625
626choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
627mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
628mat
629(+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
630(+0.500000000, +0.500000000), (+0.500000000, -0.500000000)
631isMatClass(mat, class = hermitian)
632F
633isMatClass(mat, class = posdefmat)
634F
635
636choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
637mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
638mat
639(+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
640(+0.500000000, +0.500000000), (+1.00000000, +0.00000000)
641isMatClass(mat, class = hermitian)
642F
643isMatClass(mat, class = posdefmat)
644F
645
646choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
647mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
648mat
649(+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000)
650(+0.500000000, -0.500000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000)
651(+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, +0.500000000)
652isMatClass(mat, class = hermitian)
653F
654isMatClass(mat, class = posdefmat)
655F
656
657choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
658mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
659mat
660(+1.00000000, +0.00000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000)
661(+0.500000000, +0.500000000), (+1.00000000, +0.00000000), (+0.500000000, +0.500000000)
662(+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+1.00000000, +0.00000000)
663isMatClass(mat, class = hermitian)
664F
665isMatClass(mat, class = posdefmat)
666F
667
668choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
669mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
670mat
671(+1.00000000, +0.00000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
672(+0.500000000, -0.500000000), (+1.00000000, +0.00000000), (+0.500000000, -0.500000000)
673(+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+1.00000000, +0.00000000)
674isMatClass(mat, class = hermitian)
675F
676isMatClass(mat, class = posdefmat)
677F
678
679mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
680mat
681+1.0000000000000000, -0.10231955089680571, -0.55697106295379450
682-0.10231955089680571, +1.0000000000000000, +0.59608670831049282
683-0.55697106295379450, +0.59608670831049282, +1.0000000000000000
684isMatClass(mat, class = symmetric)
685T
686isMatClass(mat, class = hermitian)
687T
688isMatClass(mat, class = posdefmat)
689T
690if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
691
692mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
693mat
694+1.0000000000000000, +0.99549186867116657
695+0.99549186867116657, +1.0000000000000000
696isMatClass(mat, class = symmetric)
697T
698isMatClass(mat, class = hermitian)
699T
700isMatClass(mat, class = posdefmat)
701T
702if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
703
704mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
705mat
706+1.0000000000000000, +0.76522423599646938, -0.80964489336474288, +0.78073688412366793, +0.44944393150656609
707+0.76522423599646938, +1.0000000000000000, -0.39166572560426810, +0.26595276776752180, +0.75953471880365053E-1
708-0.80964489336474288, -0.39166572560426810, +1.0000000000000000, -0.95815770585256022, -0.78145881010020235
709+0.78073688412366793, +0.26595276776752180, -0.95815770585256022, +1.0000000000000000, +0.78728697909557455
710+0.44944393150656609, +0.75953471880365053E-1, -0.78145881010020235, +0.78728697909557455, +1.0000000000000000
711isMatClass(mat, class = symmetric)
712T
713isMatClass(mat, class = hermitian)
714T
715isMatClass(mat, class = posdefmat)
716T
717if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
718
719mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
720mat
721+1.0000000000000000, +0.58076408974108806, +0.33706983226167547, -0.28191234027678386, +0.36049291894889957
722+0.58076408974108806, +1.0000000000000000, +0.60694607997703465, -0.18744005803061936, +0.83389170699515103
723+0.33706983226167547, +0.60694607997703465, +1.0000000000000000, +0.29352675526706240, +0.60891710604030358
724-0.28191234027678386, -0.18744005803061936, +0.29352675526706240, +1.0000000000000000, -0.27819082026885433
725+0.36049291894889957, +0.83389170699515103, +0.60891710604030358, -0.27819082026885433, +1.0000000000000000
726isMatClass(mat, class = symmetric)
727T
728isMatClass(mat, class = hermitian)
729T
730isMatClass(mat, class = posdefmat)
731T
732if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
733
734mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
735mat
736+1.0000000000000000, +0.38484638191804216, +0.23351996059452806
737+0.38484638191804216, +1.0000000000000000, -0.74573483340151525
738+0.23351996059452806, -0.74573483340151525, +1.0000000000000000
739isMatClass(mat, class = symmetric)
740T
741isMatClass(mat, class = hermitian)
742T
743isMatClass(mat, class = posdefmat)
744T
745if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
746
747mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
748mat
749+1.0000000000000000, -0.98731091981416486, -0.11763169511002675, -0.59446731392167373, +0.17335488355395998, -0.17480010866021328
750-0.98731091981416486, +1.0000000000000000, -0.23935312982060475E-2, +0.48060146914181712, -0.13054597632791995, +0.12094203019730237
751-0.11763169511002675, -0.23935312982060475E-2, +1.0000000000000000, +0.27969621760648389, -0.59886417996962571, -0.43282465544208781E-1
752-0.59446731392167373, +0.48060146914181712, +0.27969621760648389, +1.0000000000000000, -0.44133891954383608E-1, +0.50310872189727296
753+0.17335488355395998, -0.13054597632791995, -0.59886417996962571, -0.44133891954383608E-1, +1.0000000000000000, +0.58172462244470602
754-0.17480010866021328, +0.12094203019730237, -0.43282465544208781E-1, +0.50310872189727296, +0.58172462244470602, +1.0000000000000000
755isMatClass(mat, class = symmetric)
756T
757isMatClass(mat, class = hermitian)
758T
759isMatClass(mat, class = posdefmat)
760T
761if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
762
763mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
764mat
765+1.0000000000000000, -0.80255539847478208, +0.21885443710900371
766-0.80255539847478208, +1.0000000000000000, +0.19389909327050733
767+0.21885443710900371, +0.19389909327050733, +1.0000000000000000
768isMatClass(mat, class = symmetric)
769T
770isMatClass(mat, class = hermitian)
771T
772isMatClass(mat, class = posdefmat)
773T
774if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
775
776mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
777mat
778+1.0000000000000000, +0.22568709865775730, +0.68116511532450152
779+0.22568709865775730, +1.0000000000000000, -0.49968093197841956E-1
780+0.68116511532450152, -0.49968093197841956E-1, +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.85348502405010196, +0.34458183728629677, +0.39440222842390854, -0.35088135003456943E-1
792-0.85348502405010196, +1.0000000000000000, -0.28635151718198654, -0.69587412102628621, -0.16189136847493851
793+0.34458183728629677, -0.28635151718198654, +1.0000000000000000, +0.62841208186113073, +0.13554213247346689
794+0.39440222842390854, -0.69587412102628621, +0.62841208186113073, +1.0000000000000000, +0.42472252388659498
795-0.35088135003456943E-1, -0.16189136847493851, +0.13554213247346689, +0.42472252388659498, +1.0000000000000000
796isMatClass(mat, class = symmetric)
797T
798isMatClass(mat, class = hermitian)
799T
800isMatClass(mat, class = posdefmat)
801T
802if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
803
804mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
805mat
806+1.0000000000000000, -0.73571228519552945, +0.47872011108940193, -0.57937138803415489
807-0.73571228519552945, +1.0000000000000000, +0.22416055162995330, +0.85630257716602165
808+0.47872011108940193, +0.22416055162995330, +1.0000000000000000, +0.15612271635937880
809-0.57937138803415489, +0.85630257716602165, +0.15612271635937880, +1.0000000000000000
810isMatClass(mat, class = symmetric)
811T
812isMatClass(mat, class = hermitian)
813T
814isMatClass(mat, class = posdefmat)
815T
816if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
817
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: