-
Notifications
You must be signed in to change notification settings - Fork 0
/
linsys.F90
37 lines (32 loc) · 830 Bytes
/
linsys.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
program linsys
implicit none
integer, parameter :: N=4
integer :: OK,i
real :: AA(N,N),BB(N),KK0(N),KK1(N)
real :: AAx(N,N)
integer :: pivot(N)
AAx(:,:) = 0.
do i=1,N
AAx( i : N , i ) = 1.
BB(i) = i*1.
end do
#if 0
AA = AAx
AAx(:,N) = AA(:,1)
AAx(:,1) = AA(:,N)
BB(N)=(1)*1.
BB(1)=(n)*1.
#endif
!!!!!!!!!!!!!!!!!****************
!!!!!!!!!!!!!!!!!!!!!************
! NOTE that LAPACK subr's seem
! to need *TRANSPOSE* of the way A
! is naturally written above
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
AA = transpose(AAx) !!!!!!!!!!!!
!AA = AAx ! transpose(AAx) !!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
call DGESV(N, 1, AA, N, pivot, BB, N, ok)
write(*,*) BB
write(*,*) pivot
end program linsys