예제 #1
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)
예제 #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)
예제 #3
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)
예제 #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)