Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for skew symmetric variables #2416

Merged
merged 9 commits into from
Dec 23, 2020
Merged

Add support for skew symmetric variables #2416

merged 9 commits into from
Dec 23, 2020

Conversation

odow
Copy link
Member

@odow odow commented Dec 15, 2020

Rebased from #2147

Closes #2146

cc @frederikgeth

@codecov
Copy link

codecov bot commented Dec 15, 2020

Codecov Report

Merging #2416 (7540f6c) into master (52b1b38) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2416      +/-   ##
==========================================
+ Coverage   92.19%   92.21%   +0.02%     
==========================================
  Files          43       43              
  Lines        4597     4613      +16     
==========================================
+ Hits         4238     4254      +16     
  Misses        359      359              
Impacted Files Coverage Δ
src/sd.jl 90.90% <100.00%> (+3.40%) ⬆️
src/constraints.jl 93.42% <0.00%> (-0.09%) ⬇️
src/macros.jl 92.13% <0.00%> (ø)
src/aff_expr.jl 95.03% <0.00%> (ø)
src/objective.jl 91.66% <0.00%> (ø)
src/quad_expr.jl 97.43% <0.00%> (ø)
src/optimizer_interface.jl 71.42% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 52b1b38...7540f6c. Read the comment docs.

test/variable.jl Outdated
@@ -482,6 +482,30 @@ function test_variable_symmetric(ModelType, ::Any)
@test y[1, 2] === y[2, 1]
end

function test_variable_skewsymmetric(ModelType, ::Any)
model = ModelType()
@variable(model, x[1:2, 1:2] in SkewSymMatrixSpace())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I've been playing with this, and the syntax is pretty restrictive. (This also applied to symmetric matrices.)

For example, we don't support

@variable(model, x[2:3, 2:3] in SkewSymMatrixSpace())

because it isn't apparent you can have a symmetric DenseAxisArray.

But if users are forced to write

@variable(model, x[1:3, 1:3] in SkewSymMatrixSpace())

why not just

@variable(model, X in SkewSymMatrixSpace(3))

For anonymous variables, we could support

X = @variable(model, _ in SkewSymMatrixSpace(3))

@odow odow requested a review from blegat December 17, 2020 23:57
@odow odow merged commit 2b0d910 into master Dec 23, 2020
@odow odow deleted the skewsym branch December 23, 2020 20:04
@odow
Copy link
Member Author

odow commented Dec 23, 2020

We can keep discussing different syntax in the next monthly developer call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Support for skew-symmetric matrix variables
2 participants