Skip to content

Conversation

tweisser
Copy link

@tweisser tweisser commented Jun 8, 2020

Applied necessary changes to make MM run with my changes to MB.

For use in PolyJuMP I changed Moment and Measure to allow for APLs and AbstractPolynomialBasis respectively.

src/atomic.jl Outdated
measure::AtomicMeasure, x) = Measure(η, x)
function Measure::AtomicMeasure{T}, x::AbstractVector{TT}) where {T, TT}
Measure{T, monomialtype(TT), monovectype(x)}(η, x)
Measure{T, MB.MonomialBasis}(η, x)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The full type is MB.MonomialBasis{...}

end
if i > length.x)
error("The polynomial $p has a nonzero term $t with monomial $(t.x) for which the expectation is not known in ")
error("The polynomial $p has a nonzero term $(c*m) with basis function $(m) for which the expectation is not known in ")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not call it term $(c * m) but rather coordinate $c or something like that

s = 0
for t in terms(p)
while i <= length.x) && monomial(t) != μ.x[i]
for (c, m) in zip(coefficients(p, BT), MB.basis_covering_monomials(BT, monomials(p)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coefficients(p, BT) computes maxdegree_basis(Basis, variables(p), maxdegree(p)) which may not match with the basis basis = MB.basis_covering_monomials(BT, monomials(p)), use coefficients(p, basis) instead maybe

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment in MultivariateBases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants