Make LinearIndices consistent with linearindices for vectors (#26682)
Change LinearIndices(x::AbstractVector) to use the same indices as axes(x, 1).
This is consistent with linearindices(x) and allows indexing into x.
Change CartesianIndices to use custom axes so that it works with indices returned by
LinearIndices for vectors.
Use IndexLinear indexing for LinearIndices
Add bounds check to getindex for LinearIndices and CartesianIndices.