TRANSPOSE and MATMUL interaction
- From: Peter <sherwood@xxxxxxxxxxxxxx>
- Date: Thu, 30 Aug 2007 12:34:54 -0700
I am confused by the unexpected results from the following:
SUBROUTINE JacobianFwdDiff(m,n,fjac,ldfjac)
IMPLICIT NONE
INTEGER, INTENT(IN) :: m,n,ldfjac
REAL(8), DIMENSION(ldfjac,n), INTENT(OUT) :: fjac
REAL(8), DIMENSION(n,n) :: term1,M3,M4
REAL(8), DIMENSION(n,m) :: M1
REAL(8), DIMENSION(m,n) :: M2
! Code which computes fjac(1:m,1:n)
M1=TRANSPOSE(fjac(1:m,1:n)); M2=fjac(1:m,1:n)
M3=MATMUL(M1, M2); M4=MATMUL(M1(1:n,1:m), M2(1:m,1:n))
term1(1:n,1:n)=MATMUL(TRANSPOSE(fjac(1:m,1:n)), fjac(1:m,1:n))
Specifically, when m=ldfjac=769, n=1, the values for M3 and M4 are
identical, as I expected, but the value for term1 differs from these.
I thought the computation of term1 should be the same as that of M4,
but it is not.
What have I got wrong here?
.
- Follow-Ups:
- Re: TRANSPOSE and MATMUL interaction
- From: Peter
- Re: TRANSPOSE and MATMUL interaction
- From: Jan Vorbrüggen
- Re: TRANSPOSE and MATMUL interaction
- From: Paul van Delst
- Re: TRANSPOSE and MATMUL interaction
- Prev by Date: Re: fortran character set
- Next by Date: Re: TRANSPOSE and MATMUL interaction
- Previous by thread: High Performance Fortran compiler?
- Next by thread: Re: TRANSPOSE and MATMUL interaction
- Index(es):