10 #include "gtest/gtest.h" 16 std::vector<Real> vec = {1, 2, 5, 3, -2};
19 std::vector<unsigned> gold = {4, 0, 1, 3, 2};
20 for (
unsigned i = 0; i < 5; ++i)
21 EXPECT_EQ(ind[i], gold[i]);
24 gold = {2, 3, 1, 0, 4};
25 for (
unsigned i = 0; i < 5; ++i)
26 EXPECT_EQ(ind[i], gold[i]);
std::vector< unsigned > sortedIndices(const std::vector< Real > &to_sort, bool ascending)
Produces a vector of indices corresponding to the smallest-to-biggest entries in to_sort (or biggest-...
TEST(GeochemistrySortedIndicesTest, sortedIndices)