Use more efficient colmatrix-based reduction
[libstick.git] / tests / booleanmatrix.h
index 8554bf3d1b5eb407eef1c38ddb65447fa6ecd663..6cbf53847a62a93724a0ed91821e4a5577f7ea10 100644 (file)
@@ -9,18 +9,18 @@
 using namespace libstick;
 
 
-class BooleanmatrixTestSuite: public Test::Suite {
+class boolean_matrix_TestSuite: public Test::Suite {
     public:
-        BooleanmatrixTestSuite() {
-            TEST_ADD(BooleanmatrixTestSuite::test_getsetsize<BooleanRowMatrix<> >);
-            TEST_ADD(BooleanmatrixTestSuite::test_getsetsize<BooleanColMatrix<> >);
-            TEST_ADD(BooleanmatrixTestSuite::test_getsetsize<BooleanColRowMatrix<> >);
+        boolean_matrix_TestSuite() {
+            TEST_ADD(boolean_matrix_TestSuite::test_getsetsize<boolean_rowmatrix<> >);
+            TEST_ADD(boolean_matrix_TestSuite::test_getsetsize<boolean_colmatrix<> >);
+            TEST_ADD(boolean_matrix_TestSuite::test_getsetsize<boolean_colrowmatrix<> >);
 
-            TEST_ADD(BooleanmatrixTestSuite::test_addgetcolumn<BooleanColMatrix<> >);
-            TEST_ADD(BooleanmatrixTestSuite::test_addgetcolumn<BooleanColRowMatrix<> >);
+            TEST_ADD(boolean_matrix_TestSuite::test_addgetcolumn<boolean_colmatrix<> >);
+            TEST_ADD(boolean_matrix_TestSuite::test_addgetcolumn<boolean_colrowmatrix<> >);
 
-            TEST_ADD(BooleanmatrixTestSuite::test_addgetrow<BooleanRowMatrix<> >);
-            TEST_ADD(BooleanmatrixTestSuite::test_addgetrow<BooleanColRowMatrix<> >);
+            TEST_ADD(boolean_matrix_TestSuite::test_addgetrow<boolean_rowmatrix<> >);
+            TEST_ADD(boolean_matrix_TestSuite::test_addgetrow<boolean_colrowmatrix<> >);
         }
 
     protected:
@@ -61,12 +61,12 @@ class BooleanmatrixTestSuite: public Test::Suite {
 
             // Check if columns are empty
             for (unsigned c=0; c < size; ++c)
-                TEST_ASSERT(mat.getColumn(c).size() == 0);
+                TEST_ASSERT(mat.get_column(c).size() == 0);
 
+            col.push_back(0);
             col.push_back(3);
-            col.push_back(14);
             col.push_back(8);
-            col.push_back(0);
+            col.push_back(14);
 
             // Add column and test for values
             mat.add_column(5, col);
@@ -75,7 +75,7 @@ class BooleanmatrixTestSuite: public Test::Suite {
                     for (unsigned r=0; r < size; ++r )
                         TEST_ASSERT(mat.get(r,c) == (r==0 || r==3 || r==8 || r==14));
                 } else {
-                    TEST_ASSERT(mat.getColumn(c).size() == 0);
+                    TEST_ASSERT(mat.get_column(c).size() == 0);
                 }
             }
         }
@@ -88,7 +88,7 @@ class BooleanmatrixTestSuite: public Test::Suite {
 
             // Check if rows are empty
             for (unsigned r=0; r < size; ++r)
-                TEST_ASSERT(mat.getRow(r).size() == 0);
+                TEST_ASSERT(mat.get_row(r).size() == 0);
 
             row.push_back(0);
             row.push_back(8);
@@ -102,7 +102,7 @@ class BooleanmatrixTestSuite: public Test::Suite {
                     for (unsigned c=0; c < size; ++c )
                         TEST_ASSERT(mat.get(r,c) == (c==0 || c==3 || c==8 || c==14));
                 } else {
-                    TEST_ASSERT(mat.getRow(r).size() == 0);
+                    TEST_ASSERT(mat.get_row(r).size() == 0);
                 }
             }
         }