-
Notifications
You must be signed in to change notification settings - Fork 74
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
Coefficient type determination for an empty polynomial matrix #309
Comments
I think I'd suggest
Whereas:
|
I am working with Julia 1.5. eltype(eltype(a)) does not work! Is this a new
feature in Julia 1.6?
john verzani <[email protected]> schrieb am Sa., 6. Feb. 2021, 19:05:
… I think I'd suggest eltype(eltype(a)). But I'm not getting the same thing
as you (though I'm on a new branch where the symbol is part of the type):
julia> a = Polynomial.(rand(0,0))
0×0 Array{Any,2}
julia> eltype(a)
Any
Whereas:
julia> p = Polynomial([1,2,3])
Polynomial(1 + 2*x + 3*x^2)
julia> a = [p p^2; -p^2 1]
2×2 Array{Polynomial{Int64,:x},2}:
Polynomial(1 + 2*x + 3*x^2) … Polynomial(1 + 4*x + 10*x^2 + 12*x^3 + 9*x^4)
Polynomial(-1 - 4*x - 10*x^2 - 12*x^3 - 9*x^4) Polynomial(1)
julia> eltype(eltype(a))
Int64
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#309 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALJDHEDMROUQEIRJ6EC7G5DS5WAGXANCNFSM4XGPEMCQ>
.
|
I'm not certain I am answering the question you are getting at, but that construct is just applying the function |
I think this issue can be closed. However, I wonder if the following is in the current version correct:
In an earlier version (see my first entry) it was
|
Yeah, I'm not sure why this changed. I thought maybe a change to broadcasting, but the behaviour is there under v1.0 too. Must be a change to the constructor. I was about to type you just need to specify the type, as in |
This is possibly a silly question, but is related to the previous issue #308 .
Admitedly we have an empty polynomial matrix, created for example with the command:
how it is possible to determine the type of coefficients (in the above case
Float64
).For a nonempty matrix, this is easy
The text was updated successfully, but these errors were encountered: