* This routine frees all of the memory allocated to the * specified data structure. It will not, however, free * the memory used by the prototype list. The pointers to * the clusters for each prototype in the list will be set * to NULL to indicate that the cluster data structures no * longer exist. Any sample lists that have been obtained * via calls to GetSamples are no longer valid. *
| 545 | * @note History: 6/6/89, DSJ, Created. |
| 546 | */ |
| 547 | void FreeClusterer(CLUSTERER *Clusterer) { |
| 548 | if (Clusterer != NULL) { |
| 549 | memfree (Clusterer->ParamDesc); |
| 550 | if (Clusterer->KDTree != NULL) |
| 551 | FreeKDTree (Clusterer->KDTree); |
| 552 | if (Clusterer->Root != NULL) |
| 553 | FreeCluster (Clusterer->Root); |
| 554 | // Free up all used buckets structures. |
| 555 | for (int d = 0; d < DISTRIBUTION_COUNT; ++d) { |
| 556 | for (int c = 0; c < MAXBUCKETS + 1 - MINBUCKETS; ++c) |
| 557 | if (Clusterer->bucket_cache[d][c] != NULL) |
| 558 | FreeBuckets(Clusterer->bucket_cache[d][c]); |
| 559 | } |
| 560 | |
| 561 | memfree(Clusterer); |
| 562 | } |
| 563 | } // FreeClusterer |
| 564 | |
| 565 | /** |
| 566 | * This routine frees all of the memory allocated to the |
nothing calls this directly
no test coverage detected