Skip to content

Composable generic way to achieve n-ary zips of arrays #120

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
bluss opened this issue Mar 4, 2016 · 1 comment
Closed

Composable generic way to achieve n-ary zips of arrays #120

bluss opened this issue Mar 4, 2016 · 1 comment

Comments

@bluss
Copy link
Member

bluss commented Mar 4, 2016

Just brainstorming

A "builder pattern" approach may be viable here to allow n-ary zipping operations. We could even allow masking (?) which is a very valuable operation.

zip_mut(&mut a).zip(&b).zip_mut(&mut c).apply(|x, y, z| *x = *y + *z);

// This is intended to do the same as this would in numpy
// mask = c > d;
// a[mask] = b[mask]
zip_mut(&mut a).zip(&b).mask(&c, &d, <_>::gt).apply(|aelt, belt| *aelt = *belt);
@bluss
Copy link
Member Author

bluss commented Nov 13, 2016

Close in favour of #231

@bluss bluss closed this as completed Nov 13, 2016
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

No branches or pull requests

1 participant