35TEST(VectorTest, inverse_permute) {
36 std::vector<double> a = {1.0, 2.0, 3.0, 4.0};
37 std::vector<uint64_t> inversePermutation = {0, 3, 1, 2};
39 EXPECT_EQ(aperm[0], a[0]);
40 EXPECT_EQ(aperm[1], a[3]);
41 EXPECT_EQ(aperm[2], a[1]);
42 EXPECT_EQ(aperm[3], a[2]);
45TEST(VectorTest, grouped_inverse_permute) {
46 std::vector<double> a = {1.0, 2.0, 3.0, 4.0, 5.0};
47 std::vector<uint64_t> groupIndices = {0, 3, 5, 5};
48 std::vector<uint64_t> inversePermutation = {1, 2, 0};
50 std::vector<double> expected = {4.0, 5.0, 1.0, 2.0, 3.0};
51 EXPECT_EQ(aperm, expected);
54TEST(VectorTest, filterBlowUp) {
55 std::vector<uint64_t> v1 = {0, 1, 2, 3};
58 EXPECT_EQ(v1, (std::vector<uint64_t>{9, 9, 9, 9, 0, 1, 2, 3}));
60 EXPECT_EQ(v1, (std::vector<uint64_t>{0, 1, 2, 3}));
62 std::vector<uint64_t> v2 = {0, 1, 2, 3};
65 EXPECT_EQ(v2, (std::vector<uint64_t>{0, 1, 9, 9, 9, 2, 3, 9}));
67 EXPECT_EQ(v2, (std::vector<uint64_t>{0, 1, 2, 3}));
69 std::vector<uint64_t> v3 = {0, 1, 2, 3};
72 EXPECT_EQ(v3, (std::vector<uint64_t>{0, 1, 2, 3}));
74 EXPECT_EQ(v3, (std::vector<uint64_t>{0, 1, 2, 3}));
76 std::vector<uint64_t> v4 = {};
79 EXPECT_EQ(v4, (std::vector<uint64_t>{9, 9, 9, 9}));
81 EXPECT_EQ(v4, (std::vector<uint64_t>{}));
void blowUpVectorInPlace(std::vector< T > &vector, storm::storage::BitVector const &positions, T const &defaultValue=storm::utility::zero< T >())
Gets as input a vector with size n and a BitVector with size m>=n and exactly n set bits.