-
Notifications
You must be signed in to change notification settings - Fork 9
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
Allow shrinking in place #62
Comments
I agree that switching to The existing functions |
Ouch, you are right for Do you agree? And if so, do you still want a PR, or do you just want to make the changes yourself? (Either way is fine with me.) Thanks very much for the library, and your time! |
I've made this change along with a few other improvements in #63. Would you be able to review it? |
Yes, thanks! It's my first github review so I'm going slowly. :) |
Could you make a release with this fix please? Thanks!! |
sizeofSmallMutableArray
is deprecated likesizeofMutablePrimArray
, so please usegetSizeofSmallMutableArray
(like you usegetSizeofMutablePrimArray
).Then note
shrinkMutablePrimArray
andshrinkSmallMutableArray
shrink in place, andresizeMutablePrimArray
andresizeSmallMutableArray
can resize in place (if the array shrinks, not grows). Thus it would be nice to have functions to shrink, resize, and shrinkAndFreeze that work in place if possible (if the array shrinks not grows, and currently if it's a mutable prim or small array). These could be calledfastShrink
/fastResize
/unsafeFastShrinkAndFreeze
, orunsafeShrink
/unsafeResize
/unsafeShrinkAndFreeze2
. Actually we could just keep the nameunsafeShrinkAndFreeze
and allow it to work in place, though this is a breaking change.Finally,
unfoldrMutableN
could use this newfastShrink
/unsafeShrink
.I could prepare a PR if you want, if you tell me which names you like.
Thanks for the very useful library! For instance, in computer algebra one often has algorithms that work the same for various kinds of arrays, e.g.
PrimArray
s over the integers modp
for various sizes ofp
, or regularArray
s.The text was updated successfully, but these errors were encountered: