Skip to content

Commit ca28ff5

Browse files
committed
Respond to AI review
1 parent f47b08d commit ca28ff5

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

src/DiagonalHessianApproximation.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,3 +246,10 @@ function push!(
246246
B.d .*= sum(B.d) / sT_y
247247
return B
248248
end
249+
250+
for op in (DiagonalPSB, DiagonalAndrei, SpectralGradient, DiagonalBFGS)
251+
@eval begin
252+
isallocated5(::$op) = true
253+
has_args5(::$op) = true
254+
end
255+
end

src/TimedOperators.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ Creates a linear operator instrumented with timers from TimerOutputs.
2626
"""
2727
function TimedLinearOperator(op::AbstractLinearOperator{T}) where {T}
2828
timer = TimerOutput()
29-
prod!(res, x, α, β) = @timeit timer "prod" op.prod!(res, x, α, β)
30-
tprod!(res, x, α, β) = @timeit timer "tprod" op.tprod!(res, x, α, β)
31-
ctprod!(res, x, α, β) = @timeit timer "ctprod" op.ctprod!(res, x, α, β)
29+
prod!(res, x, α, β) = @timeit timer "prod" mul!(res, op, x, α, β)
30+
tprod!(res, x, α, β) = @timeit timer "tprod" mul!(res, transpose(op),x, α, β)
31+
ctprod!(res, x, α, β) = @timeit timer "ctprod" mul!(res, op', x, α, β)
3232
TimedLinearOperator{T}(timer, op, prod!, tprod!, ctprod!)
3333
end
3434

@@ -42,7 +42,6 @@ for fn ∈ (
4242
:issymmetric,
4343
:ishermitian,
4444
:has_args5,
45-
:use_prod5!,
4645
:isallocated5,
4746
:allocate_vectors_args3!,
4847
:nprod,

src/abstract.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ the 5-args `mul!`.
154154
No additional vectors are generated when using the 3-args `mul!`.
155155
156156
!!! warning
157-
`has_nargs5` can be very slow. A better option is to use Julia's `hasmethod`
157+
`has_args5` can be very slow. A better option is to use Julia's `hasmethod`
158158
at points in the code where the concrete types of objects used in `mul!` are known.
159159
160-
`has_nargs5` may be removed in a future release.
160+
`has_args5` may be removed in a future release.
161161
"""
162162
has_args5(op::AbstractLinearOperator) = get_nargs(op.prod!) == 4
163163

0 commit comments

Comments
 (0)