help?> checkbounds
checkbounds(Bool, A, I...)
Return true if the specified indices I are in bounds for the given
array A. Subtypes of AbstractArray should specialize this method
if they need to provide custom bounds checking behaviors; however,
in many cases one can rely on A's indices and checkindex.
See also checkindex.
Examples
β‘β‘β‘β‘β‘β‘β‘β‘β‘β‘
julia> A = rand(3, 3);
julia> checkbounds(Bool, A, 2)
true
julia> checkbounds(Bool, A, 3, 4)
false
julia> checkbounds(Bool, A, 1:3)
true
julia> checkbounds(Bool, A, 1:3, 2:4)
false
ββββββββββββββββββββββββββββββββββββββββββββ
checkbounds(A, I...)
Throw an error if the specified indices I are not in bounds for the
given array A.
I read it. Itβs just that it seems that the documentation of its usage is a bit different from the code I have seen above. So, I guess I will mainly focus on
checkbounds(A, I...)
Throw an error if the specified indices I are not in bounds for the
given array A.
julia> Base.OneTo(2)
Base.OneTo(2)
help?> Base.OneTo()
Base.OneTo(n)
Define an AbstractUnitRange that behaves like 1:n, with the added
distinction that the lower limit is guaranteed (by the type system)
to be 1.
While we are on this, I was wondering, do you happen to know what else is this Base.OneTo() function used? Itβs a little bit strange hereβ¦