Skip to content

Commit

Permalink
Remove auto array alloc for more_sorensen_noew
Browse files Browse the repository at this point in the history
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)`
  • Loading branch information
Andrew Sajo committed Mar 27, 2020
1 parent 303029e commit ef3861c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libRALFit/src/ral_nlls_internal.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ef3861c

Please sign in to comment.