At every inner iteration 0, the nlls_iterate is started with s=x0=0.0, which will trigger an expensive call to eval_HP or or m matrix-vector products with zero-vector y
that ultimately will return a zero matrix...
Either check if all(y==0) at the entry of calculate_sHs. A good option is to not call tensoreval_f when we already have the answer s=0 then f(s) = r_k
Under the context of Tensor-Newton Subproblem.
Multiple redundant calls to
eval_HF
wheneval_HP
is presentProblem
In the recursive call to
evaltensor_hf
there is a redundant call toeval_hf
atx=params%x
that does not change withing a recursive call tonlls_solve
.Fix
Add flag to avoid calling uneccesarily
eval_hf
withinevaltensor_hf
...Showcase
Lanczos.f90
with or withouteval_hp
call backMultiple redundant calls to
eval_HP
At every inner iteration 0, the
nlls_iterate
is started withs
=x0
=0.0, which will trigger an expensive call toeval_HP
or orm
matrix-vector products with zero-vectory
that ultimately will return a zero matrix...Either check if
all(y==0)
at the entry ofcalculate_sHs
. A good option is to not calltensoreval_f
when we already have the answer s=0 then f(s) = r_k