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
Enable reshape_generic
for slices + other things
#1180
Conversation
CI failure seems to be due to a spurious failure of an eigen proptest. |
Now that #1178 was merged, I will endeavor to update this PR soon. @sebcrozet: any thoughts on whether you would want to merge all 3 parts of this PR, or if I should leave some out (either for a separate PR or not at all, if the changes are not desirable). |
@Andlon Thank you for this PR! Keeping the 3 parts of this PR is fine. I agree with deprecating |
3931728
to
72813ea
Compare
This allows us to simply write U4 in place of U4::name() or Const::<4>, like we used to be able to before const generics.
Provide a type alias to avoid breaking code. Make Dyn a tuple struct so that we can use the succinct syntax Dyn(n) instead of Dyn::new(n).
In the process of implementing ReshapbleStorage for SliceStorage(Mut), I discovered that there appears to be no tests for the existing reshape_generic functionality on owned matrices.
dc59ef7
to
711ac67
Compare
@Andlon I took the liberty to update the PR and deprecate |
@sebcrozet: that's amazing, thank you! Pretty swamped with work and life at the moment, so haven't been able to dedicate any time to this. Great to see it merged and in the new release :D |
This PR consists of 3 commits, which can be split out as different PRs as necessary:
U0, U1, ...
constants alongside theU0, U1, ...
types. This lets us writeU4
instead ofU4::name()
orConst::<4>
when we need const dimensions. It used to be like this before we got const generics, but it got lost in the transition. I don't think there's any implied breakage from this.Dynamic
toDyn
and makeDyn
a tuple struct.Dyn(3)
instead ofDynamic::new(3)
, which is very verbose.Matrix<T, _, Dynamic, VecStorage<...>>
more concise, which might make them easier to read.Dynamic = Dyn
is also provided.Dynamic
.ReshapableStorage
for matrix slices (only for unit strides at the moment), which was missing.slice.reshape_generic(...)
on slices as well, something I've needed many times.reshape_generic
functionality, so I added some.This PR can either be merged before #1178, in which case I'd update #1178, or it can be merged afterwards, in which case I'll update this PR with the new view terminology.