| 12 | namespace xgboost { |
| 13 | namespace common { |
| 14 | TEST(Algorithm, ArgSort) { |
| 15 | Context ctx; |
| 16 | std::vector<float> inputs{3.0, 2.0, 1.0}; |
| 17 | auto ret = ArgSort<bst_feature_t>(&ctx, inputs.cbegin(), inputs.cend()); |
| 18 | std::vector<bst_feature_t> sol{2, 1, 0}; |
| 19 | ASSERT_EQ(ret, sol); |
| 20 | } |
| 21 | |
| 22 | TEST(Algorithm, Sort) { |
| 23 | Context ctx; |