-
Notifications
You must be signed in to change notification settings - Fork 10
Resolve R2 Allocation test #164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
1c94830
b5cbdc9
1e645cd
e952daf
099c7c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| export GenericExecutionStats | ||
|
|
||
| import SolverCore.GenericExecutionStats | ||
|
|
||
| # use Arpack to obtain largest eigenvalue in magnitude with a minimum of robustness | ||
| function LinearAlgebra.opnorm(B; kwargs...) | ||
| _, s, _ = tsvd(B) | ||
|
|
@@ -20,3 +24,20 @@ ShiftedProximalOperators.iprox!( | |
|
|
||
| LinearAlgebra.diag(op::AbstractDiagonalQuasiNewtonOperator) = copy(op.d) | ||
| LinearAlgebra.diag(op::SpectralGradient{T}) where {T} = zeros(T, op.nrow) .* op.d[1] | ||
|
|
||
| """ | ||
| GenericExecutionStats(reg_nlp :: AbstractRegularizedNLPModel{T, V}) | ||
|
|
||
| Construct a GenericExecutionStats object from an AbstractRegularizedNLPModel. | ||
| More specifically, construct a GenericExecutionStats on the NLPModel of reg_nlp and add three solver_specific entries namely :smooth_obj, :nonsmooth_obj and :xi. | ||
| This is useful for reducing the number of allocations when calling solve!(..., reg_nlp, stats) and should be used by default. | ||
| Warning: This should *not* be used when adding other solver_specific entries that do not have the current scalar type. | ||
| For instance, when one adds the history of the objective value as a solver_specific entry (which has Vector{T} type), this will cause an error and `GenericExecutionStats(reg_nlp.model)` should be used instead. | ||
dpo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| """ | ||
| function GenericExecutionStats(reg_nlp :: AbstractRegularizedNLPModel{T, V}) where{T, V} | ||
| stats = GenericExecutionStats(reg_nlp.model, solver_specific = Dict{Symbol, T}()) | ||
| set_solver_specific!(stats, :smooth_obj, T(Inf)) | ||
| set_solver_specific!(stats, :nonsmooth_obj, T(Inf)) | ||
| set_solver_specific!(stats, :xi, T(Inf)) | ||
|
||
| return stats | ||
| end | ||
Uh oh!
There was an error while loading. Please reload this page.