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

Enhancement request: Broaden matrix construction #23029

Closed
sbromberger opened this issue Jul 29, 2017 · 2 comments
Closed

Enhancement request: Broaden matrix construction #23029

sbromberger opened this issue Jul 29, 2017 · 2 comments
Labels
domain:arrays [a, r, r, a, y, s]

Comments

@sbromberger
Copy link
Contributor

sbromberger commented Jul 29, 2017

Matrix{Float32}(3, 4)         # works
Matrix{Float32}(0x3, 0x4)     # works 
Matrix{Float32}((3, 4))       # works 

Matrix{Float32}((0x3, 0x4))   # errors 

Would it be possible to broaden the Matrix(Tuple) constructor to allow types <: Integer in the Tuple?

Other constructors work:

julia> zeros(0x3,0x4)
3×4 Array{Float64,2}:
 0.0  0.0  0.0  0.0
 0.0  0.0  0.0  0.0
 0.0  0.0  0.0  0.0

julia> zeros((0x3,0x4))
3×4 Array{Float64,2}:
 0.0  0.0  0.0  0.0
 0.0  0.0  0.0  0.0
 0.0  0.0  0.0  0.0
@fredrikekre
Copy link
Member

#17372 and specifically #17372 (comment)

@laborg
Copy link
Contributor

laborg commented Oct 16, 2023

Matrix construction now accepts Integer:

julia> Matrix{Float32}(undef,(4,0x3))
4×3 Matrix{Float32}:
  2.34387f-37  -7.34996f34  -7.34996f34
  4.5867f-41    4.5866f-41   4.5866f-41
 -7.34996f34   -7.34996f34   2.34407f-37
  4.5866f-41    4.5866f-41   4.5867f-41

@laborg laborg closed this as completed Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:arrays [a, r, r, a, y, s]
Projects
None yet
Development

No branches or pull requests

4 participants