File tree Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change
1
+ # Changes in v0.13.6
2
+
3
+ * fix [ #401 ] ( https://github.com/jump-dev/Convex.jl/issues/401 ) by allowing ` diagm(x) ` .
4
+ *
1
5
# Changes in v0.13.5
2
6
3
7
* fix [ #398 ] ( https://github.com/jump-dev/Convex.jl/issues/398 ) by allowing ` fix! ` 'd variables in ` quadform ` .
Original file line number Diff line number Diff line change 1
1
name = " Convex"
2
2
uuid = " f65535da-76fb-5f13-bab9-19810c17039a"
3
- version = " 0.13.5 "
3
+ version = " 0.13.6 "
4
4
5
5
[deps ]
6
6
AbstractTrees = " 1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Original file line number Diff line number Diff line change 5
5
# Please read expressions.jl first.
6
6
# ############################################################################
7
7
8
- import LinearAlgebra. diagm, LinearAlgebra. Diagonal
9
8
10
9
struct DiagMatrixAtom <: AbstractExpr
11
10
head:: Symbol
@@ -48,11 +47,12 @@ function evaluate(x::DiagMatrixAtom)
48
47
return Diagonal (vec (evaluate (x. children[1 ])))
49
48
end
50
49
51
- function diagm ((d, x):: Pair{<:Integer, <:AbstractExpr} )
50
+ function LinearAlgebra . diagm ((d, x):: Pair{<:Integer, <:AbstractExpr} )
52
51
d == 0 || throw (ArgumentError (" only the main diagonal is supported" ))
53
52
return DiagMatrixAtom (x)
54
53
end
55
- Diagonal (x:: AbstractExpr ) = DiagMatrixAtom (x)
54
+ LinearAlgebra. diagm (x:: AbstractExpr ) = DiagMatrixAtom (x)
55
+ LinearAlgebra. Diagonal (x:: AbstractExpr ) = DiagMatrixAtom (x)
56
56
57
57
function conic_form! (x:: DiagMatrixAtom , unique_conic_forms:: UniqueConicForms )
58
58
if ! has_conic_form (unique_conic_forms, x)
Original file line number Diff line number Diff line change @@ -437,4 +437,9 @@ using Convex: AbstractExpr, ConicObj
437
437
add_constraints! (p, [c, c2])
438
438
@test length (p. constraints) == 2
439
439
end
440
+
441
+ @testset " `diagm` (#401)" begin
442
+ x = Variable (3 )
443
+ @test diagm (x) isa AbstractExpr
444
+ end
440
445
end
You can’t perform that action at this time.
0 commit comments