Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program programa_x
- implicit none
- real*8, dimension(4,4) :: A,AF
- real*8, dimension(4,1) :: B,X
- real*8, dimension(1) :: FERR,BERR
- real*8, dimension(4*4) :: WORK
- real*8 :: RCOND,RPVGRW
- real*8, dimension(1,2) :: ERR_BNDS_NORM,ERR_BNDS_COMP
- integer,dimension(3) :: PARAMS
- integer, dimension(4) :: R,C
- integer, dimension(4) :: IPIV,IWORK
- integer :: INFO
- integer :: i,j
- real*8 :: lam
- character*1 :: EQUED
- lam=1d-7
- A(1,:)=[ 29.0000000000000d0 , 58.0000000000000d0 , 87.0000000000000d0 , 232.000000000000d0]
- A(2,:)=[ 0.000000000000000d0 , 116.000000000000d0 , 145.000000000000d0 , 87.0000000000000d0]
- A(3,:)=[ 174.000000000000d0 , lam , 203.000000000000d0 , -145.000000000000d0]
- A(4,:)=[ -87.0000000000000d0 , 178.000000000000d0 , 116.000000000000d0 , 261.000000000000d0]
- B(:,1)= [2291.00000000000d0,1682.00000000000d0,3*lam +348.000000003000d0,2767.00000000000d0]
- !~ Only one of either dgesv, dgesvx, or dgesvxx must be executed, as they modify their inputs.
- !~ call dgesv(4, 1, A, 4, IPIV, B, 4, INFO)
- !~ print*,B(:,1)
- !~
- !~
- !~ call dgesvx ('E', 'N', 4, 1, A, 4, AF, 4, IPIV, EQUED, R,&
- !~ C, B, 4, X, 4, RCOND, FERR, BERR, WORK, IWORK, INFO)
- !~ print*,X(:,1)
- !~ print*,RCOND
- PARAMS=[1.0d0,10.0d0,1.0d0]
- call dgesvxx ('E', 'N', 4, 1, A, 4, AF, 4, IPIV, EQUED, &
- R, C, B, 4, X, 4, RCOND, RPVGRW, BERR, 2, &
- ERR_BNDS_NORM, ERR_BNDS_COMP, 3, PARAMS, WORK, IWORK, INFO)
- print*,X(:,1)
- print*,RCOND
- print*,INFO
- end program
Advertisement
Add Comment
Please, Sign In to add comment