Remove obsolete ::reduce_boundary_matrix()
authorStefan Huber <shuber@sthu.org>
Tue, 14 Jan 2014 14:03:42 +0000 (15:03 +0100)
committerStefan Huber <shuber@sthu.org>
Tue, 14 Jan 2014 15:19:07 +0000 (16:19 +0100)
include/libstick-0.1/persistence.h

index 6df70abc7c8345b0f11a86d168fdf3bcd9f4f0f2..49ddb9db4a68947c7b871dafe9cff79cb694f2b6 100644 (file)
@@ -319,54 +319,6 @@ class persistence {
 };
 
 
-/** Takes the boundary matrix b and transforms it inplace into a reduced matrix
- * b. The matrix v is required to be a unit matrix having the same dimensions
- * as b. It is maintained in order to leave the product b*inverse(v) as an
- * invariant.  Hence, the resulting b is equal to the product of the boundary
- * matrix times v. */
-template<class IT, class D>
-void reduce_boundary_matrix(boolean_colmatrix_base<IT, D> &b, boolean_colmatrix_base<IT, D> &v) {
-    assert(b.width() == v.width());
-
-    // lowestones[i] gives the column whose lowest 1 is at row i. If it contains
-    // zero, there is no such column.
-    std::vector<IT> lowestones(b.width());
-
-    // Make every column reduced, i.e., it is a zero-column or contains only one 1.
-    for (unsigned c=0; c < b.width(); ++c) {
-        //if (c % 100 == 0)
-            //std::cout << "c = " << c << " (" << (100.0*float(c)/b.width()) << " %)" << std::endl;
-        // Reduce as long as we need to reduce
-        while (b.get_column(c).size() > 0) {
-            // (r, c) is the lowest one of col
-            const IT r = b.get_column(c).back();
-            // This column contains its lowest one on the same row
-            const IT c2 = lowestones[r];
-            assert(c2 < c);
-
-            // There is no valid c2, hence we have completely reduced
-            if (c2 == 0)
-                break;
-            // Reduce col by column c2
-            else {
-                assert(b.get(r, c));
-                b.add_column(c, b.get_column(c2));
-                v.add_column(c, v.get_column(c2));
-                assert(!b.get(r, c));
-            }
-        }
-
-        // A lowest one remained, recall it
-        if (b.get_column(c).size() > 0) {
-            const IT r = b.get_column(c).back();
-            assert(lowestones[r] == 0);
-            assert(r < c);
-            lowestones[r] = c;
-        }
-    }
-}
-
-
 } // namespace libstick
 
 #endif