Skip to content

Conversation

@forfudan
Copy link
Collaborator

  1. Adds functions that are able to apply any functions working on 1-d array to any axis, with or without dimension reduction.

    • Add apply_func_on_array_with_dim_reduction() and apply_func_on_array_without_dim_reduction(). They try to utilize parallelization as much as possible.
    • In future, we only need to focus on writing (and optimizing) functions for 1-d arrays. Operating along certain axis can be easily achieved by applying the function, e.g., `apply_func_on_array_with_dim_reduction[max_1d](array, axis=axis).
  2. Implements this approach on functions in statistics.averages module and on the sort function. The sort function gain speed increase compared to the old method and is quicker than numpy.sort for large arrays.

@forfudan
Copy link
Collaborator Author

@shivasankarka Let me resolve conflicts first.

@forfudan
Copy link
Collaborator Author

@shivasankarka Conflicts resolved!

@shivasankarka shivasankarka merged commit 8b38e67 into Mojo-Numerics-and-Algorithms-group:pre-0.6 Feb 16, 2025
2 checks passed
@forfudan forfudan deleted the func branch February 16, 2025 13:08
@forfudan forfudan restored the func branch February 16, 2025 13:19
@forfudan forfudan deleted the func branch February 16, 2025 13:55
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

Successfully merging this pull request may close these issues.

2 participants