Skip to content

properly document batch deletion #992

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 1 commit into from
Jan 5, 2020
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
1 change: 1 addition & 0 deletions docs/src/apireference.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ ConstraintIndex
is_valid
throw_if_not_valid
delete(::ModelLike, ::Index)
delete(::ModelLike, ::Vector{<:Index})
```

### Variables
Expand Down
6 changes: 4 additions & 2 deletions src/indextypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,12 @@ The following modifications also take effect if `Index` is [`VariableIndex`](@re
delete(model::ModelLike, index::Index) = throw(DeleteNotAllowed(index))

"""
delete{R}(model::ModelLike, indices::Vector{R<:Index})
delete(model::ModelLike, indices::Vector{R<:Index}) where {R}

Delete the referenced objects in the vector `indices` from the model.
It may be assumed that `R` is a concrete type.
It may be assumed that `R` is a concrete type. The default fallback sequentially
deletes the individual items in `indices`, although specialized implementations
may be more efficient.
"""
function delete(model::ModelLike, indices::Vector{<:Index})
for index in indices
Expand Down