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"AA", "BB", "BB", "BB"
11"BB", "AA", "BB", "BB"
12"BB", "BB", "AA", "BB"
13"BB", "BB", "BB", "AA"
14isMatClass(mat, class = symmetric)
15T
16isMatClass(mat, class = hermitian)
17T
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", "AA"
23"AA", "BB"
24"AA", "AA"
25"AA", "AA"
26isMatClass(mat, class = symmetric)
27F
28isMatClass(mat, class = hermitian)
29F
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"AA", "AA"
35"AA", "AA"
36"AA", "AA"
37"AA", "AA"
38isMatClass(mat, class = symmetric)
39F
40isMatClass(mat, class = hermitian)
41F
42
43choice = ['AA', 'BB'] ! example matrix element values.
44mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
45mat
46"AB", "BB"
47"AA", "AB"
48"AA", "AA"
49"AA", "AA"
50isMatClass(mat, class = symmetric)
51F
52isMatClass(mat, class = hermitian)
53F
54
55choice = ['AA', 'BB'] ! example matrix element values.
56mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
57mat
58"AB", "AA"
59"BB", "AB"
60"BB", "BB"
61isMatClass(mat, class = symmetric)
62F
63isMatClass(mat, class = hermitian)
64F
65
66choice = ['AA', 'BB'] ! example matrix element values.
67mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
68mat
69"AB", "AA", "AA", "AA"
70"BB", "AB", "AA", "AA"
71"BB", "BB", "AB", "AA"
72"BB", "BB", "BB", "AB"
73isMatClass(mat, class = symmetric)
74F
75isMatClass(mat, class = hermitian)
76F
77
78choice = ['AA', 'BB'] ! example matrix element values.
79mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
80mat
81"AA", "AA"
82"AA", "AA"
83"AA", "AA"
84"AA", "AA"
85isMatClass(mat, class = symmetric)
86F
87isMatClass(mat, class = hermitian)
88F
89
90choice = ['AA', 'BB'] ! example matrix element values.
91mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
92mat
93"AB", "AA"
94"AA", "AB"
95"AA", "AA"
96isMatClass(mat, class = symmetric)
97F
98isMatClass(mat, class = hermitian)
99F
100
101choice = ['AA', 'BB'] ! example matrix element values.
102mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
103mat
104"AB", "BB", "BB", "BB"
105"AA", "AB", "BB", "BB"
106"AA", "AA", "AB", "BB"
107"AA", "AA", "AA", "AB"
108isMatClass(mat, class = symmetric)
109F
110isMatClass(mat, class = hermitian)
111F
112
113choice = ['AA', 'BB'] ! example matrix element values.
114mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
115mat
116"AB", "AA", "AA"
117"BB", "AB", "AA"
118"BB", "BB", "AB"
119isMatClass(mat, class = symmetric)
120F
121isMatClass(mat, class = hermitian)
122F
123
124choice = [1, 2] ! example matrix element values.
125mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
126mat
127+1, +1
128+2, +1
129+2, +2
130+2, +2
131isMatClass(mat, class = symmetric)
132F
133isMatClass(mat, class = hermitian)
134F
135
136choice = [1, 2] ! example matrix element values.
137mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
138mat
139+1, +1, +1, +1
140+2, +1, +1, +1
141isMatClass(mat, class = symmetric)
142F
143isMatClass(mat, class = hermitian)
144F
145
146choice = [1, 2] ! example matrix element values.
147mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
148mat
149+1, +2, +2, +2
150+1, +1, +2, +2
151+1, +1, +1, +2
152isMatClass(mat, class = symmetric)
153F
154isMatClass(mat, class = hermitian)
155F
156
157choice = [1, 2] ! example matrix element values.
158mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
159mat
160+1, +2, +2, +2
161+1, +1, +2, +2
162isMatClass(mat, class = symmetric)
163F
164isMatClass(mat, class = hermitian)
165F
166
167choice = [1, 2] ! example matrix element values.
168mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
169mat
170+2, +1, +1
171+2, +2, +1
172isMatClass(mat, class = symmetric)
173F
174isMatClass(mat, class = hermitian)
175F
176
177choice = [1, 2] ! example matrix element values.
178mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
179mat
180+1, +1, +1, +1
181+2, +1, +1, +1
182isMatClass(mat, class = symmetric)
183F
184isMatClass(mat, class = hermitian)
185F
186
187choice = [1, 2] ! example matrix element values.
188mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
189mat
190+1, +2
191+1, +1
192+1, +1
193+1, +1
194isMatClass(mat, class = symmetric)
195F
196isMatClass(mat, class = hermitian)
197F
198
199choice = [1, 2] ! example matrix element values.
200mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
201mat
202+1, +2
203+2, +1
204+2, +2
205+2, +2
206isMatClass(mat, class = symmetric)
207F
208isMatClass(mat, class = hermitian)
209F
210
211choice = [1, 2] ! example matrix element values.
212mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
213mat
214+1, +2, +2, +2
215+1, +1, +2, +2
216+1, +1, +1, +2
217isMatClass(mat, class = symmetric)
218F
219isMatClass(mat, class = hermitian)
220F
221
222choice = [1, 2] ! example matrix element values.
223mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
224mat
225+2, +1
226+1, +2
227isMatClass(mat, class = symmetric)
228T
229isMatClass(mat, class = hermitian)
230T
231
232choice = [.false., .true.] ! example matrix element values.
233mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
234mat
235F, T, T, T
236T, F, T, T
237isMatClass(mat, class = symmetric)
238F
239isMatClass(mat, class = hermitian)
240F
241
242choice = [.false., .true.] ! example matrix element values.
243mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
244mat
245F, F, F
246T, F, F
247T, T, F
248T, T, T
249isMatClass(mat, class = symmetric)
250F
251isMatClass(mat, class = hermitian)
252F
253
254choice = [.false., .true.] ! example matrix element values.
255mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
256mat
257F, F, F
258T, F, F
259isMatClass(mat, class = symmetric)
260F
261isMatClass(mat, class = hermitian)
262F
263
264choice = [.false., .true.] ! example matrix element values.
265mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
266mat
267F, F, F, F
268T, F, F, F
269T, T, F, F
270isMatClass(mat, class = symmetric)
271F
272isMatClass(mat, class = hermitian)
273F
274
275choice = [.false., .true.] ! example matrix element values.
276mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
277mat
278F, T, T, T
279T, F, T, T
280T, T, F, T
281isMatClass(mat, class = symmetric)
282F
283isMatClass(mat, class = hermitian)
284F
285
286choice = [.false., .true.] ! example matrix element values.
287mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
288mat
289T, F, F
290T, T, F
291T, T, T
292isMatClass(mat, class = symmetric)
293F
294isMatClass(mat, class = hermitian)
295F
296
297choice = [.false., .true.] ! example matrix element values.
298mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
299mat
300T, F
301T, T
302T, T
303isMatClass(mat, class = symmetric)
304F
305isMatClass(mat, class = hermitian)
306F
307
308choice = [.false., .true.] ! example matrix element values.
309mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
310mat
311T, T, T, T
312F, T, T, T
313isMatClass(mat, class = symmetric)
314F
315isMatClass(mat, class = hermitian)
316F
317
318choice = [.false., .true.] ! example matrix element values.
319mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
320mat
321T, T, T, T
322T, T, T, T
323T, T, T, T
324T, T, T, T
325isMatClass(mat, class = symmetric)
326T
327isMatClass(mat, class = hermitian)
328T
329
330choice = [.false., .true.] ! example matrix element values.
331mat = getMatInit(int(getUnifRand(2, 4, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getUnifRand(choice(1), choice(2)))
332mat
333F, F, F, F
334F, F, F, F
335F, F, F, F
336F, F, F, F
337isMatClass(mat, class = symmetric)
338T
339isMatClass(mat, class = hermitian)
340T
341
342choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
343mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
344mat
345(+1.00000000, -1.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
346(+1.00000000, +1.00000000), (+1.00000000, -1.00000000), (+1.00000000, +0.00000000)
347(+1.00000000, +1.00000000), (+1.00000000, +1.00000000), (+1.00000000, -1.00000000)
348isMatClass(mat, class = symmetric)
349F
350isMatClass(mat, class = hermitian)
351F
352
353choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
354mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
355mat
356(+1.00000000, -1.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000)
357(+1.00000000, +0.00000000), (+1.00000000, -1.00000000), (+1.00000000, +1.00000000)
358(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, -1.00000000)
359isMatClass(mat, class = symmetric)
360F
361isMatClass(mat, class = hermitian)
362F
363
364choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
365mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
366mat
367(+1.00000000, +0.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
368(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
369(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, -1.00000000)
370(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
371isMatClass(mat, class = symmetric)
372F
373isMatClass(mat, class = hermitian)
374F
375
376choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
377mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
378mat
379(+1.00000000, -1.00000000), (+1.00000000, +0.00000000)
380(+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, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
390(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
391(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
392(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
393isMatClass(mat, class = symmetric)
394T
395isMatClass(mat, class = hermitian)
396T
397
398choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
399mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
400mat
401(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
402(+1.00000000, -1.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
403(+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, +0.00000000)
404isMatClass(mat, class = symmetric)
405F
406isMatClass(mat, class = hermitian)
407F
408
409choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
410mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
411mat
412(+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
413(+1.00000000, +0.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000)
414(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, -1.00000000)
415isMatClass(mat, class = symmetric)
416F
417isMatClass(mat, class = hermitian)
418F
419
420choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
421mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
422mat
423(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
424(+1.00000000, -1.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
425(+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
426(+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, +0.00000000)
427isMatClass(mat, class = symmetric)
428F
429isMatClass(mat, class = hermitian)
430F
431
432choice = [(1., -1.), (1., 0.), (1., 1.)] ! example matrix element values.
433mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
434mat
435(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
436(+1.00000000, -1.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
437(+1.00000000, -1.00000000), (+1.00000000, -1.00000000), (+1.00000000, +0.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, -1.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000)
447(+1.00000000, +0.00000000), (+1.00000000, -1.00000000), (+1.00000000, +1.00000000), (+1.00000000, +1.00000000)
448(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, -1.00000000), (+1.00000000, +1.00000000)
449(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, -1.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.85866284, +1.56651652, +1.56651652, +1.56651652
459+1.91547370, +1.85866284, +1.56651652, +1.56651652
460+1.91547370, +1.91547370, +1.85866284, +1.56651652
461+1.91547370, +1.91547370, +1.91547370, +1.85866284
462isMatClass(mat, class = symmetric)
463F
464isMatClass(mat, class = hermitian)
465F
466
467choice = [1., 2., 3.] ! example matrix element values.
468mat = 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)))
469mat
470+1.18478990, +1.33418202, +1.33418202, +1.33418202
471+1.41534209, +1.18478990, +1.33418202, +1.33418202
472+1.41534209, +1.41534209, +1.18478990, +1.33418202
473+1.41534209, +1.41534209, +1.41534209, +1.18478990
474isMatClass(mat, class = symmetric)
475F
476isMatClass(mat, class = hermitian)
477F
478
479choice = [1., 2., 3.] ! example matrix element values.
480mat = 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)))
481mat
482+1.23036933, +1.55430412
483+1.84666681, +1.23036933
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.68098140, +1.30407143, +1.30407143
493+1.32408285, +1.68098140, +1.30407143
494+1.32408285, +1.32408285, +1.68098140
495isMatClass(mat, class = symmetric)
496F
497isMatClass(mat, class = hermitian)
498F
499
500choice = [1., 2., 3.] ! example matrix element values.
501mat = 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)))
502mat
503+1.40733719, +1.49899745
504+1.80807304, +1.40733719
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.26834357, +1.14050937
514+1.58327425, +1.26834357
515isMatClass(mat, class = symmetric)
516F
517isMatClass(mat, class = hermitian)
518F
519
520choice = [1., 2., 3.] ! example matrix element values.
521mat = 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)))
522mat
523+1.52561331, +1.67592049
524+1.98989964, +1.52561331
525isMatClass(mat, class = symmetric)
526F
527isMatClass(mat, class = hermitian)
528F
529
530choice = [1., 2., 3.] ! example matrix element values.
531mat = 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)))
532mat
533+1.44888830, +1.45923328
534+1.12755811, +1.44888830
535isMatClass(mat, class = symmetric)
536F
537isMatClass(mat, class = hermitian)
538F
539
540choice = [1., 2., 3.] ! example matrix element values.
541mat = 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)))
542mat
543+1.82335615, +1.27181673, +1.27181673
544+1.65723741, +1.82335615, +1.27181673
545+1.65723741, +1.65723741, +1.82335615
546isMatClass(mat, class = symmetric)
547F
548isMatClass(mat, class = hermitian)
549F
550
551choice = [1., 2., 3.] ! example matrix element values.
552mat = 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)))
553mat
554+1.94751787, +1.55471253, +1.55471253, +1.55471253
555+1.85313547, +1.94751787, +1.55471253, +1.55471253
556+1.85313547, +1.85313547, +1.94751787, +1.55471253
557+1.85313547, +1.85313547, +1.85313547, +1.94751787
558isMatClass(mat, class = symmetric)
559F
560isMatClass(mat, class = hermitian)
561F
562
563!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
564! Check for positive-definite matrix.
565!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
566
567
568choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
569mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
570mat
571(+1.00000000, +0.00000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000)
572(+0.500000000, +0.500000000), (+1.00000000, +0.00000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000)
573(+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+1.00000000, +0.00000000), (+0.500000000, +0.500000000)
574(+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+1.00000000, +0.00000000)
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)
584(+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)
586isMatClass(mat, class = hermitian)
587F
588isMatClass(mat, class = posdefmat)
589F
590
591choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
592mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
593mat
594(+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
595(+0.500000000, +0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
596(+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
597(+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+0.500000000, -0.500000000)
598isMatClass(mat, class = hermitian)
599F
600isMatClass(mat, class = posdefmat)
601F
602
603choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
604mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
605mat
606(+0.500000000, +0.500000000), (+0.500000000, -0.500000000)
607(+0.500000000, +0.500000000), (+0.500000000, +0.500000000)
608isMatClass(mat, class = hermitian)
609F
610isMatClass(mat, class = posdefmat)
611F
612
613choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
614mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
615mat
616(+1.00000000, +0.00000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
617(+0.500000000, +0.500000000), (+1.00000000, +0.00000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
618(+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+1.00000000, +0.00000000), (+0.500000000, -0.500000000)
619(+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+1.00000000, +0.00000000)
620isMatClass(mat, class = hermitian)
621T
622isMatClass(mat, class = posdefmat)
623F
624
625choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
626mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
627mat
628(+0.500000000, +0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
629(+1.00000000, +0.00000000), (+0.500000000, +0.500000000), (+0.500000000, -0.500000000)
630(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+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), (+1.00000000, +0.00000000)
640(+0.500000000, -0.500000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000)
641(+0.500000000, -0.500000000), (+0.500000000, -0.500000000), (+1.00000000, +0.00000000)
642isMatClass(mat, class = hermitian)
643F
644isMatClass(mat, class = posdefmat)
645F
646
647choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
648mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
649mat
650(+0.500000000, -0.500000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000)
651(+1.00000000, +0.00000000), (+0.500000000, -0.500000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000)
652(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+0.500000000, -0.500000000), (+0.500000000, +0.500000000)
653(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+0.500000000, -0.500000000)
654isMatClass(mat, class = hermitian)
655F
656isMatClass(mat, class = posdefmat)
657F
658
659choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
660mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
661mat
662(+0.500000000, +0.500000000), (+0.500000000, -0.500000000), (+0.500000000, -0.500000000)
663(+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+0.500000000, -0.500000000)
664(+0.500000000, +0.500000000), (+0.500000000, +0.500000000), (+0.500000000, +0.500000000)
665isMatClass(mat, class = hermitian)
666F
667isMatClass(mat, class = posdefmat)
668F
669
670choice = [(.5, -.5), (1., 0.), (.5, .5)] ! example matrix element values.
671mat = getMatInit(int(spread(getUnifRand(2, 4), 1, 2), IK), uppLowDia, vupp = getChoice(choice), vlow = getChoice(choice), vdia = getChoice(choice))
672mat
673(+0.500000000, -0.500000000), (+1.00000000, +0.00000000)
674(+1.00000000, +0.00000000), (+0.500000000, -0.500000000)
675isMatClass(mat, class = hermitian)
676F
677isMatClass(mat, class = posdefmat)
678F
679
680mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
681mat
682+1.0000000000000000, +0.78681166686537596, -0.72823253188059678
683+0.78681166686537596, +1.0000000000000000, -0.24973176804567110
684-0.72823253188059678, -0.24973176804567110, +1.0000000000000000
685isMatClass(mat, class = symmetric)
686T
687isMatClass(mat, class = hermitian)
688T
689isMatClass(mat, class = posdefmat)
690T
691if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
692
693mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
694mat
695+1.0000000000000000, -0.87778276513541953
696-0.87778276513541953, +1.0000000000000000
697isMatClass(mat, class = symmetric)
698T
699isMatClass(mat, class = hermitian)
700T
701isMatClass(mat, class = posdefmat)
702T
703if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
704
705mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
706mat
707+1.0000000000000000, +0.99618441336374941, -0.34544809774035024, +0.79307375877835946E-2
708+0.99618441336374941, +1.0000000000000000, -0.26437922747846238, -0.36979332864619380E-1
709-0.34544809774035024, -0.26437922747846238, +1.0000000000000000, -0.61735242244468624
710+0.79307375877835946E-2, -0.36979332864619380E-1, -0.61735242244468624, +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.14678233064256149, -0.12071456208798126, +0.11806841978007601, +0.76669232379782792
722+0.14678233064256149, +1.0000000000000000, -0.76616506626466963, +0.92962288581863239, -0.17579477441289382
723-0.12071456208798126, -0.76616506626466963, +1.0000000000000000, -0.49666315687044293, +0.39314871398542811
724+0.11806841978007601, +0.92962288581863239, -0.49666315687044293, +1.0000000000000000, -0.10132898625517209E-1
725+0.76669232379782792, -0.17579477441289382, +0.39314871398542811, -0.10132898625517209E-1, +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.37687834273199362E-1, +0.36246121076578597, +0.94318619093634637, -0.51312605151486657, -0.20271481328284865, -0.55754554519307642, +0.30436889533831613
737-0.37687834273199362E-1, +1.0000000000000000, +0.35553027496364570, +0.17900086141099975E-1, +0.44785285562670363, +0.28077685319691029E-1, -0.41687504496634786, +0.24380426736919494
738+0.36246121076578597, +0.35553027496364570, +1.0000000000000000, +0.59374555584519906, +0.40214146164822284, -0.19353423502604872, -0.50058837237572873, -0.23918676653670157
739+0.94318619093634637, +0.17900086141099975E-1, +0.59374555584519906, +1.0000000000000000, -0.39157575811963935, -0.11843083990109397, -0.50720802491971217, +0.21390807349152302
740-0.51312605151486657, +0.44785285562670363, +0.40214146164822284, -0.39157575811963935, +1.0000000000000000, -0.15222671144192373E-1, -0.22510852177141966E-1, -0.63840070804971893
741-0.20271481328284865, +0.28077685319691029E-1, -0.19353423502604872, -0.11843083990109397, -0.15222671144192373E-1, +1.0000000000000000, +0.29877225180171424, -0.11022635129391857
742-0.55754554519307642, -0.41687504496634786, -0.50058837237572873, -0.50720802491971217, -0.22510852177141966E-1, +0.29877225180171424, +1.0000000000000000, -0.21908165902483245
743+0.30436889533831613, +0.24380426736919494, -0.23918676653670157, +0.21390807349152302, -0.63840070804971893, -0.11022635129391857, -0.21908165902483245, +1.0000000000000000
744isMatClass(mat, class = symmetric)
745T
746isMatClass(mat, class = hermitian)
747T
748isMatClass(mat, class = posdefmat)
749T
750if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
751
752mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
753mat
754+1.0000000000000000, -0.62086421713841589, +0.50494830456504458, +0.13077136131373085
755-0.62086421713841589, +1.0000000000000000, +0.26145826015283946, -0.25226550575610440
756+0.50494830456504458, +0.26145826015283946, +1.0000000000000000, +0.34059329459812049
757+0.13077136131373085, -0.25226550575610440, +0.34059329459812049, +1.0000000000000000
758isMatClass(mat, class = symmetric)
759T
760isMatClass(mat, class = hermitian)
761T
762isMatClass(mat, class = posdefmat)
763T
764if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
765
766mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
767mat
768+1.0000000000000000, +0.66501439449330602, -0.65457712331141948
769+0.66501439449330602, +1.0000000000000000, -0.72872262289195011
770-0.65457712331141948, -0.72872262289195011, +1.0000000000000000
771isMatClass(mat, class = symmetric)
772T
773isMatClass(mat, class = hermitian)
774T
775isMatClass(mat, class = posdefmat)
776T
777if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
778
779mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
780mat
781+1.0000000000000000, +0.24922386111340294
782+0.24922386111340294, +1.0000000000000000
783isMatClass(mat, class = symmetric)
784T
785isMatClass(mat, class = hermitian)
786T
787isMatClass(mat, class = posdefmat)
788T
789if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
790
791mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
792mat
793+1.0000000000000000, +0.41105813956804632
794+0.41105813956804632, +1.0000000000000000
795isMatClass(mat, class = symmetric)
796T
797isMatClass(mat, class = hermitian)
798T
799isMatClass(mat, class = posdefmat)
800T
801if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
802
803mat = getCovRand(mold = 5._TKG, ndim = int(getUnifRand(2, 8), IK))
804mat
805+1.0000000000000000, -0.70212386190566545, -0.63258966919504245, +0.34843988249551638, +0.18576774329701187, +0.21646554775341179
806-0.70212386190566545, +1.0000000000000000, +0.54262439923477024, +0.15709715954331738, -0.40156275560031102, -0.17807757154785608
807-0.63258966919504245, +0.54262439923477024, +1.0000000000000000, -0.44739416963464818, -0.63020336231790142, -0.43638802798517867E-1
808+0.34843988249551638, +0.15709715954331738, -0.44739416963464818, +1.0000000000000000, -0.27736723697241672E-1, -0.49347738221042714
809+0.18576774329701187, -0.40156275560031102, -0.63020336231790142, -0.27736723697241672E-1, +1.0000000000000000, +0.41814084497976345
810+0.21646554775341179, -0.17807757154785608, -0.43638802798517867E-1, -0.49347738221042714, +0.41814084497976345, +1.0000000000000000
811isMatClass(mat, class = symmetric)
812T
813isMatClass(mat, class = hermitian)
814T
815isMatClass(mat, class = posdefmat)
816T
817if (.not. isMatClass(mat, class = posdefmat)) error stop 'The output matrix from `getCovRand()` must be positive-definite. Please report this to developers.'
818
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: