matmul does not work.
- From: Kurda Yon <kurdayon@xxxxxxxxx>
- Date: Wed, 28 Nov 2007 17:01:38 -0800 (PST)
Hi,
I multiply matrices using the matmul function. The resulting matrix
contains several columns with NaN. I have no ideas why it can happen.
The explicit multiplication (with the usage of cycles give correct
result). if it can help I give the part of my code:
x = matmul( diag, transpose(orthonormed) )
z = transpose(orthonormed)
do j=1,6
do k=1,6
y(j,k) = 0.0
do f = 1,6
y(j,k) = y(j,k) + diag(j,f)*z(f,k)
end do
end do
end do
write(21,*) 'Orthonormed: 1'
do i=1,6
write(21,'(f15.8,3x, f15.8,3x, f15.8,3x, f15.8,3x, f15.8,3x,
f15.8)') x(i,1:6)
end do
write(21,*) 'Orthonormed: 2'
do i=1,6
write(21,'(f15.8,3x, f15.8,3x, f15.8,3x, f15.8,3x, f15.8,3x,
f15.8)') y(i,1:6)
end do
----------------------------------------
This code produce the following output:
Orthonormed: 1
1452.09362793 NaN NaN
17.40710640 NaN NaN
204.90693665 NaN NaN
1595.27709961 NaN NaN
809.69036865 NaN NaN
-496.22680664 NaN NaN
-105.30693817 NaN NaN
-223.27342224 NaN NaN
-57.58103561 NaN NaN
34.73998642 NaN NaN
161.03297424 NaN NaN
104.22360229 NaN NaN
Orthonormed: 2
1452.09362793 -407.90063477 -10.16419792
17.40710640 721.49768066 -122.90818787
204.90693665 43.32880020 -206.22703552
1595.27709961 -445.82714844 -96.96454620
809.69036865 693.83178711 -250.53425598
-496.22680664 -1225.05993652 22.44420815
-105.30693817 -1233.02636719 -210.49488831
-223.27342224 -652.73901367 -998.04083252
-57.58103561 909.60437012 233.33505249
34.73998642 389.13760376 -1429.17321777
161.03297424 -174.81524658 1743.25329590
104.22360229 -390.14657593 63.16189575
Thank you in advance.
.
- Follow-Ups:
- Re: matmul does not work.
- From: Rich Townsend
- Re: matmul does not work.
- From: Richard Maine
- Re: matmul does not work.
- From: Kurda Yon
- Re: matmul does not work.
- Prev by Date: Re: Re-ordering columns or rows of an array efficiently
- Next by Date: Re: matmul does not work.
- Previous by thread: Re-ordering columns or rows of an array efficiently
- Next by thread: Re: matmul does not work.
- Index(es):