115 manager->execute([&]() {
117 ASSERT_NO_THROW(zero = manager->template getAddZero<storm::RationalFunction>());
119 EXPECT_EQ(0ul, zero.getNonZeroCount());
120 EXPECT_EQ(1ul, zero.getLeafCount());
121 EXPECT_EQ(1ul, zero.getNodeCount());
124 ASSERT_NO_THROW(one = manager->template getAddOne<storm::RationalFunction>());
126 EXPECT_EQ(0ul, one.getNonZeroCount());
127 EXPECT_EQ(1ul, one.getLeafCount());
128 EXPECT_EQ(1ul, one.getNodeCount());
133 ASSERT_NO_THROW(two = manager->template getConstant<storm::RationalFunction>(constantTwo));
140 std::shared_ptr<storm::RawPolynomialCache> cache = std::make_shared<storm::RawPolynomialCache>();
141 carl::StringParser parser;
142 parser.setVariables({
"x",
"y",
"z"});
148 storm::Polynomial(parser.template parseMultivariatePolynomial<storm::RationalFunctionCoefficient>(
"2*y"), cache));
152 ASSERT_NO_THROW(function = manager->template getConstant<storm::RationalFunction>(rationalFunction));
164 manager->execute([&]() {
165 std::pair<storm::expressions::Variable, storm::expressions::Variable> xExpr;
166 std::pair<storm::expressions::Variable, storm::expressions::Variable> yExpr;
167 std::pair<storm::expressions::Variable, storm::expressions::Variable> zExpr;
168 ASSERT_NO_THROW(xExpr = manager->addMetaVariable(
"x", 0, 1));
169 ASSERT_NO_THROW(yExpr = manager->addMetaVariable(
"y", 0, 1));
170 ASSERT_NO_THROW(zExpr = manager->addMetaVariable(
"z", 0, 1));
180 ((bddX0 && (bddY0 && bddZ0)).template toAdd<storm::RationalFunction>() *
181 manager->template getConstant<storm::RationalFunction>(
storm::RationalFunction(storm::RationalFunctionCoefficient(-1)))) +
182 ((bddX0 && (bddY0 && bddZ1)).
template toAdd<storm::RationalFunction>() *
183 manager->template getConstant<storm::RationalFunction>(
storm::RationalFunction(storm::RationalFunctionCoefficient(0)))) +
184 ((bddX0 && (bddY1 && bddZ0)).template toAdd<storm::RationalFunction>() *
185 manager->template getConstant<storm::RationalFunction>(
187 ((bddX0 && (bddY1 && bddZ1)).
template toAdd<storm::RationalFunction>() *
188 manager->template getConstant<storm::RationalFunction>(
190 ((bddX1 && (bddY0 && bddZ0)).template toAdd<storm::RationalFunction>() *
191 manager->template getConstant<storm::RationalFunction>(
storm::RationalFunction(storm::RationalFunctionCoefficient(100000)))) +
192 ((bddX1 && (bddY0 && bddZ1)).
template toAdd<storm::RationalFunction>() *
193 manager->template getConstant<storm::RationalFunction>(
storm::RationalFunction(storm::RationalFunctionCoefficient(3)))) +
194 ((bddX1 && (bddY1 && bddZ0)).template toAdd<storm::RationalFunction>() *
195 manager->template getConstant<storm::RationalFunction>(
storm::RationalFunction(storm::RationalFunctionCoefficient(4)))) +
196 ((bddX1 && (bddY1 && bddZ1)).
template toAdd<storm::RationalFunction>() *
197 manager->template getConstant<storm::RationalFunction>(
storm::RationalFunction(storm::RationalFunctionCoefficient(0))));
209 ((bddX0 && (bddY0 && bddZ0)).template toAdd<double>() * manager->template getConstant<double>(-1.0)) +
210 ((bddX0 && (bddY0 && bddZ1)).
template toAdd<double>() * manager->template getConstant<double>(0.0)) +
211 ((bddX0 && (bddY1 && bddZ0)).template toAdd<double>() * manager->template getConstant<double>(0.5)) +
212 ((bddX0 && (bddY1 && bddZ1)).
template toAdd<double>() * manager->template getConstant<double>(0.33333333333333333333)) +
213 ((bddX1 && (bddY0 && bddZ0)).template toAdd<double>() * manager->template getConstant<double>(100000.0)) +
214 ((bddX1 && (bddY0 && bddZ1)).
template toAdd<double>() * manager->template getConstant<double>(3.0)) +
215 ((bddX1 && (bddY1 && bddZ0)).template toAdd<double>() * manager->template getConstant<double>(4.0)) +
216 ((bddX1 && (bddY1 && bddZ1)).
template toAdd<double>() * manager->template getConstant<double>(0.0));
218 EXPECT_TRUE(comparisonAdd == doubleAdd);