Skip to content

Commit

Permalink
avoid 128-bit random numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
perazz committed May 9, 2024
1 parent a05809e commit 5832df5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/linalg/test_linalg_lstsq.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,17 @@ module test_linalg_least_squares

type(linalg_state_type) :: state
integer(ilp), parameter :: n = 12, m = 3
real :: Arnd(n,m),xrnd(m)
${rt}$ :: xsol(m),x(m),y(n),A(n,m)

! Random coefficient matrix and solution
call random_number(A)
call random_number(xsol)
call random_number(Arnd)
call random_number(xrnd)

! Compute rhs
y = matmul(A,xsol)
A = real(Arnd,${rk}$)
xsol = real(xrnd,${rk}$)
y = matmul(A,xsol)

! Find polynomial
x = lstsq(A,y,err=state)
Expand Down

0 comments on commit 5832df5

Please sign in to comment.