Skip to content

Commit

Permalink
use copyto! instead of views to construct blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
tb6g16 committed May 10, 2023
1 parent 246b818 commit 7c0f559
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ function split_into_blocks(Q::M, Nf::Int, No::Int) where {M <: AbstractMatrix}
# loop over the blocks and take views of snapshot matrix
for nb in 1:Nb
offset = (nb - 1)*(Nf - No)
# TODO: change to copyto! so that the original matrix isn't affected by windowing
Q_blocks[nb] = @view(Q[:, (1 + offset):(Nf + offset)])
copyto!(Q_blocks[nb], @view(Q[:, (1 + offset):(Nf + offset)]))
end

return Q_blocks, Nb
Expand Down

0 comments on commit 7c0f559

Please sign in to comment.