We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bb14ee commit a72a9c6Copy full SHA for a72a9c6
test/functions.jl
@@ -131,10 +131,16 @@ end
131
132
function test_vectoraffinefunction_creation()
133
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
+ f = MOI.VectorAffineFunction([1.0 * x + 2.0, 3.0 * x + 4.0])
+ g = MOI.VectorAffineFunction(
+ MOI.VectorAffineTerm{Float64}[
+ 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
144
end
145
146
function test_isapprox_VectorOfVariables()
0 commit comments