4 integer, parameter :: n
=3
5 real, dimension(n
,n
) :: A
, Ainv
, Id
, res
8 A
= reshape([1., 2., 3., 4., 5., 6., 7., 8., 10.],[3, 3])
9 Id
= reshape([1., 0., 0., 0., 1., 0., 0., 0., 1.],[3, 3])
13 ! call random_number(A(i,j))
22 call print_matrix('A',A
)
24 call print_matrix('Ainv',Ainv
)
26 call print_matrix('A*Ainv',res
)
28 call print_matrix('A*Ainv - I',res
)
30 print *,'lin_alg_test: error=',maxval(abs(res
))
31 end program lin_alg_test