//////////////////////////////////////////////////////////////////////////// // FinalCluster.c // // Jorge Vittes // // functions on final clusters //////////////////////////////////////////////////////////////////////////// #include #include #include "FreeList.h" #include "Data.h" #include "BaseCluster.h" #include "UnaryCluster.h" #include "FinalCluster.h" #include "BinCluster.h" //////////////////////////////////////////////////////// // Constructor for a final cluster given final data //////////////////////////////////////////////////////// final_cluster::final_cluster(final_data dat) { data = dat; parent = NULL; child = NULL; affected = 0; for(int i=0;idata),&dat); } addData (&dat, &(((unary_cluster*) child)->data), &dat); finalizeData (&dat,&data); } //////////////////////////////////////////////////////// // Return the non non-vanishing endpoint //////////////////////////////////////////////////////// int final_cluster::getNonVanishing() { printf ("Fatal Moral Error: Unary clusters do not have non-vanishing end points (boundaries).\n"); assert (0); } ///////////////////////////////////////////////////////////// // Return the vanishing endpoint ///////////////////////////////////////////////////////////// int final_cluster::getVanishing() { printf ("Fatal Moral Error: Final clusters do not vanish.\n"); assert (0); } ///////////////////////////////////////////////////////////// // siblings is just the set of binary clusters that are // your siblings ///////////////////////////////////////////////////////////// cluster** final_cluster::getSiblings() { printf ("Fatal Moral Error: Final clusters have no parents and therefore (binary) siblings\n"); assert (0); } ///////////////////////////////////////////////////////////// // return an array of all child clusters ///////////////////////////////////////////////////////////// cluster** final_cluster::getClusters() { cluster** arr = (cluster**)malloc(sizeof(cluster*)*MAX_DEGREE); for(int i=0;i