Skip to content

Revert "Add zip() for vectorizing matrix lookups for paired indices" - #3413

Closed
WardBrian wants to merge 1 commit into
developfrom
revert-3411-feature/zip-fun
Closed

WardBrian wants to merge 1 commit into
developfrom
revert-3411-feature/zip-fun

Conversation

@WardBrian

Copy link
Copy Markdown
Member

Reverts #3411

I think this was a misreading of the request in stan-dev/stanc3#1704.

The zip function described in that issue would construct an array of pairs, as is common in every other language. The code to then index a matrix with an array of pairs should live in stan-dev/stan not stan-dev/math.

@SteveBronder

Copy link
Copy Markdown
Collaborator

Talking to Bob this was the signature we wanted. The zip as written in the doc would need a to_vector

@WardBrian

Copy link
Copy Markdown
Member Author

That would depend on how the indexing operation was written in stan, no?

At the very least, this function should not be called zip, since that has a pretty well established meaning elsewhere. The original issue used the name zip_index, which would be fine

@SteveBronder

Copy link
Copy Markdown
Collaborator

If we returned a tuple of indices I just don't see how we would write something that would be more optimal than just writing the for loop. I think calling it flatten or zip_index would make sense

@SteveBronder

Copy link
Copy Markdown
Collaborator

Making the new pr rn closing this

@WardBrian
WardBrian deleted the revert-3411-feature/zip-fun branch September 24, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants