Skip to content

Commit

Permalink
Make getindex on MetricProblem return a MetricProblem
Browse files Browse the repository at this point in the history
  • Loading branch information
mhauru committed Oct 18, 2024
1 parent dda32d1 commit cac6251
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/problem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,6 @@ end
Overwrite `Base.getindex` to allow for slicing of input/output-based problems.
"""
Base.getindex(p::Problem{Vector{IOExample}}, indices) = Problem(p.spec[indices])
Base.getindex(p::MetricProblem{Vector{IOExample}}, indices) = Problem(p.spec[indices])
Base.getindex(p::MetricProblem{Vector{IOExample}}, indices) = MetricProblem(p.cost_function, p.spec[indices])


0 comments on commit cac6251

Please sign in to comment.