107 manager->execute([&]() {
109 ASSERT_NO_THROW(zero = manager->template getAddZero<storm::RationalFunction>());
111 EXPECT_EQ(0ul, zero.getNonZeroCount());
112 EXPECT_EQ(1ul, zero.getLeafCount());
113 EXPECT_EQ(1ul, zero.getNodeCount());
116 ASSERT_NO_THROW(one = manager->template getAddOne<storm::RationalFunction>());
118 EXPECT_EQ(0ul, one.getNonZeroCount());
119 EXPECT_EQ(1ul, one.getLeafCount());
120 EXPECT_EQ(1ul, one.getNodeCount());
125 ASSERT_NO_THROW(two = manager->template getConstant<storm::RationalFunction>(constantTwo));
132 std::shared_ptr<storm::RawPolynomialCache> cache = std::make_shared<storm::RawPolynomialCache>();
133 carl::StringParser parser;
134 parser.setVariables({
"x",
"y",
"z"});
140 storm::Polynomial(parser.template parseMultivariatePolynomial<storm::RationalFunctionCoefficient>(
"2*y"), cache));
144 ASSERT_NO_THROW(function = manager->template getConstant<storm::RationalFunction>(rationalFunction));
156 manager->execute([&]() {
157 std::pair<storm::expressions::Variable, storm::expressions::Variable> xExpr;
158 std::pair<storm::expressions::Variable, storm::expressions::Variable> yExpr;
159 std::pair<storm::expressions::Variable, storm::expressions::Variable> zExpr;
160 ASSERT_NO_THROW(xExpr = manager->addMetaVariable(
"x", 0, 1));
161 ASSERT_NO_THROW(yExpr = manager->addMetaVariable(
"y", 0, 1));
162 ASSERT_NO_THROW(zExpr = manager->addMetaVariable(
"z", 0, 1));
172 ((bddX0 && (bddY0 && bddZ0)).template toAdd<storm::RationalFunction>() *
173 manager->template getConstant<storm::RationalFunction>(
storm::RationalFunction(storm::RationalFunctionCoefficient(-1)))) +
174 ((bddX0 && (bddY0 && bddZ1)).
template toAdd<storm::RationalFunction>() *
175 manager->template getConstant<storm::RationalFunction>(
storm::RationalFunction(storm::RationalFunctionCoefficient(0)))) +
176 ((bddX0 && (bddY1 && bddZ0)).template toAdd<storm::RationalFunction>() *
177 manager->template getConstant<storm::RationalFunction>(
179 ((bddX0 && (bddY1 && bddZ1)).
template toAdd<storm::RationalFunction>() *
180 manager->template getConstant<storm::RationalFunction>(
182 ((bddX1 && (bddY0 && bddZ0)).template toAdd<storm::RationalFunction>() *
183 manager->template getConstant<storm::RationalFunction>(
storm::RationalFunction(storm::RationalFunctionCoefficient(100000)))) +
184 ((bddX1 && (bddY0 && bddZ1)).
template toAdd<storm::RationalFunction>() *
185 manager->template getConstant<storm::RationalFunction>(
storm::RationalFunction(storm::RationalFunctionCoefficient(3)))) +
186 ((bddX1 && (bddY1 && bddZ0)).template toAdd<storm::RationalFunction>() *
187 manager->template getConstant<storm::RationalFunction>(
storm::RationalFunction(storm::RationalFunctionCoefficient(4)))) +
188 ((bddX1 && (bddY1 && bddZ1)).
template toAdd<storm::RationalFunction>() *
189 manager->template getConstant<storm::RationalFunction>(
storm::RationalFunction(storm::RationalFunctionCoefficient(0))));
201 ((bddX0 && (bddY0 && bddZ0)).template toAdd<double>() * manager->template getConstant<double>(-1.0)) +
202 ((bddX0 && (bddY0 && bddZ1)).
template toAdd<double>() * manager->template getConstant<double>(0.0)) +
203 ((bddX0 && (bddY1 && bddZ0)).template toAdd<double>() * manager->template getConstant<double>(0.5)) +
204 ((bddX0 && (bddY1 && bddZ1)).
template toAdd<double>() * manager->template getConstant<double>(0.33333333333333333333)) +
205 ((bddX1 && (bddY0 && bddZ0)).template toAdd<double>() * manager->template getConstant<double>(100000.0)) +
206 ((bddX1 && (bddY0 && bddZ1)).
template toAdd<double>() * manager->template getConstant<double>(3.0)) +
207 ((bddX1 && (bddY1 && bddZ0)).template toAdd<double>() * manager->template getConstant<double>(4.0)) +
208 ((bddX1 && (bddY1 && bddZ1)).
template toAdd<double>() * manager->template getConstant<double>(0.0));
210 EXPECT_TRUE(comparisonAdd == doubleAdd);