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

LinearAlgebra: multiarg checksquare should perhaps be deprecated in favour of broadcasting #28897

Open
KristofferC opened this issue Aug 26, 2018 · 0 comments
Labels
linear algebra Linear algebra

Comments

@KristofferC
Copy link
Member

julia> a = rand(2,2); b = rand(3,3);

julia> LinearAlgebra.checksquare(a, b)
2-element Array{Int64,1}:
 2
 3

julia> LinearAlgebra.checksquare.((a, b))
(2, 3)

Seems unnecessary to have a multiarg checksquare (that allocates an array) where we could just use broadcasting (which is a lot faster, not that it usually matters in the context it is used)

 julia> @btime LinearAlgebra.checksquare($a, $b);
  73.619 ns (2 allocations: 128 bytes)

julia> @btime LinearAlgebra.checksquare.(($a, $b));
  5.343 ns (0 allocations: 0 bytes)
@KristofferC KristofferC added the linear algebra Linear algebra label Aug 26, 2018
@KristofferC KristofferC changed the title LinearAlgebra: multiarg checksquare should perhaps be deprecated for broadcasting LinearAlgebra: multiarg checksquare should perhaps be deprecated in favour of broadcasting Aug 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear algebra Linear algebra
Projects
None yet
Development

No branches or pull requests

1 participant