14 type(display_type) :: disp
15 character(:, SK),
allocatable :: cform, rform, iform
16 integer(IK) :: nrow, ncol, ndum, roffA, coffA, roffB, coffB, roffC, coffC, incB, incC
17 cform
= getFormat([
cmplx(
0.,
0., TKG)], ed
= SK_
'f', signed
= .true.)
18 rform
= getFormat([
real(
0., TKG)], ed
= SK_
'f', signed
= .true.)
19 iform
= getFormat([
0_IK], ed
= SK_
'i', signed
= .true.)
24 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
25 call disp%show(
"! BLAS 2 - GEMV: General matrix-vector multiplications - integer")
26 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
32 integer(TKG) :: alpha, beta
33 integer(TKG),
parameter :: DUM
= huge(DUM)
34 integer(TKG),
allocatable :: matA(:,:), matB(:), matC(:), refC(:)
38 matA
= reshape([
integer(TKG) :: DUM, DUM, DUM, DUM, DUM
&
39 , DUM, DUM,
1.0,
2.0,
3.0 &
40 , DUM, DUM,
2.0,
2.0,
4.0 &
41 , DUM, DUM,
3.0,
2.0,
2.0 &
42 , DUM, DUM,
4.0,
2.0,
1.0 &
43 , DUM, DUM, DUM, DUM, DUM
&
44 , DUM, DUM, DUM, DUM, DUM
&
45 , DUM, DUM, DUM, DUM, DUM
&
46 , DUM, DUM, DUM, DUM, DUM
&
47 , DUM, DUM, DUM, DUM, DUM
&
48 , DUM, DUM, DUM, DUM, DUM ], shape
= [
11,
5], order
= [
2,
1])
49 matB
= [
integer(TKG) :: DUM, DUM,
3.0,
2.0,
1.0 ]
50 matC
= [
integer(TKG) ::
4.0, DUM,
5.0, DUM,
2.0, DUM,
3.0 ]
51 refC
= [
integer(TKG) ::
14.0, DUM,
19.0, DUM,
17.0, DUM,
20.0 ]
54 call disp%show( matA ,
format = iform )
56 call disp%show( matB ,
format = iform )
58 call disp%show( matC ,
format = iform )
59 call disp%show(
"alpha = 1._TKG; beta = 1._TKG; nrow = 4; ncol = 3; roffA = 1; coffA = 2; incB = 1; incC = 2;")
60 alpha
= 1._TKG; beta
= 1._TKG; nrow
= 4; ncol
= 3; roffA
= 1; coffA
= 2; incB
= 1; incC
= 2;
62 call disp%show(
"call setMatMulAdd(matA, matB(3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC) ! full contiguous interface.")
63 call setMatMulAdd(matA, matB(
3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC)
65 call disp%show( matC ,
format = iform )
67 call disp%show( matC
- refC ,
format = iform )
69 call disp%show(
"matC = [ integer(TKG) :: 4.0, DUM, 5.0, DUM, 2.0, DUM, 3.0 ]")
70 matC
= [
integer(TKG) ::
4.0, DUM,
5.0, DUM,
2.0, DUM,
3.0 ]
71 call disp%show(
"call setMatMulAdd(matA(2:5, 3:5), matB(3:), matC(1::incC)) ! simplified interface.")
72 call setMatMulAdd(matA(
2:
5,
3:
5), matB(
3:), matC(
1::incC))
74 call disp%show( matC ,
format = iform )
76 call disp%show( matC
- refC ,
format = iform )
81 matA
= reshape([
integer(TKG) :: DUM, DUM, DUM, DUM, DUM
&
82 , DUM, DUM,
1.0,
2.0,
3.0 &
83 , DUM, DUM,
2.0,
2.0,
4.0 &
84 , DUM, DUM,
3.0,
2.0,
2.0 &
85 , DUM, DUM,
4.0,
2.0,
1.0 &
86 , DUM, DUM, DUM, DUM, DUM
&
87 , DUM, DUM, DUM, DUM, DUM
&
88 , DUM, DUM, DUM, DUM, DUM
&
89 , DUM, DUM, DUM, DUM, DUM
&
90 , DUM, DUM, DUM, DUM, DUM
&
91 , DUM, DUM, DUM, DUM, DUM ], shape
= [
11,
5], order
= [
2,
1])
92 matB
= [
integer(TKG) :: DUM, DUM,
3.0,
2.0,
1.0,
4.0 ]
93 matC
= [
integer(TKG) ::
1.0, DUM,
2.0, DUM,
3.0 ]
94 refC
= [
integer(TKG) ::
28.0, DUM,
24.0, DUM,
29.0 ]
97 call disp%show( matA ,
format = iform )
99 call disp%show( matB ,
format = iform )
101 call disp%show( matC ,
format = iform )
102 call disp%show(
"alpha = 1._TKG; beta = 2._TKG; nrow = 4; ncol = 3; roffA = 1; coffA = 2; incB = 1; incC = 2;")
103 alpha
= 1._TKG; beta
= 2._TKG; nrow
= 4; ncol
= 3; roffA
= 1; coffA
= 2; incB
= 1; incC
= 2;
105 call disp%show(
"call setMatMulAdd(matA, transSymm, matB(3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC) ! full contiguous interface.")
106 call setMatMulAdd(matA, transSymm, matB(
3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC)
108 call disp%show( matC ,
format = iform )
110 call disp%show( matC
- refC ,
format = iform )
112 call disp%show(
"matC = [ integer(TKG) :: 1.0, DUM, 2.0, DUM, 3.0 ]")
113 matC
= [
integer(TKG) ::
1.0, DUM,
2.0, DUM,
3.0 ]
114 call disp%show(
"call setMatMulAdd(matA(2:5, 3:5), transSymm, matB(3:), matC(1::incC), beta = beta) ! simplified interface.")
115 call setMatMulAdd(matA(
2:
5,
3:
5), transSymm, matB(
3:), matC(
1::incC), beta
= beta)
117 call disp%show( matC ,
format = iform )
119 call disp%show( matC
- refC ,
format = iform )
124 matA
= reshape([
integer(TKG) :: DUM, DUM, DUM, DUM, DUM
&
125 , DUM, DUM,
1.0,
2.0,
3.0 &
126 , DUM, DUM,
2.0,
2.0,
4.0 &
127 , DUM, DUM,
3.0,
2.0,
2.0 &
128 , DUM, DUM,
4.0,
2.0,
1.0 &
129 , DUM, DUM, DUM, DUM, DUM
&
130 , DUM, DUM, DUM, DUM, DUM
&
131 , DUM, DUM, DUM, DUM, DUM
&
132 , DUM, DUM, DUM, DUM, DUM
&
133 , DUM, DUM, DUM, DUM, DUM
&
134 , DUM, DUM, DUM, DUM, DUM ], shape
= [
11,
5], order
= [
2,
1])
135 matB
= [
integer(TKG) :: DUM, DUM,
3.0,
2.0,
1.0 ]
136 matC
= [
integer(TKG) ::
4.0, DUM,
5.0, DUM,
2.0, DUM,
3.0 ]
137 refC
= [
integer(TKG) ::
14.0, DUM,
19.0, DUM,
17.0, DUM,
20.0 ]
140 call disp%show( matA ,
format = iform )
142 call disp%show( matB ,
format = iform )
144 call disp%show( matC ,
format = iform )
145 call disp%show(
"alpha = 1._TKG; beta = 1._TKG; nrow = 4; ncol = 3; roffA = 1; coffA = 2; incB = 1; incC = 2;")
146 alpha
= 1._TKG; beta
= 1._TKG; nrow
= 4; ncol
= 3; roffA
= 1; coffA
= 2; incB
= 1; incC
= 2;
148 call disp%show(
"call setMatMulAdd(matA, matB(3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC) ! full contiguous interface.")
149 call setMatMulAdd(matA, matB(
3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC)
151 call disp%show( matC ,
format = iform )
153 call disp%show( matC
- refC ,
format = iform )
155 call disp%show(
"matC = [ integer(TKG) :: 4.0, DUM, 5.0, DUM, 2.0, DUM, 3.0 ]")
156 matC
= [
integer(TKG) ::
4.0, DUM,
5.0, DUM,
2.0, DUM,
3.0 ]
157 call disp%show(
"call setMatMulAdd(matA(2:5, 3:5), matB(3:), matC(1::incC)) ! simplified interface.")
158 call setMatMulAdd(matA(
2:
5,
3:
5), matB(
3:), matC(
1::incC))
160 call disp%show( matC ,
format = iform )
162 call disp%show( matC
- refC ,
format = iform )
170 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
171 call disp%show(
"! BLAS 2 - GEMV: General matrix-vector multiplications - complex")
172 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
178 complex(TKG) :: alpha, beta
179 complex(TKG),
parameter :: COMPLEXDUM
= cmplx(
huge(
0._TKG),
huge(
0._TKG), TKG)
180 complex(TKG),
allocatable :: matA(:,:), matB(:), matC(:), refC(:)
184 matA
= reshape([
complex(TKG) :: COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
185 , COMPLEXDUM, COMPLEXDUM, (
1.0,
2.0), (
3.0,
5.0), (
2.0,
0.0)
&
186 , COMPLEXDUM, COMPLEXDUM, (
2.0,
3.0), (
7.0,
9.0), (
4.0,
8.0)
&
187 , COMPLEXDUM, COMPLEXDUM, (
7.0,
4.0), (
1.0,
4.0), (
6.0,
0.0)
&
188 , COMPLEXDUM, COMPLEXDUM, (
8.0,
2.0), (
2.0,
5.0), (
8.0,
0.0)
&
189 , COMPLEXDUM, COMPLEXDUM, (
9.0,
1.0), (
3.0,
6.0), (
1.0,
0.0)
&
190 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
191 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
192 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
193 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
194 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM ], shape
= [
11,
5], order
= [
2,
1])
195 matB
= [
complex(TKG) :: COMPLEXDUM, COMPLEXDUM, (
1.0,
2.0), (
4.0,
0.0), (
1.0,
1.0) ]
196 matC
= [
complex(TKG) :: (
1.0,
2.0), (
4.0,
0.0), (
1.0,
-1.0), (
3.0,
4.0), (
2.0,
0.0) ]
197 refC
= [
complex(TKG) :: (
12.0,
28.0), (
24.0,
55.0), (
10.0,
39.0), (
23.0,
50.0), (
22.0,
44.0) ]
200 call disp%show( matA ,
format = cform )
202 call disp%show( matB ,
format = cform )
204 call disp%show( matC ,
format = cform )
205 call disp%show(
"alpha = 1._TKG; beta = 1._TKG; nrow = 5; ncol = 3; roffA = 1; coffA = 2; incB = 1; incC = 1;")
206 alpha
= 1._TKG; beta
= 1._TKG; nrow
= 5; ncol
= 3; roffA
= 1; coffA
= 2; incB
= 1; incC
= 1;
208 call disp%show(
"call setMatMulAdd(matA, matB(3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC) ! full contiguous interface.")
209 call setMatMulAdd(matA, matB(
3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC)
211 call disp%show( matC ,
format = cform )
213 call disp%show( matC
- refC ,
format = cform )
215 call disp%show(
"matC = [ complex(TKG) :: (1.0, 2.0), (4.0, 0.0), (1.0, -1.0), (3.0, 4.0), (2.0, 0.0) ]")
216 matC
= [
complex(TKG) :: (
1.0,
2.0), (
4.0,
0.0), (
1.0,
-1.0), (
3.0,
4.0), (
2.0,
0.0) ]
217 call disp%show(
"call setMatMulAdd(matA(2:5, 3:5), matB(3:), matC(1::incC)) ! simplified interface.")
218 call setMatMulAdd(matA(
2:
6,
3:
5), matB(
3:), matC(
1::incC))
220 call disp%show( matC ,
format = cform )
222 call disp%show( matC
- refC ,
format = cform )
227 matA
= reshape([
complex(TKG) :: COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
228 , COMPLEXDUM, COMPLEXDUM, (
1.0,
2.0), (
3.0,
5.0), (
2.0,
0.0)
&
229 , COMPLEXDUM, COMPLEXDUM, (
2.0,
3.0), (
7.0,
9.0), (
4.0,
8.0)
&
230 , COMPLEXDUM, COMPLEXDUM, (
7.0,
4.0), (
1.0,
4.0), (
6.0,
0.0)
&
231 , COMPLEXDUM, COMPLEXDUM, (
8.0,
2.0), (
2.0,
5.0), (
8.0,
0.0)
&
232 , COMPLEXDUM, COMPLEXDUM, (
9.0,
1.0), (
3.0,
6.0), (
1.0,
0.0)
&
233 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
234 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
235 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
236 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
237 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM ], shape
= [
11,
5], order
= [
2,
1])
238 matB
= [
complex(TKG) :: COMPLEXDUM, COMPLEXDUM, (
1.0,
2.0), (
4.0,
0.0), (
1.0,
1.0), (
3.0,
4.0), (
2.0,
0.0) ]
239 matC
= [
complex(TKG) :: COMPLEXDUM, COMPLEXDUM, COMPLEXDUM ]
240 refC
= [
complex(TKG) :: (
42.0,
67.0), (
10.0,
87.0), (
50.0,
74.0) ]
243 call disp%show( matA ,
format = cform )
245 call disp%show( matB ,
format = cform )
247 call disp%show( matC ,
format = cform )
248 call disp%show(
"alpha = 1._TKG; beta = 0._TKG; nrow = 5; ncol = 3; roffA = 1; coffA = 2; incB = 1; incC = 1;")
249 alpha
= 1._TKG; beta
= 0._TKG; nrow
= 5; ncol
= 3; roffA
= 1; coffA
= 2; incB
= 1; incC
= 1;
251 call disp%show(
"call setMatMulAdd(matA, transSymm, matB(3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC) ! full contiguous interface.")
252 call setMatMulAdd(matA, transSymm, matB(
3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC)
254 call disp%show( matC ,
format = cform )
256 call disp%show( matC
- refC ,
format = cform )
258 call disp%show(
"matC = [ complex(TKG) :: COMPLEXDUM, COMPLEXDUM, COMPLEXDUM ]")
259 matC
= [
complex(TKG) :: COMPLEXDUM, COMPLEXDUM, COMPLEXDUM ]
260 call disp%show(
"call setMatMulAdd(matA(2:5, 3:5), transSymm, matB(3:), matC(1::incC), beta = beta) ! simplified interface.")
261 call setMatMulAdd(matA(
2:
6,
3:
5), transSymm, matB(
3:), matC(
1::incC), beta
= beta)
263 call disp%show( matC ,
format = cform )
265 call disp%show( matC
- refC ,
format = cform )
270 matA
= reshape([
complex(TKG) :: COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
271 , COMPLEXDUM, COMPLEXDUM, (
1.0,
2.0), (
3.0,
5.0), (
2.0,
0.0)
&
272 , COMPLEXDUM, COMPLEXDUM, (
2.0,
3.0), (
7.0,
9.0), (
4.0,
8.0)
&
273 , COMPLEXDUM, COMPLEXDUM, (
7.0,
4.0), (
1.0,
4.0), (
6.0,
0.0)
&
274 , COMPLEXDUM, COMPLEXDUM, (
8.0,
2.0), (
2.0,
5.0), (
8.0,
0.0)
&
275 , COMPLEXDUM, COMPLEXDUM, (
9.0,
1.0), (
3.0,
6.0), (
1.0,
0.0)
&
276 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
277 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
278 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
279 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
280 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM ], shape
= [
11,
5], order
= [
2,
1])
281 matB
= [
complex(TKG) :: COMPLEXDUM, COMPLEXDUM, (
1.0,
2.0), (
4.0,
0.0), (
1.0,
1.0), (
3.0,
4.0), (
2.0,
0.0) ]
282 matC
= [
complex(TKG) :: (
1.0,
2.0), (
4.0,
0.0), (
1.0,
-1.0) ]
283 refC
= [
complex(TKG) :: (
-73.0,
-13.0), (
-74.0,
57.0), (
-49.0,
-11.0) ]
286 call disp%show( matA ,
format = cform )
288 call disp%show( matB ,
format = cform )
290 call disp%show( matC ,
format = cform )
291 call disp%show(
"alpha = -1._TKG; beta = 1._TKG; nrow = 5; ncol = 3; roffA = 1; coffA = 2; incB = 1; incC = 1;")
292 alpha
= -1._TKG; beta
= 1._TKG; nrow
= 5; ncol
= 3; roffA
= 1; coffA
= 2; incB
= 1; incC
= 1;
294 call disp%show(
"call setMatMulAdd(matA, transHerm, matB(3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC) ! full contiguous interface.")
295 call setMatMulAdd(matA, transHerm, matB(
3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC)
297 call disp%show( matC ,
format = cform )
299 call disp%show( matC
- refC ,
format = cform )
301 call disp%show(
"matC = [ complex(TKG) :: (1.0, 2.0), (4.0, 0.0), (1.0, -1.0) ]")
302 matC
= [
complex(TKG) :: (
1.0,
2.0), (
4.0,
0.0), (
1.0,
-1.0) ]
303 call disp%show(
"call setMatMulAdd(matA(2:5, 3:5), transHerm, matB(3:), matC(1::incC), alpha) ! simplified interface.")
304 call setMatMulAdd(matA(
2:
6,
3:
5), transHerm, matB(
3:), matC(
1::incC), alpha)
306 call disp%show( matC ,
format = cform )
308 call disp%show( matC
- refC ,
format = cform )
316 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
317 call disp%show(
"! BLAS 2 - GEMV: General matrix-vector multiplications - real")
318 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
324 real(TKG) :: alpha, beta
325 real(TKG),
parameter :: DUM
= huge(DUM)
326 real(TKG),
allocatable :: matA(:,:), matB(:), matC(:), refC(:)
330 matA
= reshape([
real(TKG) :: DUM, DUM, DUM, DUM, DUM
&
331 , DUM, DUM,
1.0,
2.0,
3.0 &
332 , DUM, DUM,
2.0,
2.0,
4.0 &
333 , DUM, DUM,
3.0,
2.0,
2.0 &
334 , DUM, DUM,
4.0,
2.0,
1.0 &
335 , DUM, DUM, DUM, DUM, DUM
&
336 , DUM, DUM, DUM, DUM, DUM
&
337 , DUM, DUM, DUM, DUM, DUM
&
338 , DUM, DUM, DUM, DUM, DUM
&
339 , DUM, DUM, DUM, DUM, DUM
&
340 , DUM, DUM, DUM, DUM, DUM ], shape
= [
11,
5], order
= [
2,
1])
341 matB
= [
real(TKG) :: DUM, DUM,
3.0,
2.0,
1.0 ]
342 matC
= [
real(TKG) ::
4.0, DUM,
5.0, DUM,
2.0, DUM,
3.0 ]
343 refC
= [
real(TKG) ::
14.0, DUM,
19.0, DUM,
17.0, DUM,
20.0 ]
346 call disp%show( matA ,
format = rform )
348 call disp%show( matB ,
format = rform )
350 call disp%show( matC ,
format = rform )
351 call disp%show(
"alpha = 1._TKG; beta = 1._TKG; nrow = 4; ncol = 3; roffA = 1; coffA = 2; incB = 1; incC = 2;")
352 alpha
= 1._TKG; beta
= 1._TKG; nrow
= 4; ncol
= 3; roffA
= 1; coffA
= 2; incB
= 1; incC
= 2;
354 call disp%show(
"call setMatMulAdd(matA, matB(3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC) ! full contiguous interface.")
355 call setMatMulAdd(matA, matB(
3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC)
357 call disp%show( matC ,
format = rform )
359 call disp%show( matC
- refC ,
format = rform )
361 call disp%show(
"matC = [ real(TKG) :: 4.0, DUM, 5.0, DUM, 2.0, DUM, 3.0 ]")
362 matC
= [
real(TKG) ::
4.0, DUM,
5.0, DUM,
2.0, DUM,
3.0 ]
363 call disp%show(
"call setMatMulAdd(matA(2:5, 3:5), matB(3:), matC(1::incC)) ! simplified interface.")
364 call setMatMulAdd(matA(
2:
5,
3:
5), matB(
3:), matC(
1::incC))
366 call disp%show( matC ,
format = rform )
368 call disp%show( matC
- refC ,
format = rform )
373 matA
= reshape([
real(TKG) :: DUM, DUM, DUM, DUM, DUM
&
374 , DUM, DUM,
1.0,
2.0,
3.0 &
375 , DUM, DUM,
2.0,
2.0,
4.0 &
376 , DUM, DUM,
3.0,
2.0,
2.0 &
377 , DUM, DUM,
4.0,
2.0,
1.0 &
378 , DUM, DUM, DUM, DUM, DUM
&
379 , DUM, DUM, DUM, DUM, DUM
&
380 , DUM, DUM, DUM, DUM, DUM
&
381 , DUM, DUM, DUM, DUM, DUM
&
382 , DUM, DUM, DUM, DUM, DUM
&
383 , DUM, DUM, DUM, DUM, DUM ], shape
= [
11,
5], order
= [
2,
1])
384 matB
= [
real(TKG) :: DUM, DUM,
3.0,
2.0,
1.0,
4.0 ]
385 matC
= [
real(TKG) ::
1.0, DUM,
2.0, DUM,
3.0 ]
386 refC
= [
real(TKG) ::
28.0, DUM,
24.0, DUM,
29.0 ]
389 call disp%show( matA ,
format = rform )
391 call disp%show( matB ,
format = rform )
393 call disp%show( matC ,
format = rform )
394 call disp%show(
"alpha = 1._TKG; beta = 2._TKG; nrow = 4; ncol = 3; roffA = 1; coffA = 2; incB = 1; incC = 2;")
395 alpha
= 1._TKG; beta
= 2._TKG; nrow
= 4; ncol
= 3; roffA
= 1; coffA
= 2; incB
= 1; incC
= 2;
397 call disp%show(
"call setMatMulAdd(matA, transSymm, matB(3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC) ! full contiguous interface.")
398 call setMatMulAdd(matA, transSymm, matB(
3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC)
400 call disp%show( matC ,
format = rform )
402 call disp%show( matC
- refC ,
format = rform )
404 call disp%show(
"matC = [ real(TKG) :: 1.0, DUM, 2.0, DUM, 3.0 ]")
405 matC
= [
real(TKG) ::
1.0, DUM,
2.0, DUM,
3.0 ]
406 call disp%show(
"call setMatMulAdd(matA(2:5, 3:5), transSymm, matB(3:), matC(1::incC), beta = beta) ! simplified interface.")
407 call setMatMulAdd(matA(
2:
5,
3:
5), transSymm, matB(
3:), matC(
1::incC), beta
= beta)
409 call disp%show( matC ,
format = rform )
411 call disp%show( matC
- refC ,
format = rform )
416 matA
= reshape([
real(TKG) :: DUM, DUM, DUM, DUM, DUM
&
417 , DUM, DUM,
1.0,
2.0,
3.0 &
418 , DUM, DUM,
2.0,
2.0,
4.0 &
419 , DUM, DUM,
3.0,
2.0,
2.0 &
420 , DUM, DUM,
4.0,
2.0,
1.0 &
421 , DUM, DUM, DUM, DUM, DUM
&
422 , DUM, DUM, DUM, DUM, DUM
&
423 , DUM, DUM, DUM, DUM, DUM
&
424 , DUM, DUM, DUM, DUM, DUM
&
425 , DUM, DUM, DUM, DUM, DUM
&
426 , DUM, DUM, DUM, DUM, DUM ], shape
= [
11,
5], order
= [
2,
1])
427 matB
= [
real(TKG) :: DUM, DUM,
3.0,
2.0,
1.0 ]
428 matC
= [
real(TKG) ::
4.0, DUM,
5.0, DUM,
2.0, DUM,
3.0 ]
429 refC
= [
real(TKG) ::
14.0, DUM,
19.0, DUM,
17.0, DUM,
20.0 ]
432 call disp%show( matA ,
format = rform )
434 call disp%show( matB ,
format = rform )
436 call disp%show( matC ,
format = rform )
437 call disp%show(
"alpha = 1._TKG; beta = 1._TKG; nrow = 4; ncol = 3; roffA = 1; coffA = 2; incB = 1; incC = 2;")
438 alpha
= 1._TKG; beta
= 1._TKG; nrow
= 4; ncol
= 3; roffA
= 1; coffA
= 2; incB
= 1; incC
= 2;
440 call disp%show(
"call setMatMulAdd(matA, matB(3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC) ! full contiguous interface.")
441 call setMatMulAdd(matA, matB(
3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC)
443 call disp%show( matC ,
format = rform )
445 call disp%show( matC
- refC ,
format = rform )
447 call disp%show(
"matC = [ real(TKG) :: 4.0, DUM, 5.0, DUM, 2.0, DUM, 3.0 ]")
448 matC
= [
real(TKG) ::
4.0, DUM,
5.0, DUM,
2.0, DUM,
3.0 ]
449 call disp%show(
"call setMatMulAdd(matA(2:5, 3:5), matB(3:), matC(1::incC)) ! simplified interface.")
450 call setMatMulAdd(matA(
2:
5,
3:
5), matB(
3:), matC(
1::incC))
452 call disp%show( matC ,
format = rform )
454 call disp%show( matC
- refC ,
format = rform )
464 real(TKG) :: alpha, beta
465 real(TKG),
parameter :: DUM
= huge(DUM)
466 real(TKG),
allocatable :: matA(:,:), matB(:), matC(:), refC(:)
470 matA
= reshape([
real(TKG) :: DUM, DUM, DUM, DUM, DUM
&
471 , DUM, DUM,
1.0,
2.0,
3.0 &
472 , DUM, DUM,
2.0,
2.0,
4.0 &
473 , DUM, DUM,
3.0,
2.0,
2.0 &
474 , DUM, DUM,
4.0,
2.0,
1.0 &
475 , DUM, DUM, DUM, DUM, DUM
&
476 , DUM, DUM, DUM, DUM, DUM
&
477 , DUM, DUM, DUM, DUM, DUM
&
478 , DUM, DUM, DUM, DUM, DUM
&
479 , DUM, DUM, DUM, DUM, DUM
&
480 , DUM, DUM, DUM, DUM, DUM ], shape
= [
11,
5], order
= [
2,
1])
481 matB
= [
real(TKG) :: DUM, DUM,
3.0,
2.0,
1.0 ]
482 matC
= [
real(TKG) ::
4.0, DUM,
5.0, DUM,
2.0, DUM,
3.0 ]
483 refC
= [
real(TKG) ::
14.0, DUM,
19.0, DUM,
17.0, DUM,
20.0 ]
486 call disp%show( matA ,
format = rform )
488 call disp%show( matB ,
format = rform )
490 call disp%show( matC ,
format = rform )
491 call disp%show(
"alpha = 1._TKG; beta = 1._TKG; nrow = 4; ncol = 3; roffA = 1; coffA = 2; incB = 1; incC = 2;")
492 alpha
= 1._TKG; beta
= 1._TKG; nrow
= 4; ncol
= 3; roffA
= 1; coffA
= 2; incB
= 1; incC
= 2;
494 call disp%show(
"call setMatMulAdd(matA, matB(3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC) ! full contiguous interface.")
495 call setMatMulAdd(matA, matB(
3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC)
497 call disp%show( matC ,
format = rform )
499 call disp%show( matC
- refC ,
format = rform )
501 call disp%show(
"matC = [ real(TKG) :: 4.0, DUM, 5.0, DUM, 2.0, DUM, 3.0 ]")
502 matC
= [
real(TKG) ::
4.0, DUM,
5.0, DUM,
2.0, DUM,
3.0 ]
503 call disp%show(
"call setMatMulAdd(matA(2:5, 3:5), matB(3:), matC(1::incC)) ! simplified interface.")
504 call setMatMulAdd(matA(
2:
5,
3:
5), matB(
3:), matC(
1::incC))
506 call disp%show( matC ,
format = rform )
508 call disp%show( matC
- refC ,
format = rform )
513 matA
= reshape([
real(TKG) :: DUM, DUM, DUM, DUM, DUM
&
514 , DUM, DUM,
1.0,
2.0,
3.0 &
515 , DUM, DUM,
2.0,
2.0,
4.0 &
516 , DUM, DUM,
3.0,
2.0,
2.0 &
517 , DUM, DUM,
4.0,
2.0,
1.0 &
518 , DUM, DUM, DUM, DUM, DUM
&
519 , DUM, DUM, DUM, DUM, DUM
&
520 , DUM, DUM, DUM, DUM, DUM
&
521 , DUM, DUM, DUM, DUM, DUM
&
522 , DUM, DUM, DUM, DUM, DUM
&
523 , DUM, DUM, DUM, DUM, DUM ], shape
= [
11,
5], order
= [
2,
1])
524 matB
= [
real(TKG) :: DUM, DUM,
3.0,
2.0,
1.0,
4.0 ]
525 matC
= [
real(TKG) ::
1.0, DUM,
2.0, DUM,
3.0 ]
526 refC
= [
real(TKG) ::
28.0, DUM,
24.0, DUM,
29.0 ]
529 call disp%show( matA ,
format = rform )
531 call disp%show( matB ,
format = rform )
533 call disp%show( matC ,
format = rform )
534 call disp%show(
"alpha = 1._TKG; beta = 2._TKG; nrow = 4; ncol = 3; roffA = 1; coffA = 2; incB = 1; incC = 2;")
535 alpha
= 1._TKG; beta
= 2._TKG; nrow
= 4; ncol
= 3; roffA
= 1; coffA
= 2; incB
= 1; incC
= 2;
537 call disp%show(
"call setMatMulAdd(matA, transSymm, matB(3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC) ! full contiguous interface.")
538 call setMatMulAdd(matA, transSymm, matB(
3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC)
540 call disp%show( matC ,
format = rform )
542 call disp%show( matC
- refC ,
format = rform )
544 call disp%show(
"matC = [ real(TKG) :: 1.0, DUM, 2.0, DUM, 3.0 ]")
545 matC
= [
real(TKG) ::
1.0, DUM,
2.0, DUM,
3.0 ]
546 call disp%show(
"call setMatMulAdd(matA(2:5, 3:5), transSymm, matB(3:), matC(1::incC), beta = beta) ! simplified interface.")
547 call setMatMulAdd(matA(
2:
5,
3:
5), transSymm, matB(
3:), matC(
1::incC), beta
= beta)
549 call disp%show( matC ,
format = rform )
551 call disp%show( matC
- refC ,
format = rform )
556 matA
= reshape([
real(TKG) :: DUM, DUM, DUM, DUM, DUM
&
557 , DUM, DUM,
1.0,
2.0,
3.0 &
558 , DUM, DUM,
2.0,
2.0,
4.0 &
559 , DUM, DUM,
3.0,
2.0,
2.0 &
560 , DUM, DUM,
4.0,
2.0,
1.0 &
561 , DUM, DUM, DUM, DUM, DUM
&
562 , DUM, DUM, DUM, DUM, DUM
&
563 , DUM, DUM, DUM, DUM, DUM
&
564 , DUM, DUM, DUM, DUM, DUM
&
565 , DUM, DUM, DUM, DUM, DUM
&
566 , DUM, DUM, DUM, DUM, DUM ], shape
= [
11,
5], order
= [
2,
1])
567 matB
= [
real(TKG) :: DUM, DUM,
3.0,
2.0,
1.0 ]
568 matC
= [
real(TKG) ::
4.0, DUM,
5.0, DUM,
2.0, DUM,
3.0 ]
569 refC
= [
real(TKG) ::
14.0, DUM,
19.0, DUM,
17.0, DUM,
20.0 ]
572 call disp%show( matA ,
format = rform )
574 call disp%show( matB ,
format = rform )
576 call disp%show( matC ,
format = rform )
577 call disp%show(
"alpha = 1._TKG; beta = 1._TKG; nrow = 4; ncol = 3; roffA = 1; coffA = 2; incB = 1; incC = 2;")
578 alpha
= 1._TKG; beta
= 1._TKG; nrow
= 4; ncol
= 3; roffA
= 1; coffA
= 2; incB
= 1; incC
= 2;
580 call disp%show(
"call setMatMulAdd(matA, matB(3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC) ! full contiguous interface.")
581 call setMatMulAdd(matA, matB(
3:), matC, alpha, beta, nrow, ncol, roffA, coffA, incB, incC)
583 call disp%show( matC ,
format = rform )
585 call disp%show( matC
- refC ,
format = rform )
587 call disp%show(
"matC = [ real(TKG) :: 4.0, DUM, 5.0, DUM, 2.0, DUM, 3.0 ]")
588 matC
= [
real(TKG) ::
4.0, DUM,
5.0, DUM,
2.0, DUM,
3.0 ]
589 call disp%show(
"call setMatMulAdd(matA(2:5, 3:5), matB(3:), matC(1::incC)) ! simplified interface.")
590 call setMatMulAdd(matA(
2:
5,
3:
5), matB(
3:), matC(
1::incC))
592 call disp%show( matC ,
format = rform )
594 call disp%show( matC
- refC ,
format = rform )
602 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
603 call disp%show(
"! Complete general integer matrix-matrix multiplications.")
604 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
611 integer(TKG),
allocatable, dimension(:,:) :: matA, matB, matC, refC
612 integer(TKG) :: alpha, beta
613 integer(IK) :: nrow, ncol
615 alpha
= 2_TKG; beta
= 3_TKG
616 nrow
= 2; ncol
= 2; ndum
= 3
617 allocate(matA(nrow, ndum), matB(ndum, ncol), matC(nrow, ncol))
620 call disp%show(
"call setUnifRand(matA, lb = -10_TKG, ub = +10_TKG)")
622 call disp%show(
"call setUnifRand(matB, lb = -10_TKG, ub = +10_TKG)")
624 call disp%show(
"call setUnifRand(matC, lb = -10_TKG, ub = +10_TKG)")
627 call disp%show( matA ,
format = iform )
629 call disp%show( matB ,
format = iform )
631 call disp%show( matC ,
format = iform )
634 call disp%show(
"[nrow, ncol, ndum]")
635 call disp%show( [nrow, ncol, ndum] )
636 call disp%show(
"refC = matmul(alpha * matA, matB) + beta * matC ! reference value.")
637 refC
= matmul(alpha
* matA, matB)
+ beta
* matC
638 call disp%show(
"call setMatMulAdd(matA, matB, matC, alpha, beta)")
641 call disp%show( matC
- refC ,
format = iform )
643 call disp%show(
"call setUnifRand(matC, lb = -10_TKG, ub = +10_TKG) ! reset for new multiplication.")
645 call disp%show(
"matA = transpose(matA)")
646 matA
= transpose(matA)
648 call disp%show( matA ,
format = iform )
650 call disp%show( matC ,
format = iform )
651 call disp%show(
"refC = matmul(alpha * transpose(matA), matB) + beta * matC ! reference value.")
652 refC
= matmul(alpha
* transpose(matA), matB)
+ beta
* matC
653 call disp%show(
"call setMatMulAdd(matA, transSymm, matB, matC, alpha, beta)")
654 call setMatMulAdd(matA, transSymm, matB, matC, alpha, beta)
656 call disp%show( matC
- refC ,
format = iform )
662 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
663 call disp%show(
"! Complete general complex matrix-matrix multiplications.")
664 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
671 complex(TKG),
allocatable, dimension(:,:) :: matA, matB, matC, refC
672 complex(TKG) :: alpha, beta
673 integer(IK) :: nrow, ncol
675 nrow
= 2; ncol
= 2; ndum
= 3
676 alpha
= (
1._TKG,
0._TKG); beta
= (
0._TKG,
0._TKG)
677 allocate(matA(nrow, ndum), matB(ndum, ncol), matC(nrow, ncol))
680 call disp%show(
"call setUnifRand(matA)")
682 call disp%show(
"call setUnifRand(matB)")
684 call disp%show(
"call setUnifRand(matC)")
687 call disp%show( matA ,
format = cform )
689 call disp%show( matB ,
format = cform )
691 call disp%show( matC ,
format = cform )
694 call disp%show(
"[nrow, ncol, ndum]")
695 call disp%show( [nrow, ncol, ndum] )
696 call disp%show(
"refC = matmul(alpha * matA, matB) + beta * matC ! reference value.")
697 refC
= matmul(alpha
* matA, matB)
+ beta
* matC
698 call disp%show(
"call setMatMulAdd(matA, matB, matC, alpha, beta)")
701 call disp%show( matC
- refC ,
format = cform )
703 call disp%show(
"call setUnifRand(matC) ! reset for new multiplication.")
705 call disp%show(
"matA = conjg(transpose(matA))")
706 matA
= conjg(
transpose(matA))
708 call disp%show( matA ,
format = cform )
710 call disp%show( matC ,
format = cform )
711 call disp%show(
"refC = matmul(alpha * conjg(transpose(matA)), matB) + beta * matC ! reference value.")
712 refC
= matmul(alpha
* conjg(
transpose(matA)), matB)
+ beta
* matC
713 call disp%show(
"call setMatMulAdd(matA, transHerm, matB, matC, alpha, beta)")
714 call setMatMulAdd(matA, transHerm, matB, matC, alpha, beta)
716 call disp%show( matC
- refC ,
format = cform )
722 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
723 call disp%show(
"! Subset general integer matrix-matrix multiplication.")
724 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
730 integer(TKG) :: alpha, beta
731 integer(TKG),
parameter :: DUM
= huge(DUM)
732 integer(TKG),
allocatable, dimension(:,:) :: matA, matB, matC, refC
736 matA
= reshape( [
integer(TKG) ::
1.0,
2.0,
-1.0,
-1.0,
4.0 &
737 ,
2.0,
0.0,
1.0,
1.0,
-1.0 &
738 ,
1.0,
-1.0,
-1.0,
1.0,
2.0 &
739 ,
-3.0,
2.0,
2.0,
2.0,
0.0 &
740 ,
4.0,
0.0,
-2.0,
1.0,
-1.0 &
741 ,
-1.0,
-1.0,
1.0,
-3.0,
2.0 &
742 , DUM, DUM, DUM, DUM, DUM
&
743 , DUM, DUM, DUM, DUM, DUM ], shape
= [
8,
5], order
= [
2,
1])
744 matB
= reshape( [
integer(TKG) ::
1.0,
-1.0,
0.0,
2.0 &
745 ,
2.0,
2.0,
-1.0,
-2.0 &
746 ,
1.0,
0.0,
-1.0,
1.0 &
747 ,
-3.0,
-1.0,
1.0,
-1.0 &
748 ,
4.0,
2.0,
-1.0,
1.0 &
749 , DUM, DUM, DUM, DUM ], shape
= [
6,
4], order
= [
2,
1])
750 matC
= reshape( [
integer(TKG) ::
1.0,
1.0,
1.0,
1.0 &
751 ,
1.0,
1.0,
1.0,
1.0 &
752 ,
1.0,
1.0,
1.0,
1.0 &
753 ,
1.0,
1.0,
1.0,
1.0 &
754 ,
1.0,
1.0,
1.0,
1.0 &
755 ,
1.0,
1.0,
1.0,
1.0 &
756 , DUM, DUM, DUM, DUM ], shape
= [
6,
4], order
= [
2,
1])
757 refC
= reshape( [
integer(TKG) ::
24.0,
13.0,
-5.0,
3.0 &
758 ,
-3.0,
-4.0,
2.0,
4.0 &
759 ,
4.0,
1.0,
2.0,
5.0 &
760 ,
-2.0,
6.0,
-1.0,
-9.0 &
761 ,
-4.0,
-6.0,
5.0,
5.0 &
762 ,
16.0,
7.0,
-4.0,
7.0 &
763 , DUM, DUM, DUM, DUM ], shape
= [
6,
4], order
= [
2,
1])
766 call disp%show( matA ,
format = iform )
768 call disp%show( matB ,
format = iform )
770 call disp%show( matC ,
format = iform )
771 call disp%show(
"alpha = 1._TKG; beta = 1._TKG; nrow = 6; ncol = 4; ndum = 5; roffA = 0; coffA = 0; roffB = 0; coffB = 0; roffC = 0; coffC = 0;")
772 alpha
= 1._TKG; beta
= 1._TKG; nrow
= 6; ncol
= 4; ndum
= 5; roffA
= 0; coffA
= 0; roffB
= 0; coffB
= 0; roffC
= 0; coffC
= 0;
773 call disp%show(
"call setMatMulAdd(matA, matB, matC, alpha, beta, nrow, ncol, ndum, roffA, coffA, roffB, coffB, roffC, coffC)")
774 call setMatMulAdd(matA, matB, matC, alpha, beta, nrow, ncol, ndum, roffA, coffA, roffB, coffB, roffC, coffC)
776 call disp%show( matC ,
format = iform )
778 call disp%show( matC
- refC ,
format = iform )
783 matA
= reshape( [
integer(TKG) ::
1.0,
-3.0 &
786 , DUM, DUM ], shape
= [
4,
2], order
= [
2,
1])
787 matB
= reshape( [
integer(TKG) ::
1.0,
-3.0 &
789 ,
1.0,
-1.0 ], shape
= [
3,
2], order
= [
2,
1])
790 matC
= reshape( [
integer(TKG) ::
1.0,
1.0,
1.0 &
794 , DUM, DUM, DUM ], shape
= [
5,
3], order
= [
2,
1])
795 refC
= reshape( [
integer(TKG) ::
11.0,
-9.,
5.0 &
799 , DUM, DUM, DUM ], shape
= [
5,
3], order
= [
2,
1])
802 call disp%show( matA ,
format = iform )
804 call disp%show( matB ,
format = iform )
806 call disp%show( matC ,
format = iform )
807 call disp%show(
"alpha = 1._TKG; beta = 1._TKG; nrow = 3; ncol = 3; ndum = 2; roffA = 0; coffA = 0; roffB = 0; coffB = 0; roffC = 0; coffC = 0;")
808 alpha
= 1._TKG; beta
= 1._TKG; nrow
= 3; ncol
= 3; ndum
= 2; roffA
= 0; coffA
= 0; roffB
= 0; coffB
= 0; roffC
= 0; coffC
= 0;
809 call disp%show(
"call setMatMulAdd(matA, matB, transSymm, matC, alpha, beta, nrow, ncol, ndum, roffA, coffA, roffB, coffB, roffC, coffC)")
810 call setMatMulAdd(matA, matB, transSymm, matC, alpha, beta, nrow, ncol, ndum, roffA, coffA, roffB, coffB, roffC, coffC)
812 call disp%show( matC ,
format = iform )
814 call disp%show( matC
- refC ,
format = iform )
820 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
821 call disp%show(
"! Subset general complex matrix-matrix multiplication.")
822 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
828 complex(TKG) :: alpha, beta
829 complex(TKG),
parameter :: COMPLEXDUM
= cmplx(
huge(
0._TKG),
huge(
0._TKG), TKG)
830 complex(TKG),
allocatable, dimension(:,:) :: matA, matB, matC, refC
834 matA
= reshape( [
complex(TKG) :: (
1.0,
5.0), (
9.0,
2.0), (
1.0,
9.0)
&
835 , (
2.0,
4.0), (
8.0,
3.0), (
1.0,
8.0)
&
836 , (
3.0,
3.0), (
7.0,
5.0), (
1.0,
7.0)
&
837 , (
4.0,
2.0), (
4.0,
7.0), (
1.0,
5.0)
&
838 , (
5.0,
1.0), (
5.0,
1.0), (
1.0,
6.0)
&
839 , (
6.0,
6.0), (
3.0,
6.0), (
1.0,
4.0)
&
840 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
841 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM ], shape
= [
8,
3], order
= [
2,
1])
842 matB
= reshape( [
complex(TKG) :: (
1.0,
8.0), (
2.0,
7.0)
&
843 , (
4.0,
4.0), (
6.0,
8.0)
&
844 , (
6.0,
2.0), (
4.0,
5.0)
&
845 , COMPLEXDUM, COMPLEXDUM ], shape
= [
4,
2], order
= [
2,
1])
846 matC
= reshape( [
complex(TKG) :: (
0.5,
0.0), (
0.5,
0.0)
&
847 , (
0.5,
0.0), (
0.5,
0.0)
&
848 , (
0.5,
0.0), (
0.5,
0.0)
&
849 , (
0.5,
0.0), (
0.5,
0.0)
&
850 , (
0.5,
0.0), (
0.5,
0.0)
&
851 , (
0.5,
0.0), (
0.5,
0.0)
&
852 , COMPLEXDUM, COMPLEXDUM
&
853 , COMPLEXDUM, COMPLEXDUM ], shape
= [
8,
2], order
= [
2,
1])
854 refC
= reshape( [
complex(TKG) :: (
-22.0,
113.0), (
-35.0,
142.0)
&
855 , (
-19.0,
114.0), (
-35.0,
141.0)
&
856 , (
-20.0,
119.0), (
-43.0,
146.0)
&
857 , (
-27.0,
110.0), (
-58.0,
131.0)
&
858 , (
8.0,
103.0), (
0.0,
112.0)
&
859 , (
-55.0,
116.0), (
-75.0,
135.0)
&
860 , COMPLEXDUM, COMPLEXDUM
&
861 , COMPLEXDUM, COMPLEXDUM ], shape
= [
8,
2], order
= [
2,
1])
864 call disp%show( matA ,
format = cform )
866 call disp%show( matB ,
format = cform )
868 call disp%show( matC ,
format = cform )
869 call disp%show(
"alpha = (1._TKG, 0._TKG); beta = (2._TKG, 0._TKG); nrow = 6; ncol = 2; ndum = 3; roffA = 0; coffA = 0; roffB = 0; coffB = 0; roffC = 0; coffC = 0;")
870 alpha
= (
1._TKG,
0._TKG); beta
= (
2._TKG,
0._TKG); nrow
= 6; ncol
= 2; ndum
= 3; roffA
= 0; coffA
= 0; roffB
= 0; coffB
= 0; roffC
= 0; coffC
= 0;
871 call disp%show(
"call setMatMulAdd(matA, matB, matC, alpha, beta, nrow, ncol, ndum, roffA, coffA, roffB, coffB, roffC, coffC)")
872 call setMatMulAdd(matA, matB, matC, alpha, beta, nrow, ncol, ndum, roffA, coffA, roffB, coffB, roffC, coffC)
874 call disp%show( matC ,
format = cform )
876 call disp%show( matC
- refC ,
format = cform )
881 matA
= reshape( [
complex(TKG) :: (
1.0,
3.0), (
-3.0,
2.0)
&
882 , (
2.0,
5.0), (
4.0,
6.0)
&
883 , (
1.0,
1.0), (
-1.0,
9.0) ], shape
= [
3,
2], order
= [
2,
1])
884 matB
= reshape( [
complex(TKG) :: (
1.0,
2.0), (
-3.0,
2.0)
&
885 , (
2.0,
6.0), (
4.0,
5.0)
&
886 , (
1.0,
2.0), (
-1.0,
8.0)
&
887 , COMPLEXDUM, COMPLEXDUM ], shape
= [
4,
2], order
= [
2,
1])
888 matC
= reshape( [
complex(TKG) :: COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
889 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
890 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
891 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM ], shape
= [
4,
3], order
= [
2,
1])
892 refC
= reshape( [
complex(TKG) :: (
20.0,
1.0), (
18.0,
23.0), (
26.0,
23.0)
&
893 , (
12.0,
-25.0), (
80.0,
2.0), (
56.0,
-37.0)
&
894 , (
24.0,
-26.0), (
49.0,
37.0), (
76.0,
-2.0)
&
895 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM ], shape
= [
4,
3], order
= [
2,
1])
898 call disp%show( matA ,
format = cform )
900 call disp%show( matB ,
format = cform )
901 call disp%show(
"matC ! Note that the initialization is irrelevant because `beta = (0., 0.)`.")
902 call disp%show( matC ,
format = cform )
903 call disp%show(
"alpha = (1._TKG, 0._TKG); beta = (0._TKG, 0._TKG); nrow = 3; ncol = 3; ndum = 2; roffA = 0; coffA = 0; roffB = 0; coffB = 0; roffC = 0; coffC = 0;")
904 alpha
= (
1._TKG,
0._TKG); beta
= (
0._TKG,
0._TKG); nrow
= 3; ncol
= 3; ndum
= 2; roffA
= 0; coffA
= 0; roffB
= 0; coffB
= 0; roffC
= 0; coffC
= 0;
905 call disp%show(
"call setMatMulAdd(matA, matB, transHerm, matC, alpha, beta, nrow, ncol, ndum, roffA, coffA, roffB, coffB, roffC, coffC)")
906 call setMatMulAdd(matA, matB, transHerm, matC, alpha, beta, nrow, ncol, ndum, roffA, coffA, roffB, coffB, roffC, coffC)
908 call disp%show( matC ,
format = cform )
910 call disp%show( matC
- refC ,
format = cform )
916 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
917 call disp%show(
"! Subset general real matrix-matrix multiplication.")
918 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
923 real(TKG) :: alpha, beta
924 real(TKG),
parameter :: DUM
= huge(DUM)
925 real(TKG),
allocatable, dimension(:,:) :: matA, matB, matC, refC
929 matA
= reshape([
real(TKG) ::
1.0,
2.0,
-1.0,
-1.0,
4.0 &
930 ,
2.0,
0.0,
1.0,
1.0,
-1.0 &
931 ,
1.0,
-1.0,
-1.0,
1.0,
2.0 &
932 ,
-3.0,
2.0,
2.0,
2.0,
0.0 &
933 ,
4.0,
0.0,
-2.0,
1.0,
-1.0 &
934 ,
-1.0,
-1.0,
1.0,
-3.0,
2.0 &
935 , DUM, DUM, DUM, DUM, DUM
&
936 , DUM, DUM, DUM, DUM, DUM ], shape
= [
8,
5], order
= [
2,
1])
937 matB
= reshape([
real(TKG) ::
1.0,
-1.0,
0.0,
2.0 &
938 ,
2.0,
2.0,
-1.0,
-2.0 &
939 ,
1.0,
0.0,
-1.0,
1.0 &
940 ,
-3.0,
-1.0,
1.0,
-1.0 &
941 ,
4.0,
2.0,
-1.0,
1.0 &
942 , DUM, DUM, DUM, DUM ], shape
= [
6,
4], order
= [
2,
1])
943 matC
= reshape([
real(TKG) ::
0.5,
0.5,
0.5,
0.5 &
944 ,
0.5,
0.5,
0.5,
0.5 &
945 ,
0.5,
0.5,
0.5,
0.5 &
946 ,
0.5,
0.5,
0.5,
0.5 &
947 ,
0.5,
0.5,
0.5,
0.5 &
948 ,
0.5,
0.5,
0.5,
0.5 &
949 , DUM, DUM, DUM, DUM ], shape
= [
6,
4], order
= [
2,
1])
950 refC
= reshape([
real(TKG) ::
24.0,
13.0,
-5.0,
3.0 &
951 ,
-3.0,
-4.0,
2.0,
4.0 &
952 ,
4.0,
1.0,
2.0,
5.0 &
953 ,
-2.0,
6.0,
-1.0,
-9.0 &
954 ,
-4.0,
-6.0,
5.0,
5.0 &
955 ,
16.0,
7.0,
-4.0,
7.0 &
956 , DUM, DUM, DUM, DUM ], shape
= [
6,
4], order
= [
2,
1])
959 call disp%show( matA ,
format = rform )
961 call disp%show( matB ,
format = rform )
963 call disp%show( matC ,
format = rform )
964 call disp%show(
"alpha = 1._TKG; beta = 2._TKG; nrow = 6; ncol = 4; ndum = 5; roffA = 0; coffA = 0; roffB = 0; coffB = 0; roffC = 0; coffC = 0;")
965 alpha
= 1._TKG; beta
= 2._TKG; nrow
= 6; ncol
= 4; ndum
= 5; roffA
= 0; coffA
= 0; roffB
= 0; coffB
= 0; roffC
= 0; coffC
= 0;
966 call disp%show(
"call setMatMulAdd(matA, matB, matC, alpha, beta, nrow, ncol, ndum, roffA, coffA, roffB, coffB, roffC, coffC)")
967 call setMatMulAdd(matA, matB, matC, alpha, beta, nrow, ncol, ndum, roffA, coffA, roffB, coffB, roffC, coffC)
969 call disp%show( matC ,
format = rform )
971 call disp%show( matC
- refC ,
format = rform )
976 matA
= reshape([
real(TKG) ::
1.0,
-3.0 &
979 , DUM, DUM ], shape
= [
4,
2], order
= [
2,
1])
980 matB
= reshape([
real(TKG) ::
1.0,
-3.0 &
982 ,
1.0,
-1.0 ], shape
= [
3,
2], order
= [
2,
1])
983 matC
= reshape([
real(TKG) ::
0.5,
0.5,
0.5 &
987 , DUM, DUM, DUM ], shape
= [
5,
3], order
= [
2,
1])
988 refC
= reshape([
real(TKG) ::
11.0,
-9.,
5.0 &
992 , DUM, DUM, DUM ], shape
= [
5,
3], order
= [
2,
1])
995 call disp%show( matA ,
format = rform )
997 call disp%show( matB ,
format = rform )
999 call disp%show( matC ,
format = rform )
1000 call disp%show(
"alpha = 1._TKG; beta = 2._TKG; nrow = 3; ncol = 3; ndum = 2; roffA = 0; coffA = 0; roffB = 0; coffB = 0; roffC = 0; coffC = 0;")
1001 alpha
= 1._TKG; beta
= 2._TKG; nrow
= 3; ncol
= 3; ndum
= 2; roffA
= 0; coffA
= 0; roffB
= 0; coffB
= 0; roffC
= 0; coffC
= 0;
1002 call disp%show(
"call setMatMulAdd(matA, matB, transSymm, matC, alpha, beta, nrow, ncol, ndum, roffA, coffA, roffB, coffB, roffC, coffC)")
1003 call setMatMulAdd(matA, matB, transSymm, matC, alpha, beta, nrow, ncol, ndum, roffA, coffA, roffB, coffB, roffC, coffC)
1005 call disp%show( matC ,
format = rform )
1007 call disp%show( matC
- refC ,
format = rform )
1013 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
1014 call disp%show(
"! Subset symmetric complex matrix-matrix multiplication.")
1015 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
1021 complex(TKG) :: alpha, beta
1022 real(TKG),
parameter :: DUM
= huge(DUM)
1023 complex(TKG),
parameter :: COMPLEXDUM
= cmplx(
huge(
0._TKG),
huge(
0._TKG), TKG)
1024 complex(TKG),
allocatable, dimension(:,:) :: matA, matB, matC, refC
1028 matB
= reshape( [
complex(TKG) :: (
1.0,
5.0), (
-3.0,
2.0), (
1.0,
6.0)
&
1029 , COMPLEXDUM, (
4.0,
5.0), (
-1.0,
4.0)
&
1030 , COMPLEXDUM, COMPLEXDUM, (
2.0,
5.0)
&
1031 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
1032 ], shape
= [
4,
3], order
= [
2,
1])
1033 matA
= reshape( [
complex(TKG) :: (
1.0,
1.0), (
-3.0,
2.0), (
3.0,
3.0)
&
1034 , (
2.0,
6.0), (
4.0,
5.0), (
-1.0,
4.0)
&
1035 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
1036 ], shape
= [
3,
3], order
= [
2,
1])
1037 matC
= reshape( [
complex(TKG) :: (
13.0,
6.0), (
-18.0,
6.0), (
10.0,
7.0)
&
1038 , (
-11.0,
8.0), (
11.0,
1.0), (
-4.0,
2.0)
&
1039 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
1040 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
1041 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
1042 ], shape
= [
5,
3], order
= [
2,
1])
1043 refC
= reshape( [
complex(TKG) :: (
-96.0,
72.0), (
-141.0,
-226.0), (
-112.0,
38.0)
&
1044 , (
-230.0,
-269.0), (
-133.0,
-23.0), (
-272.0,
-198.0)
&
1045 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
1046 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
1047 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
1048 ], shape
= [
5,
3], order
= [
2,
1])
1051 call disp%show( matA ,
format = cform )
1053 call disp%show( matB ,
format = cform )
1055 call disp%show( matC ,
format = cform )
1056 call disp%show(
"alpha = (2._TKG, 3._TKG); beta = (1._TKG, 6._TKG); nrow = 2; ncol = 3; roffA = 0; coffA = 0; roffB = 0; coffB = 0; roffC = 0; coffC = 0;")
1057 alpha
= (
2._TKG,
3._TKG); beta
= (
1._TKG,
6._TKG); nrow
= 2; ncol
= 3; roffA
= 0; coffA
= 0; roffB
= 0; coffB
= 0; roffC
= 0; coffC
= 0;
1058 call disp%show(
"call setMatMulAdd(matA, matB, symmetric, uppDia, matC, alpha, beta, nrow, ncol, roffA, coffA, roffB, coffB, roffC, coffC)")
1059 call setMatMulAdd(matA, matB, symmetric, uppDia, matC, alpha, beta, nrow, ncol, roffA, coffA, roffB, coffB, roffC, coffC)
1061 call disp%show( matC ,
format = cform )
1063 call disp%show( matC
- refC ,
format = cform )
1068 matB
= reshape( [
complex(TKG) :: (
1.0, DUM), COMPLEXDUM, COMPLEXDUM
&
1069 , (
3.0,
2.0), (
4.0, DUM), COMPLEXDUM
&
1070 , (
-1.0,
6.0), (
1.0,
4.0), (
2.0, DUM)
&
1071 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
1072 ], shape
= [
4,
3], order
= [
2,
1])
1073 matA
= reshape( [
complex(TKG) :: (
1.0,
1.0), (
-3.0,
2.0), (
3.0,
3.0)
&
1074 , (
2.0,
6.0), (
4.0,
5.0), (
-1.0,
4.0)
&
1075 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
1076 ], shape
= [
3,
3], order
= [
2,
1])
1077 matC
= reshape( [
complex(TKG) :: (
13.0,
6.0), (
-18.0,
6.0), (
10.0,
7.0)
&
1078 , (
-11.0,
8.0), (
11.0,
1.0), (
-4.0,
2.0)
&
1079 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
1080 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
1081 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
1082 ], shape
= [
5,
3], order
= [
2,
1])
1083 refC
= reshape( [
complex(TKG) :: (
-137.0,
17.0), (
-158.0,
-102.0), (
-39.0,
141.0)
&
1084 , (
-154.0,
-77.0), (
-63.0,
186.0), (
159.0,
104.0)
&
1085 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
1086 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
1087 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
1088 ], shape
= [
5,
3], order
= [
2,
1])
1091 call disp%show( matA ,
format = cform )
1093 call disp%show( matB ,
format = cform )
1095 call disp%show( matC ,
format = cform )
1096 call disp%show(
"alpha = (2._TKG, 3._TKG); beta = (1._TKG, 6._TKG); nrow = 2; ncol = 3; roffA = 0; coffA = 0; roffB = 0; coffB = 0; roffC = 0; coffC = 0;")
1097 alpha
= (
2._TKG,
3._TKG); beta
= (
1._TKG,
6._TKG); nrow
= 2; ncol
= 3; roffA
= 0; coffA
= 0; roffB
= 0; coffB
= 0; roffC
= 0; coffC
= 0;
1098 call disp%show(
"call setMatMulAdd(matA, matB, hermitian, lowDia, matC, alpha, beta, nrow, ncol, roffA, coffA, roffB, coffB, roffC, coffC)")
1099 call setMatMulAdd(matA, matB, hermitian, lowDia, matC, alpha, beta, nrow, ncol, roffA, coffA, roffB, coffB, roffC, coffC)
1101 call disp%show( matC ,
format = cform )
1103 call disp%show( matC
- refC ,
format = cform )
1109 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
1110 call disp%show(
"! Subset symmetric real matrix-matrix multiplication.")
1111 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
1116 real(TKG) :: alpha, beta
1117 real(TKG),
parameter :: DUM
= huge(DUM)
1118 real(TKG),
allocatable, dimension(:,:) :: matA, matB, matC, refC
1120 matA
= reshape([
real(TKG) ::
1.0,
2.0,
-1.0,
-1.0,
4.0 &
1121 , DUM,
0.0,
1.0,
1.0,
-1.0 &
1122 , DUM, DUM,
-1.0,
1.0,
2.0 &
1123 , DUM, DUM, DUM,
2.0,
0.0 &
1124 , DUM, DUM, DUM, DUM,
-1.0 &
1125 , DUM, DUM, DUM, DUM, DUM
&
1126 , DUM, DUM, DUM, DUM, DUM
&
1127 , DUM, DUM, DUM, DUM, DUM
&
1128 ], shape
= [
8,
5], order
= [
2,
1])
1129 matB
= reshape([
real(TKG) ::
1.0,
-1.0,
0.0,
2.0 &
1130 ,
2.0,
2.0,
-1.0,
-2.0 &
1131 ,
1.0,
0.0,
-1.0,
1.0 &
1132 ,
-3.0,
-1.0,
1.0,
-1.0 &
1133 ,
4.0,
2.0,
-1.0,
1.0 &
1134 , DUM, DUM, DUM, DUM
&
1135 ], shape
= [
6,
4], order
= [
2,
1])
1136 matC
= reshape([
real(TKG) ::
23.0,
12.0,
-6.0,
2.0 &
1137 ,
-4.0,
-5.0,
1.0,
3.0 &
1138 ,
5.0,
6.0,
-1.0,
-4.0 &
1139 ,
-4.0,
1.0,
0.0,
-5.0 &
1140 ,
8.0,
-4.0,
-2.0,
13.0 &
1141 ], shape
= [
5,
4], order
= [
2,
1])
1142 refC
= reshape([
real(TKG) ::
69.0,
36.0,
-18.0,
6.0 &
1143 ,
-12.0,
-15.0,
3.0,
9.0 &
1144 ,
15.0,
18.0,
-3.0,
-12.0 &
1145 ,
-12.0,
3.0,
0.0,
-15.0 &
1146 ,
8.0,
-20.0,
-2.0,
35.0 &
1147 ], shape
= [
5,
4], order
= [
2,
1])
1150 call disp%show( matA ,
format = rform )
1152 call disp%show( matB ,
format = rform )
1154 call disp%show( matC ,
format = rform )
1155 call disp%show(
"alpha = 2._TKG; beta = 1._TKG; nrow = 5; ncol = 4; roffA = 0; coffA = 0; roffB = 0; coffB = 0; roffC = 0; coffC = 0;")
1156 alpha
= 2._TKG; beta
= 1._TKG; nrow
= 5; ncol
= 4; roffA
= 0; coffA
= 0; roffB
= 0; coffB
= 0; roffC
= 0; coffC
= 0;
1157 call disp%show(
"call setMatMulAdd(matA, symmetric, uppDia, matB, matC, alpha, beta, nrow, ncol, roffA, coffA, roffB, coffB, roffC, coffC)")
1158 call setMatMulAdd(matA, symmetric, uppDia, matB, matC, alpha, beta, nrow, ncol, roffA, coffA, roffB, coffB, roffC, coffC)
1160 call disp%show( matC ,
format = rform )
1162 call disp%show( matC
- refC ,
format = rform )
1165 matC
= reshape([
real(TKG) ::
23.0,
12.0,
-6.0,
2.0 &
1166 ,
-4.0,
-5.0,
1.0,
3.0 &
1167 ,
5.0,
6.0,
-1.0,
-4.0 &
1168 ,
-4.0,
1.0,
0.0,
-5.0 &
1169 ,
8.0,
-4.0,
-2.0,
13.0 &
1170 ], shape
= [
5,
4], order
= [
2,
1])
1172 call disp%show( matC ,
format = rform )
1173 call disp%show(
"call setMatMulAdd(matA(1:5, 1:5), symmetric, uppDia, matB(1:5, 1:4), matC, alpha, beta)")
1174 call setMatMulAdd(matA(
1:
5,
1:
5), symmetric, uppDia, matB(
1:
5,
1:
4), matC, alpha, beta)
1176 call disp%show( matC ,
format = rform )
1178 call disp%show( matC
- refC ,
format = rform )
1183 matA
= reshape([
real(TKG) ::
1.0, DUM, DUM
&
1187 ], shape
= [
4,
3], order
= [
2,
1])
1188 matB
= reshape([
real(TKG) ::
1.0,
-3.0,
2.0,
2.0,
-1.0,
2.0 &
1189 ,
2.0,
4.0,
0.0,
0.0,
1.0,
-2.0 &
1190 ,
1.0,
-1.0,
-1.0,
-1.0,
-1.0,
1.0 &
1191 ], shape
= [
3,
6], order
= [
2,
1])
1192 matC
= reshape([
real(TKG) ::
6.0,
4.0,
1.0,
1.0,
0.0,
-1.0 &
1193 ,
9.0,
11.0,
5.0,
5.0,
3.0,
-5.0 &
1194 ,
-2.0,
-6.0,
3.0,
3.0,
-1.0,
32.0 &
1195 , DUM, DUM, DUM, DUM, DUM, DUM
&
1196 , DUM, DUM, DUM, DUM, DUM, DUM
&
1197 ], shape
= [
5,
6], order
= [
2,
1])
1198 refC
= reshape([
real(TKG) ::
24.0,
16.0,
4.0,
4.0,
0.0,
-4.0 &
1199 ,
36.0,
44.0,
20.0,
20.0,
12.0,
-20.0 &
1200 ,
-8.0,
-24.0,
12.0,
12.0,
-4.0,
70.0 &
1201 , DUM, DUM, DUM, DUM, DUM, DUM
&
1202 , DUM, DUM, DUM, DUM, DUM, DUM
&
1203 ], shape
= [
5,
6], order
= [
2,
1])
1206 call disp%show( matA ,
format = rform )
1208 call disp%show( matB ,
format = rform )
1210 call disp%show( matC ,
format = rform )
1211 call disp%show(
"alpha = 2._TKG; beta = 2._TKG; nrow = 3; ncol = 6; roffA = 0; coffA = 0; roffB = 0; coffB = 0; roffC = 0; coffC = 0;")
1212 alpha
= 2._TKG; beta
= 2._TKG; nrow
= 3; ncol
= 6; roffA
= 0; coffA
= 0; roffB
= 0; coffB
= 0; roffC
= 0; coffC
= 0;
1213 call disp%show(
"call setMatMulAdd(matA, symmetric, lowDia, matB, matC, alpha, beta, nrow, ncol, roffA, coffA, roffB, coffB, roffC, coffC)")
1214 call setMatMulAdd(matA, symmetric, lowDia, matB, matC, alpha, beta, nrow, ncol, roffA, coffA, roffB, coffB, roffC, coffC)
1216 call disp%show( matC ,
format = rform )
1218 call disp%show( matC
- refC ,
format = rform )
1221 matC
= reshape([
real(TKG) ::
6.0,
4.0,
1.0,
1.0,
0.0,
-1.0 &
1222 ,
9.0,
11.0,
5.0,
5.0,
3.0,
-5.0 &
1223 ,
-2.0,
-6.0,
3.0,
3.0,
-1.0,
32.0 &
1224 , DUM, DUM, DUM, DUM, DUM, DUM
&
1225 , DUM, DUM, DUM, DUM, DUM, DUM
&
1226 ], shape
= [
5,
6], order
= [
2,
1])
1228 call disp%show( matC ,
format = rform )
1229 call disp%show(
"call setMatMulAdd(matA(1:3, 1:3), symmetric, lowDia, matB(1:3, 1:6), matC(1:3, 1:6), alpha, beta)")
1230 call setMatMulAdd(matA(
1:
3,
1:
3), symmetric, lowDia, matB(
1:
3,
1:
6), matC(
1:
3,
1:
6), alpha, beta)
1232 call disp%show( matC ,
format = rform )
1234 call disp%show( matC
- refC ,
format = rform )
1239 matB
= reshape([
real(TKG) ::
1.0,
-3.0,
1.0 &
1243 ], shape
= [
4,
3], order
= [
2,
1])
1244 matA
= reshape([
real(TKG) ::
1.0,
-3.0,
3.0 &
1247 ], shape
= [
3,
3], order
= [
2,
1])
1248 matC
= reshape([
real(TKG) ::
13.0,
-18.0,
10.0 &
1249 ,
-11.0,
11.0,
-4.0 &
1253 ], shape
= [
5,
3], order
= [
2,
1])
1254 refC
= reshape([
real(TKG) ::
39.0,
-54.0,
30.0 &
1255 ,
-33.0,
33.0,
-12.0 &
1259 ], shape
= [
5,
3], order
= [
2,
1])
1262 call disp%show( matA ,
format = rform )
1264 call disp%show( matB ,
format = rform )
1266 call disp%show( matC ,
format = rform )
1267 call disp%show(
"alpha = 2._TKG; beta = 1._TKG; nrow = 2; ncol = 3; roffA = 0; coffA = 0; roffB = 0; coffB = 0; roffC = 0; coffC = 0;")
1268 alpha
= 2._TKG; beta
= 1._TKG; nrow
= 2; ncol
= 3; roffA
= 0; coffA
= 0; roffB
= 0; coffB
= 0; roffC
= 0; coffC
= 0;
1269 call disp%show(
"call setMatMulAdd(matA, matB, symmetric, uppDia, matC, alpha, beta, nrow, ncol, roffA, coffA, roffB, coffB, roffC, coffC)")
1270 call setMatMulAdd(matA, matB, symmetric, uppDia, matC, alpha, beta, nrow, ncol, roffA, coffA, roffB, coffB, roffC, coffC)
1272 call disp%show( matC ,
format = rform )
1274 call disp%show( matC
- refC ,
format = rform )
1277 matC
= reshape([
real(TKG) ::
13.0,
-18.0,
10.0 &
1278 ,
-11.0,
11.0,
-4.0 &
1282 ], shape
= [
5,
3], order
= [
2,
1])
1284 call disp%show( matC ,
format = rform )
1285 call disp%show(
"call setMatMulAdd(matA(1:2, 1:3), matB(1:3, 1:3), symmetric, uppDia, matC(1:2, 1:3), alpha, beta)")
1286 call setMatMulAdd(matA(
1:
2,
1:
3), matB(
1:
3,
1:
3), symmetric, uppDia, matC(
1:
2,
1:
3), alpha, beta)
1288 call disp%show( matC ,
format = rform )
1290 call disp%show( matC
- refC ,
format = rform )
1295 matB
= reshape([
real(TKG) ::
1.0, DUM, DUM
&
1298 ], shape
= [
3,
3], order
= [
2,
1])
1299 matA
= reshape([
real(TKG) ::
1.0,
-3.0,
2.0 &
1302 ], shape
= [
3,
3], order
= [
2,
1])
1303 matC
= reshape([
real(TKG) ::
1.0,
5.0,
-9.0 &
1304 ,
-3.0,
10.0,
-2.0 &
1306 ], shape
= [
3,
3], order
= [
2,
1])
1307 refC
= reshape([
real(TKG) ::
4.0,
11.0,
15.0 &
1308 ,
-13.0,
-34.0,
-48.0 &
1310 ], shape
= [
3,
3], order
= [
2,
1])
1313 call disp%show( matA ,
format = rform )
1315 call disp%show( matB ,
format = rform )
1317 call disp%show( matC ,
format = rform )
1318 call disp%show(
"alpha = -1._TKG; beta = 1._TKG; nrow = 3; ncol = 3; roffA = 0; coffA = 0; roffB = 0; coffB = 0; roffC = 0; coffC = 0;")
1319 alpha
= -1._TKG; beta
= 1._TKG; nrow
= 3; ncol
= 3; roffA
= 0; coffA
= 0; roffB
= 0; coffB
= 0; roffC
= 0; coffC
= 0;
1320 call disp%show(
"call setMatMulAdd(matA, matB, symmetric, lowDia, matC, alpha, beta, nrow, ncol, roffA, coffA, roffB, coffB, roffC, coffC)")
1321 call setMatMulAdd(matA, matB, symmetric, lowDia, matC, alpha, beta, nrow, ncol, roffA, coffA, roffB, coffB, roffC, coffC)
1323 call disp%show( matC ,
format = rform )
1325 call disp%show( matC
- refC ,
format = rform )
1328 matC
= reshape([
real(TKG) ::
1.0,
5.0,
-9.0 &
1329 ,
-3.0,
10.0,
-2.0 &
1331 ], shape
= [
3,
3], order
= [
2,
1])
1333 call disp%show( matC ,
format = rform )
1334 call disp%show(
"call setMatMulAdd(matA(1:3, 1:3), matB(1:3, 1:3), symmetric, lowDia, matC(1:3, 1:3), alpha, beta)")
1335 call setMatMulAdd(matA(
1:
3,
1:
3), matB(
1:
3,
1:
3), symmetric, lowDia, matC(
1:
3,
1:
3), alpha, beta)
1337 call disp%show( matC ,
format = rform )
1339 call disp%show( matC
- refC ,
format = rform )
1345 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
1346 call disp%show(
"! Subset symmetric real matrix-vector multiplication.")
1347 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
1352 real(TKG) :: alpha, beta
1353 real(TKG) ,
parameter :: DUM
= huge(DUM)
1354 real(TKG) ,
allocatable :: matA(:,:), matB(:), matC(:), refC(:)
1355 integer(IK) :: ndim, incB, incC
1357 matA
= reshape([
real(TKG) ::
8.0, DUM, DUM
&
1360 ], shape
= [
3,
3], order
= [
2,
1])
1361 matB
= [
3.00,
2.0,
1.00]
1362 matC
= [
5.00, DUM,
3.00, DUM,
2.00]
1363 refC
= [
39.0, DUM,
34.0, DUM,
25.0]
1366 call disp%show( matA ,
format = rform )
1368 call disp%show( matB ,
format = rform )
1370 call disp%show( matC ,
format = rform )
1371 call disp%show(
"alpha = 1._TKG; beta = 1._TKG; ndim = 3; roffA = 0; coffA = 0; incB = 1; incC = 2;")
1372 alpha
= 1._TKG; beta
= 1._TKG; ndim
= 3; roffA
= 0; coffA
= 0; incB
= 1; incC
= 2;
1373 call disp%show(
"call setMatMulAdd(matA, symmetric, lowDia, matB, matC, alpha, beta, ndim, roffA, coffA, incB, incC)")
1374 call setMatMulAdd(matA, symmetric, lowDia, matB, matC, alpha, beta, ndim, roffA, coffA, incB, incC)
1376 call disp%show( matC ,
format = rform )
1378 call disp%show( matC
- refC ,
format = rform )
1381 matB
= [
3.00,
2.0,
1.00]
1382 matC
= [
5.00,
3.00,
2.00]
1383 refC
= [
39.0,
34.0,
25.0]
1385 call disp%show( matB ,
format = rform )
1387 call disp%show( matC ,
format = rform )
1388 call disp%show(
"alpha = 1._TKG; beta = 1._TKG;")
1389 alpha
= 1._TKG; beta
= 1._TKG;
1390 call disp%show(
"call setMatMulAdd(matA, symmetric, lowDia, matB, matC, alpha, beta)")
1391 call setMatMulAdd(matA, symmetric, lowDia, matB, matC, alpha, beta)
1393 call disp%show( matC ,
format = rform )
1395 call disp%show( matC
- refC ,
format = rform )
1400 matA
= reshape([
real(TKG) ::
8.0,
4.0,
2.0 &
1404 ], shape
= [
3,
3], order
= [
2,
1])
1405 matB
= [
4.0, DUM,
2.0, DUM,
1.0]
1406 matC
= [
6.0,
5.0,
4.0]
1407 refC
= [
36.0,
54.0,
36.0]
1410 call disp%show( matA ,
format = rform )
1412 call disp%show( matB ,
format = rform )
1414 call disp%show( matC ,
format = rform )
1415 call disp%show(
"alpha = 1._TKG; beta = 2._TKG; ndim = 3; roffA = 0; coffA = 0; incB = -2; incC = 1;")
1416 alpha
= 1._TKG; beta
= 2._TKG; ndim
= 3; roffA
= 0; coffA
= 0; incB
= -2; incC
= 1;
1417 call disp%show(
"call setMatMulAdd(matA, symmetric, uppDia, matB, matC, alpha, beta, ndim, roffA, coffA, incB, incC)")
1418 call setMatMulAdd(matA, symmetric, uppDia, matB, matC, alpha, beta, ndim, roffA, coffA, incB, incC)
1420 call disp%show( matC ,
format = rform )
1422 call disp%show( matC
- refC ,
format = rform )
1425 matB
= matB(
size(matB):
1:incB)
1426 matC
= [
6.0,
5.0,
4.0]
1428 call disp%show( matB ,
format = rform )
1430 call disp%show( matC ,
format = rform )
1431 call disp%show(
"alpha = 1._TKG; beta = 2._TKG;")
1432 alpha
= 1._TKG; beta
= 2._TKG;
1433 call disp%show(
"call setMatMulAdd(matA, symmetric, uppDia, matB, matC, alpha, beta)")
1434 call setMatMulAdd(matA, symmetric, uppDia, matB, matC, alpha, beta)
1436 call disp%show( matC ,
format = rform )
1438 call disp%show( matC
- refC ,
format = rform )
1446 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
1447 call disp%show(
"! Subset Hermitian complex matrix-vector multiplication.")
1448 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
1454 complex(TKG) :: alpha, beta
1455 real(TKG) ,
parameter :: DUM
= huge(DUM)
1456 complex(TKG) ,
parameter :: COMPLEXDUM
= cmplx(
huge(
0._TKG),
huge(
0._TKG), TKG)
1457 complex(TKG) ,
allocatable :: matA(:,:), matB(:), matC(:), refC(:)
1458 integer(IK) :: ndim, incB, incC
1460 matA
= reshape([
real(TKG) :: (
1.0, DUM), COMPLEXDUM, COMPLEXDUM
&
1461 , (
3.0,
-5.0), (
7.0, DUM), COMPLEXDUM
&
1462 , (
2.0,
3.0), (
4.0,
8.0), (
6.0, DUM)
&
1463 ], shape
= [
3,
3], order
= [
2,
1])
1464 matB
= [(
1.0,
2.0), (
4.0,
0.0), (
3.0,
4.0)]
1465 matC
= [(
1.0,
0.0), COMPLEXDUM, (
2.0,
-1.0), COMPLEXDUM, (
2.0,
1.0)]
1466 refC
= [(
20.,
10.), COMPLEXDUM, (
45.,
21.0), COMPLEXDUM, (
38.,
29.)]
1469 call disp%show( matA ,
format = cform )
1471 call disp%show( matB ,
format = cform )
1473 call disp%show( matC ,
format = cform )
1474 call disp%show(
"alpha = (1._TKG, 0._TKG); beta = (1._TKG, 0._TKG); ndim = 3; roffA = 0; coffA = 0; incB = 1; incC = 2;")
1475 alpha
= (
1._TKG,
0._TKG); beta
= (
1._TKG,
0._TKG); ndim
= 3; roffA
= 0; coffA
= 0; incB
= 1; incC
= 2;
1476 call disp%show(
"call setMatMulAdd(matA, hermitian, lowDia, matB, matC, alpha, beta, ndim, roffA, coffA, incB, incC)")
1477 call setMatMulAdd(matA, hermitian, lowDia, matB, matC, alpha, beta, ndim, roffA, coffA, incB, incC)
1479 call disp%show( matC ,
format = cform )
1481 call disp%show( matC
- refC ,
format = cform )
1484 matC
= [(
1.0,
0.0), (
2.0,
-1.0), (
2.0,
1.0)]
1485 refC
= refC(
1::incC)
1487 call disp%show( matB ,
format = cform )
1489 call disp%show( matC ,
format = cform )
1490 call disp%show(
"call setMatMulAdd(matA, hermitian, lowDia, matB, matC, alpha, beta)")
1491 call setMatMulAdd(matA, hermitian, lowDia, matB, matC, alpha, beta)
1493 call disp%show( matC ,
format = cform )
1495 call disp%show( matC
- refC ,
format = cform )
1500 matA
= reshape([
real(TKG) :: COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM
&
1501 , COMPLEXDUM, COMPLEXDUM, (
1.0, DUM), (
3.0,
5.0), (
2.0,
-3.0)
&
1502 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, (
7.0, DUM), (
4.0,
-8.0)
&
1503 , COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, (
6.0, DUM)
&
1504 ], shape
= [
4,
5], order
= [
2,
1])
1505 matB
= [(
3.0,
4.0), COMPLEXDUM, (
4.0,
0.0), COMPLEXDUM, (
1.0,
2.0)]
1506 matC
= [COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM, COMPLEXDUM]
1507 refC
= [(
19.,
10.), COMPLEXDUM, (
43.,
22.), COMPLEXDUM, (
36.,
28.)]
1510 call disp%show( matA ,
format = cform )
1512 call disp%show( matB ,
format = cform )
1514 call disp%show( matC ,
format = cform )
1515 call disp%show(
"alpha = (1._TKG, 0._TKG); beta = (0._TKG, 0._TKG); ndim = 3; roffA = 1; coffA = 2; incB = -2; incC = 2;")
1516 alpha
= (
1._TKG,
0._TKG); beta
= (
0._TKG,
0._TKG); ndim
= 3; roffA
= 1; coffA
= 2; incB
= -2; incC
= 2;
1517 call disp%show(
"call setMatMulAdd(matA, hermitian, uppDia, matB, matC, alpha, beta, ndim, roffA, coffA, incB, incC)")
1518 call setMatMulAdd(matA, hermitian, uppDia, matB, matC, alpha, beta, ndim, roffA, coffA, incB, incC)
1520 call disp%show( matC ,
format = cform )
1522 call disp%show( matC
- refC ,
format = cform )
1526 matB
= matB(
size(matB):
1:incB)
1527 matC
= [COMPLEXDUM, COMPLEXDUM, COMPLEXDUM]
1528 refC
= refC(
1::
-incB)
1530 call disp%show( matA ,
format = cform )
1532 call disp%show( matB ,
format = cform )
1534 call disp%show( matC ,
format = cform )
1535 call disp%show(
"call setMatMulAdd(matA, hermitian, uppDia, matB, matC, alpha, beta)")
1536 call setMatMulAdd(matA, hermitian, uppDia, matB, matC, alpha, beta)
1538 call disp%show( matC ,
format = cform )
1540 call disp%show( matC
- refC ,
format = cform )
Generate and return an output array whose elements are the reversed-order elements of the input array...
Return a uniform random scalar or contiguous array of arbitrary rank of randomly uniformly distribute...
This is a generic method of the derived type display_type with pass attribute.
This is a generic method of the derived type display_type with pass attribute.
This module contains procedures and generic interfaces for reversing the order of elements in arrays ...
This module contains classes and procedures for computing various statistical quantities related to t...
This module contains classes and procedures for input/output (IO) or generic display operations on st...
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
integer, parameter CKS
The single-precision complex kind in Fortran mode. On most platforms, this is a 32-bit real kind.
integer, parameter IKS
The single-precision integer kind in Fortran mode. On most platforms, this is a 32-bit integer kind.
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
integer, parameter RKH
The scalar integer constant of intrinsic default kind, representing the highest-precision real kind t...
integer, parameter RKS
The single-precision real kind in Fortran mode. On most platforms, this is an 32-bit real kind.
Generate and return an object of type display_type.