Skip to content

Commit

Permalink
Add Base.require_one_based_indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffFessler committed Nov 2, 2022
1 parent a6b910a commit 2c38ee1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/frobenius.jl
Expand Up @@ -24,7 +24,7 @@ the subdiagonal of the nonzero column is stored as a dense vector,
so that the size can be inferred automatically as j+k,
where j is the column index and k is the number of subdiagonal elements.
```julia
```jldoctest
julia> using SpecialMatrices
julia> F = Frobenius(3, 4:6) # Specify subdiagonals of column 3
Expand Down Expand Up @@ -103,6 +103,7 @@ end
# 3-argument mul! mutates first argument: y <= F * x
# *(F, x) = F * x derives from this automatically in Base
function mul!(y::Vector, F::Frobenius, x::AbstractVector)
Base.require_one_based_indexing(x)
@boundscheck (n = size(F, 2)) == length(x) == length(y) ||
throw(DimensionMismatch("$n $(length(y)) $(length(x))"))
j = F.colidx
Expand Down

1 comment on commit 2c38ee1

@JeffFessler
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies to all: again I meant to push this to a branch and then do a PR.

Please sign in to comment.