-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
working with tw/MB #16
base: master
Are you sure you want to change the base?
Conversation
src/atomic.jl
Outdated
@@ -45,9 +45,9 @@ end | |||
|
|||
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) |
There was a problem hiding this comment.
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{...}
src/expectation.jl
Outdated
i += 1 | ||
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 $μ") |
There was a problem hiding this comment.
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
src/expectation.jl
Outdated
i = 1 | ||
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))) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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.