Skip to content

Commit 32f9a24

Browse files
committed
add test
add test add test
1 parent 376f2e1 commit 32f9a24

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test/linalg/test_linalg_determinant.fypp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ module test_linalg_determinant
4747
integer(ilp), parameter :: n = 128_ilp
4848

4949
${rt}$ :: a(n,n),deta
50+
${rt}$, allocatable :: aalloc(:,:)
5051

5152
a = eye(n)
5253

@@ -55,8 +56,18 @@ module test_linalg_determinant
5556

5657
call check(error,state%ok(),state%print())
5758
if (allocated(error)) return
58-
5959
call check(error, abs(deta-1.0_${rk}$)<epsilon(0.0_${rk}$), 'det(eye(n))==1')
60+
if (allocated(error)) return
61+
62+
!> Test with allocatable matrix
63+
aalloc = eye(n)
64+
deta = det(aalloc,overwrite_a=.false.,err=state)
65+
call check(error,state%ok(),state%print()//' (allocatable a)')
66+
if (allocated(error)) return
67+
call check(error,allocated(aalloc),'a is still allocated')
68+
if (allocated(error)) return
69+
call check(error, abs(deta-1.0_${rk}$)<epsilon(0.0_${rk}$), 'det(eye(n))==1 (allocatable a))')
70+
if (allocated(error)) return
6071

6172
end subroutine test_${rt[0]}$${rk}$_eye_determinant
6273

0 commit comments

Comments
 (0)