Skip to content

Commit

Permalink
Rename apply_argsort to take_along_axis to maintain consistency with …
Browse files Browse the repository at this point in the history
…numpy
  • Loading branch information
KHLee529 committed Feb 3, 2025
1 parent 1f59f92 commit 1998843
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cpp/modmesh/buffer/SimpleArray.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ class SimpleArrayMixinCalculators
auto athis = static_cast<A *>(this);
if (athis->ndim() != 1)
{
throw std::runtime_error(Formatter() << "SimpleArray: sorting is only supported in 1D array. "
<< athis->ndim() << "D array is currently not supported");
throw std::runtime_error(Formatter() << "SimpleArray: sorting is only supported in 1D array. "
<< athis->ndim() << "D array is currently not supported");
}

std::sort(athis->begin(), athis->end());
Expand Down Expand Up @@ -622,7 +622,7 @@ class SimpleArray
return ret;
}

void apply_argsort(SimpleArray<uint64_t> const & sorted_args);
void take_along_axis(SimpleArray<uint64_t> const & sorted_args);

template <typename... Args>
value_type const & operator()(Args... args) const { return *vptr(args...); }
Expand Down Expand Up @@ -769,7 +769,7 @@ class SimpleArray
}; /* end class SimpleArray */

template <typename T>
void SimpleArray<T>::apply_argsort(SimpleArray<uint64_t> const & sorted_args)
void SimpleArray<T>::take_along_axis(SimpleArray<uint64_t> const & sorted_args)
{
if (ndim() != 1 || sorted_args.ndim() != 1)
{
Expand Down

0 comments on commit 1998843

Please sign in to comment.