Skip to content

Commit

Permalink
Add support function for Measure
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Dec 7, 2023
1 parent 82cb09c commit add22ce
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/flat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,11 @@ function hankel(μ::Measure{T}, rows, cols) where {T}
]
end

function compute_support!(
ν::MomentMatrix{T},
function support(
μ::Measure{T},
rank_check::RankCheck,
solver::FlatExtension,
) where {T}
μ = measure(ν)
d = MP.maxdegree(μ)
v = MP.variables(μ)
d0 = div(d - 1, 2)
Expand All @@ -91,8 +90,16 @@ function compute_support!(
push!(H, hankel(μ, B0, [b * x for b in B1]))
end
λ = [one(T)]
ν.support = ZeroDimensionalVariety(
return ZeroDimensionalVariety(
decompose(H, λ, rank_check, solver.multiplication_matrices_solver),
)
end

function compute_support!(
ν::MomentMatrix,
rank_check::RankCheck,
solver::FlatExtension,
)
ν.support = support(measure(ν), rank_check, solver)
return
end

0 comments on commit add22ce

Please sign in to comment.