Skip to content

Commit

Permalink
Fix right-multiply bug, add simple test (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericphanson authored and ararslan committed Mar 25, 2019
1 parent 7f11002 commit 5d7ece3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/atoms/affine/multiply_divide.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function conic_form!(x::MultiplyAtom, unique_conic_forms::UniqueConicForms=Uniqu
# right matrix multiplication
else
objective = conic_form!(x.children[1], unique_conic_forms)
objective = kron(x.children[2].value', sparse(1.0I, x.size[1], x.size[1])) * objective
objective = kron(transpose(x.children[2].value), sparse(1.0I, x.size[1], x.size[1])) * objective
end
cache_conic_form!(unique_conic_forms, x, objective)
end
Expand Down
6 changes: 6 additions & 0 deletions test/test_affine.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
@test vexity(p) == AffineVexity()
solve!(p, solver)
@test p.optval 3 atol=TOL

# Check #274
x = ComplexVariable(2,2)
p = minimize( real( [1.0im, 0.0]' * x * [1.0im, 0.0] ), [ x == [1.0 0.0; 0.0 1.0] ])
solve!(p, solver)
@test p.optval 1.0
end

@testset "dot atom" begin
Expand Down

0 comments on commit 5d7ece3

Please sign in to comment.