Skip to content

add signatures for reverse #446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mcol opened this issue Jan 30, 2020 · 6 comments · Fixed by #548
Closed

add signatures for reverse #446

mcol opened this issue Jan 30, 2020 · 6 comments · Fixed by #548
Assignees

Comments

@mcol
Copy link
Contributor

mcol commented Jan 30, 2020

In stan-dev/math#1650 I added the implementation of reverse. We should expose the following signatures:

vector reverse(vector)
row_vector reverse(row_vector)
int[] reverse(int[])
real[] reverse(real[])
@bob-carpenter
Copy link
Member

Is the C++ code general enough to reverse an arbitrary T[] and not just int[] and real[]? If so, we can add a lot more signatures than the above.

@mcol
Copy link
Contributor Author

mcol commented Jan 30, 2020

Yes, it should be, but I don't know how to express it in signature form.

@bob-carpenter
Copy link
Member

bob-carpenter commented Jan 30, 2020 via email

@rok-cesnovar
Copy link
Member

Should be fairly easy to add this in stanc3. Will make a PR once the release stuff settles.

@rok-cesnovar rok-cesnovar self-assigned this Jan 31, 2020
@wds15
Copy link

wds15 commented Apr 22, 2020

This is still active? I just missed this neat function when writing the COVID model. Not urgent at all... just bumping (but @rok-cesnovar is probably busy with lots of other stuff which I throw at him - sorry).

@rok-cesnovar
Copy link
Member

Yes, still active but I dropped the ball on this and #452
They both take 15 minutes, but it simply slipped my mind. @mcol did a good job adding them in Math and I feel bad I forgot. Ping me next time I forget Marco :)

On my TODO now so will add after the feature freeze.

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 a pull request may close this issue.

4 participants