Skip to content

Commit c3ac898

Browse files
authored
Make copyto! return dest for Hankel (#82)
1 parent 35dff69 commit c3ac898

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/hankel.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ for op in (:+, :-)
8181
end
8282
function copyto!(A::Hankel, B::Hankel)
8383
promote_shape(A,B)
84-
copyto!(A.v,B.v)
84+
copyto!(A.v, B.v)
85+
return A
8586
end
8687
for fun in (:lmul!,)
8788
@eval function $fun(x::Number, A::Hankel)

test/runtests.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ end
166166
@test H[7] == 3
167167
@test diag(H) == [1,3,5,7,9]
168168

169+
@test copy(H) == copyto!(similar(H), H)
170+
169171
x = ones(5)
170172
@test mul!(copy(x), H, x) Matrix(H)*x H*x
171173

0 commit comments

Comments
 (0)