Skip to content

Commit

Permalink
Enable working tests (#370)
Browse files Browse the repository at this point in the history
* Enable working tests

* measure -> moment_vector
  • Loading branch information
blegat authored Jul 6, 2024
1 parent 6334d4c commit 9b69681
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ using DynamicPolynomials
@polyvar x
monos = [1, x, x^2]
using SumOfSquares
μ = measure([μ0, μ1, μ2], monos)
μ = moment_vector([μ0, μ1, μ2], monos)

# We need to pick an SDP solver, see [here](https://jump.dev/JuMP.jl/v1.12/installation/#Supported-solvers) for a list of the available choices.
# We use `SOSModel` instead of `Model` to be able to use the `>=` syntax for Sum-of-Squares constraints.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ solution_summary(model)
# We can obtain the following list of these moments without duplicates
# (ignoring when difference of entries representing the same moments is below `1e-5`)

μ = measure(ν, atol = 1e-5)
μ = moment_vector(ν, atol = 1e-5)

# The truncated moment matrix can then be obtained as follows

Expand Down
18 changes: 9 additions & 9 deletions test/Mock/mock_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ include("utilities.jl")

using Test, JuMP

#@testset "Term" begin
# include("term.jl")
#end
@testset "Term" begin
include("term.jl")
end
#@testset "Term fixed" begin
# include("term_fixed.jl")
#end
Expand Down Expand Up @@ -60,9 +60,9 @@ end
@testset "SOSDEMO9" begin
include("sosdemo9.jl")
end
#@testset "SOSDEMO10" begin
# include("sosdemo10.jl")
#end
#@testset "Options Pricing" begin
# include("options_pricing.jl")
#end
@testset "SOSDEMO10" begin
include("sosdemo10.jl")
end
@testset "Options Pricing" begin
include("options_pricing.jl")
end
2 changes: 1 addition & 1 deletion test/Tests/options_pricing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function options_pricing_test(
@polyvar x y z
σ = [184.04, 164.88, 164.88, 184.04, 164.88, 184.04]
X = [x^2, x * y, x * z, y^2, y * z, z^2, x, y, z, 1]
μ = measure([σ .+ 44.21^2; 44.21 * ones(3); 1], X)
μ = moment_vector([σ .+ 44.21^2; 44.21 * ones(3); 1], X)

cocone = CopositiveInner(cone)

Expand Down

0 comments on commit 9b69681

Please sign in to comment.