Skip to content

implementing 0-based indexing #371

Open
@ExpandingMan

Description

@ExpandingMan

Hello all. I want to implement some StaticArray objects (LorentzTensor) with 0-based indexing and some custom methods. (I'm on 0.7.) I made the appropriate definition of axes and getindex(t::LorentzTensor, i::Int). This works fine for vectors, but (as you probably know) fails for all higher rank tensors. I've traced the problem down to here which indeed seems to be specialized to 1-based indexing.

My question is, what is the minimum I should implement to get this working? Will there be some other nasty surprises?

I would be happy to make a PR using axes to get this working for the general case, but I'm assuming that it would be far easier said than done (I have no idea what else it would break) and considering that this is a performance-critical package I don't know what other side effects this would have.

Metadata

Metadata

Assignees

No one assigned

    Labels

    designspeculative design related issuefeaturefeatures and feature requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions