Skip to content

Commit

Permalink
Make copyto! return dest for Hankel (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack authored Mar 21, 2023
1 parent 35dff69 commit c3ac898
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/hankel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ for op in (:+, :-)
end
function copyto!(A::Hankel, B::Hankel)
promote_shape(A,B)
copyto!(A.v,B.v)
copyto!(A.v, B.v)
return A
end
for fun in (:lmul!,)
@eval function $fun(x::Number, A::Hankel)
Expand Down
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ end
@test H[7] == 3
@test diag(H) == [1,3,5,7,9]

@test copy(H) == copyto!(similar(H), H)

x = ones(5)
@test mul!(copy(x), H, x) Matrix(H)*x H*x

Expand Down

0 comments on commit c3ac898

Please sign in to comment.