From ef3861cbc5c7d105b3a0ae53a1e5392f4022a483 Mon Sep 17 00:00:00 2001 From: Andrew Sajo Date: Fri, 27 Mar 2020 10:51:08 +0000 Subject: [PATCH] Remove auto array alloc for more_sorensen_noew estimate `nd = dot(d,matmul(H,d))` in two stages using `w%q` 1. `w%q = matmul(H,d)` 2. `nd = dot(d, w%q)` --- libRALFit/src/ral_nlls_internal.f90 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libRALFit/src/ral_nlls_internal.f90 b/libRALFit/src/ral_nlls_internal.f90 index 7be7b696..e0aef976 100644 --- a/libRALFit/src/ral_nlls_internal.f90 +++ b/libRALFit/src/ral_nlls_internal.f90 @@ -2435,7 +2435,10 @@ subroutine more_sorensen_noew(A,v,n,m,Delta,d,nd,options,inform,w) Write(rec(1), Fmt=6020) sigma_l Call printmsg(5,.False.,options,1,rec) End If - dHd = dot_product(d, matmul(w%AplusSigma,d)) + !dHd = dot_product(d, matmul(w%AplusSigma,d)) + !reuse w%q to store intermediary MV product + w%q(:) = matmul(w%AplusSigma,d) + dHd = dot_product(d, w%q) call findbeta(d,w%y1,Delta,alpha,inform) ! check -- is this what I need?!?! if (inform%status /= 0 ) goto 100 d = d + alpha * w%y1