Skip to content
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

Add helpers to work with scalars #10

Open
robinchrist opened this issue Nov 10, 2021 · 7 comments
Open

Add helpers to work with scalars #10

robinchrist opened this issue Nov 10, 2021 · 7 comments
Assignees
Labels

Comments

@robinchrist
Copy link

robinchrist commented Nov 10, 2021

Hi,

It would be great if there were helpers to work with scalars, e.g. if multiplies allowed to multiply a sequence with a scalar

Alternatively there could be a fill function or similar that allows creating an integer sequence with all elements identical from a scalar and a size

What do you think?

@d-frey
Copy link
Member

d-frey commented Nov 10, 2021

@d-frey d-frey self-assigned this Nov 10, 2021
@robinchrist
Copy link
Author

Nope, I didn't 🤦‍♂️ Thank you for the hint.

Maybe a note at multiplies would be good, something like
"For the scalar version, see scale"

@robinchrist
Copy link
Author

Is there something similar for plus? Like offset instead of scale

@d-frey
Copy link
Member

d-frey commented Nov 10, 2021

I can add the hint when I have some time.

Currently, there is only scale as it is the only thing I encountered in practice. The problem with a library like taocpp/Sequences is, that you could easily add a thousand little helpers, so I'd like to restrict it to cases that are actually useful in practice. Do you have an actual use-case for offset?

@robinchrist
Copy link
Author

Yeah, I'm building unshuffle sequences for complex numbers (AoS to SoA), which is basically
2*Is..., 2*Is + 1 ... for a standard index_sequence<Is...>

@d-frey
Copy link
Member

d-frey commented Nov 10, 2021

OK, I'll need some time as I'm quite busy.

@robinchrist
Copy link
Author

Yeah no worries, there's no rush

Maybe I'll try to add such a helper myself, shouldn't be too difficult

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

No branches or pull requests

2 participants