Skip to content

Commit 5d7ece3

Browse files
ericphansonararslan
authored andcommitted
Fix right-multiply bug, add simple test (#280)
1 parent 7f11002 commit 5d7ece3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/atoms/affine/multiply_divide.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function conic_form!(x::MultiplyAtom, unique_conic_forms::UniqueConicForms=Uniqu
8686
# right matrix multiplication
8787
else
8888
objective = conic_form!(x.children[1], unique_conic_forms)
89-
objective = kron(x.children[2].value', sparse(1.0I, x.size[1], x.size[1])) * objective
89+
objective = kron(transpose(x.children[2].value), sparse(1.0I, x.size[1], x.size[1])) * objective
9090
end
9191
cache_conic_form!(unique_conic_forms, x, objective)
9292
end

test/test_affine.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@
4747
@test vexity(p) == AffineVexity()
4848
solve!(p, solver)
4949
@test p.optval 3 atol=TOL
50+
51+
# Check #274
52+
x = ComplexVariable(2,2)
53+
p = minimize( real( [1.0im, 0.0]' * x * [1.0im, 0.0] ), [ x == [1.0 0.0; 0.0 1.0] ])
54+
solve!(p, solver)
55+
@test p.optval 1.0
5056
end
5157

5258
@testset "dot atom" begin

0 commit comments

Comments
 (0)