Skip to content

Commit

Permalink
Replace inefficient broadcast with copyto! (#438)
Browse files Browse the repository at this point in the history
* Replace inefficient broadcast with `copyto!`

* Update src/polynomials/ngcd.jl

Co-authored-by: Daniel Karrasch <[email protected]>

Co-authored-by: john verzani <[email protected]>
  • Loading branch information
dkarrasch and jverzani authored Jul 29, 2022
1 parent ad781ef commit bf295af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/polynomials/ngcd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,9 @@ function ngcd(p::PnPolynomial{T,X},

nr, nc = size(Sₓ) # m+1, m-n+2
F = qr(Sₓ)
Q[1:nr, 1:nr] .= F.Q
dest = view(Q, 1:nr, 1:nr)
copyto!(dest, I)
lmul!(F.Q, dest)
R[1:nc, 1:nc] .= F.R

# tolerances
Expand Down

0 comments on commit bf295af

Please sign in to comment.