diff --git a/src/dependence.jl b/src/dependence.jl index d9abace..4b40980 100644 --- a/src/dependence.jl +++ b/src/dependence.jl @@ -247,8 +247,11 @@ function BasisDependence{StaircaseDependence}( end end vars = MP.variables(basis) - full_basis = - MB.maxdegree_basis(MB.Monomial, vars, MP.maxdegree(basis.monomials)) + full_basis = MB.maxdegree_basis( + MB.FullBasis{MB.Monomial,M}(), + vars, + MP.maxdegree(basis.monomials), + ) d = StaircaseDependence[] # This sieve of [LLR08, Algorithm 1] is a performance improvement but not only. # It also ensures that the standard monomials have the "staircase structure". diff --git a/src/moment_matrix.jl b/src/moment_matrix.jl index b829f1e..7a1ed14 100644 --- a/src/moment_matrix.jl +++ b/src/moment_matrix.jl @@ -112,6 +112,10 @@ struct BlockDiagonalMomentMatrix{T,B<:SA.ExplicitBasis,MT} <: blocks::Vector{MomentMatrix{T,B,MT}} end +function block_diagonal(blocks::Vector{<:MomentMatrix}) + return BlockDiagonalMomentMatrix(blocks) +end + function show_basis_indexed_blocks(io::IO, blocks) print(io, " with $(length(blocks)) blocks:") nd = ndigits(length(blocks)) diff --git a/test/moment_matrix.jl b/test/moment_matrix.jl index 954514f..304baae 100644 --- a/test/moment_matrix.jl +++ b/test/moment_matrix.jl @@ -30,7 +30,7 @@ And entries in a 2×2 SymMatrix{$Int}: @test nvariables(ν) == 2 end @test_throws ArgumentError moment_matrix(moment_vector([1], [x]), [y]) - block_ν = BlockDiagonalMomentMatrix([ν1, ν2]) + block_ν = block_diagonal([ν1, ν2]) @test block_ν isa BlockDiagonalMomentMatrix{Int,typeof(ν1.basis)} @test sprint(show, block_ν) == """ BlockDiagonalMomentMatrix with 2 blocks: