Skip to content

Moved optstats to SciMLBase #681

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

Merged
merged 5 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Optimization"
uuid = "7f7a1694-90dd-40f0-9382-eb1efda571ba"
version = "3.21.1"
version = "3.21.2"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Expand Down Expand Up @@ -57,7 +57,7 @@ Printf = "1.10"
ProgressLogging = "0.1"
Reexport = "1.2"
ReverseDiff = "1.14"
SciMLBase = "2.16.3"
SciMLBase = "2.20.0"
SparseArrays = "1.10"
SparseDiffTools = "2.14"
SymbolicIndexingInterface = "0.3.2"
Expand Down
1 change: 1 addition & 0 deletions docs/src/optimization_packages/mathoptinterface.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Pkg.add("OptimizationMOI");
```

## Details

As of now, the `Optimization` interface to `MathOptInterface` implements only
the `maxtime` common keyword argument.

Expand Down
7 changes: 4 additions & 3 deletions src/Optimization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ using ArrayInterface, Base.Iterators, SparseArrays, LinearAlgebra
using SymbolicIndexingInterface
using Pkg

import SciMLBase: OptimizationProblem, OptimizationFunction, ObjSense,
MaxSense, MinSense
import SciMLBase: OptimizationProblem,
OptimizationFunction, ObjSense,
MaxSense, MinSense, OptimizationStats
export ObjSense, MaxSense, MinSense

include("utils.jl")
include("function.jl")
include("adtypes.jl")
include("cache.jl")
include("stats_state.jl")
include("state.jl")

export solve, OptimizationCache

Expand Down
27 changes: 27 additions & 0 deletions src/state.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""
$(TYPEDEF)

Stores the optimization run's state at the current iteration
and is passed to the callback function as the first argument.

## Fields
- `iter`: current iteration
- `u`: current solution
- `objective`: current objective value
- `gradient`: current gradient
- `hessian`: current hessian
- `original`: if the solver has its own state object then it is stored here
"""
struct OptimizationState{X, O, G, H, S}
iter::Int
u::X
objective::O
grad::G
hess::H
original::S
end

function OptimizationState(; iter = 0, u = nothing, objective = nothing,
grad = nothing, hess = nothing, original = nothing)
OptimizationState(iter, u, objective, grad, hess, original)
end
56 changes: 0 additions & 56 deletions src/stats_state.jl

This file was deleted.