2 ! PR 34566 - logical matmul used to give the wrong result.
3 ! We check this by running through every permutation in
4 ! multiplying two 3*3 matrices, and all permutations of multiplying
5 ! a 3-vector and a 3*3 matrices and checking against equivalence
6 ! with integer matrix multiply.
9 integer, parameter :: ki
=4
10 integer, parameter :: dimen
=3
12 real, dimension(dimen
,dimen
) :: r1
, r2
13 integer, dimension(dimen
,dimen
) :: m1
, m2
14 logical(kind
=ki
), dimension(dimen
,dimen
) :: l1
, l2
15 logical(kind
=ki
), dimension(dimen
*dimen
) :: laux
16 logical(kind
=ki
), dimension(dimen
) :: lv
17 integer, dimension(dimen
) :: iv
19 do i
=0,2**(dimen
*dimen
)-1
20 forall (k
=1:dimen
*dimen
)
21 laux(k
) = btest(i
, k
-1)
23 l1
= reshape(laux
,shape(l1
))
26 ! Check matrix*matrix multiply
27 do j
=0,2**(dimen
*dimen
)-1
28 forall (k
=1:dimen
*dimen
)
29 laux(k
) = btest(i
, k
-1)
31 l2
= reshape(laux
,shape(l2
))
33 if (any(matmul(l1
,l2
) .neqv
. (matmul(m1
,m2
) /= 0))) then
38 ! Check vector*matrix and matrix*vector multiply.
44 if (any(matmul(lv
,l1
) .neqv
. (matmul(iv
,m1
) /=0))) then
47 if (any(matmul(l1
,lv
) .neqv
. (matmul(m1
,iv
) /= 0))) then
54 elemental
function ltoi(v
)
58 logical(kind
=4), intent(in
) :: v