Skip to content

Wrong result for scalar-vector product #104

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

Closed
tkoolen opened this issue Nov 9, 2018 · 3 comments
Closed

Wrong result for scalar-vector product #104

tkoolen opened this issue Nov 9, 2018 · 3 comments

Comments

@tkoolen
Copy link

tkoolen commented Nov 9, 2018

julia> using DynamicPolynomials

julia> @polyvar x
(x,)

julia> y = x * [x, x]
(PolyVar{true}[x, x])x

julia> typeof(y)
Term{true,Array{PolyVar{true},1}}

This calls

@eval Base.$op(p::APL, α) = $fun(p, α)
.

@blegat
Copy link
Member

blegat commented Nov 9, 2018

This is related to #103 and due to the design that what isn't a polynomial is a constant to avoid restricting constants to, say, Number so that constants can for example be matrices of Float64 (we also never assume that * is commutative for this reason).
We should maybe make a special case for AbstractArray or polynomials and fallback to broadcast for operation such as scalar * array, array * scalar and array / scalar. Do you see any other ones ?

@saschatimme
Copy link
Collaborator

Fixed in #105.

@tkoolen
Copy link
Author

tkoolen commented Nov 18, 2018

Sorry for not responding to your earlier comment @blegat. Thanks @saschatimme!

blegat added a commit that referenced this issue Jan 17, 2022
blegat added a commit that referenced this issue Mar 18, 2022
blegat added a commit that referenced this issue Mar 18, 2022
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

No branches or pull requests

3 participants