From aebc0cd66cff396b7e55971fed29c994467431ca Mon Sep 17 00:00:00 2001 From: adtzlr Date: Sun, 21 Jun 2020 08:17:26 +0200 Subject: [PATCH] fix dot product of two vectors fixes #14 : just a single loop over two vectors --- ttb/libdot.f | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ttb/libdot.f b/ttb/libdot.f index 66195ab..555945e 100644 --- a/ttb/libdot.f +++ b/ttb/libdot.f @@ -288,13 +288,11 @@ function dot_11(T1, T2) type(Tensor1), intent(in) :: T1 type(Tensor1), intent(in) :: T2 real(kind=8) :: dot_11 - integer :: i,j + integer :: i dot_11 = 0.d0 do i = 1,3 - do j = 1,3 - dot_11 = dot_11 + T1%a(i)*T2%a(j) - enddo + dot_11 = dot_11 + T1%a(i)*T2%a(i) enddo end function dot_11 @@ -334,4 +332,4 @@ function dot_2s2s(T1, T2) * +T1%a6(5)*T2%a6(3) dot_2s2s%a6(6) = T1%a6(6)*T2%a6(1)+T1%a6(5)*T2%a6(4) * +T1%a6(3)*T2%a6(6) - end function dot_2s2s \ No newline at end of file + end function dot_2s2s