From 62b11daa07f943c5ab047049cf2e2803188d467c Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@fe.uni-lj.si>
Date: Tue, 05 Jul 2016 10:11:56 +0000
Subject: [PATCH] Added stub function for clustering

---
 src/cluster.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/cluster.c b/src/cluster.c
index 5d05058..60d09c1 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -42,12 +42,13 @@
 			do{
 				n--;
 			} while(cstlist->cluster[n]==NULL && n>i);
+			if(i<=n) break;
 			cstlist->cluster[i]=cstlist->cluster[n];
 			cstlist->cluster[n]=NULL;
 		}
 	}
 	cstlist->cluster=(ts_cluster **)realloc(cstlist->cluster,n*sizeof(ts_cluster *));
-
+	cstlist->n=n;
 	return TS_SUCCESS;
 }
 
@@ -94,8 +95,12 @@
 
 /* This is a stub function. User should check whether the vertex is clustering or not. */
 ts_bool is_clusterable(ts_vertex *vtx){
-
-return 1;
+	if(fabs(vtx->c)>1e-6){
+		return 1;
+	}
+	else {
+		return 0;
+	}
 }
 
 

--
Gitblit v1.9.3