Skip to content
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

element-wise operations not defined #51

Closed
neveritt opened this issue May 31, 2016 · 0 comments
Closed

element-wise operations not defined #51

neveritt opened this issue May 31, 2016 · 0 comments

Comments

@neveritt
Copy link
Contributor

Current version:

julia> using Polynomials

julia> p1 = Poly([1, 2])
Poly(1 + 2x)

julia> p2 = Poly([3, 1.])
Poly(3.0 + x)

julia> p = [p1, p2]
2-element Array{Polynomials.Poly{Float64},1}:
Poly(1.0 + 2.0x)
Poly(3.0 + x)   

julia> q = [3,p1]
2-element Array{Any,1}:
3            
Poly(1 + 2x)

julia> 3p
ERROR: MethodError: `.*` has no method matching .*(::Int64,
::Polynomials.Poly{Float64})
Closest candidates are:
.*(::Real, ::OrdinalRange{T,S})
.*(::Real, ::FloatRange{T<:AbstractFloat})
.*(::Real, ::LinSpace{T<:AbstractFloat})
...
in .* at arraymath.jl:120
in * at abstractarraymath.jl:54

Dot product is not defined between Numbers and Polys.
It would be convenient to have such a feature.

Promotion rule from Numbers to Polys is not defined either.

@neveritt neveritt changed the title .* not defined element-wise operations not defined May 31, 2016
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

1 participant