Skip to content

Commit

Permalink
Fix docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Feb 14, 2019
1 parent 4832d28 commit c9208dd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions docs/src/constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,8 @@ julia> @variable(model, x)
x
julia> @SDconstraint(model, [x 2x; 3x 4x] >= ones(2, 2))
x - 1 2 x - 1
3 x - 1 4 x - 1 ∈ PSDCone()
[x - 1 2 x - 1;
3 x - 1 4 x - 1] ∈ PSDCone()
```

Solvers supporting such constraints usually expect to be given a matrix that
Expand All @@ -519,16 +519,16 @@ follows:
julia> using LinearAlgebra
julia> @constraint(model, Symmetric([x 2x; 2x 4x] - ones(2, 2)) in PSDCone())
x - 1 2 x - 1
2 x - 1 4 x - 1 ∈ PSDCone()
[x - 1 2 x - 1;
2 x - 1 4 x - 1] ∈ PSDCone()
```

Note that the lower triangular entries are silently ignored even if they are
different so use it with caution:
```jldoctest con_psd
julia> cref = @constraint(model, Symmetric([x 2x; 3x 4x]) in PSDCone())
x 2 x
2 x 4 x ∈ PSDCone()
[x 2 x;
2 x 4 x] ∈ PSDCone()
julia> jump_function(constraint_object(cref))
3-element Array{GenericAffExpr{Float64,VariableRef},1}:
Expand Down
4 changes: 2 additions & 2 deletions src/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -760,8 +760,8 @@ julia> b = [1 2
3 4];
julia> cref = @SDconstraint(model, a ⪰ b)
x - 1 2 x - 2
-3 x - 4 ∈ PSDCone()
[x - 1 2 x - 2;
-3 x - 4 ] ∈ PSDCone()
julia> jump_function(constraint_object(cref))
4-element Array{GenericAffExpr{Float64,VariableRef},1}:
Expand Down
8 changes: 4 additions & 4 deletions src/sd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ julia> b = [1 2
2 4];
julia> cref = @SDconstraint(model, a ⪰ b)
x - 1 2 x - 2
2 x - 2 x - 4 ∈ PSDCone()
[x - 1 2 x - 2;
2 x - 2 x - 4 ] ∈ PSDCone()
julia> jump_function(constraint_object(cref))
4-element Array{GenericAffExpr{Float64,VariableRef},1}:
Expand All @@ -45,8 +45,8 @@ matrix is constrained to belong to the `PositiveSemidefiniteConeSquare`.
julia> using LinearAlgebra # For Symmetric
julia> cref = @constraint(model, Symmetric(a - b) in PSDCone())
x - 1 2 x - 2
2 x - 2 x - 4 ∈ PSDCone()
[x - 1 2 x - 2;
2 x - 2 x - 4 ] ∈ PSDCone()
julia> jump_function(constraint_object(cref))
3-element Array{GenericAffExpr{Float64,VariableRef},1}:
Expand Down

0 comments on commit c9208dd

Please sign in to comment.