Skip to content

LinearIndices behavior change #28503

Closed
Closed
@barche

Description

With PR #26775 the behavior of indexing into a LinearIndices object was changed when the referred range does not start at 1. Before:

LinearIndices((5:8,))[5]

woud return 1, now it is a boundserror. The idea of the old behavior was to have an array with linear indices that is indexed in the same way as the original array, but this is no longer the case now for non-standard indexed arrays, so index conversion first requires a manual conversion to a 1-based index now.

CC @nalimilan @mbauman

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions