Skip to content

Add array stacking methods #75

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 Feb 4, 2016 · 4 comments
Closed

Add array stacking methods #75

bluss opened this issue Feb 4, 2016 · 4 comments

Comments

@bluss
Copy link
Member

bluss commented Feb 4, 2016

No description provided.

@bluss
Copy link
Member Author

bluss commented Feb 8, 2016

<[_]>::concat() can be an inspiration.

@vbarrielle
Copy link
Contributor

As a data point, I have some stacking methods for sparse matrices in sprs, as free functions:
https://github.com/vbarrielle/sprs/blob/master/src/sparse/construct.rs#L231

If I follow you, taking inspiration from SliceConcatExt would mean having a trait with methods such as fn stack(self, axis: Axis), and possibly helper methods such as vstack.
Ie we would have stacking work as let stacked = [a, b, c].stack(Axis(0)). That's probably lighter than the free function option.

One point that's hard to address using slices though is type heterogeneity. With that design, it's not possible to stack an OwnedArray and an ArrayView together. Maybe some trait like IntoArrayView could help there, not sure.

@bluss
Copy link
Member Author

bluss commented Feb 29, 2016

Using a slice argument either way is an inspiration from concat() too, so a free function can work.

@vbarrielle
Copy link
Contributor

FYI I've started working on this, I'll PR once I have a proof of concept.

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

2 participants