From 35efb0f73e86dc197cda350d2128ea25c9d06128 Mon Sep 17 00:00:00 2001 From: root <root@altea.penic.eu> Date: Sun, 03 Jul 2016 22:38:16 +0000 Subject: [PATCH] Clustering? --- src/Makefile.am | 6 +++--- src/general.h | 17 ++++++++++++++++- src/cluster.h | 8 ++++++++ 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 573b8b0..19449c4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,5 @@ bin_PROGRAMS = trisurf tsmeasure tspoststat -trisurf_SOURCES = general.c vertex.c bond.c triangle.c cell.c vesicle.c initial_distribution.c io.c dumpstate.c frame.c energy.c timestep.c vertexmove.c bondflip.c main.c poly.c stats.c sh.c shcomplex.c constvol.c snapshot.c restore.c +trisurf_SOURCES = general.c vertex.c bond.c triangle.c cell.c vesicle.c initial_distribution.c io.c dumpstate.c frame.c energy.c timestep.c vertexmove.c bondflip.c main.c poly.c stats.c sh.c shcomplex.c constvol.c snapshot.c restore.c cluster.c GITVERSION:=$(shell git --no-pager describe --tags --always --dirty) AM_CFLAGS = -Wall -Werror -DTS_VERSION=\"$(GITVERSION)\" -fgnu89-inline AM_CPPFLAGS = ${libxml2_CFLAGS} -fgnu89-inline @@ -18,10 +18,10 @@ #spherical_trisurf_ff_SOURCES = general.c vertex.c bond.c triangle.c cell.c vesicle.c initial_distribution.c io.c frame.c energy.c timestep.c vertexmove.c spherical_trisurf_ff.c sh.c bondflip.c poly.c stats.c shcomplex.c -tsmeasure_SOURCES = general.c vertex.c bond.c triangle.c cell.c vesicle.c initial_distribution.c io.c dumpstate.c frame.c energy.c timestep.c vertexmove.c bondflip.c tsmeasure.c poly.c stats.c sh.c shcomplex.c constvol.c snapshot.c restore.c +tsmeasure_SOURCES = general.c vertex.c bond.c triangle.c cell.c vesicle.c initial_distribution.c io.c dumpstate.c frame.c energy.c timestep.c vertexmove.c bondflip.c tsmeasure.c poly.c stats.c sh.c shcomplex.c constvol.c snapshot.c restore.c cluster.c tsmeasure_LDADD = ${libcurl_LIBS} ${libxml2_LIBS} -tspoststat_SOURCES = general.c vertex.c bond.c triangle.c cell.c vesicle.c initial_distribution.c io.c dumpstate.c frame.c energy.c timestep.c vertexmove.c bondflip.c tspoststat.c poly.c stats.c sh.c shcomplex.c constvol.c snapshot.c restore.c +tspoststat_SOURCES = general.c vertex.c bond.c triangle.c cell.c vesicle.c initial_distribution.c io.c dumpstate.c frame.c energy.c timestep.c vertexmove.c bondflip.c tspoststat.c poly.c stats.c sh.c shcomplex.c constvol.c snapshot.c restore.c cluster.c tspoststat_LDADD = ${libcurl_LIBS} ${libxml2_LIBS} #gitversion.c: .git/HEAD .git/index # echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@ diff --git a/src/cluster.h b/src/cluster.h new file mode 100644 index 0000000..5250628 --- /dev/null +++ b/src/cluster.h @@ -0,0 +1,8 @@ +#ifndef _H_CLUSTER +#define _H_CLUSTER +ts_cluster_list *init_cluster_list(); +ts_cluster *new_cluster(ts_cluster_list *cstlist); +ts_bool cluster_add_vertex(ts_cluster *cluster, ts_vertex *vtx); +ts_bool cluster_free(ts_cluster *cluster); +ts_bool cluster_list_free(ts_cluster_list *cstlist); +#endif diff --git a/src/general.h b/src/general.h index 31de50a..9fefc5b 100644 --- a/src/general.h +++ b/src/general.h @@ -156,7 +156,8 @@ ts_double projArea; ts_double relR; ts_double solAngle; - struct ts_poly *grafted_poly; + struct ts_poly *grafted_poly; + struct ts_cluster *cluster; }; typedef struct ts_vertex ts_vertex; @@ -322,6 +323,20 @@ +struct ts_cluster{ + ts_uint nvtx; + ts_uint idx; + ts_vertex **vtx; +}; + +typedef struct ts_cluster ts_cluster; + +typedef struct{ + ts_uint n; + ts_cluster **cluster; +} ts_cluster_list; + + /* GLOBAL VARIABLES */ int quiet; -- Gitblit v1.9.3