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.

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