Skip to content
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

[docs] clarify you can use index sets when setting the start value #3148

Merged
merged 1 commit into from
Dec 8, 2022
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
2 changes: 2 additions & 0 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added Benders tutorial with in-place resolves (#3145)
- Added more [Tips and tricks](@id linear_tips_and_tricks) for linear programs
(#3144)
- Clarified documentation that `start` can depend on the indices of a
variable container (#3148)

## Version 1.5.0 (December 8, 2022)

Expand Down
14 changes: 14 additions & 0 deletions docs/src/manual/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,20 @@ julia> start_value(y)
2.0
```

The `start` keyword argument can depend on the indices of a variable container:

```jldoctest; setup=:(model=Model())
julia> @variable(model, z[i = 1:2], start = i^2)
2-element Vector{VariableRef}:
z[1]
z[2]

julia> start_value.(z)
2-element Vector{Float64}:
1.0
4.0
```

!!! warning
Some solvers do not support start values. If a solver does not support start
values, an `MathOptInterface.UnsupportedAttribute{MathOptInterface.VariablePrimalStart}`
Expand Down