File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1059,6 +1059,7 @@ LinearAlgebra.adjoint(scalar::AbstractJuMPScalar) = conj(scalar)
1059
1059
Base. iterate (x:: AbstractJuMPScalar ) = (x, true )
1060
1060
Base. iterate (:: AbstractJuMPScalar , state) = nothing
1061
1061
Base. isempty (:: AbstractJuMPScalar ) = false
1062
+ Base. length (:: AbstractJuMPScalar ) = 1
1062
1063
1063
1064
# Check if two arrays of AbstractJuMPScalars are equal. Useful for testing.
1064
1065
function isequal_canonical (
Original file line number Diff line number Diff line change @@ -1601,4 +1601,11 @@ function test_bad_bound_types()
1601
1601
return
1602
1602
end
1603
1603
1604
+ function test_variable_length ()
1605
+ model = Model ()
1606
+ @variable (model, x)
1607
+ @test length (x) == 1
1608
+ return
1609
+ end
1610
+
1604
1611
end # module TestVariable
You can’t perform that action at this time.
0 commit comments