You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

408 lines
18 KiB

  1. #include "gtest/gtest.h"
  2. #include "storm-config.h"
  3. #include "src/exceptions/InvalidArgumentException.h"
  4. #include "src/storage/dd/CuddDdManager.h"
  5. #include "src/storage/dd/CuddAdd.h"
  6. #include "src/storage/dd/CuddOdd.h"
  7. #include "src/storage/dd/DdMetaVariable.h"
  8. #include "src/settings/SettingsManager.h"
  9. #include "src/storage/SparseMatrix.h"
  10. TEST(CuddDdManager, Constants) {
  11. std::shared_ptr<storm::dd::DdManager<storm::dd::DdType::CUDD>> manager(new storm::dd::DdManager<storm::dd::DdType::CUDD>());
  12. storm::dd::Add<storm::dd::DdType::CUDD> zero;
  13. ASSERT_NO_THROW(zero = manager->getAddZero());
  14. EXPECT_EQ(0ul, zero.getNonZeroCount());
  15. EXPECT_EQ(1ul, zero.getLeafCount());
  16. EXPECT_EQ(1ul, zero.getNodeCount());
  17. EXPECT_EQ(0, zero.getMin());
  18. EXPECT_EQ(0, zero.getMax());
  19. storm::dd::Add<storm::dd::DdType::CUDD> one;
  20. ASSERT_NO_THROW(one = manager->getAddOne());
  21. EXPECT_EQ(1ul, one.getNonZeroCount());
  22. EXPECT_EQ(1ul, one.getLeafCount());
  23. EXPECT_EQ(1ul, one.getNodeCount());
  24. EXPECT_EQ(1, one.getMin());
  25. EXPECT_EQ(1, one.getMax());
  26. storm::dd::Add<storm::dd::DdType::CUDD> two;
  27. ASSERT_NO_THROW(two = manager->getConstant(2));
  28. EXPECT_EQ(1ul, two.getNonZeroCount());
  29. EXPECT_EQ(1ul, two.getLeafCount());
  30. EXPECT_EQ(1ul, two.getNodeCount());
  31. EXPECT_EQ(2, two.getMin());
  32. EXPECT_EQ(2, two.getMax());
  33. }
  34. TEST(CuddDdManager, AddGetMetaVariableTest) {
  35. std::shared_ptr<storm::dd::DdManager<storm::dd::DdType::CUDD>> manager(new storm::dd::DdManager<storm::dd::DdType::CUDD>());
  36. ASSERT_NO_THROW(manager->addMetaVariable("x", 1, 9));
  37. EXPECT_EQ(2ul, manager->getNumberOfMetaVariables());
  38. ASSERT_THROW(manager->addMetaVariable("x", 0, 3), storm::exceptions::InvalidArgumentException);
  39. ASSERT_NO_THROW(manager->addMetaVariable("y", 0, 3));
  40. EXPECT_EQ(4ul, manager->getNumberOfMetaVariables());
  41. EXPECT_TRUE(manager->hasMetaVariable("x'"));
  42. EXPECT_TRUE(manager->hasMetaVariable("y'"));
  43. std::set<std::string> metaVariableSet = {"x", "x'", "y", "y'"};
  44. EXPECT_EQ(metaVariableSet, manager->getAllMetaVariableNames());
  45. }
  46. TEST(CuddDdManager, EncodingTest) {
  47. std::shared_ptr<storm::dd::DdManager<storm::dd::DdType::CUDD>> manager(new storm::dd::DdManager<storm::dd::DdType::CUDD>());
  48. std::pair<storm::expressions::Variable, storm::expressions::Variable> x = manager->addMetaVariable("x", 1, 9);
  49. storm::dd::Bdd<storm::dd::DdType::CUDD> encoding;
  50. ASSERT_THROW(encoding = manager->getEncoding(x.first, 0), storm::exceptions::InvalidArgumentException);
  51. ASSERT_THROW(encoding = manager->getEncoding(x.first, 10), storm::exceptions::InvalidArgumentException);
  52. ASSERT_NO_THROW(encoding = manager->getEncoding(x.first, 4));
  53. EXPECT_EQ(1ul, encoding.getNonZeroCount());
  54. // As a BDD, this DD has one only leaf, because there does not exist a 0-leaf, and (consequently) one node less
  55. // than the MTBDD.
  56. EXPECT_EQ(5ul, encoding.getNodeCount());
  57. EXPECT_EQ(1ul, encoding.getLeafCount());
  58. // As an MTBDD, the 0-leaf is there, so the count is actually 2 and the node count is 6.
  59. EXPECT_EQ(6ul, encoding.toAdd().getNodeCount());
  60. EXPECT_EQ(2ul, encoding.toAdd().getLeafCount());
  61. }
  62. TEST(CuddDdManager, RangeTest) {
  63. std::shared_ptr<storm::dd::DdManager<storm::dd::DdType::CUDD>> manager(new storm::dd::DdManager<storm::dd::DdType::CUDD>());
  64. std::pair<storm::expressions::Variable, storm::expressions::Variable> x;
  65. ASSERT_NO_THROW(x = manager->addMetaVariable("x", 1, 9));
  66. storm::dd::Bdd<storm::dd::DdType::CUDD> range;
  67. ASSERT_NO_THROW(range = manager->getRange(x.first));
  68. EXPECT_EQ(9ul, range.getNonZeroCount());
  69. EXPECT_EQ(1ul, range.getLeafCount());
  70. EXPECT_EQ(5ul, range.getNodeCount());
  71. }
  72. TEST(CuddDdManager, IdentityTest) {
  73. std::shared_ptr<storm::dd::DdManager<storm::dd::DdType::CUDD>> manager(new storm::dd::DdManager<storm::dd::DdType::CUDD>());
  74. std::pair<storm::expressions::Variable, storm::expressions::Variable> x = manager->addMetaVariable("x", 1, 9);
  75. storm::dd::Add<storm::dd::DdType::CUDD> identity;
  76. ASSERT_NO_THROW(identity = manager->getIdentity(x.first));
  77. EXPECT_EQ(9ul, identity.getNonZeroCount());
  78. EXPECT_EQ(10ul, identity.getLeafCount());
  79. EXPECT_EQ(21ul, identity.getNodeCount());
  80. }
  81. TEST(CuddDd, OperatorTest) {
  82. std::shared_ptr<storm::dd::DdManager<storm::dd::DdType::CUDD>> manager(new storm::dd::DdManager<storm::dd::DdType::CUDD>());
  83. std::pair<storm::expressions::Variable, storm::expressions::Variable> x = manager->addMetaVariable("x", 1, 9);
  84. EXPECT_TRUE(manager->getAddZero() == manager->getAddZero());
  85. EXPECT_FALSE(manager->getAddZero() == manager->getAddOne());
  86. EXPECT_FALSE(manager->getAddZero() != manager->getAddZero());
  87. EXPECT_TRUE(manager->getAddZero() != manager->getAddOne());
  88. storm::dd::Add<storm::dd::DdType::CUDD> dd1 = manager->getAddOne();
  89. storm::dd::Add<storm::dd::DdType::CUDD> dd2 = manager->getAddOne();
  90. storm::dd::Add<storm::dd::DdType::CUDD> dd3 = dd1 + dd2;
  91. EXPECT_TRUE(dd3 == manager->getConstant(2));
  92. dd3 += manager->getAddZero();
  93. EXPECT_TRUE(dd3 == manager->getConstant(2));
  94. dd3 = dd1 * manager->getConstant(3);
  95. EXPECT_TRUE(dd3 == manager->getConstant(3));
  96. dd3 *= manager->getConstant(2);
  97. EXPECT_TRUE(dd3 == manager->getConstant(6));
  98. dd3 = dd1 - dd2;
  99. EXPECT_TRUE(dd3.isZero());
  100. dd3 -= manager->getConstant(-2);
  101. EXPECT_TRUE(dd3 == manager->getConstant(2));
  102. dd3 /= manager->getConstant(2);
  103. EXPECT_TRUE(dd3.isOne());
  104. dd3 = !dd3;
  105. EXPECT_TRUE(dd3.isZero());
  106. dd1 = !dd3;
  107. EXPECT_TRUE(dd1.isOne());
  108. dd3 = dd1 || dd2;
  109. EXPECT_TRUE(dd3.isOne());
  110. dd1 = manager->getIdentity(x.first);
  111. dd2 = manager->getConstant(5);
  112. dd3 = dd1.equals(dd2);
  113. EXPECT_EQ(1ul, dd3.getNonZeroCount());
  114. storm::dd::Add<storm::dd::DdType::CUDD> dd4 = dd1.notEquals(dd2);
  115. EXPECT_TRUE(dd4.toBdd() == !dd3.toBdd());
  116. dd3 = dd1.less(dd2);
  117. EXPECT_EQ(11ul, dd3.getNonZeroCount());
  118. dd3 = dd1.lessOrEqual(dd2);
  119. EXPECT_EQ(12ul, dd3.getNonZeroCount());
  120. dd3 = dd1.greater(dd2);
  121. EXPECT_EQ(4ul, dd3.getNonZeroCount());
  122. dd3 = dd1.greaterOrEqual(dd2);
  123. EXPECT_EQ(5ul, dd3.getNonZeroCount());
  124. dd3 = (manager->getEncoding(x.first, 2).toAdd()).ite(dd2, dd1);
  125. dd4 = dd3.less(dd2);
  126. EXPECT_EQ(10ul, dd4.getNonZeroCount());
  127. dd4 = dd3.minimum(dd1);
  128. dd4 *= manager->getEncoding(x.first, 2).toAdd();
  129. dd4 = dd4.sumAbstract({x.first});
  130. EXPECT_EQ(2, dd4.getValue());
  131. dd4 = dd3.maximum(dd1);
  132. dd4 *= manager->getEncoding(x.first, 2).toAdd();
  133. dd4 = dd4.sumAbstract({x.first});
  134. EXPECT_EQ(5, dd4.getValue());
  135. dd1 = manager->getConstant(0.01);
  136. dd2 = manager->getConstant(0.01 + 1e-6);
  137. EXPECT_TRUE(dd1.equalModuloPrecision(dd2, 1e-6, false));
  138. EXPECT_FALSE(dd1.equalModuloPrecision(dd2, 1e-6));
  139. }
  140. TEST(CuddDd, AbstractionTest) {
  141. std::shared_ptr<storm::dd::DdManager<storm::dd::DdType::CUDD>> manager(new storm::dd::DdManager<storm::dd::DdType::CUDD>());
  142. std::pair<storm::expressions::Variable, storm::expressions::Variable> x = manager->addMetaVariable("x", 1, 9);
  143. storm::dd::Add<storm::dd::DdType::CUDD> dd1;
  144. storm::dd::Add<storm::dd::DdType::CUDD> dd2;
  145. storm::dd::Add<storm::dd::DdType::CUDD> dd3;
  146. dd1 = manager->getIdentity(x.first);
  147. dd2 = manager->getConstant(5);
  148. dd3 = dd1.equals(dd2);
  149. storm::dd::Bdd<storm::dd::DdType::CUDD> dd3Bdd = dd3.toBdd();
  150. EXPECT_EQ(1ul, dd3Bdd.getNonZeroCount());
  151. ASSERT_THROW(dd3Bdd = dd3Bdd.existsAbstract({x.second}), storm::exceptions::InvalidArgumentException);
  152. ASSERT_NO_THROW(dd3Bdd = dd3Bdd.existsAbstract({x.first}));
  153. EXPECT_EQ(1ul, dd3Bdd.getNonZeroCount());
  154. EXPECT_EQ(1, dd3Bdd.toAdd().getMax());
  155. dd3 = dd1.equals(dd2);
  156. dd3 *= manager->getConstant(3);
  157. EXPECT_EQ(1ul, dd3.getNonZeroCount());
  158. ASSERT_THROW(dd3Bdd = dd3.toBdd().existsAbstract({x.second}), storm::exceptions::InvalidArgumentException);
  159. ASSERT_NO_THROW(dd3Bdd = dd3.toBdd().existsAbstract({x.first}));
  160. EXPECT_TRUE(dd3Bdd.isOne());
  161. dd3 = dd1.equals(dd2);
  162. dd3 *= manager->getConstant(3);
  163. ASSERT_THROW(dd3 = dd3.sumAbstract({x.second}), storm::exceptions::InvalidArgumentException);
  164. ASSERT_NO_THROW(dd3 = dd3.sumAbstract({x.first}));
  165. EXPECT_EQ(1ul, dd3.getNonZeroCount());
  166. EXPECT_EQ(3, dd3.getMax());
  167. dd3 = dd1.equals(dd2);
  168. dd3 *= manager->getConstant(3);
  169. ASSERT_THROW(dd3 = dd3.minAbstract({x.second}), storm::exceptions::InvalidArgumentException);
  170. ASSERT_NO_THROW(dd3 = dd3.minAbstract({x.first}));
  171. EXPECT_EQ(0ul, dd3.getNonZeroCount());
  172. EXPECT_EQ(0, dd3.getMax());
  173. dd3 = dd1.equals(dd2);
  174. dd3 *= manager->getConstant(3);
  175. ASSERT_THROW(dd3 = dd3.maxAbstract({x.second}), storm::exceptions::InvalidArgumentException);
  176. ASSERT_NO_THROW(dd3 = dd3.maxAbstract({x.first}));
  177. EXPECT_EQ(1ul, dd3.getNonZeroCount());
  178. EXPECT_EQ(3, dd3.getMax());
  179. }
  180. TEST(CuddDd, SwapTest) {
  181. std::shared_ptr<storm::dd::DdManager<storm::dd::DdType::CUDD>> manager(new storm::dd::DdManager<storm::dd::DdType::CUDD>());
  182. std::pair<storm::expressions::Variable, storm::expressions::Variable> x = manager->addMetaVariable("x", 1, 9);
  183. std::pair<storm::expressions::Variable, storm::expressions::Variable> z = manager->addMetaVariable("z", 2, 8);
  184. storm::dd::Add<storm::dd::DdType::CUDD> dd1;
  185. storm::dd::Add<storm::dd::DdType::CUDD> dd2;
  186. dd1 = manager->getIdentity(x.first);
  187. ASSERT_THROW(dd1 = dd1.swapVariables({std::make_pair(x.first, z.first)}), storm::exceptions::InvalidArgumentException);
  188. ASSERT_NO_THROW(dd1 = dd1.swapVariables({std::make_pair(x.first, x.second)}));
  189. EXPECT_TRUE(dd1 == manager->getIdentity(x.second));
  190. }
  191. TEST(CuddDd, MultiplyMatrixTest) {
  192. std::shared_ptr<storm::dd::DdManager<storm::dd::DdType::CUDD>> manager(new storm::dd::DdManager<storm::dd::DdType::CUDD>());
  193. std::pair<storm::expressions::Variable, storm::expressions::Variable> x = manager->addMetaVariable("x", 1, 9);
  194. storm::dd::Add<storm::dd::DdType::CUDD> dd1 = manager->getIdentity(x.first).equals(manager->getIdentity(x.second));
  195. storm::dd::Add<storm::dd::DdType::CUDD> dd2 = manager->getRange(x.second).toAdd();
  196. storm::dd::Add<storm::dd::DdType::CUDD> dd3;
  197. dd1 *= manager->getConstant(2);
  198. ASSERT_NO_THROW(dd3 = dd1.multiplyMatrix(dd2, {x.second}));
  199. ASSERT_NO_THROW(dd3 = dd3.swapVariables({std::make_pair(x.first, x.second)}));
  200. EXPECT_TRUE(dd3 == dd2 * manager->getConstant(2));
  201. }
  202. TEST(CuddDd, GetSetValueTest) {
  203. std::shared_ptr<storm::dd::DdManager<storm::dd::DdType::CUDD>> manager(new storm::dd::DdManager<storm::dd::DdType::CUDD>());
  204. std::pair<storm::expressions::Variable, storm::expressions::Variable> x = manager->addMetaVariable("x", 1, 9);
  205. storm::dd::Add<storm::dd::DdType::CUDD> dd1 = manager->getAddOne();
  206. ASSERT_NO_THROW(dd1.setValue(x.first, 4, 2));
  207. EXPECT_EQ(2ul, dd1.getLeafCount());
  208. std::map<storm::expressions::Variable, int_fast64_t> metaVariableToValueMap;
  209. metaVariableToValueMap.emplace(x.first, 1);
  210. EXPECT_EQ(1, dd1.getValue(metaVariableToValueMap));
  211. metaVariableToValueMap.clear();
  212. metaVariableToValueMap.emplace(x.first, 4);
  213. EXPECT_EQ(2, dd1.getValue(metaVariableToValueMap));
  214. }
  215. TEST(CuddDd, ForwardIteratorTest) {
  216. std::shared_ptr<storm::dd::DdManager<storm::dd::DdType::CUDD>> manager(new storm::dd::DdManager<storm::dd::DdType::CUDD>());
  217. std::pair<storm::expressions::Variable, storm::expressions::Variable> x = manager->addMetaVariable("x", 1, 9);
  218. std::pair<storm::expressions::Variable, storm::expressions::Variable> y = manager->addMetaVariable("y", 0, 3);
  219. storm::dd::Add<storm::dd::DdType::CUDD> dd;
  220. ASSERT_NO_THROW(dd = manager->getRange(x.first).toAdd());
  221. storm::dd::DdForwardIterator<storm::dd::DdType::CUDD> it, ite;
  222. ASSERT_NO_THROW(it = dd.begin());
  223. ASSERT_NO_THROW(ite = dd.end());
  224. std::pair<storm::expressions::SimpleValuation, double> valuationValuePair;
  225. uint_fast64_t numberOfValuations = 0;
  226. while (it != ite) {
  227. ASSERT_NO_THROW(valuationValuePair = *it);
  228. ASSERT_NO_THROW(++it);
  229. ++numberOfValuations;
  230. }
  231. EXPECT_EQ(9ul, numberOfValuations);
  232. dd = manager->getRange(x.first).toAdd();
  233. dd = dd.ite(manager->getAddOne(), manager->getAddOne());
  234. ASSERT_NO_THROW(it = dd.begin());
  235. ASSERT_NO_THROW(ite = dd.end());
  236. numberOfValuations = 0;
  237. while (it != ite) {
  238. ASSERT_NO_THROW(valuationValuePair = *it);
  239. ASSERT_NO_THROW(++it);
  240. ++numberOfValuations;
  241. }
  242. EXPECT_EQ(16ul, numberOfValuations);
  243. ASSERT_NO_THROW(it = dd.begin(false));
  244. ASSERT_NO_THROW(ite = dd.end());
  245. numberOfValuations = 0;
  246. while (it != ite) {
  247. ASSERT_NO_THROW(valuationValuePair = *it);
  248. ASSERT_NO_THROW(++it);
  249. ++numberOfValuations;
  250. }
  251. EXPECT_EQ(1ul, numberOfValuations);
  252. }
  253. TEST(CuddDd, AddOddTest) {
  254. std::shared_ptr<storm::dd::DdManager<storm::dd::DdType::CUDD>> manager(new storm::dd::DdManager<storm::dd::DdType::CUDD>());
  255. std::pair<storm::expressions::Variable, storm::expressions::Variable> a = manager->addMetaVariable("a");
  256. std::pair<storm::expressions::Variable, storm::expressions::Variable> x = manager->addMetaVariable("x", 1, 9);
  257. storm::dd::Add<storm::dd::DdType::CUDD> dd = manager->getIdentity(x.first);
  258. storm::dd::Odd<storm::dd::DdType::CUDD> odd;
  259. ASSERT_NO_THROW(odd = storm::dd::Odd<storm::dd::DdType::CUDD>(dd));
  260. EXPECT_EQ(9ul, odd.getTotalOffset());
  261. EXPECT_EQ(12ul, odd.getNodeCount());
  262. std::vector<double> ddAsVector;
  263. ASSERT_NO_THROW(ddAsVector = dd.toVector<double>());
  264. EXPECT_EQ(9ul, ddAsVector.size());
  265. for (uint_fast64_t i = 0; i < ddAsVector.size(); ++i) {
  266. EXPECT_TRUE(i+1 == ddAsVector[i]);
  267. }
  268. // Create a non-trivial matrix.
  269. dd = manager->getIdentity(x.first).equals(manager->getIdentity(x.second)) * manager->getRange(x.first).toAdd();
  270. dd += manager->getEncoding(x.first, 1).toAdd() * manager->getRange(x.second).toAdd() + manager->getEncoding(x.second, 1).toAdd() * manager->getRange(x.first).toAdd();
  271. // Create the ODDs.
  272. storm::dd::Odd<storm::dd::DdType::CUDD> rowOdd;
  273. ASSERT_NO_THROW(rowOdd = storm::dd::Odd<storm::dd::DdType::CUDD>(manager->getRange(x.first).toAdd()));
  274. storm::dd::Odd<storm::dd::DdType::CUDD> columnOdd;
  275. ASSERT_NO_THROW(columnOdd = storm::dd::Odd<storm::dd::DdType::CUDD>(manager->getRange(x.second).toAdd()));
  276. // Try to translate the matrix.
  277. storm::storage::SparseMatrix<double> matrix;
  278. ASSERT_NO_THROW(matrix = dd.toMatrix({x.first}, {x.second}, rowOdd, columnOdd));
  279. EXPECT_EQ(9ul, matrix.getRowCount());
  280. EXPECT_EQ(9ul, matrix.getColumnCount());
  281. EXPECT_EQ(25ul, matrix.getNonzeroEntryCount());
  282. dd = manager->getRange(x.first).toAdd() * manager->getRange(x.second).toAdd() * manager->getEncoding(a.first, 0).toAdd().ite(dd, dd + manager->getConstant(1));
  283. ASSERT_NO_THROW(matrix = dd.toMatrix({a.first}, rowOdd, columnOdd));
  284. EXPECT_EQ(18ul, matrix.getRowCount());
  285. EXPECT_EQ(9ul, matrix.getRowGroupCount());
  286. EXPECT_EQ(9ul, matrix.getColumnCount());
  287. EXPECT_EQ(106ul, matrix.getNonzeroEntryCount());
  288. }
  289. TEST(CuddDd, BddOddTest) {
  290. std::shared_ptr<storm::dd::DdManager<storm::dd::DdType::CUDD>> manager(new storm::dd::DdManager<storm::dd::DdType::CUDD>());
  291. std::pair<storm::expressions::Variable, storm::expressions::Variable> a = manager->addMetaVariable("a");
  292. std::pair<storm::expressions::Variable, storm::expressions::Variable> x = manager->addMetaVariable("x", 1, 9);
  293. storm::dd::Add<storm::dd::DdType::CUDD> dd = manager->getIdentity(x.first);
  294. storm::dd::Odd<storm::dd::DdType::CUDD> odd;
  295. ASSERT_NO_THROW(odd = storm::dd::Odd<storm::dd::DdType::CUDD>(dd));
  296. EXPECT_EQ(9ul, odd.getTotalOffset());
  297. EXPECT_EQ(12ul, odd.getNodeCount());
  298. std::vector<double> ddAsVector;
  299. ASSERT_NO_THROW(ddAsVector = dd.toVector<double>());
  300. EXPECT_EQ(9ul, ddAsVector.size());
  301. for (uint_fast64_t i = 0; i < ddAsVector.size(); ++i) {
  302. EXPECT_TRUE(i+1 == ddAsVector[i]);
  303. }
  304. storm::dd::Add<storm::dd::DdType::CUDD> vectorAdd(manager, ddAsVector, odd, {x.first});
  305. EXPECT_EQ(dd, vectorAdd);
  306. // Create a non-trivial matrix.
  307. dd = manager->getIdentity(x.first).equals(manager->getIdentity(x.second)) * manager->getRange(x.first).toAdd();
  308. dd += manager->getEncoding(x.first, 1).toAdd() * manager->getRange(x.second).toAdd() + manager->getEncoding(x.second, 1).toAdd() * manager->getRange(x.first).toAdd();
  309. // Create the ODDs.
  310. storm::dd::Odd<storm::dd::DdType::CUDD> rowOdd;
  311. ASSERT_NO_THROW(rowOdd = storm::dd::Odd<storm::dd::DdType::CUDD>(manager->getRange(x.first)));
  312. storm::dd::Odd<storm::dd::DdType::CUDD> columnOdd;
  313. ASSERT_NO_THROW(columnOdd = storm::dd::Odd<storm::dd::DdType::CUDD>(manager->getRange(x.second)));
  314. // Try to translate the matrix.
  315. storm::storage::SparseMatrix<double> matrix;
  316. ASSERT_NO_THROW(matrix = dd.toMatrix({x.first}, {x.second}, rowOdd, columnOdd));
  317. EXPECT_EQ(9ul, matrix.getRowCount());
  318. EXPECT_EQ(9ul, matrix.getColumnCount());
  319. EXPECT_EQ(25ul, matrix.getNonzeroEntryCount());
  320. dd = manager->getRange(x.first).toAdd() * manager->getRange(x.second).toAdd() * manager->getEncoding(a.first, 0).toAdd().ite(dd, dd + manager->getConstant(1));
  321. ASSERT_NO_THROW(matrix = dd.toMatrix({a.first}, rowOdd, columnOdd));
  322. EXPECT_EQ(18ul, matrix.getRowCount());
  323. EXPECT_EQ(9ul, matrix.getRowGroupCount());
  324. EXPECT_EQ(9ul, matrix.getColumnCount());
  325. EXPECT_EQ(106ul, matrix.getNonzeroEntryCount());
  326. }