From c97d6358e9fe1baef6cd93722e5883d0968ff219 Mon Sep 17 00:00:00 2001 From: Matthew Wilhelm Date: Wed, 29 Jan 2020 00:17:49 -0500 Subject: [PATCH] Add power unit test --- test/mccormick.jl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/mccormick.jl b/test/mccormick.jl index ca356f13..b332e25e 100644 --- a/test/mccormick.jl +++ b/test/mccormick.jl @@ -593,6 +593,16 @@ end @test isapprox(z13a.cv, -3.9600001, atol=1E-6) @test isapprox(z13b.cv, -3.96064453125, atol=1E-6) + X = MC{2,Diff}(3.0, 3.0, Interval{Float64}(2.0,4.0), seed_gradient(1,Val(2)),seed_gradient(1,Val(2)),false) + out1 = EAGO.McCormick.flt_pow_1(X, 0.5, X.Intv^0.5) + @test isapprox(out1.cv, 1.70710678, atol=1E-5) + @test isapprox(out1.cc, 1.7320508, atol=1E-5) + + X = MC{2,NS}(3.0, 3.0, Interval{Float64}(2.0,4.0), seed_gradient(1,Val(2)),seed_gradient(1,Val(2)),false) + out2 = EAGO.McCormick.flt_pow_1(X, 0.5, X.Intv^0.5) + @test isapprox(out2.cv, 1.70710678, atol=1E-5) + @test isapprox(out2.cc, 1.7320508, atol=1E-5) + end @testset "Multiplication Operator" begin