-
Notifications
You must be signed in to change notification settings - Fork 54
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
ndarray.set the i, j vector #32
Comments
I think there is no way to do it since the underlying data might not be contiguous in your newVector. Except some cases only you know about, there are no more efficient ways than the one you showed. |
I have the same requirement. I need to copy a subset of an ndarray into a different bigger ndarray as efficiently as possible. I think this can be implemented faster than the for loop above by using the compilation techniques that ndarray uses. |
You can use ndarray ops to do this, or for your median filter it might be faster to use cwise. |
Ah, right! I didn't see that, it's under "Special cases". So, it's:
Meaning you slice your source and destination arrays properly and then do This issue can be closed then. |
Using this library, I have found frequently that I need to set an entire vector at a time when manipulating the ndarray. For example:
Is there an intended way to handle this redundancy? Ideally:
Context:
Writing an image processing library. I wrote a median filter for the image. I need iterate over all the pixels and set them to the median of their neighbors.
The text was updated successfully, but these errors were encountered: