17#include <lagrange/utils/warnoff.h>
18#include <tbb/parallel_sort.h>
19#include <lagrange/utils/warnon.h>
27template <
typename DerivedX,
typename DerivedIX>
29 const Eigen::DenseBase<DerivedX>& X,
31 Eigen::PlainObjectBase<DerivedX>& Y,
32 Eigen::PlainObjectBase<DerivedIX>& IX)
34 using Index =
typename DerivedIX::Scalar;
38 IX.resize(X.rows(), 1);
39 std::iota(IX.begin(), IX.end(), Index(0));
41 auto run_sort = [&](
auto cmp) {
42 tbb::parallel_sort(IX.begin(), IX.end(), [&](Index i, Index j) {
43 return std::lexicographical_compare(
53 run_sort(std::less<>());
55 run_sort(std::greater<>());
58 for (Eigen::Index i = 0; i < X.rows(); ++i) {
59 Y.row(i) = X.row(IX(i));
63template <
typename DerivedX>
65 const Eigen::DenseBase<DerivedX>& X,
67 Eigen::PlainObjectBase<DerivedX>& Y)
69 Eigen::Matrix<int, DerivedX::RowsAtCompileTime, 1> I;
70 return lagrange::internal::sortrows(X, ascending, Y, I);
nullptr_t, size_t, ptrdiff_t basic_ostream bad_weak_ptr extent, remove_extent, is_array,...
Definition: attribute_string_utils.h:21