Skip to content

Commit

Permalink
[docs] clarify you can use index sets when setting the start value (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Dec 8, 2022
1 parent 1de2b1f commit 96f3477
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
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

0 comments on commit 96f3477

Please sign in to comment.