How to use the gudhi.CoverComplex function in gudhi

To help you get started, we’ve selected a few gudhi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GUDHI / gudhi-devel / src / python / example / functional_graph_induced_complex.py View on Github external
"- Constructs the functional GIC with the "
    "points from the given OFF and function files.",
)
parser.add_argument("-o", "--off-file", type=str, required=True)
parser.add_argument("-f", "--function-file", type=str, required=True)
parser.add_argument(
    "-v",
    "--verbose",
    default=False,
    action="store_true",
    help="Flag for program verbosity",
)

args = parser.parse_args()

nerve_complex = gudhi.CoverComplex()
nerve_complex.set_verbose(args.verbose)

if nerve_complex.read_point_cloud(args.off_file):
    nerve_complex.set_type("GIC")
    nerve_complex.set_color_from_file(args.function_file)
    nerve_complex.set_function_from_file(args.function_file)
    nerve_complex.set_graph_from_automatic_rips()
    nerve_complex.set_automatic_resolution()
    nerve_complex.set_gain()
    nerve_complex.set_cover_from_function()
    nerve_complex.find_simplices()
    nerve_complex.plot_dot()
    simplex_tree = nerve_complex.create_simplex_tree()
    nerve_complex.compute_PD()
    if args.verbose:
        print("Iterator on functional GIC simplices")
github MathieuCarriere / sklearn-tda / sklearn_tda / code.py View on Github external
def __init__(self, graph = -1, graph_subsampling = 100, graph_subsampling_power = 0.001, graph_subsampling_constant = 10,
                       cover_type = "functional", filter = 0, resolution = -1, gain = 0.33, Voronoi_subsampling = 1000,
                       mask = 0, color = 0, verbose = False):

        if USE_GUDHI == False:
            raise ImportError("Error: Gudhi not imported")

        self.cc = gd.CoverComplex()
        self.cc.set_type("GIC")
        self.cc.set_mask(mask)
        self.cc.set_verbose(verbose)
        self.graph, self.graph_subsampling, self.graph_subsampling_constant, self.graph_subsampling_power = graph, graph_subsampling, graph_subsampling_constant, graph_subsampling_power
        self.cover_type, self.filter, self.resolution, self.gain, self.Voronoi_subsampling = cover_type, filter, resolution, gain, Voronoi_subsampling
        self.color = color
github GUDHI / gudhi-devel / src / python / example / coordinate_graph_induced_complex.py View on Github external
"- Constructs the coordinate GIC with the "
    "points from the given OFF file.",
)
parser.add_argument("-f", "--file", type=str, required=True)
parser.add_argument("-c", "--coordinate", type=int, default=0)
parser.add_argument(
    "-v",
    "--verbose",
    default=False,
    action="store_true",
    help="Flag for program verbosity",
)

args = parser.parse_args()

nerve_complex = gudhi.CoverComplex()
nerve_complex.set_verbose(args.verbose)

if nerve_complex.read_point_cloud(args.file):
    nerve_complex.set_type("GIC")
    nerve_complex.set_color_from_coordinate(args.coordinate)
    nerve_complex.set_function_from_coordinate(args.coordinate)
    nerve_complex.set_graph_from_automatic_rips()
    nerve_complex.set_automatic_resolution()
    nerve_complex.set_gain()
    nerve_complex.set_cover_from_function()
    nerve_complex.find_simplices()
    nerve_complex.plot_dot()
    simplex_tree = nerve_complex.create_simplex_tree()
    nerve_complex.compute_PD()
    if args.verbose:
        print("Iterator on coordinate GIC simplices")
github GUDHI / gudhi-devel / src / python / example / nerve_of_a_covering.py View on Github external
)
parser.add_argument("-f", "--file", type=str, required=True)
parser.add_argument("-c", "--coordinate", type=int, default=0)
parser.add_argument("-r", "--resolution", type=int, default=10)
parser.add_argument("-g", "--gain", type=float, default=0.3)
parser.add_argument(
    "-v",
    "--verbose",
    default=False,
    action="store_true",
    help="Flag for program verbosity",
)

args = parser.parse_args()

nerve_complex = gudhi.CoverComplex()
nerve_complex.set_verbose(args.verbose)

if nerve_complex.read_point_cloud(args.file):
    nerve_complex.set_type("Nerve")
    nerve_complex.set_color_from_coordinate(args.coordinate)
    nerve_complex.set_function_from_coordinate(args.coordinate)
    nerve_complex.set_graph_from_OFF()
    nerve_complex.set_resolution_with_interval_number(args.resolution)
    nerve_complex.set_gain(args.gain)
    nerve_complex.set_cover_from_function()
    nerve_complex.find_simplices()
    nerve_complex.write_info()
    simplex_tree = nerve_complex.create_simplex_tree()
    nerve_complex.compute_PD()
    if args.verbose:
        print("Iterator on graph induced complex simplices")
github GUDHI / gudhi-devel / src / python / example / voronoi_graph_induced_complex.py View on Github external
"- Constructs the Voronoi GIC with the "
    "points from the given OFF file.",
)
parser.add_argument("-f", "--file", type=str, required=True)
parser.add_argument("-n", "--subsample-nb-points", type=int, default=100)
parser.add_argument(
    "-v",
    "--verbose",
    default=False,
    action="store_true",
    help="Flag for program verbosity",
)

args = parser.parse_args()

nerve_complex = gudhi.CoverComplex()
nerve_complex.set_verbose(args.verbose)

if nerve_complex.read_point_cloud(args.file):
    nerve_complex.set_type("GIC")
    nerve_complex.set_color_from_coordinate()
    nerve_complex.set_graph_from_OFF()
    nerve_complex.set_cover_from_Voronoi(args.subsample_nb_points)
    nerve_complex.find_simplices()
    nerve_complex.plot_off()
    simplex_tree = nerve_complex.create_simplex_tree()
    nerve_complex.compute_PD()
    if args.verbose:
        print("Iterator on graph induced complex simplices")
        result_str = (
            "Graph induced complex is of dimension "
            + repr(simplex_tree.dimension())