Skip to content

Commit

Permalink
MacaulayNullspace from MomentMatrix (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat authored Aug 12, 2024
1 parent e2e8a96 commit de95d4a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/null.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,22 @@ struct MacaulayNullspace{T,MT<:AbstractMatrix{T},BT<:SA.ExplicitBasis}
basis::BT
accuracy::T
end

function MacaulayNullspace(matrix::AbstractMatrix{T}, basis) where {T}
return MacaulayNullspace(matrix, basis, Base.rtoldefault(T))
end

function MacaulayNullspace(
ν::MomentMatrix,
rank_check::RankCheck,
ldlt::LowRankLDLTAlgorithm = SVDLDLT(),
)
M = value_matrix(ν)
chol = low_rank_ldlt(M, ldlt, rank_check)
@assert size(chol.L, 1) == LinearAlgebra.checksquare(M)
return MacaulayNullspace(chol.L, ν.basis, accuracy(chol))
end

function Base.getindex(
null::MacaulayNullspace{T,MT,<:MB.SubBasis{B}},
monos,
Expand Down Expand Up @@ -69,8 +81,8 @@ function compute_support!(
rank_check::RankCheck,
solver::ImageSpaceSolver,
)
ν.support =
solve(MacaulayNullspace(ν, rank_check, solver.ldlt), solver.null)
null = MacaulayNullspace(ν, rank_check, solver.ldlt)
ν.support = solve(null, solver.null)
return
end

Expand Down

0 comments on commit de95d4a

Please sign in to comment.