Skip to content

Commit a72a9c6

Browse files
authored
Update functions.jl
1 parent 2bb14ee commit a72a9c6

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

test/functions.jl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,16 @@ end
131131

132132
function test_vectoraffinefunction_creation()
133133
x = MOI.VariableIndex(1)
134-
f = MOI.VectorAffineFunction([1.0 * x, 2.0 * x])
135-
@test f.constants == [0.0, 0.0]
136-
@test f.terms[1].scalar_term.coefficient == 1.0
137-
@test f.terms[2].scalar_term.coefficient == 2.0
134+
f = MOI.VectorAffineFunction([1.0 * x + 2.0, 3.0 * x + 4.0])
135+
g = MOI.VectorAffineFunction(
136+
MOI.VectorAffineTerm{Float64}[
137+
MOI.VectorAffineTerm(1, MOI.ScalarAffineTerm(1.0, x)),
138+
MOI.VectorAffineTerm(2, MOI.ScalarAffineTerm(3.0, x)),
139+
],
140+
[2.0, 4.0],
141+
)
142+
@test f g
143+
return
138144
end
139145

140146
function test_isapprox_VectorOfVariables()

0 commit comments

Comments
 (0)