Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function check_parent(a::MatrixElem, b::MatrixElem, throw::Bool = true)
end

function _check_dim(r::Int, c::Int, arr::AbstractMatrix{T}, transpose::Bool = false) where {T}
Base.require_one_based_indexing(arr)
Copy link
Member

Choose a reason for hiding this comment

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

Those are not official API. OTOH that hasn't stopped us is in other cases...

Copy link
Member Author

Choose a reason for hiding this comment

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

They are in julia nightly. See JuliaLang/julia#56196

if !transpose
size(arr) != (r, c) && throw(ErrorConstrDimMismatch(r, c, size(arr)...))
else
Expand All @@ -38,6 +39,7 @@ function _check_dim(r::Int, c::Int, arr::AbstractMatrix{T}, transpose::Bool = fa
end

function _check_dim(r::Int, c::Int, arr::AbstractVector{T}) where {T}
Base.require_one_based_indexing(arr)
length(arr) != r*c && throw(ErrorConstrDimMismatch(r, c, length(arr)))
return nothing
end
Expand Down
Loading