def test_simple1(self):
        """example with 1 triangle"""
        edges = array([[0,1],[0,2],[1,2]])

        expected = [ array([[0],[1],[2]]),
                     array([[0,1],[0,2],[1,2]]),
                     array([[0,1,2]]) ]

        result = rips_simplices(3, edges, 2)

        for r,e in zip(result,expected):
            assert_equal(r,e)
Beispiel #2
0
    def test_simple1(self):
        """example with 1 triangle"""
        edges = array([[0, 1], [0, 2], [1, 2]])

        expected = [
            array([[0], [1], [2]]),
            array([[0, 1], [0, 2], [1, 2]]),
            array([[0, 1, 2]])
        ]

        result = rips_simplices(3, edges, 2)

        for r, e in zip(result, expected):
            assert_equal(r, e)
    def test_simple2(self):
        """example with 1 tet and 1 triangle"""
        edges = array([[0,1],[0,2],[0,3],[0,4],[0,5],[1,2],[1,5],[2,5],[3,4]])

        expected = [ array([[0],[1],[2],[3],[4],[5]]),
                     array([[0,1],[0,2],[0,3],
                            [0,4],[0,5],[1,2],
                            [1,5],[2,5],[3,4]]),
                     array([[0,1,2],[0,1,5],[0,2,5],[0,3,4],[1,2,5]]),
                     array([[0,1,2,5]]) ]

        result = rips_simplices(6, edges, 3)

        for r,e in zip(result,expected):
            assert_equal(r,e)
Beispiel #4
0
    def test_simple2(self):
        """example with 1 tet and 1 triangle"""
        edges = array([[0, 1], [0, 2], [0, 3], [0, 4], [0, 5], [1, 2], [1, 5],
                       [2, 5], [3, 4]])

        expected = [
            array([[0], [1], [2], [3], [4], [5]]),
            array([[0, 1], [0, 2], [0, 3], [0, 4], [0, 5], [1, 2], [1, 5],
                   [2, 5], [3, 4]]),
            array([[0, 1, 2], [0, 1, 5], [0, 2, 5], [0, 3, 4], [1, 2, 5]]),
            array([[0, 1, 2, 5]])
        ]

        result = rips_simplices(6, edges, 3)

        for r, e in zip(result, expected):
            assert_equal(r, e)