@@ -121,7 +121,7 @@ void listPrint(List list){
121121}
122122
123123void listPrintClusteringInFile (List list ,FILE * fptr ){
124- if (list == NULL ){ printf ( "List Empty!\n" ); return ;}
124+ if (list == NULL ){ return ;}
125125 List temp = list ;
126126 while (temp != NULL ){
127127 printVectorIdInFileNoNewline (temp -> v ,fptr );
@@ -426,7 +426,8 @@ void listFindNeighborsInRadiusClustering(List list,int centroidIndex,List* confL
426426 if (id == (temp -> vector_ID )){
427427 if (assignedToCluster (temp -> v ) && (getAssignedIteration (temp -> v )== iteration )){
428428 int assignedCluster = getAssignedCluster (temp -> v );
429- if (assignedCluster == centroidIndex || (((int )getAssignedAtRadius (temp -> v ))!= radius )){
429+ // if(assignedCluster==centroidIndex || (((int)getAssignedAtRadius(temp->v))!=radius)){
430+ if (assignedCluster == centroidIndex || (((int )getAssignedAtRadius (temp -> v ))< -1 )){
430431 temp = temp -> next ;
431432 continue ;
432433 }else {
@@ -470,7 +471,8 @@ void listFindNeighborsInRadiusClusteringCube(List list,int centroidIndex,List* c
470471 // then
471472 // check if vector has already been assigned at the some cluster (check the centroid index)
472473 // or if vector has already been assigned previously in cluster at a search with different radius
473- if (assignedCluster == centroidIndex || (getAssignedAtRadius (temp -> v )!= radius )){
474+ if (assignedCluster == centroidIndex || (getAssignedAtRadius (temp -> v )< -1.0 )){
475+ // if(assignedCluster==centroidIndex || (getAssignedAtRadius(temp->v)!=radius )){
474476 // ok, then skip it
475477 temp = temp -> next ;
476478 continue ;
@@ -484,10 +486,10 @@ void listFindNeighborsInRadiusClusteringCube(List list,int centroidIndex,List* c
484486 }
485487 }
486488 else {
487- htRangeInsert (storeNeighbors ,temp -> v ,temp -> vector_ID ,d );
488489 setAssignedCluster (temp -> v ,centroidIndex );
489490 setAssignedIteration (temp -> v ,iteration );
490491 setAssignedAtRadius (temp -> v ,radius );
492+ htRangeInsert (storeNeighbors ,temp -> v ,temp -> vector_ID ,d );
491493 (* assignCounter )++ ;
492494 }
493495 }
0 commit comments