Exemplo n.º 1
0
def test_kth_boundary_group():
    sigma = SimplicialComplex()
    # sigma.add_simplex_fromfile('test_simplexfromfile.txt')
    sigma.add_simplex_fromfile("../../data/test_simplexfromfile.txt")

    # for k in range(sigma.maxK):  # not maxK + 1
    for k in range(0, 3):  # not maxK + 1
        print str(k) + '-th Boundary group:'
        Bk = KthBoundaryGroup(k)
        Bk.construct_from_simplex(sigma.get_allkth_simplices(k + 1), sigma.simplex_idmap,
                                  sigma.get_allkth_simplices(k))  # Send all the k+1 simplices to it
        print Bk.get_transformation_matrix()
        Bk.print_columnobjects()
        Bk.print_rowobjects()
Exemplo n.º 2
0
from src.simplex import KSimplex, SimplicialComplex
from src.BoundaryGroup import KthBoundaryGroup
from src.homology import another_bettinum, bettiNumber
from HomologyGroup import Homology

if __name__ == '__main__':
    # FilePath = "../../data/simplices.out"
    FilePath = "../../data/test_simplexfromfile.txt"

    sigma = SimplicialComplex()
    sigma.add_simplex_fromfile(FilePath)

    # for k in range(sigma.maxK):  # not maxK + 1
    for k in range(0, 1):  # not maxK
        # print str(k + 1) + '-th Transformation Matrix:'
        Bk = KthBoundaryGroup(k)
        Bk.construct_from_simplex(sigma.get_allkth_simplices(k + 1), sigma.simplex_idmap,
                                  sigma.get_allkth_simplices(k))  # Send all the k+1 simplices to it
        # print Bk.get_transformation_matrix()
        # print Bk.get_columnobjects()
        # print Bk.get_rowobjects()
        m = k + 1
        # print str(m + 1) + '-th Transformation Matrix:'
        Bk1 = KthBoundaryGroup(m)
        Bk1.construct_from_simplex(sigma.get_allkth_simplices(m + 1), sigma.simplex_idmap,
                                   sigma.get_allkth_simplices(m))  # Send all the k+1 simplices to it
        # print Bk1.get_transformation_matrix()
        #
        # print Bk1.get_columnobjects()
        # print Bk1.get_rowobjects()
        homology_obj = Homology(Bk, Bk1)
Exemplo n.º 3
0
from src.simplex import KSimplex, SimplicialComplex
from src.BoundaryGroup import KthBoundaryGroup
from src.homology import another_bettinum, bettiNumber
from HomologyGroup import Homology

if __name__ == '__main__':
    FilePath = "../../data/simplices.out"
    # FilePath = "../../data/test_simplexfromfile.txt"

    sigma = SimplicialComplex()
    sigma.add_simplex_fromfile(FilePath)

    # for k in range(sigma.maxK):  # not maxK + 1
    for k in range(-1, sigma.maxK + 1):  # not maxK
        # print str(k + 1) + '-th Transformation Matrix:'
        Bk = KthBoundaryGroup(k)
        Bk.construct_from_simplex(
            sigma.get_allkth_simplices(k + 1), sigma.simplex_idmap,
            sigma.get_allkth_simplices(k))  # Send all the k+1 simplices to it
        # print Bk.get_transformation_matrix()
        # print Bk.get_columnobjects()
        # print Bk.get_rowobjects()
        m = k + 1
        # print str(m + 1) + '-th Transformation Matrix:'
        Bk1 = KthBoundaryGroup(m)
        Bk1.construct_from_simplex(
            sigma.get_allkth_simplices(m + 1), sigma.simplex_idmap,
            sigma.get_allkth_simplices(m))  # Send all the k+1 simplices to it
        # print Bk1.get_transformation_matrix()
        #
        # print Bk1.get_columnobjects()