Skip to content

Commit 6d90c25

Browse files
committed
add test
1 parent 5ebfa9b commit 6d90c25

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/linalg/test_linalg_lstsq.fypp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ module test_linalg_least_squares
7171
type(linalg_state_type) :: state
7272
integer(ilp), parameter :: n = 12, m = 3
7373
real :: Arnd(n,m),xrnd(m)
74-
${rt}$ :: xsol(m),x(m),y(n),A(n,m)
74+
${rt}$, allocatable :: x(:)
75+
${rt}$ :: xsol(m),y(n),A(n,m)
7576

7677
! Random coefficient matrix and solution
7778
call random_number(Arnd)
@@ -88,6 +89,10 @@ module test_linalg_least_squares
8889
call check(error,state%ok(),state%print())
8990
if (allocated(error)) return
9091

92+
! Check size
93+
call check(error,size(x)==m)
94+
if (allocated(error)) return
95+
9196
call check(error, all(abs(x-xsol)<1.0e-4_${rk}$), 'data converged')
9297
if (allocated(error)) return
9398

0 commit comments

Comments
 (0)