|
@ -12,3 +12,22 @@ TEST(VectorTest, sum_if) { |
|
|
ASSERT_EQ(24.0, storm::utility::vector::sum_if(a, f2)); |
|
|
ASSERT_EQ(24.0, storm::utility::vector::sum_if(a, f2)); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TEST(VectorTest, max_if) { |
|
|
|
|
|
std::vector<double> a = {1.0, 2.0, 34.0, 8.0, 16.0}; |
|
|
|
|
|
storm::storage::BitVector f1(5, {2,4}); |
|
|
|
|
|
storm::storage::BitVector f2(5, {3,4}); |
|
|
|
|
|
|
|
|
|
|
|
ASSERT_EQ(34.0, storm::utility::vector::max_if(a,f1,0.0)); |
|
|
|
|
|
ASSERT_EQ(16.0, storm::utility::vector::max_if(a,f2,0.0)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEST(VectorTest, min_if) { |
|
|
|
|
|
std::vector<double> a = {1.0, 2.0, 34.0, 8.0, 16.0}; |
|
|
|
|
|
storm::storage::BitVector f1(5, {2,4}); |
|
|
|
|
|
storm::storage::BitVector f2(5, {3,4}); |
|
|
|
|
|
|
|
|
|
|
|
ASSERT_EQ(16.0, storm::utility::vector::min_if(a,f1,100.0)); |
|
|
|
|
|
ASSERT_EQ(8.0, storm::utility::vector::min_if(a,f2,100.0)); |
|
|
|
|
|
} |