Conversation
blegat
reviewed
Jun 11, 2020
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) |
Member
There was a problem hiding this comment.
The full type is MB.MonomialBasis{...}
blegat
reviewed
Jun 11, 2020
src/expectation.jl
Outdated
| 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 $μ") |
Member
There was a problem hiding this comment.
I would not call it term $(c * m) but rather coordinate $c or something like that
blegat
reviewed
Jun 11, 2020
src/expectation.jl
Outdated
| 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))) |
Member
There was a problem hiding this comment.
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
blegat
reviewed
Jul 13, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.