LinearAlgebra.jl icon indicating copy to clipboard operation
LinearAlgebra.jl copied to clipboard

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

Open KristofferC opened this issue 7 years ago • 2 comments

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 avatar Aug 26 '18 10:08 KristofferC

Now that the package is in its own repo, is it possible to make breaking changes like this?

tpapp avatar May 28 '25 12:05 tpapp

Not really, that is mostly just a development change.

KristofferC avatar Jun 05 '25 14:06 KristofferC