|
4 | 4 | module test_sparse_spmv |
5 | 5 | use testdrive, only : new_unittest, unittest_type, error_type, check, skip_test |
6 | 6 | use stdlib_kinds, only: sp, dp, xdp, qp, int8, int16, int32, int64 |
| 7 | + use stdlib_linalg, only: hermitian |
| 8 | + use stdlib_math, only: all_close |
7 | 9 | use stdlib_sparse |
8 | 10 |
|
9 | 11 | implicit none |
@@ -408,14 +410,22 @@ contains |
408 | 410 |
|
409 | 411 | ! Test y = A @ x |
410 | 412 | y1 = matmul(Amat, x) ; call spmv(A, x, y2) |
411 | | - call check(error, all(y1 == y2)) |
| 413 | + call check(error, all_close(y1, y2)) |
412 | 414 | if (allocated(error)) return |
413 | 415 |
|
414 | 416 | ! Test y = A.T @ x |
415 | 417 | y1 = 0.0_wp ; y2 = 0.0_wp |
416 | 418 | y1 = matmul(transpose(Amat), x) ; call spmv(A, x, y2, op="T") |
417 | | - call check(error, all(y1 == y2)) |
| 419 | + call check(error, all_close(y1, y2)) |
418 | 420 | if (allocated(error)) return |
| 421 | + |
| 422 | + #:if t1.startswith('complex') |
| 423 | + ! Test y = A.H @ x |
| 424 | + y1 = 0.0_wp ; y2 = 0.0_wp |
| 425 | + y1 = matmul(hermitian(Amat), x) ; call spmv(A, x, y2, op="H") |
| 426 | + call check(error, all_close(y1, y2)) |
| 427 | + if (allocated(error)) return |
| 428 | + #:endif |
419 | 429 | end block |
420 | 430 | #:endif |
421 | 431 | #:endfor |
|
0 commit comments