program test_GELS
use lapack95
implicit none
integer :: i
integer, parameter :: m = 4, n = 3
real*8 :: a(4,3), b(4)
!|---------------------------------------------------------|
!| MATRIX A |
!|0.814723686393179 0.632359246225410 0.957506835434298|
!|0.905791937075619 0.097540404999410 0.964888535199277|
!|0.126986816293506 0.278498218867048 0.157613081677548|
!|0.913375856139019 0.546881519204984 0.970592781760616|
!|---------------------------------------------------------|
open( 101, file = 'A.txt' )
do i = 1, m
read(101,*) a(i,:)
end do
close( 101 )
!|---------------------------------------------------------|
!| VECTOR b |
!| 4.951962685146891 |
!| 3.995538352672268 |
!| 1.156822499060248 |
!| 4.918917239830835 |
!|---------------------------------------------------------|
open( 101, file = 'B.txt' )
read( 101,* ) b
close( 101 )
call gels( a, b ) !// x -> b
print*, b(1:3)
end program test_GELS