Skip to content

Commit

Permalink
don't use begin in indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub committed May 31, 2023
1 parent 6be2d24 commit 838b05c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/linearalgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -312,18 +312,18 @@ end
function _vc_first_rest_rev(C::Circulant)
v = _vc(C)
v1 = first(v)
v2 = @view v[begin+1:end]
v2rev = view(v2, reverse(eachindex(v2)))
v1, v2, v2rev
vrest = @view v[firstindex(v)+1:lastindex(v)]
vrestrev = view(vrest, reverse(eachindex(vrest)))
v1, vrest, vrestrev
end

function issymmetric(C::Circulant)
v1, v2, v2rev = _vc_first_rest_rev(C)
issymmetric(v1) && all(((a,b),) -> a == transpose(b), zip(v2, v2rev))
v1, vrest, vrestrev = _vc_first_rest_rev(C)
issymmetric(v1) && all(((a,b),) -> a == transpose(b), zip(vrest, vrestrev))
end
function ishermitian(C::Circulant)
v1, v2, v2rev = _vc_first_rest_rev(C)
ishermitian(v1) && all(((a,b),) -> a == adjoint(b), zip(v2, v2rev))
v1, vrest, vrestrev = _vc_first_rest_rev(C)
ishermitian(v1) && all(((a,b),) -> a == adjoint(b), zip(vrest, vrestrev))
end

# Triangular
Expand Down

0 comments on commit 838b05c

Please sign in to comment.